Skip to content

Commit

Permalink
Hacky way to release to Azure
Browse files Browse the repository at this point in the history
  • Loading branch information
dividor committed Apr 16, 2024
1 parent 7ea5d4f commit b20b634
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 4 deletions.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,33 @@ Note: You can reset Libre chat by removing contents of `ui/recipes_assistant_cha

## Deploying to Azure

Make dure docker has 'Use Rosetta for x86_64/amd64 emulation on Apple Silicon' set in settings
The environment has been configured to run on a multicontainer web app in Azure. This actually isn't a very robust solution, as we shall see below, and should be migrated onto something more formal for launch.

### Not on a Mac

Run ...

`python3 deploy_azure.py`

### On a Mac

Make dure docker has 'Use Rosetta for x86_64/amd64 emulation on Apple Silicon' set in settings if using a MAC silicon chip. You will also need to build the Docker image for platform: linux/amd64 so when pushed to Azure, they'll work. This is a bit tricky ...

1. Make some change that needs to be released
2. `docker compose down -v`
3. `docker compose -f docker-compose-build-azure.yml pull`
4. `docker compose -f docker-compose-build-azure.yml build`
5. `docker compose -f docker-compose-build-azure.yml up -d`

Note, this break the app for running locally, it's just to build images that will run in Azure when using Mac

6. `python3 deploy_azure.py`

Then Revert back, to work on Mac

7. `docker compose -f docker-compose-build-azure.yml down -v`
8. `docker compose pull`
9. `docker compose build`
10. `docker compose up -d`


5 changes: 2 additions & 3 deletions docker-compose-azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ services:
image: "dkdsprototypesreg01.azurecr.io/containergroup:api"
platform: "linux/amd64"
ports:
- "443:3080"
- "80:3080"
- "80:80"
depends_on:
- mongodb
- rag_api
Expand All @@ -28,7 +27,7 @@ services:
command: mongod --noauth
meilisearch:
image: "dkdsprototypesreg01.azurecr.io/containergroup:meilisearch"
platform: "linux/amd64"
#platform: "linux/amd64"
restart: always
user: "${UID}:${GID}"
environment:
Expand Down
97 changes: 97 additions & 0 deletions docker-compose-build-azure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
version: "3.4"

# Do not edit this file directly. Use a ‘docker-compose.override.yaml’ file if you can.
# Refer to `docker-compose.override.yaml.example’ for some sample configurations.

services:
api:
platform: linux/amd64
container_name: haa-libre-chat
# Have to build a dockerfile as Azure multicontainer apps don't support bind mounts
#image: ghcr.io/danny-avila/librechat:v0.7.0
#image: ghcr.io/danny-avila/librechat-dev:latest
build:
context: .
dockerfile: ./ui/recipes_assistant_chat/Dockerfile
ports:
#- "${PORT}:${PORT}"
- 8080:8080
# DK Added
- 3080:3080
depends_on:
- mongodb
- rag-api
restart: always
user: "${UID}:${GID}"
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
HOST: 0.0.0.0
MONGO_URI: mongodb://mongodb:27017/LibreChat
MEILI_HOST: http://meilisearch:7700
RAG_PORT: ${RAG_PORT:-8000}
RAG_API_URL: http://rag-api:${RAG_PORT:-8000}
volumes:
- type: bind
source: ./.env
target: /app/.env
- ./ui/recipes_assistant_chat/images:/app/client/public/images
- ./ui/recipes_assistant_chat/logs:/app/api/logs
- type: bind
source: ./ui/recipes_assistant_chat/librechat.yaml
target: /app/librechat.yaml
mongodb:
platform: linux/amd64
container_name: chat-mongodb
image: mongo
restart: always
user: "${UID}:${GID}"
volumes:
- ./ui/recipes_assistant_chat/data-node:/data/db
command: mongod --noauth
meilisearch:
platform: linux/amd64
container_name: chat-meilisearch
image: getmeili/meilisearch:v1.7.3
restart: always
user: "${UID}:${GID}"
environment:
MEILI_HOST: http://meilisearch:7700
MEILI_NO_ANALYTICS: true
volumes:
- ./ui/recipes_assistant_chat/meili_data_v1.7:/meili_data
vectordb:
platform: linux/amd64
image: ankane/pgvector:latest
environment:
POSTGRES_DB: mydatabase
POSTGRES_USER: myuser
POSTGRES_PASSWORD: mypassword
restart: always
volumes:
- ./ui/recipes_assistant_chat/pgdata2:/var/lib/postgresql/data
rag-api:
platform: linux/amd64
image: ghcr.io/danny-avila/librechat-rag-api-dev-lite:latest
environment:
DB_HOST: vectordb
RAG_PORT: ${RAG_PORT:-8000}
restart: always
depends_on:
- vectordb
env_file:
- .env
actions:
platform: linux/amd64
container_name: haa-libre-robo-actions
build:
context: .
dockerfile: ./actions/Dockerfile
ports:
# API
- 3001:8080
# Action server portal
- 4001:8087

volumes:
pgdata2:

0 comments on commit b20b634

Please sign in to comment.