balena-io-experimental / balena-gitlab-runner Goto Github PK
View Code? Open in Web Editor NEWGitlab Runner as a balena application
License: Apache License 2.0
Gitlab Runner as a balena application
License: Apache License 2.0
So replace the defaults in the settings, maybe people want to do some stuff differently.
Add env var to add extra flags
Clean the helper images as well, but:
Without this, software update on the devices, without garbage collection, can mean that gitlab-runner-helpers take up all the space...
Which can also be a balena device ;)
The variable for listen_address
(see the gitlab-runner config docs) set from an env var?
Containers seem to be cleaned, but have leftover catching containers. Will need to try whether the docker images are cleaned.
Can use it automatically? Or describe it here how to set it up properly?
Hosted at https://hub.docker.com/r/imrehg/gitlab-runner-helper and should have some flags or other ways of adding it, not sure how did I do it before, if I didn't do it with hands.... https://docs.gitlab.com/runner/configuration/advanced-configuration.html#helper-image
Not sure what the healthcheck should be:
... or think about what else could be checked
root@74d36fbe1180:/usr/src/app# balena-engine
Illegal instruction (core dumped)
The wrong version is installed?
Currently gitlab-runner
reports developer verison, should figure out how to change that...
Make sure that signals are catched fine, so the services are smooth-stopped whenever possible.
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?)
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:
config.toml
(helper_image
, when it's set) and maybe gitlab-runner
output (when it's automatic)?The runners can do prometheus, and that's great for devops, most likely. Does it make sense to run a prometheus on the device on the side (and some other prometheus instance gathering stuff?)
Some things to answer (not exhaustive):
gitlab-runner register
Not sure if caching works currently, maybe have to make /cache
into a volume? Or does it even work for our setup?
In case running on an older device types, which doesn't have the balena env vars. Or wait until everyone's updated to OS version that has the right 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
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
)
A project that:
Current examples from Gitlab to get inspired by: https://docs.gitlab.com/ee/ci/examples/README.html
Notables:
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
Including:
Some architectures (i386*, I guess?) might need creation of gitlub-runner-helper images, FYI.
E.g. if BALENA_...
is not available, don't use them
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...
Currently compiled and released to imrehg/gitlab-runner-helper
, but needs testing, and needs upstreaming.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.