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

Add flower #179

Merged
merged 3 commits into from
Apr 29, 2019
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
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ before_script:
- docker-compose up -d

script:
- make integration-tests
- |
if [[ "$TRAVIS_PULL_REQUEST" = "false" ]] && [[ "$LOKOLE_QUEUE_BROKER_SCHEME" = "azureservicebus" ]]; then
echo "Skipping live service test for branch build"
else
make integration-tests
fi

after_failure:
- docker-compose logs
Expand Down
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ services:
- ${APP_PORT}:8888
environment:
DNS_RESOLVER: 127.0.0.11
HOSTNAME_FLOWER: flower:8080
HOSTNAME_CLIENT_READ: api:8080
HOSTNAME_CLIENT_WRITE: api:8080
HOSTNAME_EMAIL_RECEIVE: api:8080
HOSTNAME_CLIENT_REGISTER: api:8080
depends_on:
- api
- flower

api:
<< : *shared-app-build
Expand Down Expand Up @@ -79,6 +81,14 @@ services:
- azurite
- rabbitmq

flower:
<< : *shared-app-build
command: ["/app/run-flower.sh"]
environment:
<< : *shared-app-environment
FLOWER_USERNAME: flower
FLOWER_PASSWORD: 123456

setup:
image: ${DOCKER_REPO}/opwenserver_setup:${BUILD_TAG}
build:
Expand Down
1 change: 1 addition & 0 deletions docker/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ WORKDIR /app

COPY --from=builder /src/docker/docker-entrypoint.sh .
COPY --from=builder /src/docker/app/run-celery.sh .
COPY --from=builder /src/docker/app/run-flower.sh .
COPY --from=builder /src/docker/app/run-gunicorn.sh .
COPY --from=builder /src/opwen_email_server ./opwen_email_server

Expand Down
7 changes: 7 additions & 0 deletions docker/app/run-flower.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

"${PY_ENV}/bin/flower" \
--app="opwen_email_server.integration.celery" \
--port="${PORT}" \
--url_prefix="flower" \
--basic_auth="${FLOWER_USERNAME}:${FLOWER_PASSWORD}"
6 changes: 6 additions & 0 deletions docker/nginx/nginx.conf.mu
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ http {
root /static;
}

location /flower/ {
rewrite ^/flower/(.*)$ /$1 break;
proxy_pass http://{{HOSTNAME_FLOWER}};
proxy_set_header Host $host;
}

location /api/email/sendgrid {
proxy_pass http://{{HOSTNAME_EMAIL_RECEIVE}};
}
Expand Down
40 changes: 40 additions & 0 deletions helm/templates/flower-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert --file=compose.yml --chart
kompose.version: 1.13.0 (84fa826)
creationTimestamp: null
labels:
io.kompose.service: flower
name: flower
spec:
replicas: 1
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
io.kompose.service: flower
spec:
containers:
- name: flower
image: {{.Values.version.imageRegistry}}/opwenserver_app:{{.Values.version.dockerTag}}
command: ["/app/run-flower.sh"]
env:
{{ include "opwen.environment.shared" . }}
- name: FLOWER_USERNAME
valueFrom:
secretKeyRef:
name: users
key: FLOWER_USERNAME
- name: FLOWER_PASSWORD
valueFrom:
secretKeyRef:
name: users
key: FLOWER_PASSWORD
ports:
- containerPort: 8080
resources: {}
restartPolicy: Always
status: {}
19 changes: 19 additions & 0 deletions helm/templates/flower-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.cmd: kompose convert --file=compose.yml --chart
kompose.version: 1.13.0 (84fa826)
creationTimestamp: null
labels:
io.kompose.service: flower
name: flower
spec:
ports:
- name: "8080"
port: 8080
targetPort: 8080
selector:
io.kompose.service: flower
status:
loadBalancer: {}
2 changes: 2 additions & 0 deletions helm/templates/nginx-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ spec:
env:
- name: DNS_RESOLVER
value: 127.0.0.1:53 ipv6=off
- name: HOSTNAME_FLOWER
value: flower:8080
- name: HOSTNAME_CLIENT_READ
value: api:8080
- name: HOSTNAME_CLIENT_WRITE
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ beautifulsoup4==4.7.1
cached-property==1.5.1
connexion[flask,swagger-ui]==2.2.0
environs==4.1.0
flower==0.9.3
msgpack==0.6.1
pyzmail36==1.0.4
requests==2.21.0
Expand Down