Build staging from source (#421)
This commit is contained in:
parent
bc8814e24f
commit
268b268044
4 changed files with 93 additions and 3 deletions
20
.github/workflows/porter_app_worker_4828.yml
vendored
20
.github/workflows/porter_app_worker_4828.yml
vendored
|
|
@ -2,21 +2,37 @@
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
name: Deploy to worker
|
|
||||||
|
name: Deploy to staging
|
||||||
jobs:
|
jobs:
|
||||||
porter-deploy:
|
porter-deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set Github tag
|
- name: Set Github tag
|
||||||
id: vars
|
id: vars
|
||||||
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Setup porter
|
- name: Setup porter
|
||||||
uses: porter-dev/setup-porter@v0.1.0
|
uses: porter-dev/setup-porter@v0.1.0
|
||||||
|
|
||||||
|
- name: Install Poetry
|
||||||
|
uses: snok/install-poetry@v1
|
||||||
|
with:
|
||||||
|
version: 1.8.5
|
||||||
|
|
||||||
|
- name: Build Dist
|
||||||
|
run: make full-dist
|
||||||
|
|
||||||
|
- name: Export Requirements
|
||||||
|
run: |
|
||||||
|
cd arcade && poetry export --output ../dist/requirements.txt
|
||||||
|
|
||||||
- name: Deploy stack
|
- name: Deploy stack
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
run: exec porter apply
|
run: exec porter apply -f porter/staging.yaml
|
||||||
env:
|
env:
|
||||||
PORTER_APP_NAME: worker
|
PORTER_APP_NAME: worker
|
||||||
PORTER_CLUSTER: "4828"
|
PORTER_CLUSTER: "4828"
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ FROM python:3.11-slim
|
||||||
# Define build arguments with default values
|
# Define build arguments with default values
|
||||||
ARG PORT=8001
|
ARG PORT=8001
|
||||||
ARG HOST=0.0.0.0
|
ARG HOST=0.0.0.0
|
||||||
ARG VERSION=${VERSION:-1.0.1}
|
ARG VERSION=${VERSION:-0.1.0.dev0}
|
||||||
ARG INSTALL_TOOLKITS=true
|
ARG INSTALL_TOOLKITS=true
|
||||||
|
|
||||||
# Set environment variables using the build arguments
|
# Set environment variables using the build arguments
|
||||||
|
|
|
||||||
37
porter/prod.yaml
Normal file
37
porter/prod.yaml
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
version: v2
|
||||||
|
name: worker
|
||||||
|
services:
|
||||||
|
- name: worker
|
||||||
|
type: web
|
||||||
|
instances: 1
|
||||||
|
cpuCores: 0.5
|
||||||
|
ramMegabytes: 1024
|
||||||
|
terminationGracePeriodSeconds: 30
|
||||||
|
port: 8002
|
||||||
|
autoscaling:
|
||||||
|
enabled: true
|
||||||
|
minInstances: 3
|
||||||
|
maxInstances: 15
|
||||||
|
gpu: false
|
||||||
|
cpuThresholdPercent: 50
|
||||||
|
memoryThresholdPercent: 50
|
||||||
|
gpuThresholdPercent: 100
|
||||||
|
vramThresholdPercent: 100
|
||||||
|
healthCheck:
|
||||||
|
enabled: true
|
||||||
|
httpPath: /worker/health
|
||||||
|
timeoutSeconds: 1
|
||||||
|
initialDelaySeconds: 15
|
||||||
|
private: true
|
||||||
|
sleep: false
|
||||||
|
serviceMeshEnabled: false
|
||||||
|
build:
|
||||||
|
context: ./
|
||||||
|
method: docker
|
||||||
|
dockerfile: ./docker/Dockerfile
|
||||||
|
envGroups:
|
||||||
|
- otel-configs
|
||||||
|
- worker
|
||||||
|
autoRollback:
|
||||||
|
enabled: true
|
||||||
|
deploymentStrategy: {}
|
||||||
37
porter/staging.yaml
Normal file
37
porter/staging.yaml
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
version: v2
|
||||||
|
name: worker
|
||||||
|
services:
|
||||||
|
- name: worker
|
||||||
|
type: web
|
||||||
|
instances: 1
|
||||||
|
cpuCores: 0.5
|
||||||
|
ramMegabytes: 1024
|
||||||
|
terminationGracePeriodSeconds: 30
|
||||||
|
port: 8002
|
||||||
|
autoscaling:
|
||||||
|
enabled: true
|
||||||
|
minInstances: 1
|
||||||
|
maxInstances: 5
|
||||||
|
gpu: false
|
||||||
|
cpuThresholdPercent: 50
|
||||||
|
memoryThresholdPercent: 50
|
||||||
|
gpuThresholdPercent: 100
|
||||||
|
vramThresholdPercent: 100
|
||||||
|
healthCheck:
|
||||||
|
enabled: true
|
||||||
|
httpPath: /worker/health
|
||||||
|
timeoutSeconds: 1
|
||||||
|
initialDelaySeconds: 15
|
||||||
|
private: true
|
||||||
|
sleep: false
|
||||||
|
serviceMeshEnabled: false
|
||||||
|
build:
|
||||||
|
context: ./
|
||||||
|
method: docker
|
||||||
|
dockerfile: ./docker/Dockerfile
|
||||||
|
envGroups:
|
||||||
|
- otel-configs
|
||||||
|
- worker
|
||||||
|
autoRollback:
|
||||||
|
enabled: true
|
||||||
|
deploymentStrategy: {}
|
||||||
Loading…
Reference in a new issue