Add-forge-now automation#
Intended audience
sysadm staff members
When a request status is updated to Accepted
, a Gitlab pipeline is triggered to process the request.
Pipeline#
Concurrent jobs
runner0
:root@runner0:~# awk '/concurrent/' config.toml
concurrent = 10
Pre stage#
pre
stage add a comment on the webapp request with the Gitlab issue URL.Staging stages#
Scheduled
and
a comment is added to the Gitlab issue.Production stages#
First Origins Loaded
,
a comment is added to the Gitlab issue and this issue is closed.Request status#
pre stage adds a comment on request;
if the staging stages are successfully completed, the request status is updated to
Scheduled
;if the production stages are successfully completed, the request status is updated to
First Origin Loaded
.
All comments contain the url of the issue where to find the associated pipeline.
Common errors#
A non-exhaustive list of common pipeline errors is:
- Stage pre, job 02_check_ports_and_token:
error: the network ports checks failed;
cause: one of the SWH components are unreachable or the forge URL (https) is unreachable;
relaunch the job.
- Stage *_list_origins, job 2*_check_listed_origins:
error:
Forge <forge> (<type>) isn't registered in the scheduler database.
;cause: the lister pod creation took more time than the listing delay (600s);
relaunch the job.
- Stage *_list_origins, job 2*_check_listed_origins:
error:
Forge <forge> (<type>) has 0 listed origin in the scheduler database.
;cause: the lister failed to find some origin;
process request manually (most of the time, it needs the optional base_git_url parameter). See How to process add-forge-now requests
- Stage *_ingest_origins, job 4*_check_ingested_origins:
error:
There are too many ingestion failures.
;cause: ingestion failures > 70%;
check ingestion (e.g. lots of empty repositories,…) and/or swh platform (e.g. objstorage unavailable,…); process request manually (combination of url and base_git_url).
- Any stage, any job (generally in job 4p_check-ingested-origins):
error:
ERROR: Job failed: execution took longer than 168h0m0s seconds
;cause: job timeout (7d);
relaunch the job.
Gitlab-runner#
Runners
section to check the runner’s status and update the runner configuration;Variables
section to check, retrieve or update the variables that need to be protected and masked;Webapp Token
If the webapp token is expired and not renewed (normally it should), the pipeline will fail in third job of pre stage.
You can update the variable WEBAPP_TOKEN
in this section.
Pipeline trigger tokens
section to check or change the pipeline token.docker-compose.yml
version: "3"
services:
gitlab-runner:
image: gitlab/gitlab-runner:alpine
container_name: gitlab-runner
restart: always
volumes:
- "/run/docker.sock:/var/run/docker.sock"
- "gitlab_gitlab-runner:/etc/gitlab-runner"
- "./config.toml:/etc/gitlab-runner/config.toml"
volumes:
gitlab_gitlab-runner:
Runner configuration file config.toml
concurrent = 10
check_interval = 0
shutdown_timeout = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "add-forge-now-runner"
url = "https://gitlab.softwareheritage.org"
id = 4
token = "xxx"
token_obtained_at = 2023-10-12T14:12:16Z
token_expires_at = 0001-01-01T00:00:00Z
executor = "docker"
[runners.cache]
MaxUploadedArchiveSize = 0
[runners.docker]
tls_verify = false
image = "ruby:2.7"
privileged = false
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache",
"/etc/swh/scheduler-staging.yml:/etc/swh/scheduler-staging.yml",
"/etc/swh/scheduler-production.yml:/etc/swh/scheduler-production.yml"]
shm_size = 0
Check the runner version and status:
root@runner0:~# alias dck
alias dck='docker compose'
root@runner0:~# dck exec -ti gitlab-runner gitlab-runner --version
Version: 16.10.0
Git revision: 81ab07f6
Git branch: 16-10-stable
GO version: go1.21.7
Built: 2024-03-21T19:43:25+0000
OS/Arch: linux/amd64
root@runner0:~# dck exec -ti gitlab-runner gitlab-runner verify
Runtime platform arch=amd64 os=linux pid=177 revision=81ab07f6 version=16.10.0
Running in system-mode.
Verifying runner... is valid runner=6aU8maWXg