Skip to content

Commit

Permalink
Docker compose to setup new UI (#379)
Browse files Browse the repository at this point in the history
  • Loading branch information
LawyZheng authored May 29, 2024
1 parent b767e6f commit f13dffb
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
docs
images

# Front
skyvern-frontend/.env*
skyvern-frontend/dist
skyvern-frontend/node_modules

.dockerignore
.gitignore
Dockerfile
30 changes: 24 additions & 6 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ on:

env:
AWS_REGION: us-east-1
ECR_REPOSITORY: skyvern
REGISTRY_ALIAS: t6d4b5t4 # skyvern
ECR_BACKEND_REPOSITORY: skyvern
ECR_UI_REPOSITORY: skyvern-ui
REGISTRY_ALIAS: skyvern # t6d4b5t4

jobs:
run-ci:
Expand Down Expand Up @@ -36,7 +37,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build, tag, and push image to Amazon Public ECR
- name: Build, tag, and push backend image to Amazon Public ECR
id: build-image
uses: docker/build-push-action@v2
env:
Expand All @@ -48,6 +49,23 @@ jobs:
linux/arm64
push: true
tags: |
${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_REPOSITORY }}:${{ github.sha }}
${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_REPOSITORY }}:${{ github.event.release.tag_name }}
${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_REPOSITORY }}:latest
${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_BACKEND_REPOSITORY }}:${{ github.sha }}
${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_BACKEND_REPOSITORY }}:${{ github.event.release.tag_name }}
${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_BACKEND_REPOSITORY }}:latest
- name: Build, tag, and push ui image to Amazon Public ECR
id: build-ui-image
uses: docker/build-push-action@v2
env:
ECR_REGISTRY: ${{ steps.login-ecr-public.outputs.registry }}
with:
context: .
file: Dockerfile.ui
platforms: |
linux/amd64
linux/arm64
push: true
tags: |
${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_UI_REPOSITORY }}:${{ github.sha }}
${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_UI_REPOSITORY }}:${{ github.event.release.tag_name }}
${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_UI_REPOSITORY }}:latest
12 changes: 12 additions & 0 deletions Dockerfile.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node:20.12-slim

WORKDIR /app
COPY ./skyvern-frontend /app
COPY ./entrypoint-skyvernui.sh /app/entrypoint-skyvernui.sh
RUN npm install

ENV VITE_API_BASE_URL=http://localhost:8000/api/v1
ENV VITE_ARTIFACT_API_BASE_URL=http://localhost:9090

CMD [ "/bin/bash", "/app/entrypoint-skyvernui.sh" ]

29 changes: 24 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ version: '3.8'
services:
postgres:
image: postgres:14-alpine
restart: always
# comment out if you want to externally connect DB
# ports:
# - 5432:5432
Expand All @@ -20,11 +21,11 @@ services:
retries: 5

skyvern:
image: public.ecr.aws/t6d4b5t4/skyvern:latest
image: public.ecr.aws/skyvern/skyvern:latest
restart: on-failure
# comment out if you want to externally call skyvern API
# ports:
# - 8000:8000
ports:
- 8000:8000
volumes:
- ./artifacts:/data/artifacts
- ./videos:/data/videos
Expand All @@ -40,7 +41,7 @@ services:
# - LLM_KEY=ANTHROPIC_CLAUDE3_OPUS
# - ANTHROPIC_API_KEY=<your_anthropic_key>
# - ENABLE_AZURE=true
# - LLM_KEY=AZURE_OPENAI_GPT4V
# - LLM_KEY=AZURE_OPENAI
# - AZURE_DEPLOYMENT=<your_azure_deployment>
# - AZURE_API_KEY=<your_azure_api_key>
# - AZURE_API_BASE=<your_azure_api_base>
Expand All @@ -53,9 +54,27 @@ services:
interval: 5s
timeout: 5s
retries: 5

skyvern-ui:
image: public.ecr.aws/skyvern/skyvern-ui:latest
restart: on-failure
ports:
- 8080:8080
- 9090:9090
volumes:
- ./artifacts:/data/artifacts
- ./videos:/data/videos
- ./har:/data/har
- ./.streamlit:/app/.streamlit
# environment:
# - VITE_API_BASE_URL=
# - VITE_SKYVERN_API_KEY=
depends_on:
skyvern:
condition: service_healthy

streamlit:
image: public.ecr.aws/t6d4b5t4/skyvern:latest
image: public.ecr.aws/skyvern/skyvern:latest
restart: on-failure
ports:
- 8501:8501
Expand Down
11 changes: 11 additions & 0 deletions entrypoint-skyvernui.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

#!/bin/bash

set -e

# setting api key
export VITE_SKYVERN_API_KEY=$(sed -n 's/.*cred\s*=\s*"\([^"]*\)".*/\1/p' .streamlit/secrets.toml)

npm run start


0 comments on commit f13dffb

Please sign in to comment.