Skip to content

Commit

Permalink
Merge pull request #28 from jkremser/init-Q
Browse files Browse the repository at this point in the history
Init q
  • Loading branch information
jkremser authored Jun 18, 2024
2 parents 8b457b3 + 3f19c97 commit f4f6fb4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion samples/stable-diffusion/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Stable Diffusion use-case

![diagram](./demo.png "Diagram")
https://excalidraw.com/#json=p1f9nzyFye_sOgnV9AmIL,69oUi00h3HKXnsyzUReA5g
https://excalidraw.com/#json=PeQw--dGn7z7P99xFgA0y,y9O3lE3D-r2Xy76G2Rmxow

The architecture is based on the job queue design pattern where webui app is responsible for feeding the queue called `tasks` with
job requests. Then KEDA spawns worker pods (either jobs or scales the corresponding deployment) which take the top job from the message queue
Expand Down
2 changes: 1 addition & 1 deletion samples/stable-diffusion/manifests/rabbitmq.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
resources:
requests:
cpu: 100m
memory: 100Mi
memory: 175Mi
secretBackend:
externalSecret:
name: "stablediff"
15 changes: 15 additions & 0 deletions samples/stable-diffusion/manifests/webapp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,21 @@ spec:
volumeMounts:
- name: shared-images
mountPath: /images
initContainers:
# we use the worker container image as init container for the web app to initialize the message Q and also to assure the worker image is pulled,
# because it may have been scaled to 0 and k8s node might have been rotated (spot instances)
- image: ghcr.io/kedify/stable-diffusion-worker
name: init-q
command: ["/bin/sh", "-c"]
args:
- |
amqp-declare-queue --url "${AMQP_URL}" -q "tasks"
env:
- name: AMQP_URL
valueFrom:
secretKeyRef:
name: stablediff-rabbitmq
key: host
volumes:
- name: shared-images
emptyDir: {}
Expand Down

0 comments on commit f4f6fb4

Please sign in to comment.