Git Product home page Git Product logo

balena-gitlab-runner's Issues

Clean gitlab-runner-helper images

Clean the helper images as well, but:

  • check if running image is not cleared, as I think that was an issue before, or
  • use a separate docker-gc config for that, which excludes different files, and keeps at least one of the runners, which should be the latest.

Without this, software update on the devices, without garbage collection, can mean that gitlab-runner-helpers take up all the space...

Add health check

Not sure what the healthcheck should be:

  • if no config, then fine
  • if config, than check that runners are running

... or think about what else could be checked

Fix version reporting

Currently gitlab-runner reports developer verison, should figure out how to change that...

Dynamic list of cleared containers/images

Runner cache

  • should not ever clear the cache containers for the currently configured runners (it will result in runner error)
  • should, however clear containers when the runner has been reconfigured, and the containers are orphan, so to say.

This can be achieved by reading the relevant config.toml and parse the runner names?

Or run a cleanup before doing the runner registration? (edge cases?)

Runner helper

Connects to #22, here probably could use a cleanup which only keeps the most recent image for every repo. Thus could have a schedule of:

  • normal cleaning of containers, skipping runner helpers
  • once a day (?) cleaning that keeps 1 most recent images (likely that's the way? Unless the runners can be downgraded, in which case it would clear the wrong helper....) Can we parse this info from the config.toml (helper_image, when it's set) and maybe gitlab-runner output (when it's automatic)?
  • Or could we do a general cleanup, that only targets the helper images, and skips everything else?

Add a README to this repo

Some things to answer (not exhaustive):

  • How to set up? Initial setup and expansion (extra runners created with gitlab-runner register
  • Limitations (architecture? balena?)
  • Full example project link and walkthrough

Check if cache volumes work

Not sure if caching works currently, maybe have to make /cache into a volume? Or does it even work for our setup?

Add default runner setup from env vars

Have some general logic (well documented!), that people can define application env vars, and new devices connected will automatically be added as runners somewhere

  • default runner name (device short uuid?)
  • architecture tags: yes/no
  • default image: architecture mapping?
  • other tags (balenaCloud? / openBalena)
  • device type tags?

Document the fact that these are at initiation, not taking effect if already have configuration (ie. cannot do dynamic setup from env vars)

Also, would be nice to have a better format for boolean tags (ie. be able to use yes / no, in lower/uppercase, or 1 / 0)

Create demo project to use this application

A project that:

  • can be pushed to Gitlab or to a Gitlab instance directly
  • can use architecture tags
  • by default build and test successfully (without changes, so easy quickstart)

Current examples from Gitlab to get inspired by: https://docs.gitlab.com/ee/ci/examples/README.html
Notables:

Runner disconnects from gitlab self hosted instance

Running the latest code, only changes are environment variables. Things run okay on gitlab.com, but on our self-hosted instance, the runner does it's thing for about 20 minutes, then starts trying to hit 127.0.0.11:53 instead and doesn't recover. If you reboot the pi, you get another 20 minutes of normal operation before it reverts to this behavior. On the server side, there are no errors, it just stops hearing from the runner.

I've tried this on wired, wireless, changed raspis, tried the staging instance of our self-hosted gitlab. Only time it gets "fixed" is if I go back to using the gitlab.com instead of our self-hosted version.

14.08.20 11:05:58 (-0500) Feeding runners to channel builds=0
14.08.20 11:05:58 (-0500) Checking for jobs... nothing runner=FH_HhUcz
14.08.20 11:06:01 (-0500) Feeding runners to channel builds=0
14.08.20 11:06:01 (-0500) Checking for jobs... nothing runner=FH_HhUcz
14.08.20 11:06:04 (-0500) Feeding runners to channel builds=0
14.08.20 11:06:04 (-0500) Checking for jobs... nothing runner=FH_HhUcz
14.08.20 11:06:07 (-0500) Feeding runners to channel builds=0
14.08.20 11:06:07 (-0500) Checking for jobs... nothing runner=FH_HhUcz
14.08.20 11:06:10 (-0500) Feeding runners to channel builds=0
14.08.20 11:06:10 (-0500) Checking for jobs... nothing runner=FH_HhUcz
14.08.20 11:06:13 (-0500) Feeding runners to channel builds=0
14.08.20 11:06:13 (-0500) Checking for jobs... nothing runner=FH_HhUcz
14.08.20 11:06:16 (-0500) Feeding runners to channel builds=0
14.08.20 11:06:16 (-0500) Dialing: tcp redacted.com:443 ...
14.08.20 11:06:16 (-0500) WARNING: Checking for jobs... failed runner=FH_HhUcz status=couldn't execute POST against https://redacted.com/api/v4/jobs/request: Post https://redacted.com/api/v4/jobs/request: dial tcp: lookup redacted.com on 127.0.0.11:53: read udp 127.0.0.1:36144->127.0.0.11:53: read: connection refused
14.08.20 11:06:19 (-0500) Feeding runners to channel builds=0
14.08.20 11:06:19 (-0500) Dialing: tcp redacted.com:443 ...
14.08.20 11:06:19 (-0500) WARNING: Checking for jobs... failed runner=FH_HhUcz status=couldn't execute POST against https://redacted.com/api/v4/jobs/request: Post https://redacted.com/api/v4/jobs/request: dial tcp: lookup redacted.com on 127.0.0.11:53: read udp 127.0.0.1:59394->127.0.0.11:53: read: connection refused
14.08.20 11:06:22 (-0500) Feeding runners to channel builds=0
14.08.20 11:06:22 (-0500) Dialing: tcp redacted.com:443 ...
14.08.20 11:06:22 (-0500) WARNING: Checking for jobs... failed runner=FH_HhUcz status=couldn't execute POST against https://redacted.com/api/v4/jobs/request: Post https://redacted.com/api/v4/jobs/request: dial tcp: lookup redacted.com on 127.0.0.11:53: read udp 127.0.0.1:34104->127.0.0.11:53: read: connection refused
14.08.20 11:06:25 (-0500) Feeding runners to channel builds=0
14.08.20 11:06:25 (-0500) Dialing: tcp redacted.com:443 ...
14.08.20 11:06:25 (-0500) WARNING: Checking for jobs... failed runner=FH_HhUcz status=couldn't execute POST against https://redacted.com/api/v4/jobs/request: Post https://redacted.com/api/v4/jobs/request: dial tcp: lookup redacted.com on 127.0.0.11:53: read udp 127.0.0.1:58683->127.0.0.11:53: read: connection refused

Find ways to clean up old runner containers

When runners are switched, there might be old runner containers left around, they should be cleaned up, but the name match depends on the current runner configuration, so needs some smarts. Also runner_ seem to match runner- as well, maybe.... Other container cleannup would be good too, to make it more hands off...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.