Skip to content

Commit

Permalink
Use app image for flower deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
suever committed Feb 13, 2023
1 parent 0047e3f commit 899087f
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
6 changes: 5 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ services:
- redis

flower:
image: mher/flower
build:
context: .
dockerfile: ops/Dockerfile
environment:
CELERY_BROKER_URL: redis://redis:6379
CELERY_RESULT_BACKEND: redis://redis:6379
MATL_ONLINE_ENV: prod
command: celery --app worker.celery flower
ports:
- "5555:5555"
depends_on:
Expand Down
18 changes: 17 additions & 1 deletion ops/templates/flower/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ spec:
spec:
containers:
- name: web
image: "mher/flower:1.2"
image: "suever/matl-online:{{ .Values.CommitHash }}"
command:
- celery
- --app=worker.celery
- flower
- --auth-provider=flower.views.auth.GithubLoginHandler
ports:
Expand All @@ -30,6 +31,10 @@ spec:
value: "admin"
- name: FLOWER_PORT
value: "5555"
- name: FLOWER_DB
value: "/data/flower"
- name: FLOWER_PERSISTENT
value: "True"
- name: FLOWER_AUTH
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -57,6 +62,11 @@ spec:
secretKeyRef:
key: REDIS_URL
name: secrets
- name: MATL_ONLINE_ENV
value: prod
volumeMounts:
- name: data
mountPath: "/data"
securityContext:
runAsNonRoot: true
runAsUser: 8877
Expand All @@ -73,3 +83,9 @@ spec:
limits:
cpu: 200m
memory: 256Mi
securityContext:
fsGroup: 8877
volumes:
- name: data
persistentVolumeClaim:
claimName: flower-pvc
11 changes: 11 additions & 0 deletions ops/templates/flower/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: flower-pvc
namespace: matl-online
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 256Mi
1 change: 1 addition & 0 deletions requirements/prod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ python_socketio==5.7.2

# Celery
celery==5.2.7
flower==1.2.0
redis==4.5.1

# Octave interaction
Expand Down

0 comments on commit 899087f

Please sign in to comment.