-
Notifications
You must be signed in to change notification settings - Fork 11
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
Use virtualenv instead of user pip #44
Changes from 5 commits
ced7caf
f762774
1b531b3
3895edb
fd5a4d9
7e4bf68
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,15 +19,15 @@ | |
- "{{ pretalx_staticfiles_directory }}" | ||
- "{{ pretalx_data_dir }}" | ||
- "{{ pretalx_media_dir }}" | ||
- "{{ pretalx_virtualenv }}" | ||
tags: | ||
- pretalx | ||
|
||
- name: Install redis client | ||
pip: | ||
name: django_redis | ||
executable: pip3 | ||
extra_args: --user | ||
state: latest # noqa package-latest | ||
virtualenv: "{{ pretalx_virtualenv }}" | ||
become: true | ||
become_user: "{{ pretalx_system_user }}" | ||
when: pretalx_redis or pretalx_celery | ||
|
@@ -38,9 +38,8 @@ | |
- name: Install gunicorn | ||
pip: | ||
name: gunicorn | ||
executable: pip3 | ||
extra_args: --user | ||
state: latest # noqa package-latest | ||
virtualenv: "{{ pretalx_virtualenv }}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're using |
||
become: true | ||
become_user: "{{ pretalx_system_user }}" | ||
tags: | ||
|
@@ -93,14 +92,14 @@ | |
- name: Install pretalx (latest) | ||
pip: | ||
name: "pretalx{{ pretalx_extra }}" | ||
executable: pip3 | ||
extra_args: --user | ||
state: latest # noqa package-latest | ||
virtualenv: "{{ pretalx_virtualenv | default(omit) }}" | ||
notify: | ||
- Restart pretalx service | ||
- Restart worker service | ||
- Run pretalx migrations | ||
- Collect static pretalx files | ||
- Compile pretalx javascript | ||
- Compress static pretalx files | ||
- Compile pretalx messages | ||
- Compile pretalx styles | ||
|
@@ -114,13 +113,13 @@ | |
- name: Install pretalx (versioned) | ||
pip: | ||
name: "pretalx{{ pretalx_extra }}" | ||
executable: pip3 | ||
extra_args: --user | ||
version: "{{ pretalx_version }}" | ||
version: "{{ pretalx_version }}" # noqa package-lastest | ||
virtualenv: "{{ pretalx_virtualenv | default(omit) }}" | ||
notify: | ||
- Restart pretalx service | ||
- Restart worker service | ||
- Run pretalx migrations | ||
- Compile pretalx javascript | ||
- Collect static pretalx files | ||
- Compress static pretalx files | ||
- Compile pretalx messages | ||
|
@@ -135,14 +134,14 @@ | |
- name: Install pretalx (git) | ||
pip: | ||
name: "git+{{ pretalx_git_url }}@{{ pretalx_git_version }}#egg=pretalx{{ pretalx_extra }}" | ||
executable: pip3 | ||
extra_args: --user | ||
state: latest # noqa package-latest | ||
virtualenv: "{{ pretalx_virtualenv | default(omit) }}" | ||
notify: | ||
- Restart pretalx service | ||
- Restart worker service | ||
- Run pretalx migrations | ||
- Collect static pretalx files | ||
- Compile pretalx javascript | ||
- Compress static pretalx files | ||
- Compile pretalx messages | ||
- Compile pretalx styles | ||
|
@@ -181,6 +180,7 @@ | |
- Run pretalx migrations | ||
- Collect static pretalx files | ||
- Compress static pretalx files | ||
- Compile pretalx javascript | ||
- Compile pretalx messages | ||
- Compile pretalx styles | ||
- Install pretalx plugins | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
- gcc | ||
- gettext | ||
- git | ||
- npm | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Included this in a separate commit, just to get it merged while we talk about the rest here. |
||
state: present | ||
tags: | ||
- pretalx | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ After=network.target | |
[Service] | ||
User={{ pretalx_system_user_prefix }}%i | ||
Group={{ pretalx_system_user_prefix }}%i | ||
WorkingDirectory=/home/{{ pretalx_system_user_prefix }}%i/.local/lib/python{{ pretalx_system_python_version }}/site-packages/pretalx | ||
ExecStart=/home/{{ pretalx_system_user_prefix }}%i/.local/bin/gunicorn --bind unix:/run/gunicorn/pretalx_%i --workers {{ pretalx_service_workers }} --max-requests {{ pretalx_service_workers_max_requests }} --max-requests-jitter {{ pretalx_service_workers_max_requests_jitter }} pretalx.wsgi | ||
WorkingDirectory={{ pretalx_virtualenv }}/lib/python{{ pretalx_system_python_version }}/site-packages/pretalx | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You've removed the parametrisation ( |
||
ExecStart={{ pretalx_virtualenv }}/bin/gunicorn --bind unix:/run/gunicorn/pretalx_%i --workers {{ pretalx_service_workers }} --max-requests {{ pretalx_service_workers_max_requests }} --max-requests-jitter {{ pretalx_service_workers_max_requests_jitter }} pretalx.wsgi | ||
ExecReload=/bin/kill -s HUP $MAINPID | ||
ExecStop=/bin/kill -s TERM $MAINPID | ||
ExecStop=/bin/kill -s TERM $MAINPID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I don't think this is quite correct. Instead, we can just replace the
collectstatic
andcompress
commands withrebuild
– rebuild runs collectstatic, compress and also compilemessages.