Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
62b6dd00
Commit
62b6dd00
authored
Feb 12, 2015
by
Max Rothman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
venv stuff
parent
fe8b6261
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
13 additions
and
10 deletions
+13
-10
playbooks/roles/xqwatcher/defaults/main.yml
+4
-2
playbooks/roles/xqwatcher/tasks/code_jail.yml
+3
-3
playbooks/roles/xqwatcher/tasks/deploy_watcher.yml
+1
-1
playbooks/roles/xqwatcher/templates/edx/app/supervisor/conf.d/xqwatcher.conf.j2
+1
-0
playbooks/roles/xqwatcher/templates/etc/apparmor.d/code.jail.j2
+2
-2
playbooks/roles/xqwatcher/templates/etc/sudoers.d/95-course-sandbox.j2
+1
-1
playbooks/roles/xqwatcher/templates/etc/sudoers.d/95-xqwatcher.j2
+1
-1
No files found.
playbooks/roles/xqwatcher/defaults/main.yml
View file @
62b6dd00
...
...
@@ -77,11 +77,13 @@ xqwatcher_module: "xqueue_watcher"
xqwatcher_app_dir
:
"
{{
COMMON_APP_DIR
}}/{{
xqwatcher_service_name
}}"
xqwatcher_app_data
:
"
{{
xqwatcher_app_dir
}}/data"
xqwatcher_venv_base
:
"
{{
xqwatcher_app_dir
}}/venvs"
xqwatcher_venv_dir
:
"
{{
xqwatcher_venv_base
}}/{{
xqwatcher_service_name
}}"
xqwatcher_code_dir
:
"
{{
xqwatcher_app_dir
}}/src"
xqwatcher_conf_dir
:
"
{{
xqwatcher_app_dir
}}"
#Do not reference these outside of this file
xqwatcher_venv_base
:
"
{{
xqwatcher_app_dir
}}/venvs"
xqwatcher_venv_dir
:
"
{{
xqwatcher_venv_base
}}/{{
xqwatcher_service_name
}}"
xqwatcher_requirements_file
:
"
{{
xqwatcher_code_dir
}}/requirements.txt"
xqwatcher_log_dir
:
"
{{
COMMON_LOG_DIR
}}/{{
xqwatcher_service_name
}}"
...
...
playbooks/roles/xqwatcher/tasks/code_jail.yml
View file @
62b6dd00
...
...
@@ -31,7 +31,7 @@
-
name
:
create jail virtualenv
shell
:
>
/usr/local/bin/virtualenv --no-site-packages {{ xqwatcher_
venv_base }}
/{{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.name }}
/usr/local/bin/virtualenv --no-site-packages {{ xqwatcher_
app_dir }}/venvs
/{{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.name }}
with_items
:
XQWATCHER_COURSES
-
name
:
write out requirements.txt
...
...
@@ -44,14 +44,14 @@
-
name
:
install course specific python requirements
pip
:
>
requirements="{{ xqwatcher_app_data }}/{{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.name }}-requirements.txt"
virtualenv="{{ xqwatcher_
venv_base }}
/{{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.name }}"
virtualenv="{{ xqwatcher_
app_dir }}/venvs
/{{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.name }}"
state=present
extra_args="{{ XQWATCHER_PIP_EXTRA_ARGS }}"
with_items
:
XQWATCHER_COURSES
-
name
:
give other read permissions to the virtualenv
shell
:
>
chown -R {{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.user }} {{ xqwatcher_
venv_base }}
/{{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.name }}
chown -R {{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.user }} {{ xqwatcher_
app_dir }}/venvs
/{{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.name }}
with_items
:
XQWATCHER_COURSES
-
name
:
start apparmor service
...
...
playbooks/roles/xqwatcher/tasks/deploy_watcher.yml
View file @
62b6dd00
...
...
@@ -5,7 +5,7 @@
-
name
:
install application requirements
pip
:
>
requirements="{{ xqwatcher_requirements_file }}"
virtualenv="{{ xqwatcher_
venv_dir
}}" state=present
virtualenv="{{ xqwatcher_
app_dir }}/venvs/{{ xqwatcher_service_name
}}" state=present
sudo
:
true
sudo_user
:
"
{{
xqwatcher_user
}}"
...
...
playbooks/roles/xqwatcher/templates/edx/app/supervisor/conf.d/xqwatcher.conf.j2
View file @
62b6dd00
; {{ ansible_managed }}
;
{% set xqwatcher_venv_dir = xqwatcher_app_dir + '/venvs/' + xqwatcher_service_name %}
{% if COMMON_ENABLE_NEWRELIC_APP %}
{% set executable = xqwatcher_venv_dir + '/bin/newrelic-admin run-program ' + xqwatcher_venv_dir + '/bin/python' %}
{% else %}
...
...
playbooks/roles/xqwatcher/templates/etc/apparmor.d/code.jail.j2
View file @
62b6dd00
#include <tunables/global>
{{ xqwatcher_
venv_base }}
/{{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.name }}/bin/python {
{{ xqwatcher_
app_dir }}/venvs
/{{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.name }}/bin/python {
#include <abstractions/base>
{{ xqwatcher_
venv_base }}
/{{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.name }}/** mr,
{{ xqwatcher_
app_dir }}/venvs
/{{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.name }}/** mr,
#todo need a way of providing.
# edxapp_code_dir /common/lib/sandbox-packages/** r,
/tmp/codejail-*/ rix,
...
...
playbooks/roles/xqwatcher/templates/etc/sudoers.d/95-course-sandbox.j2
View file @
62b6dd00
{{ item.QUEUE.HANDLERS[0].CODEJAIL.user }} ALL=({{ item.QUEUE.HANDLERS[0].CODEJAIL.user }}) SETENV:NOPASSWD:{{ xqwatcher_
venv_base }}
/{{ item.QUEUE.HANDLERS[0].CODEJAIL.name }}/bin/python
{{ item.QUEUE.HANDLERS[0].CODEJAIL.user }} ALL=({{ item.QUEUE.HANDLERS[0].CODEJAIL.user }}) SETENV:NOPASSWD:{{ xqwatcher_
app_dir }}/venvs
/{{ item.QUEUE.HANDLERS[0].CODEJAIL.name }}/bin/python
{{ item.QUEUE.HANDLERS[0].CODEJAIL.user }} ALL=(ALL) NOPASSWD:/bin/kill
{{ item.QUEUE.HANDLERS[0].CODEJAIL.user }} ALL=(ALL) NOPASSWD:/usr/bin/pkill
playbooks/roles/xqwatcher/templates/etc/sudoers.d/95-xqwatcher.j2
View file @
62b6dd00
{{ xqwatcher_user }} ALL=({{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.user }}) SETENV:NOPASSWD:{{ xqwatcher_
venv_base }}
/{{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.name }}/bin/python
{{ xqwatcher_user }} ALL=({{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.user }}) SETENV:NOPASSWD:{{ xqwatcher_
app_dir }}/venvs
/{{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.name }}/bin/python
{{ xqwatcher_user }} ALL=({{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.user }}) NOPASSWD:/bin/kill
{{ xqwatcher_user }} ALL=({{ item.QUEUE_CONFIG.HANDLERS[0].CODEJAIL.user }}) NOPASSWD:/usr/bin/pkill
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment