Merge ~pappacena/turnip:charm-celery-virtinfo-config into turnip:master

Proposed by Thiago F. Pappacena
Status: Merged
Approved by: Thiago F. Pappacena
Approved revision: ea799348d59e4b1fb2fc4a9466a55423f8e42791
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~pappacena/turnip:charm-celery-virtinfo-config
Merge into: turnip:master
Diff against target: 41 lines (+11/-0)
3 files modified
charm/README.md (+1/-0)
charm/turnip-celery/config.yaml (+8/-0)
charm/turnip-celery/templates/turnip-celery.service.j2 (+2/-0)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+391554@code.launchpad.net

Commit message

Adding virtinfo endpoint config on celery charm

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

Maybe adjust the instructions in charm/README.md too? But otherwise LGTM.

review: Approve
ea79934... by Thiago F. Pappacena

Adjusting charm readme instructions

Revision history for this message
Thiago F. Pappacena (pappacena) wrote :

Thanks, cjwatson!

I forgot about the README. Changed that, and I'll merge this MP.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/charm/README.md b/charm/README.md
2index 497591d..0bc4a18 100644
3--- a/charm/README.md
4+++ b/charm/README.md
5@@ -27,6 +27,7 @@ authenticate users, and so on. This may be Launchpad or the stub
6 $ juju config turnip-pack-backend virtinfo_endpoint="$VIRT_ENDPOINT"
7 $ juju config turnip-pack-virt virtinfo_endpoint="$VIRT_ENDPOINT"
8 $ juju config turnip-pack-frontend-http virtinfo_endpoint="$VIRT_ENDPOINT"
9+ $ juju config turnip-celery virtinfo_endpoint="$VIRT_ENDPOINT"
10
11 # Contact Information
12
13diff --git a/charm/turnip-celery/config.yaml b/charm/turnip-celery/config.yaml
14index 9cf765d..6f8ffb1 100644
15--- a/charm/turnip-celery/config.yaml
16+++ b/charm/turnip-celery/config.yaml
17@@ -3,3 +3,11 @@ options:
18 type: string
19 default: pyamqp://guest@localhost//
20 description: Celery broker URL
21+ virtinfo_endpoint:
22+ type: string
23+ default: http://localhost:6543/githosting
24+ description: Virtinfo endpoint (Launchpad/Turnipcake)
25+ virtinfo_timeout:
26+ type: int
27+ default: 15
28+ description: Timeout for virtinfo requests, in seconds.
29diff --git a/charm/turnip-celery/templates/turnip-celery.service.j2 b/charm/turnip-celery/templates/turnip-celery.service.j2
30index 6370157..e6a2132 100644
31--- a/charm/turnip-celery/templates/turnip-celery.service.j2
32+++ b/charm/turnip-celery/templates/turnip-celery.service.j2
33@@ -14,6 +14,8 @@ Environment=PATH={{ venv_dir }}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/us
34 Environment=REPO_STORE={{ data_dir }}/repos
35 Environment=TURNIP_LOG_DIR={{ logs_dir }}
36 Environment=CELERY_BROKER={{ celery_broker }}
37+Environment=VIRTINFO_ENDPOINT={{ virtinfo_endpoint }}
38+Environment=VIRTINFO_TIMEOUT={{ virtinfo_timeout }}
39 ExecStart={{ venv_dir }}/bin/celery -A turnip.tasks worker --logfile={{ logs_dir }}/turnip-celery.log --pool=gevent
40 ExecReload=/bin/kill -s HUP $MAINPID
41 ExecStop=/bin/kill -s TERM $MAINPID

Subscribers

People subscribed via source and target branches