Skip to content
/ GitLabKit Public

Toolkit for GitLab server admins and GitLab feature developers!

License

Notifications You must be signed in to change notification settings

encX/GitLabKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitLabKit

Toolkit for GitLab server admins and GitLab feature developers!


Module: Runner Admin

Better way to see and control your GitLab self-hosted runners.

Status

Image publish status Dockerhub Image Version Dockerhub Image Size

Why?

Take a look at current GitLab runner page in group's CI/CD settings.
You can see all runner names and basic information but that's it.
You can rename runners, pause/resume/delete them only individually.
Most importantly, it could only display 4 runners at a time. (as of version 14.10)

Some organizations might have 100+ runners and want to take actions with all of them or at least runners with some specific tags at once.
Some also embrace ephemeral runners where they are periodically destroyed and respawned. This helps mitigate "state drift" issue on servers.
(The state drift issue might be addressed by using docker runner but some still prefer VM/baremetal runners for performance gain or job startup time.)

Status report is another area that's missing.
GitLab doesn't display if a runner is running a job or being idle.
Let alone job history for each runner that could help identifying faulty runners.

GitLabKit Runner Admin can help improve experience of managing runners.

How?

Main page

Put your group ID in text box and hit enter to go to group page. Simple enough.

main-page

Group page

Displays all runners in the group

  • Orange row = Runner is running a job (job displayed on far right)
  • Red row = Runner is offline
  • Use the toggle in front of runner name to individually enable/disable it
  • Click on job name on the right to navigate back to job page on GitLab
  • Click on runner name for runner history page

group-page

Filters!

You could filter runners by tags, online status and active/paused status.
And number in parentheses show you runner counts for that tag/status given current active filter criteria.
Filters can be combined too!

Sort

Simple enough

Action buttons

At the bottom of group page you can take action on runners being displayed.
So you can filter with some criteria and enable, disable or delete them.

group-page-in-action

Runner page

From group page, click on any runner name to see its job history.

  • Green row = Succeeded job
  • Red row = Failed job
  • Orange row = Running job
  • Neutral row = Cancelled job
  • Time in parentheses on the far right = Job duration
  • Click on job name on the right to navigate back to job page on GitLab

runner-page

Installation

GitLabKit Runner Admin is published as a docker image.

You can try running by using docker run

$ docker run \
  -e CONNECTIONS__GITLABSERVER="https://<your-gitlab-server>" \
  -e SECRETS__GITLABTOKEN="<gitlab-token>" \
  -p 80:80 \
  encx/gitlabkit-runner

or docker-compose file

version: '3.8'

services:
  gitlabkit-runner-admin:
    image: encx/gitlabkit-runner
    environment:
      - CONNECTIONS__GITLABSERVER="https://<your-gitlab-server>"
      - SECRETS__GITLABTOKEN="<gitlab-token>"
      - ASPNETCORE_URLS=http://+:80
    ports: ["80:80"]

of course, you could also run this in Kubernetes environment and have multiple pods of it since the Runner Admin doesn't hold any state.

Configuration

Settings could be passed to Runner Admin's container using these environment variables

variable example required description
CONNECTIONS__GITLABSERVER https://gitlab.yourcompany.com yes GitLab server URL
SECRETS__GITLABTOKEN rG2f93ddaz yes GitLab token. Could be a personal token or group token that has sufficient permission to view CI/CD settings in the group
CONNECTIONS__REDISSERVER redis-server:16379 no Redis host. If set, it will be used as cache.
SECRETS__REDISUSER username no Redis ACL user. Leave empty if Redis has no ACL user set.
SECRETS__REDISPASSWORD password no Redis password. Could be used alone if Redis has set requirepass. Or could be used together with SECRETS__REDISUSER for ACL authentication.
LOGTARGETS__SEQ http://seq-server:5341 no Runner Admin supports Seq logger. Use this to set log ingestion URL.
APPLICATIONINSIGHTS__CONNECTIONSTRING - no Runner Admin supports Application Insights to see application diagnostics. Use this to set connection string from Azure dashboard.

Module: REST API Client (coming soon)

Full suite GitLab REST API client.
No more manual HTTP clients.

Will be available on .net, TypeScript, JVM languages and more.


This project is in its early phase. More modules to come.

For contributors, please read CONTRIBUTING.md