Skip to content

Commit

Permalink
Initial Glitchtip installation definition
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevinjil committed Sep 9, 2024
1 parent 2ddac69 commit df7feb2
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 0 deletions.
22 changes: 22 additions & 0 deletions provision-contest/ansible/glitchtip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---

- hosts: glitchtip
vars:
host_type: glitchtip
become: true
handlers:
- include_tasks: handlers.yml
roles:
# - role: base_packages
# tags: base_packages
# - role: icpc_fixes
# tags: icpc_fixes
# when: ICPC_IMAGE
# - role: system_fixes
# tags: system_fixes
# - role: hosts
# tags: hosts
- role: docker
tags: docker
- role: glitchtip
tags: glitchtip
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,6 @@ PRESCLIENT_CONTEST: nwerc18

# Sentry DSN URL
# SENTRY_DSN:

# Glitchtip
# GLITCHTIP_SECRET: {some-strong-glitchtip-password}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
glitchtip_port: 8000
5 changes: 5 additions & 0 deletions provision-contest/ansible/roles/glitchtip/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- name: Restart Glitchtip
community.docker.docker_compose_v2:
project_src: /opt/glitchtip
state: restarted
17 changes: 17 additions & 0 deletions provision-contest/ansible/roles/glitchtip/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
- name: Create directories
become_user: root
file:
path: /opt/glitchtip
state: directory

- name: Create compose file
template:
src: templates/docker-compose.yaml.j2
dest: /opt/glitchtip/docker-compose.yaml

- name: Deploy Glitchtip compose stack
community.docker.docker_compose_v2:
project_src: /opt/glitchtip
files:
- docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Uncomment version if using an older version of docker compose
# version: "3.8"
x-environment:
&default-environment
DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres
SECRET_KEY: {{GLITCHTIP_SECRET}}
PORT: {{glitchtip_port}}
EMAIL_URL: consolemail://
GLITCHTIP_DOMAIN: http://glitchtip.domjudge
DEFAULT_FROM_EMAIL: [email protected]
CELERY_WORKER_AUTOSCALE: "1,1"
CELERY_WORKER_MAX_TASKS_PER_CHILD: "1000"

x-depends_on:
&default-depends_on
- postgres
- redis

services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_HOST_AUTH_METHOD: "trust" # Consider removing this and setting a password
restart: unless-stopped
volumes:
- pg-data:/var/lib/postgresql/data
redis:
image: redis:7-alpine
restart: unless-stopped
web:
image: glitchtip/glitchtip:v4.1.3
depends_on: *default-depends_on
ports:
- {{glitchtip_port}}:8000
environment: *default-environment
restart: unless-stopped
volumes:
- uploads:/code/uploads
worker:
image: glitchtip/glitchtip:v4.1.3
command: ./bin/run-celery-with-beat.sh
depends_on: *default-depends_on
environment: *default-environment
restart: unless-stopped
volumes:
- uploads:/code/uploads
migrate:
image: glitchtip/glitchtip:v4.1.3
depends_on: *default-depends_on
command: ./bin/run-migrate.sh
environment: *default-environment

volumes:
pg-data:
uploads:
1 change: 1 addition & 0 deletions provision-contest/ansible/roles/glitchtip/vars/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.yml

0 comments on commit df7feb2

Please sign in to comment.