Skip to content

Commit

Permalink
Merge pull request #3 from edly-io/feat/discovery-worker
Browse files Browse the repository at this point in the history
Add discovery-worker to docker and k8s
  • Loading branch information
hinakhadim authored Sep 13, 2023
2 parents aca9206 + 6dfec27 commit d6e7a7f
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
41 changes: 41 additions & 0 deletions tutordiscovery/patches/k8s-deployments
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,44 @@ spec:
- name: settings
configMap:
name: discovery-settings



---
apiVersion: apps/v1
kind: Deployment
metadata:
name: discovery-worker
labels:
app.kubernetes.io/name: discovery-worker
spec:
selector:
matchLabels:
app.kubernetes.io/name: discovery-worker
template:
metadata:
labels:
app.kubernetes.io/name: discovery-worker
spec:
securityContext:
runAsUser: 1000
runAsGroup: 1000
containers:
- name: discovery-worker
image: {{ DISCOVERY_DOCKER_IMAGE }}
args: ["celery", "--app=course_discovery.celery", "worker", "--loglevel=info", "--max-tasks-per-child=100"]
env:
- name: SERVICE_VARIANT
value: discovery
- name: DJANGO_SETTINGS_MODULE
value: course_discovery.settings.tutor.production
volumeMounts:
- mountPath: /openedx/discovery/course_discovery/settings/tutor/production.py
name: settings
subPath: production.py
securityContext:
allowPrivilegeEscalation: false
volumes:
- name: settings
configMap:
name: discovery-settings
4 changes: 4 additions & 0 deletions tutordiscovery/patches/local-docker-compose-dev-services
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ discovery:
default:
aliases:
- "{{ DISCOVERY_HOST }}"

discovery-worker:
environment:
DJANGO_SETTINGS_MODULE: course_discovery.settings.tutor.development
12 changes: 12 additions & 0 deletions tutordiscovery/patches/local-docker-compose-services
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,15 @@ discovery:
- lms
{% if RUN_MYSQL %}- mysql{% endif %}
{% if RUN_ELASTICSEARCH %}- elasticsearch{% endif %}

discovery-worker:
image: {{ DISCOVERY_DOCKER_IMAGE }}
environment:
SERVICE_VARIANT: discovery
DJANGO_SETTINGS_MODULE: course_discovery.settings.tutor.production
command: celery --app=course_discovery.celery worker --loglevel=info --max-tasks-per-child=100
restart: unless-stopped
volumes:
- ../plugins/discovery/apps/settings/tutor:/openedx/discovery/course_discovery/settings/tutor:ro
depends_on:
- discovery

0 comments on commit d6e7a7f

Please sign in to comment.