Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c9e061f
Add nomad installation
LDiazN Jul 16, 2026
430f31f
Add nomad config file
LDiazN Jul 16, 2026
c3bc013
Install docker in nomad server
LDiazN Jul 16, 2026
1520461
Add relevant tags to every service
LDiazN Jul 16, 2026
be8c6b8
Add dehydrated and nginx for https
LDiazN Jul 16, 2026
9d367ce
Open nomad ports
LDiazN Jul 16, 2026
5401687
Add nomad webui port
LDiazN Jul 16, 2026
9b2ba52
Add tls to nomad webui
LDiazN Jul 16, 2026
9b9ccdf
Add basic auth to nomad
LDiazN Jul 16, 2026
5b6093d
Use password in dev env
LDiazN Jul 16, 2026
212bb7f
deactivate internal tls (nginx handles tls)
LDiazN Jul 17, 2026
8c5939b
Add nomad provider to terraform
LDiazN Jul 17, 2026
5eaacd8
Add nomad to terraform
LDiazN Jul 17, 2026
dee04ac
remove podman
LDiazN Jul 17, 2026
ba74b1b
Add job directory with oonimeasurements job
LDiazN Jul 17, 2026
61feb22
restore podman
LDiazN Jul 17, 2026
284fe43
Add nomad nginx configs
LDiazN Jul 17, 2026
125406e
Fix nginx config
LDiazN Jul 17, 2026
d6b054e
Final settings to support exec on browser
LDiazN Jul 17, 2026
dfd1e39
Add nginx for api
LDiazN Jul 17, 2026
fe4a270
Remove redundant prometheus file
LDiazN Jul 17, 2026
9e3f3d7
Add anonc to clickhouse proxy rules
LDiazN Jul 17, 2026
7a1857b
Change clickhouse proxy url
LDiazN Jul 17, 2026
e72f4f6
Add health checking
LDiazN Jul 17, 2026
38292a1
Add plugin dir configuration to nomad
LDiazN Jul 23, 2026
8bb024b
Add nomad tags
LDiazN Jul 23, 2026
3c0aad0
Start podman service; setup podman driver
LDiazN Jul 23, 2026
4e39209
Change driver from docker to podman
LDiazN Jul 23, 2026
28c3ff4
Add docker prefix to image name
LDiazN Jul 23, 2026
622cd5d
Create podman user for rootless containers
LDiazN Jul 23, 2026
9a12d22
Setup service to run as rootless
LDiazN Jul 23, 2026
49e91e5
Fix bug with uid space
LDiazN Jul 23, 2026
be19062
Add nomad tags
LDiazN Jul 23, 2026
452df97
Remove user config in job
LDiazN Jul 23, 2026
4189092
Add template for generic jobs
LDiazN Jul 23, 2026
518dc3a
Add valkey job
LDiazN Jul 27, 2026
6301f73
Add canary deployment to oonimeasurements
LDiazN Jul 27, 2026
27c1501
Add var for oonimeasurements tag
LDiazN Jul 28, 2026
598aa47
Add dispatch to trigger a deployment of updated services
LDiazN Jul 28, 2026
43a843a
Checkout to the current branch for experiments
LDiazN Jul 30, 2026
3b7d002
Merge branch 'main' into nomad-experiment
LDiazN Jul 31, 2026
66537e0
Cleanup nomad installation
LDiazN Jul 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/update_service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Update Service

on:
repository_dispatch:
types: [deploy]

concurrency:
# with this group each combination <env>-<service> can run in parallel.
# Requests to the same <env>-<service> get queued
group: deploy-${{ github.event.client_payload.env }}-${{ github.event.client_payload.service }}
cancel-in-progress: false

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Validate inputs
env:
ENV: ${{ github.event.client_payload.env }}
SERVICE: ${{ github.event.client_payload.service }}
TAG: ${{ github.event.client_payload.tag }}
run: |
case "$ENV" in dev|prod) ;; *) echo "Invalid env: $ENV"; exit 1 ;; esac
case "$SERVICE" in
oonimeasurements|ooniprobe|oonifindings|ooniauth|oonirun) ;;
*) echo "Invalid service: $SERVICE"; exit 1 ;;
esac
if [ -z "$TAG" ]; then echo "Missing tag"; exit 1; fi

- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT }} # needs repo write to commit back
ref: nomad-experiment # TODO remove on actual deploy

- name: Update service_tags.auto.tfvars.json
env:
ENV: ${{ github.event.client_payload.env }}
SERVICE: ${{ github.event.client_payload.service }}
TAG: ${{ github.event.client_payload.tag }}
run: |
FILE="tf/environments/${ENV}/service_tags.auto.tfvars.json"
[ -f "$FILE" ] || echo '{}' > "$FILE"
jq --arg key "${SERVICE}_tag" --arg tag "$TAG" \
'.[$key] = $tag' "$FILE" > tmp.json && mv tmp.json "$FILE"

- name: Commit and push
env:
ENV: ${{ github.event.client_payload.env }}
SERVICE: ${{ github.event.client_payload.service }}
TAG: ${{ github.event.client_payload.tag }}
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add "tf/environments/${ENV}/service_tags.auto.tfvars.json"
git commit -m "deploy: ${SERVICE} -> ${TAG} (${ENV})"
git push

- uses: hashicorp/setup-terraform@v3

- name: Terraform init
working-directory: tf/environments/${{ github.event.client_payload.env }}
run: terraform init

- name: Terraform apply
working-directory: tf/environments/${{ github.event.client_payload.env }}
env:
NOMAD_ADDR: ${{ secrets.NOMAD_ADDR }}
NOMAD_TOKEN: ${{ secrets.NOMAD_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.OONIDEVOPS_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.OONIDEVOPS_AWS_SECRET_ACCESS_KEY }}
SERVICE: ${{ github.event.client_payload.service }}
run: |
terraform apply -auto-approve -target="nomad_job.${SERVICE}"
13 changes: 13 additions & 0 deletions ansible/deploy-nomad.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
# This will be in dev mode for the moment, just as a POC
- name: Deploy Nomad agent
hosts: anonc.dev.ooni.io # Use this host in the meanwhile
become: true
vars:
ssl_domains:
- "{{ inventory_hostname }}"
roles:
# - bootstrap
- nginx
- dehydrated
- nomad
2 changes: 1 addition & 1 deletion ansible/roles/bootstrap/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

- name: install systemd-resolved
tags: resolved
ignore_errors: yes # some ubuntu hosts do not have the systemd-resolved package
ignore_errors: true # some ubuntu hosts do not have the systemd-resolved package
ansible.builtin.apt:
install_recommends: no
cache_valid_time: 86400
Expand Down
8 changes: 8 additions & 0 deletions ansible/roles/nomad/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
nomad_webui_username: "admin"
nomad_webui_password: "{{ lookup('amazon.aws.aws_ssm', '/oonidevops/secrets/nomad_webui_password', profile='oonidevops_user_dev') }}"
nomad_htpasswd_path: "/etc/nginx/nomad.htpasswd"

# Choose one that it's outside of system users ranges (0-100)
# and human user ranges > 1000
podman_uid: 64501
32 changes: 32 additions & 0 deletions ansible/roles/nomad/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
- name: test nginx config
command: /usr/sbin/nginx -t -c /etc/nginx/nginx.conf
listen:
- restart nginx
- reload nginx

- name: restart nginx
service:
name: nginx
state: restarted

- name: reload nginx
service:
name: nginx
state: reloaded

- name: reload nftables
tags: nftables
ansible.builtin.systemd_service:
name: nftables
state: reloaded

- name: restart docker
tags: docker
ansible.builtin.systemd_service:
name: docker
state: restarted

- name: restart nomad
ansible.builtin.systemd_service:
name: nomad
state: restarted
Loading
Loading