Skip to content

Commit

Permalink
feat: add workspaces UI Service to the docker deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
hc186011 committed Aug 1, 2024
1 parent 09d50f7 commit e66271a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
24 changes: 21 additions & 3 deletions deployments/docker/ai-unlimited.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
replicas: 1
platform: linux/amd64
container_name: ai-unlimited-workspaces
image: ${AI_UNLIMITED_IMAGE_NAME:-teradata/ai-unlimited-workspaces}:${AI_UNLIMITED_IMAGE_TAG:-latest}
image: ${WORKSPACES_IMAGE_NAME:-docker.io/teradata/regulus-workspaces}:latest
command: workspaces serve -v
restart: unless-stopped
ports:
Expand All @@ -16,10 +16,28 @@ services:
environment:
accept_license: "Y"
TZ: ${AI_UNLIMITED_TZ:-UTC}
TD_VCD_INIT_API_KEY: "${AI_UNLIMITED_INIT_API_KEY:?Initial API key is required, please run the generate api key script.}"
volumes:
- ${AI_UNLIMITED_HOME:-./volumes/ai-unlimited-workspaces}:/etc/td
networks:
- ai-unlimited

ai-unlimited-front-end:
deploy:
replicas: 1
platform: linux/amd64
container_name: workspaces-ui
image: ${WORKSPACES_UI_IMAGE_NAME:-teradata/regulus-workspaces-ui}:${WORKSPACES_UI_IMAGE_TAG:-latest}
ports:
- "${TD_VCD_UI_PORT:-80}:80/tcp"
environment:
TD_VCD_UI_BASE_URL: "http://localhost"
TD_VCD_UI_PORT: "${TD_VCD_UI_PORT:-80}"
TD_VCD_API_BASE_URL: "http://localhost"
TD_VCD_API_PORT: "${TD_VCD_API_PORT:-3282}"
TD_VCD_AUTH_PORT: "${TD_VCD_AUTH_PORT:-3000}"
TD_VCD_INIT_API_KEY: "${AI_UNLIMITED_INIT_API_KEY:?Initial API key is required, please run the generate api key script.}"
networks:
- ai-unlimited-network
networks:
ai-unlimited:
ai-unlimited-network:
name: ai-unlimited-network
8 changes: 8 additions & 0 deletions deployments/docker/generate_api_key.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Write-Host "Generating API key..."

# all characters
$API_KEY=(-join ((33..126) | Get-Random -Count 32 | % {[char]$_}))
$env:AI_UNLIMITED_INIT_API_KEY = $API_KEY

Write-Host "API Key is generated, please export it by running the following command: \n"
Write-Host '$env:AI_UNLIMITED_INIT_API_KEY = $API_KEY'
11 changes: 11 additions & 0 deletions deployments/docker/generate_api_key.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

API_KEY=$(LC_ALL=C tr -dc A-Za-z0-9 </dev/urandom | head -c 64)

# Set the value of the environment variable
export AI_UNLIMITED_INIT_API_KEY=$API_KEY

# Print the value of the environment variable
echo "API Key is generated, if the shell script is not run with source, please export the following environment variable:"
echo ''
echo "export AI_UNLIMITED_INIT_API_KEY=${API_KEY}"

0 comments on commit e66271a

Please sign in to comment.