Skip to content
This repository was archived by the owner on Mar 27, 2023. It is now read-only.

Commit 1540e10

Browse files
committed
Merge branch '35-add-flower-for-celery-monitoring' into 'develop'
Resolve "Add flower service" Closes #35 See merge request verbose-equals-true/django-postgres-vue-gitlab-ecs!86
2 parents 6b5241d + 3771d48 commit 1540e10

File tree

8 files changed

+420
-460
lines changed

8 files changed

+420
-460
lines changed

awscdk/awscdk/cloudfront.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def __init__(self, scope: core.Construct, id: str, **kwargs,) -> None:
2323
s3_domain_suffix = ".s3-website-us-east-1.amazonaws.com"
2424
s3_website_domain_name = s3_domain_prefix + s3_domain_suffix
2525

26-
path_patterns = ["/api/*", "/admin/*", "/flower/*"]
26+
path_patterns = ["/api/*", "/admin/*", "/flower*"]
2727

2828
self.distribution = cloudfront.CloudFrontWebDistribution(
2929
self,

awscdk/awscdk/flower.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ def __init__(self, scope: core.Construct, id: str, **kwargs,) -> None:
2222
REDIS_SERVICE_HOST = (
2323
scope.elasticache.elasticache.attr_redis_endpoint_address
2424
)
25-
CELERY_BROKER_URL = f"redis://{REDIS_SERVICE_HOST}:6379/0"
25+
CELERY_BROKER_URL = f"redis://{REDIS_SERVICE_HOST}:6379/1"
26+
2627
self.flower_task.add_container(
2728
"FlowerContainer",
2829
image=ecs.ContainerImage.from_registry("mher/flower"),
@@ -37,8 +38,14 @@ def __init__(self, scope: core.Construct, id: str, **kwargs,) -> None:
3738
],
3839
)
3940

41+
self.flower_task.add_container(
42+
"FlowerProxyContainer",
43+
image=ecs.AssetImage("./nginx/flowerproxy"),
44+
# image=ecs.ContainerImage.from_registry("nginx"),
45+
)
46+
4047
port_mapping = ecs.PortMapping(
41-
container_port=5555, protocol=ecs.Protocol.TCP
48+
container_port=80, protocol=ecs.Protocol.TCP
4249
)
4350
self.flower_task.default_container.add_port_mappings(port_mapping)
4451

@@ -60,8 +67,8 @@ def __init__(self, scope: core.Construct, id: str, **kwargs,) -> None:
6067
port=80,
6168
targets=[self.flower_service],
6269
priority=1,
63-
path_patterns=["/flower/*", "flower/*"],
70+
path_patterns=["/flower/*", "/flower*"],
6471
health_check=elbv2.HealthCheck(
65-
healthy_http_codes="200-401", path="/flower/"
72+
healthy_http_codes="200-404", path="/flower"
6673
),
6774
)

gitlab-ci/aws/cdk.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ cdk deploy:
3030
services:
3131
- docker:19.03.5-dind
3232
stage: deploy
33-
only:
34-
- master
33+
# only:
34+
# - master
3535
variables:
3636
ENVIRONMENT: dev
3737
DOCKER_TLS_CERTDIR: ""

nginx/flowerproxy/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM nginx:1.18.0-alpine
2+
COPY proxy.conf /etc/nginx/nginx.conf
3+
EXPOSE 80
4+
CMD ["nginx", "-g", "daemon off;"]

nginx/flowerproxy/proxy.conf

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# server {
2+
# listen 80;
3+
# charset utf-8;
4+
5+
# location /flower/ {
6+
# rewrite ^/flower/(.*)$ /$1 break;
7+
# proxy_pass http://localhost:5555;
8+
# proxy_set_header Host $host;
9+
# proxy_redirect off;
10+
# proxy_http_version 1.1;
11+
# proxy_set_header Upgrade $http_upgrade;
12+
# proxy_set_header Connection "upgrade";
13+
# }
14+
# }
15+
16+
17+
# server {
18+
# listen 80;
19+
# charset utf-8;
20+
21+
# location /flower/ {
22+
# return 200 'Test';
23+
# add_header Content-Type text/plain;
24+
# }
25+
26+
# location /flower/test {
27+
# return 200 'Testing';
28+
# add_header Content-Type text/plain;
29+
# }
30+
# }
31+
32+
33+
user nginx;
34+
worker_processes 1;
35+
36+
events {
37+
worker_connections 1024;
38+
}
39+
40+
http {
41+
include /etc/nginx/mime.types;
42+
client_max_body_size 100m;
43+
44+
server {
45+
listen 80;
46+
charset utf-8;
47+
48+
# flower
49+
location /flower/ {
50+
rewrite ^/flower/(.*)$ /$1 break;
51+
proxy_pass http://localhost:5555;
52+
proxy_set_header Host $host;
53+
proxy_redirect off;
54+
proxy_http_version 1.1;
55+
proxy_set_header Upgrade $http_upgrade;
56+
proxy_set_header Connection "upgrade";
57+
}
58+
}
59+
}

quasar/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"test": "echo \"No test specified\" && exit 0"
1212
},
1313
"dependencies": {
14-
"@quasar/extras": "1.7.0",
14+
"@quasar/extras": "1.8.1",
1515
"apollo-cache-inmemory": "1.6.6",
1616
"apollo-client": "2.6.9",
1717
"apollo-link": "1.2.14",
@@ -25,13 +25,13 @@
2525
"highcharts-vue": "1.3.5",
2626
"js-cookie": "2.2.1",
2727
"prettier": "^2.0.5",
28-
"quasar": "1.10.5",
28+
"quasar": "1.12.0",
2929
"vue-apollo": "3.0.3",
3030
"vue-i18n": "8.17.4",
3131
"vue-native-websocket": "2.0.14"
3232
},
3333
"devDependencies": {
34-
"@quasar/app": "1.8.5",
34+
"@quasar/app": "1.9.0",
3535
"@vue/eslint-config-prettier": "6.0.0",
3636
"babel-eslint": "10.1.0",
3737
"eslint": "5.16.0",

quasar/quasar.conf.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,13 @@ module.exports = function (ctx) {
137137

138138
pwa: {
139139
// workboxPluginMode: "InjectManifest",
140-
// workboxOptions: {
141-
// navigateFallback: "/index.html",
142-
// navigateFallbackDenylist: [
143-
// /\/[admin,api,flower]+\/.*/,
144-
// /[admin,api,flower]+\/.*/,
145-
// ],
146-
// },
140+
workboxOptions: {
141+
navigateFallback: "/index.html",
142+
navigateFallbackBlacklist: [
143+
/\/[admin,api,flower]+\/.*/,
144+
/[admin,api,flower]+\/.*/,
145+
],
146+
},
147147
manifest: {
148148
// name: "Verbose Equals True",
149149
// short_name: "Verbose Equals True",

0 commit comments

Comments
 (0)