Skip to content

WIP: Added functionality to create a network per build-ID and attach containers to it.

What does this MR do?

Add a docker network for each build.

Why was this MR needed?

Docker links are deprecated in place of using networks. This also gives bidirectional communication between containers.

Are there points in the code the reviewer needs to double check?

It isn't finished! You may want to run docker network prune after running tests.

TODO

  • Delete networks after they are finished with.
  • Test that config.toml's network settings aren't overwritten
  • Add integration tests.
  • Having run go test gitlab.com/gitlab-org/gitlab-ci-multi-runner/executors/docker there are many docker networks called build-0. I was expecting one, so it looks like docker.CreateNetwork can create many networks with the same name, but different IDs. Probably want to do a list networks before create to avoid this. Also change tests to use unique build IDs to keep them isolated if run in parallel.

Does this MR meet the acceptance criteria?

  • Documentation created/updated
  • Tests
    • Added for this feature/bug
    • All builds are passing
  • Branch has no merge conflicts with master (if you do - rebase it please)

What are the relevant issue numbers?

#1042

Merge request reports