I should be able to install runner on developers machine and just run and debug pipeline there, with or without Gitlab server present.
I should be able to install runner on developers machine and just run and debug pipeline there, with or without Gitlab server present.
EDIT: I should also mention, https://gitlab.com/groups/gitlab-org/-/epics/2072 is a big priority for us where we want to reduce the time to first green pipeline (not just for new users, but for new projects too). Feedback is welcome there as well.
Not sure if having a runner is the proper solution to this problem. Off the cuff I feel like there are better ways to go about it if I where making a CI server from scratch. Like only allowing single Docker commands per action? Then you would just those and have a nice portable and consistent environment. But Docker isn't very friendly as development tooling as you have to go through length to persist file artifacts and such. Would seem like there is some room in the space...
My point is your complaint seems more general than Gitlab itself.
a. They will write an inline script. Solution: Rip it out into a file.
b. Each Job is using a different container. Solution: use Docker with mapped volumes or we all have the same machines (this might not be possible for some workloads) and only use a single container. Why not run the shell directly you may ask? b.1 Each container has a different environment and my machine has one. b.2 Some things do not run natively on my machine that do on theirs.
c. Variables are defined in the yaml instead of the scripts. Solution: Make a local .env file see b.
So sure, a local gitlab runner us probably best patch here. But I am imagine if someone made a container runtime specifically for this then wrapped that in a CI config it could be very ergonomic. Which is what I would explore if I where to write a IC today. I am sure some build system today already does this...
Things outside (kindof) of Gitlab's control that I might as well complain about while I am here:
d. And regardless, there are transient dependencies everywhere (which I blame the all language creators for really, mfs :P ). So everything gets fucked eventually anyhow. Wouldn't it be nice if you could whip out a three year old project, run the build, and its exactly as you left it?
e. People thinks all right to allow for mutable versions so I have to asdjnasdaskdjasdlasjdl;askjd;asldkj = asdasdljkdasl;kdjlaskdjaslkjd some non-human readable hash if I am feeling paranoid.
d. and e. are firmly in the language creators hand I believe. But Gitlab does offer artifact repositories (which are non-portable and could also easily could be). Gitlab could also save dependency trees in different languages. But really I would gripe to the tool/language creators.
- making sure you can access the AWS docker image registry, which may require particular runner configuration
- making sure deploy keys are set up correctly so you can access private dependencies
- testing caching behaviour
- testing improvements to pipeline duration (for us, just parallelising and reordering some things meant build times decreasing from 24 to 9 minutes)
- testing when exactly jobs should be triggered (e.g. stages, "only", "when", etc.)
- testing the predefined variables (such as the name of the branch)
- and so on
If you can't run a build with your internet disconnected, it's not repeatable and you don't own it. The thing is it's MUCH better for companies like GitLab and GitHub to get you locked in to their SaaS build systems, so simple, repeatable, offline builds will never be a priority. The harder it is, the better it is because they can charge you more money to "manage" it.
I have no idea how someone looks at a system like GitHub Actions and likes it. To me it seems obvious what's going on a GitHub. Eventually Microsoft is going to marry a bunch of tech together (ex: GitHub, Visual Studio Online, GitHub Actions, Azure Resource Manager) and everyone will be so hyped about how easy it is to click a button and have dev, build, deploy "just work" that they'll blindly give up control of their development and build environment. Just look at how easy it was for Apple and Google to convince developers to give up their ability to deploy apps without being blessed.
Features like https://gitlab.com/gitlab-org/gitlab/issues/39527 will make this easier and allow you to do similar troubleshooting in an interactive web terminal.
You can run CI files locally. Just install a GitLab runner and run it through the command line.
Notice: Not all features of .gitlab-ci.yml are supported by exec. [2]
[1]: https://gitlab.com/gitlab-org/gitlab-runner/issues/2710 [2]: https://docs.gitlab.com/runner/commands/#gitlab-runner-exec
Deprecated `exec` command is hell to use
Curious what makes it hell to use? Unfortunatelly there is still no way to run CI file locally which is major turn down
I don't think thats correct. As you mention there is `exec`. Do you know of better alternatives?As I mentioned above, exec is no longer maintained and has missing features.
I currently use task system with Gitlab to make any job in 1-3 lines. Then I can easily replicate build locally. The task engine is either installed on runner's host itself or run inside docker container.