Skip to content

Commit

Permalink
Merge pull request #23 from datakind/feature/autogen-coding-team
Browse files Browse the repository at this point in the history
Feature/autogen coding team
  • Loading branch information
dividor authored May 13, 2024
2 parents eaee31a + bf95780 commit 381273b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ IMAGE_HOST=http://localhost:3080/images
# Deployment to Azure #
#==================================================#
AZURE_CONTAINER_REGISTRY=
AZURE_CONTAINER_REGISTRY_USERNAME=d
AZURE_CONTAINER_REGISTRY_REPO=

#==================================================#
# API Settings #
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ We will add more details here soon, for now, here are some notes on Azure ...

## Deploying to Azure

A deployment script './deployment/deploy_azure.py' is provided to deploy to an Azure Multicontainer web app you have set up with [these instructions](https://learn.microsoft.com/en-us/azure/app-service/tutorial-multi-container-app). Note: This is for demo purposes only, as Multicontainer web app are still in Public Preview.
A deployment script './deployment/deploy_azure.py' is provided to deploy to an Azure Multicontainer web app you have set up with [these instructions](https://learn.microsoft.com/en-us/azure/app-service/tutorial-multi-container-app). The script is run from the top directory. Note: This is for demo purposes only, as Multicontainer web app are still in Public Preview.

To run the deployment ...

Expand All @@ -165,6 +165,8 @@ Note:

:warning: *This is very much a work in progress, deployment will be automated with fewer compose files soon*

You will need to set key environment variables, see your local `.env` for examples. The exceptions are the tokens needed for authetication, do not use the defaults for these. You can generate them on [this page](https://www.librechat.ai/toolkit/creds_generator).

## Databases

When running in Azure it is useful to use remote databases, at least for the mongodb instance so that user logins are retained with each release. For example, a databse can be configured by following [these instructions](https://docs.librechat.ai/install/configuration/mongodb.html). If doing this, then docker-compose-azure.yml in Azure can have the mongo DB section removed, and any instance of the Mongo URL used by other containers updated with the cloud connection string accordingly.
18 changes: 15 additions & 3 deletions deployment/deploy_azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,28 @@
#

import os
import sys

import docker
from dotenv import load_dotenv

client = docker.from_env()
load_dotenv()

container_registry = os.getenv("AZURE_CONTAINER_REGISTRY")
repo = os.getenv("AZURE_CONTAINER_REGISTRY_REPO")

# Script is run from top directory
docker_compose_file = "./deployment/docker-compose-deploy.yml"
azure_platform = "linux/amd64"

if sys.platform == "darwin":
print("Running on Mac")
client = docker.DockerClient(
base_url="unix:///Users/matthewharris/.docker/run/docker.sock "
)
else:
client = docker.from_env()


def run_cmd(cmd):
"""
Expand Down Expand Up @@ -69,8 +83,6 @@ def deploy():
"code-interpreter",
],
}
docker_compose_file = "docker-compose-deploy.yml"
azure_platform = "linux/amd64"

run_cmd("az login")
run_cmd(f"az acr login --name {container_registry}")
Expand Down
2 changes: 1 addition & 1 deletion ui/recipes-chat/librechat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ endpoints:
assistants: true
groups:
- group: "region-eastus2"
apiKey: 21e38dd24f114ef7b7ea8cd96112603a
apiKey: ${AZURE_API_KEY_ENV}
instanceName: "dkopenai2"
version: "2024-02-15-preview"
assistants: true
Expand Down

0 comments on commit 381273b

Please sign in to comment.