Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

Commit

Permalink
improve Gateway documentation (#72)
Browse files Browse the repository at this point in the history
* improve

* Update docs/prem-gateway/domains.md

* Update docs/prem-gateway/domains.md
  • Loading branch information
tiero authored Oct 25, 2023
1 parent d1a5d09 commit a797e44
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 67 deletions.
24 changes: 14 additions & 10 deletions docs/prem-app/installation/install-aws-ec2.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ Launch an EC2 instance using the below bookmark link, opening port 8000 and sele

### Step by Step Guide:

https://console.aws.amazon.com/ec2/v2/home?region=eu-west-1#LaunchInstanceWizard:ami=ami-06d4672384794fa01
🔗 [ami-06d4672384794fa01](https://console.aws.amazon.com/ec2/v2/home?region=eu-west-1#LaunchInstanceWizard:ami=ami-06d4672384794fa01)

1. **Access the Bookmark Link**:
- Open your browser.
- Click on the [bookmark](https://console.aws.amazon.com/ec2/v2/home?region=eu-west-1#LaunchInstanceWizard:ami=ami-06d4672384794fa01) or paste the bookmark link into your browser's address bar and press Enter.
- This will take you to the AWS Management Console, specifically to the EC2 Launch Instance Wizard with the public AMI pre-selected.

2. **Choose an Instance Type**:
- Scroll down the list until you find `g5.xlarge`.
- Scroll down the list until you find `g5.12xlarge`.
- Click on the `Select` button next to it.

3. **Configure Instance Details**:
Expand All @@ -38,12 +38,9 @@ https://console.aws.amazon.com/ec2/v2/home?region=eu-west-1#LaunchInstanceWizard
6. **Configure Security Group**:
- Choose “Create a new security group”.
- You will see that by default SSH port 22 is open.
- Click on the `Add Rule` button to add more rules.
- For HTTP: Choose HTTP from the dropdown and it will automatically populate the port range as `80`.
- For HTTPS: Choose HTTPS from the dropdown and it will automatically populate the port range as `443`.
- For port 8000: Choose `Custom TCP Rule` from the dropdown, type `8000` in the port range box, and choose 'Anywhere' (or a specific IP or range) in the source box.

Remember: Be cautious when opening ports to 'Anywhere' as it exposes those ports to the entire internet. Consider tightening security by only allowing specific IPs or IP ranges.
- Select both HTTP (:80) and HTTPS (:443) from the list.

Remember: Be cautious when opening ports to 'Anywhere' as it exposes those ports to the entire internet. Consider tightening security by only allowing specific IPs or IP ranges.

7. **Review and Launch**:
- Review your settings to ensure everything is correct.
Expand All @@ -57,6 +54,13 @@ https://console.aws.amazon.com/ec2/v2/home?region=eu-west-1#LaunchInstanceWizard
- Finally, click the `Launch Instances` button.

9. **Confirmation Page**:
- After launching, you'll be taken to a confirmation page where you can click on the `View Instances` button to see your new instance starting up.
- After launching, you'll be taken to a confirmation page where you can click on the `View Instances` button to see your new instance starting up. After a few minutes, your EC2 instance should be up and running.

10. **Install Prem**

That's it! After a few minutes, your EC2 instance should be up and running.
- Now login inside the machine using the key pair you created in the previous step.
- Run the following command to install Prem:
```bash
wget -q https://get.prem.ninja/install.sh -O install.sh; sudo bash ./install.sh
```
- After the installation is finished, you can access Prem App on the public IP address of your EC2 instance. You can find the IP address in the EC2 console under the `IPv4 Public IP` column.
24 changes: 1 addition & 23 deletions docs/prem-app/installation/install-linux-production.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,6 @@ wget -q https://get.prem.ninja/install.sh -O install.sh; sudo bash ./install.sh
If you want to uninstall Prem, you can run the following commands

```bash
# navigate to prem directory
cd ~/prem/

# stop docker-compose services
docker-compose down
wget -q https://get.prem.ninja/uninstall.sh -O uninstall.sh; sudo bash ./uninstall.sh
```
------

If you encounter issues or you want to build the Prem App docker image inside your Linux server

### CPU
```bash
git clone https://github.com/premAI-io/prem-app.git
cd ./prem-app
docker-compose up -d
```

### GPU (NVIDIA)
```bash
git clone https://github.com/premAI-io/prem-app.git
cd ./prem-app
docker-compose -f docker-compose.yml -f docker-compose.gpu.yml up -d
```

And you will have the UI at `http://{localhost|server_ip}:8000`.
2 changes: 1 addition & 1 deletion docs/prem-gateway/_category_.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"position": 3,
"link": {
"type": "generated-index",
"description": "Prem-Gateway acts as an API gateway for directing and managing a multitude of operations.\nIt is responsible for routing requests from the frontend prem-app to either the prem-daemon for Docker image management or directly to Docker images providing prem-services.\nIt is also in charge of managing the authentication/authorization of users and services, TLS, Domain management, and more."
"description": "The Prem Gateway acts as an API gateway for directing and managing a multitude of operations.\nIt is responsible for routing requests from the frontend prem-app to either the prem-daemon for Docker image management or directly to Docker images providing prem-services.\nIt is also in charge of managing the authentication/authorization of users and services, TLS, Domain management, and more."
}
}
18 changes: 18 additions & 0 deletions docs/prem-gateway/domains.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
id: domains
title: Domains
sidebar_label: Domains
sidebar_position: 1
---

At start, the Prem App is accessible via IP that is printed by the installation script. This IP is Prem Gateway IP address.

## How it works?

Domains feature gives you option to easily map your domain to your Prem App application.
It is necessary to insert two A records:
- A `example.com` to `<IP_GATEWAY>`
- A `*.example.com` `<IP_GATEWAY>`
You can also use a subdomain ie. `prem.example.com` and `*.prem.example.com`

After this is done you need to add your domain in **Prem App > Settings > Domains**, and you are ready to go.
14 changes: 14 additions & 0 deletions docs/prem-gateway/https.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
id: https
title: Automatic HTTPS
sidebar_label: Automatic HTTPS
sidebar_position: 2
---

At start, the Prem App is accessible via IP that is printed by the installation script. This IP is Prem Gateway IP address.

## How it works?

Once you setup [your own domain](./domains.md), Prem App will automatically generate SSL certificate for your domain and enable HTTPS for the application. Nothing to do here.

Prem Services are accessible on subdomain level, for example, if you have Chat model named `llama`, it will be accessible on `https://llama.example.com/v1/chat/completions` endpoint
18 changes: 0 additions & 18 deletions docs/prem-gateway/installation.md

This file was deleted.

15 changes: 0 additions & 15 deletions docs/prem-gateway/usage.md

This file was deleted.

0 comments on commit a797e44

Please sign in to comment.