Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added celery worker container to github actions #3186

Merged
merged 2 commits into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ jobs:
context: .
dockerfile: docker/Dockerfile.backend
build-args: ""
build-backend-worker:
uses: ./.github/workflows/docker-build.yaml
needs: pre-commit
with:
image-name: oasst-backend-worker
context: .
dockerfile: docker/Dockerfile.backend-worker
build-args: ""
build-web:
uses: ./.github/workflows/docker-build.yaml
needs: pre-commit
Expand Down
38 changes: 38 additions & 0 deletions ansible/deploy-to-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
community.docker.docker_container:
name: "oasst-{{ stack_name }}-postgres-{{ item.name }}"
image: ghcr.io/laion-ai/open-assistant/oasst-postgres
platform: linux/x86_64
state: started
pull: true
recreate: "{{ (stack_name == 'dev') | bool }}"
Expand Down Expand Up @@ -97,6 +98,7 @@
community.docker.docker_container:
name: "oasst-{{ stack_name }}-backend"
image: "ghcr.io/laion-ai/open-assistant/oasst-backend:{{ image_tag }}"
platform: linux/x86_64
state: started
recreate: true
pull: true
Expand Down Expand Up @@ -186,6 +188,42 @@
ports:
- "{{ backend_port }}:8080"

- name: Setup Celery worker
community.docker.docker_container:
name: "oasst-{{ stack_name }}-celery-worker"
image:
"ghcr.io/laion-ai/open-assistant/oasst-backend-worker:{{ image_tag }}"
state: started
pull: true
restart_policy: always
network_mode: "oasst-{{ stack_name }}"
env:
CELERY_BROKER_URL: "redis://oasst-{{ stack_name }}-redis:6379/0"
CELERY_RESULT_BACKEND: "redis://oasst-{{ stack_name }}-redis:6379/0"
POSTGRES_HOST: "oasst-{{ stack_name }}-postgres-backend"
POSTGRES_PASSWORD: "{{ postgres_password }}"
REDIS_HOST: "oasst-{{ stack_name }}-redis"
MAX_WORKERS: "1"
command: celery -A oasst_backend.celery_worker worker -l info

- name: Setup Celery worker beat
community.docker.docker_container:
name: "oasst-{{ stack_name }}-celery-worker-beat"
image:
"ghcr.io/laion-ai/open-assistant/oasst-backend-worker:{{ image_tag }}"
state: started
pull: true
restart_policy: always
network_mode: "oasst-{{ stack_name }}"
env:
CELERY_BROKER_URL: "redis://oasst-{{ stack_name }}-redis:6379/0"
CELERY_RESULT_BACKEND: "redis://oasst-{{ stack_name }}-redis:6379/0"
POSTGRES_HOST: "oasst-{{ stack_name }}-postgres-backend"
POSTGRES_PASSWORD: "{{ postgres_password }}"
REDIS_HOST: "oasst-{{ stack_name }}-redis"
MAX_WORKERS: "1"
command: celery -A oasst_backend.celery_worker beat -l INFO

- name: Run the oasst oasst-web frontend
community.docker.docker_container:
name: "oasst-{{ stack_name }}-web"
Expand Down