Skip to content

Commit

Permalink
Make readme file more beginner friendly (#153)
Browse files Browse the repository at this point in the history
Co-authored-by: Kaan Çaylı <[email protected]>
  • Loading branch information
yassinsws and kaancayli authored Sep 11, 2024
1 parent 84871c3 commit 4ed30d5
Showing 1 changed file with 42 additions and 60 deletions.
102 changes: 42 additions & 60 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Currently, Pyris empowers [Iris](https://artemis.cit.tum.de/about-iris), a virtu

## Setup
### With local environment
> **⚠️ Warning:** For local Weaviate vector database setup, please refer to [Weaviate Docs](https://weaviate.io/developers/weaviate/quickstart).
> **⚠️ Warning:** To change the local Weaviate vector database setup, please refer to [Weaviate Docs](https://weaviate.io/developers/weaviate/quickstart).
- Check python version: `python --version` (should be 3.12)
- Install packages: `pip install -r requirements.txt`
- Create an `application.local.yml` file in the root directory. This file includes configurations that can be used by the application.
Expand Down Expand Up @@ -60,85 +61,66 @@ Currently, Pyris empowers [Iris](https://artemis.cit.tum.de/about-iris), a virtu
```
- Access API docs: http://localhost:8000/docs

### With docker
Pyris can be deployed using Docker, which provides an easy way to set up the application in a consistent environment.
Below are the instructions for setting up Pyris using Docker.

#### Prerequisites
- Ensure Docker and Docker Compose are installed on your machine.
- Clone the Pyris repository to your local machine.
-
#### Setup Instructions

1. **Build and Run the Containers**
### Getting Started with Docker

You can run Pyris in different environments: development or production. Docker Compose is used to orchestrate the different services, including Pyris, Weaviate, and Nginx.
Deploying Pyris using Docker is a straightforward way to set up the application in a consistent environment. Here's how you can do it:

- **For Development:**
**Build and Run the Containers**

Use the following command to start the development environment:

```bash
docker-compose -f docker-compose/pyris-dev.yml up --build
```
The essential part of setting up Pyris with Docker is building and running the containers. Docker Compose is used to manage the different services, including Pyris, Weaviate, and Nginx, for both development and production environments.

This command will:
- Build the Pyris application from the Dockerfile.
- Start the Pyris application along with Weaviate in development mode.
- Mount the local configuration files (`application.local.yml` and `llm-config.local.yml`) for easy modification.
- **For Development:**

The application will be available at `http://localhost:8000`.
To start the development environment, run:

- **For Production:**

Use the following command to start the production environment:

```bash
docker-compose -f docker-compose/pyris-production.yml up -d
```
```bash
docker-compose -f docker-compose/pyris-dev.yml up --build
```

This command will:
- Pull the latest Pyris image from the GitHub Container Registry.
- Start the Pyris application along with Weaviate and Nginx in production mode.
- Nginx will serve as a reverse proxy, handling SSL termination if certificates are provided.
This command will:
- Build the Pyris application.
- Start the Pyris application along with Weaviate in development mode.
- Mount local configuration files for easy modification.

The application will be available at `https://<your-domain>`.
The application will be available at `http://localhost:8000`.

2. **Configuration**
- **For Production:**

- **Weaviate**: Weaviate is configured via the `weaviate.yml` file. By default, it runs on port 8001.
- **Pyris Application**: The Pyris application configuration is handled through environment variables and mounted YAML configuration files.
- **Nginx**: Nginx is used for handling requests in a production environment and is configured via `nginx.yml`.
To start the production environment, run:

3. **Accessing the Application**
```bash
docker-compose -f docker-compose/pyris-production.yml up -d
```

- For development, access the API documentation at: `http://localhost:8000/docs`
- For production, access the application at your domain (e.g., `https://<your-domain>`).
This command will:
- Pull the latest Pyris image from the GitHub Container Registry.
- Start Pyris along with Weaviate and Nginx in production mode.
- Nginx will handle SSL and serve as a reverse proxy.

4. **Stopping the Containers**
The application will be available at `https://<your-domain>`.

To stop the running containers, use:
#### Additional Steps (Optional)

```bash
docker-compose -f docker-compose/pyris-dev.yml down
```
If you need to stop the containers, use:

or
```bash
docker-compose -f docker-compose/pyris-dev.yml down
```

```bash
docker-compose -f docker-compose/pyris-production.yml down
```
or

5. **Logs and Debugging**
```bash
docker-compose -f docker-compose/pyris-production.yml down
```

- View the logs for a specific service, e.g., Pyris:
You can also customize the configuration for Weaviate, Pyris, and Nginx by editing their respective configuration files. However, the default setup should work fine for most users.

```bash
docker-compose -f docker-compose/pyris-dev.yml logs pyris-app
```
For development, access the API documentation at `http://localhost:8000/docs`. For production, access the application at your domain (e.g., `https://<your-domain>`).

- For production, ensure that Nginx and Weaviate services are running smoothly and check their respective logs if needed.
If you need to view logs or debug, you can check the logs of specific services using:

---
```bash
docker-compose -f docker-compose/pyris-dev.yml logs pyris-app
```

This setup should help you run the Pyris application in both development and production environments with Docker. Ensure you modify the configuration files as per your specific requirements before deploying.
This setup should help you run the Pyris application in both development and production environments with Docker. Ensure you modify the configuration files as per your specific requirements before deploying.

0 comments on commit 4ed30d5

Please sign in to comment.