File tree 10 files changed +54
-6
lines changed
provision-contest/ansible
10 files changed +54
-6
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ There are a few places where additional files should/can be added:
44
44
* Machine/group specific local packages under ` roles/base_packages/files/install-*/ ` .
45
45
* Judgehost chroot local packages under ` roles/judgedaemon/files/install-chroot/ ` .
46
46
* The vendor dependencies under ` roles/domjudge_checkout/files/vendor.tgz ` .
47
+ * Machine/group specific docker containers under ` roles/docker/files/containers-*/ ` .
47
48
48
49
## TODO
49
50
Original file line number Diff line number Diff line change @@ -70,5 +70,5 @@ PRESCLIENT_CONTEST: nwerc18
70
70
# Sentry DSN URL
71
71
# SENTRY_DSN:
72
72
73
- # Glitchtip
73
+ # GlitchTip
74
74
# GLITCHTIP_SECRET: {some-strong-glitchtip-password}
Original file line number Diff line number Diff line change
1
+ # Loading containers from archives
2
+ Any container ` .tar ` files placed in a ` containers-<host_type> ` directory will be loaded as a container for the said host type.
3
+ The container will be tagged with the relative path starting from ` containers-<host_type> ` , without the ` .tar ` file extension.
4
+ For example, the file ` containers-glitchtip/glitchtip/glitchtip:v4.1.3.tar ` will be loaded as a container tagged ` glitchtip/glitchtip:v4.1.3 ` for the ` glitchtip ` host type.
5
+ Note that a nested directory structure is needed to tag containers which have both an organization and a container name.
Original file line number Diff line number Diff line change
1
+ * .tar
Original file line number Diff line number Diff line change
1
+ ---
2
+ - block :
3
+ - name : Check for existing container
4
+ community.docker.docker_image_info :
5
+ name : " {{ img_name }}"
6
+ register : result
7
+
8
+ - block :
9
+ - name : Create temp container directory
10
+ file :
11
+ path : /tmp/dj_ansible
12
+ state : directory
13
+ owner : root
14
+ group : root
15
+ mode : 0700
16
+
17
+ - name : Transfer container archive
18
+ copy :
19
+ src : " {{ item.src }}"
20
+ dest : " {{ img_path }}"
21
+ owner : root
22
+ group : root
23
+ mode : 0700
24
+
25
+ - name : Import container from archive
26
+ community.docker.docker_image :
27
+ name : " {{ img_name }}"
28
+ load_path : " {{ img_path }}"
29
+ source : load
30
+ when : not result.images
31
+ vars :
32
+ img_name : " {{ item.path | splitext | first }}"
33
+ img_path : " /tmp/dj_ansible/{{ item.path | basename }}"
Original file line number Diff line number Diff line change 24
24
- name : Install Docker module for Python
25
25
pip :
26
26
name : docker
27
+
28
+ - name : Load container archives
29
+ include_tasks : load-container.yml
30
+ with_filetree :
31
+ - files/containers-{{ host_type }}/
32
+ when : item.state == 'file' and (item.path | splitext | last) == ".tar"
Original file line number Diff line number Diff line change 1
1
---
2
- - name : Restart Glitchtip
2
+ - name : Restart GlitchTip
3
3
community.docker.docker_compose_v2 :
4
4
project_src : /opt/glitchtip
5
+ files :
6
+ - docker-compose.yaml
5
7
state : restarted
Original file line number Diff line number Diff line change 10
10
src : templates/docker-compose.yaml.j2
11
11
dest : /opt/glitchtip/docker-compose.yaml
12
12
13
- - name : Deploy Glitchtip compose stack
13
+ - name : Deploy GlitchTip compose stack
14
14
community.docker.docker_compose_v2 :
15
15
project_src : /opt/glitchtip
16
16
files :
Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ x-environment:
6
6
SECRET_KEY: {{GLITCHTIP_SECRET}}
7
7
PORT: {{glitchtip_port}}
8
8
EMAIL_URL: consolemail://
9
- GLITCHTIP_DOMAIN: http://glitchtip.domjudge
10
- DEFAULT_FROM_EMAIL: email@glitchtip.domjudge
9
+ GLITCHTIP_DOMAIN: http://glitchtip:{{glitchtip_port}}
10
+ DEFAULT_FROM_EMAIL: email@glitchtip
11
11
CELERY_WORKER_AUTOSCALE: "1,1"
12
12
CELERY_WORKER_MAX_TASKS_PER_CHILD: "1000"
13
13
@@ -31,7 +31,7 @@ services:
31
31
image: glitchtip/glitchtip:v4.1.3
32
32
depends_on: *default-depends_on
33
33
ports:
34
- - {{glitchtip_port}}:8000
34
+ - {{glitchtip_port}}:{{glitchtip_port}}
35
35
environment: *default-environment
36
36
restart: unless-stopped
37
37
volumes:
You can’t perform that action at this time.
0 commit comments