Running Neuron on Gitlab CI/CD Pipelines #673
vedang
started this conversation in
Installation
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Capturing my investigation here in the hopes it helps others interested in the same topic:
Private pages on Gitlab
Did you know that Gitlab Pages supports private / auth-based static sites? Basically, you add people you want to share your site with as Project Members to the repository. Gitlab then enforces Gitlab Login on the website, so you can only see the content if you are logged into Gitlab (and have been given access to the repository).
This is a very cool way to host private static sites freely (vs, for example, self-hosting + HTTP Basic Auth).
Moving from Github Actions to Gitlab CI/CD Pipelines (+ running Docker containers in CI/CD scripts)
It's ridiculously hard to Google for the right way to run a dockerized tool in CI/CD environments.
Github Actions makes this a nobrainer because their images (example:
ubuntu-latest
) havedocker
clients and servers baked in already. So you just write your command (saydocker run hello-world
) directly into your YAML file and you are done.Gitlab CI/CD does not have this. They expect you to search + use images from Dockerhub / Gitlab Container Registry. To make matters worse, it isn't enough to use the official Docker in Docker image (which is
docker:latest
btw). Using this image only gives you thedocker
client. You still need to run thedocker
server separately. If you don't, your pipeline will fail with the following error:To run the server, you need to understand the Services concept of Gitlab CI/CD. In short, this is a way to run services that your main job might need to access when it runs. You can use it, for example, to run database instances that your test job would connect to. In our case, we need a docker daemon service, which is provided by the
docker:dind
image.Once you have this, then your entire pipeline will finally run. It took me a frustratingly long time to figure it all out. Here is what my final
.gitlab-ci.yml
file looks like:The
pages
job-name is special. Gitlab understands that it is meant for hosting, and expects HTML / assets in a top-level directory calledpublic
.I hope this helps someone else waste less time.
Beta Was this translation helpful? Give feedback.
All reactions