Self Hosted Gitlab

Self-Hosted GitLab (CE) #

Upgrading #

  1. Check pre-upgrade steps.
  2. If multiple versions were skipped, it is possible that a multi-step upgrade process would be required. That is, instead of isntalling the latest desired version, we would have to upgrade to intermediate versions first. We can check if this is necessary on the Upgrade Paths page.

gitlab-ce on node @gitlab0 was installed from the official repository. Thus, running:

sudo apt update && apt list --upgradable

will update the apt cache of available gitlab-ce versions.

Then, if a single-step upgrade is possible, we can upgrade all installed packages with:

sudo apt upgrade

When multi-step upgrade is necessary, we need to check the next version needed at a given step:

sudo apt list | grep gitlab

Then install a specific version according the current upgrade path:

sudo apt install gitlab-ce=x.y.z-ce.0

Reboot the server, and proceed to upgrade to the next version, until reaching the latest/desired version.

Caveats of DinD in CI/CD Pipelines #

One of the benefits of running a self-hosted GitLab instance is that it allows running CI/CD pipelines without any quotas. So, we can push many small fixes and run a test/build pipeline as frequently as we desire.

However, when a pipeline job uses the dind service, i.e., it uses the docker image for running Docker-in-Docker, the nested docker process always starts with no pre-cached images. Such a job, when calling docker pull / build / run would be always pulling an image from the origin registry. Pipelines in which jobs pull images from non-local registries can incur a lot of redundant network traffic over time, and unnecessarily overuse public registry resources.

Therefore, dind should be used only in pipelines that are not expected to run too frequently.

Pipelines that do need to run frequently and have jobs that call docker build or docker run, can be configured to launch on the “shell executor” type gitlab-runners. This way, on consequent runs, previusly pulled images would be available on gitlab-runner’s host system.