diff --git a/.env.example b/.env.example index 095d1878..bddf1346 100644 --- a/.env.example +++ b/.env.example @@ -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 # diff --git a/README.md b/README.md index 3e4f4645..191035f1 100644 --- a/README.md +++ b/README.md @@ -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 ... @@ -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. \ No newline at end of file diff --git a/deployment/deploy_azure.py b/deployment/deploy_azure.py index 56331941..f05954a3 100644 --- a/deployment/deploy_azure.py +++ b/deployment/deploy_azure.py @@ -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): """ @@ -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}") diff --git a/ui/recipes-chat/librechat.yaml b/ui/recipes-chat/librechat.yaml index a6834a20..6be20eb5 100644 --- a/ui/recipes-chat/librechat.yaml +++ b/ui/recipes-chat/librechat.yaml @@ -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