Per-build networking: MTU cannot be configured
Summary
Docker does not respect a globally configured MTU when creating docker networks. This is described in this issue. In certain environments, e.g. Openstack, the MTU does not default to 1500, which is why it needs to be set to a lower value to use per-build networking. Currently, this is not possible.
Steps to reproduce
- Create a runner in a network environment with an MTU set to a value smaller than
1500. - Activate the feature flag
FF_NETWORK_PER_BUILD. - Start a CI job on that runner.
- It will fail with random and unclear network issues.
Actual behavior
Communication via network fails with random errors if MTU in the environment is lower than 1500.
Expected behavior
Be able to configure an MTU for the docker network to fix the network issues.
Relevant logs and/or screenshots
Environment description
- GitLab-Runner configured with docker-machine executor.
- Openstack backend with MTU lower than 1500.
Used GitLab Runner version
Version: 14.8.2
Git revision: c6e7e194
Git branch: 14-8-stable
GO version: go1.17.7
Built: 2022-03-01T17:18:25+0000
OS/Arch: linux/amd64
Possible fixes
We built a custom version of the gitlab-runner which allows to configure the MTU for docker networks. I would like to contribute this but need guidance on how to make the MTU size configurable. I am not sure which way is the best and which way you prefer.
See hifis/gitlab-runner@2ba60a95 for the fix we created for us.
