Files
computer-playbook/roles/web-app-gitlab/templates/compose.yml.j2
T
kevinveenbirkenbach a90b3f15a6 fix(web-app-gitlab): pin 19.0.0-ee.0 and patch redis autoload race via custom Dockerfile
GitLab 19.0.0-ee.0 puma crash-loops with
`NameError: uninitialized constant Gitlab::Redis::ALL_CLASSES` whenever
omniauth is not configured. The instrumentation/redis.rb autoloads
before lib/gitlab/redis.rb has the chance to define the constant; with
OIDC enabled the omniauth gem eager-loads gitlab/redis first and
silences the race. Without OIDC (variant 1/2) the race is deterministic
and the deploy aborts at hlth-webserver because lab.git returns 502.

- New plain `files/Dockerfile` prepends `require_relative "../redis"`
  to `lib/gitlab/instrumentation/redis.rb`. Image/version arrive via
  `ARG GITLAB_IMAGE` / `ARG GITLAB_VERSION` forwarded from compose
  `build.args`, so `meta/services.yml` stays the single source of truth.
- `templates/compose.yml.j2` now builds `GITLAB_CUSTOM_IMAGE` locally
  instead of pulling, with `pull_policy: never` and `build.args`.
- `vars/main.yml` adds `entity_name` and `GITLAB_CUSTOM_IMAGE`.
- `meta/services.yml` pins GitLab to `19.0.0-ee.0` (current latest
  stable on Docker Hub) to make the patch reproducible.

Verified in-container: hand-applying the same require_relative makes
puma boot listening; `INFINITO_VARIANT=1 make compose-deploy
mode=update apps=web-app-gitlab` builds the patched image and Playwright
passes 2 / 4 skipped for gitlab variant 1.
2026-05-25 13:42:54 +02:00

31 lines
1.1 KiB
Django/Jinja

{% include 'roles/sys-svc-compose/templates/base.yml.j2' %}
gitlab:
image: "{{ GITLAB_CUSTOM_IMAGE }}"
hostname: '{{ GITLAB_HOSTNAME }}'
container_name: "{{ GITLAB_CONTAINER }}"
pull_policy: never
build:
context: .
dockerfile: Dockerfile
args:
GITLAB_IMAGE: "{{ GITLAB_IMAGE }}"
GITLAB_VERSION: "{{ GITLAB_VERSION }}"
{% include 'roles/sys-svc-container/templates/base.yml.j2' %}
ports:
- "{{ DOCKER_BIND_HOST }}:{{ lookup('config', application_id, 'services.gitlab.ports.local.http') }}:80"
- "{{lookup('config', application_id, 'services.gitlab.ports.public.ssh')}}:22"
volumes:
- 'config:/etc/gitlab'
- 'logs:/var/log/gitlab'
- 'data:/var/opt/gitlab'
shm_size: '256m'
{{ lookup('container_depends_on', application_id) }}
{% include 'roles/sys-svc-container/templates/networks.yml.j2' %}
{{ lookup('applications') | compose_volumes(
application_id,
extra_volumes={'config': {'name': GITLAB_CONF_VOLUME}, 'data': {'name': GITLAB_DATA_VOLUME}, 'logs': {'name': GITLAB_LOGS_VOLUME}}
) }}
{% include 'roles/sys-svc-compose/templates/networks.yml.j2' %}