{"id":18936109,"url":"https://github.com/collabora/lava-gitlab-runner","last_synced_at":"2025-04-15T18:31:23.705Z","repository":{"id":65436842,"uuid":"559898036","full_name":"collabora/lava-gitlab-runner","owner":"collabora","description":"Gitlab runner for lava","archived":false,"fork":false,"pushed_at":"2025-04-08T02:07:24.000Z","size":284,"stargazers_count":4,"open_issues_count":10,"forks_count":6,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-11T18:27:53.571Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/collabora.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-31T10:29:36.000Z","updated_at":"2025-03-28T06:17:52.000Z","dependencies_parsed_at":"2024-04-18T20:50:24.886Z","dependency_job_id":"5f077eb8-1488-4911-907a-270aa03d9c08","html_url":"https://github.com/collabora/lava-gitlab-runner","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/collabora%2Flava-gitlab-runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/collabora%2Flava-gitlab-runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/collabora%2Flava-gitlab-runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/collabora%2Flava-gitlab-runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/collabora","download_url":"https://codeload.github.com/collabora/lava-gitlab-runner/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249129060,"owners_count":21217276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T12:06:03.304Z","updated_at":"2025-04-15T18:31:23.699Z","avatar_url":"https://github.com/collabora.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lava gitlab runner\n\nA gitlab runner implementation intended to bridge gitlab to\n[Lava](https://lavasoftware.org/).\n\n\n# Installation\n\nThe lava gitlab runner only requires network (https) access to both the gitlab\nserver and the lava server(s), so can pretty much run anywhere.\n\nThe runner requires a runner token to connect to the gitlab server and pick up\njobs. The lava url and token are provided by the gitlab-ci jobs so don't have\nto be configured on the runner.\n\n## Registering a new runner\n\nThe runner cannot register itself with the gitlab server, so this has to be\ndone by hand using the gitlab\n[runner registration API](https://docs.gitlab.com/ee/api/runners.html#register-a-new-runner).\n\nThe registration token can be retrieved from the runners section in the Gitlab\nadministration area. With that token the runner can be register using a curl\ncommand like:\n```\ncurl --request POST \"https://GITLAB_URL/api/v4/runners\"  \\\n  --form \"description=Lava runner\" \\\n  --form \"run_untagged=false\" \\\n  --form \"tag_list=lava-runner\" \\\n  --form \"token=REGISTRATION_TOKEN\"\n```\n\nAs a response to this command a new token for the registered runner will be\nprovided, this token should be provided to the runner for it's gitlab\nconnection.\n\nOne thing to key parameter provided here is `run_untagged=false`, which will\nmake the runner *only* pickup jobs which matches its tag. This is important to\nprevent the runner from picking up \"normal\" jobs which it will not be able to\nprocess.\n\n## Running the runner from the source tree\n\nThe runner can be build using Cargo like any Rust program. To run it the url to\nthe gitlab server and the token have to be either provided on the command line\nor in the `GITLAB_URL` and `GITLAB_TOKEN` environment variables. For example to\nrun directly from source `cargo run https://gitlab.myserver.org RUNNER_TOKEN`.\n\n## Running from a docker image\n\nA pre-built docker image can be found at\nregistry.gitlab.collabora.com/lava/lava-gitlab-runner/main. To connect to the\ngitlab server, `GITLAB_URL` and `GITLAB_TOKEN` should be set in the docker\nenvironment when running the container.\n\n## Running in a Kubernetes cluster\n\nA helm chart is provided in the repository for the runner (in the `chart`\ndirectory). The main values in this chart that should be set are `gitlab.url` to\nset the gitlab url and `gitlab.token` to set the gitlab token.\n\n# Runner Usage\n\nThe runner is used with normal gitlab runner jobs in the same way as other\nrunners. The main difference is that rather then the script commands being run\ninside a shell they're directly executed by the runner itself.\n\n## Runner variables usage\n\n* `LAVA_URL`: This lava server the job should work with\n* `LAVA_TOKEN`: The lava authentication token\n\nThese variables will typically be set as (masked) CI variables, but they could\nalso be provided directly in the job.\n\n## Accessing GitLab CI job variables inside LAVA job definition file\n\nGitLab CI job variables are exposed as fields of a ``job`` template variable\ninside the LAVA job definition file. Example:\n\n```\njob_name: Automated test submitted from GitLab CI Job {{ job.CI_JOB_ID }}\n```\n\n## Runner supported commands\n\nThe following commands are currently supported in the job scripts:\n\n`submit \u003cfilename\u003e` - This submits the given filename from the dependencies to\nthe lava server and will follow the lava job's log output. The gitlab job will\nfail if the lava job ends in an incomplete state or any other issue occurs\n(e.g. submission failure)\n\n\n\n\n`monitor-file \u003cfilename\u003e` - This monitors the lava job ids in the given filename\nfrom the dependencies. The job file should be a json file containing a\ndictionary with a \"jobids\" field which holds an array of ids, e.g.\n`{\"jobids\": [ 1, 2, 3, 4]}`. As multiple lava jobs can be monitored, the job\noutputs will not be directly logged to the gitlab job log output, only the job\nstates are logged. The job will fail if one of the lava jobs finishes with an\nincomplete state.\n\n## Runner artifacts\n\nWhen the gitlab job definition defines artifacts, the log file(s) of the\nsubmitted or monitor jobs will be uploaded as an artifact by the runner.\n\n## Example jobs\n\nTo submit a job to lava, monitor it and retrieve the raw log as a job artifact\nthe following snippet can be used. The referred `lava-job.yaml` should be a file\navailable in one of the artifacts from the job's dependencies.\n\n```\nlava submission:\n  stage: lava\n  timeout: 1d\n  tags:\n    - lava-runner\n  script:\n    - submit lava-job.yaml\n  artifacts:\n    when: always\n    paths:\n      - \"*.yaml\"\n```\n\nTo monitor a set of jobs and retrieve their log files the following snippet can\nbe used.The referred `tests.json` should be a file available in one of the\nartifacts from the job's dependencies.\n\n```\nlava submission:\n  stage: lava\n  timeout: 1d\n  tags:\n    - lava-runner\n  script:\n    - monitor-files test.json\n  artifacts:\n    when: always\n    paths:\n      - \"*.yaml\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcollabora%2Flava-gitlab-runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcollabora%2Flava-gitlab-runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcollabora%2Flava-gitlab-runner/lists"}