Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gitlab-runner: make check for docker-image option with machine too #108762

Closed

Conversation

jpotier
Copy link
Contributor

@jpotier jpotier commented Jan 8, 2021

closes: #108759

Motivation for this change

The "docker+machine" executor requires setting docker-image too. If not,
it will fail with:

PANIC: The docker-image needs to be entered

Since the docker-image argument was tied with the docker executor, this
would fail every time when attempting to use docker+machine.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

The "docker+machine" executor requires setting docker-image too. If not,
it will fail with:

  PANIC: The docker-image needs to be entered

Since the docker-image argument was tied with the docker executor, this
would fail everytime when attempting to use docker+machine.
assertMsg (service.dockerImage != null)
"dockerImage option is required for docker+machine executor (${name})");
[ "--docker-image ${service.dockerImage}" ]
)
Copy link
Contributor

@misuzu misuzu Jan 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are other --docker- options not used with docker+machine? What about docker-ssh+machine?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, that is a good point. I actually do not know, since I am not (currently) using them.

I was surprised by the runtime error (PANIC: …), so I wanted to add the assert for docker+machine at least.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is gitlab-runner register reacting to extraneous args? Maybe the --docker-* options do not need to be under the check?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested #108763 docker+machine and docker-ssh+machine (--ssh-* flags required) with dockerVolumes set - no errors.

@MartinPotier
Copy link
Contributor

Closing in favor of #108763 (review)

@jpotier jpotier closed this Jan 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gitlab-runner module: the dockerImage is also mandatory for the “docker+machine” executor
3 participants