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

chore: switch vagrant to Docker #2235

Merged
merged 4 commits into from
Jul 4, 2022

Conversation

dduportal
Copy link
Contributor

@dduportal dduportal commented Jun 30, 2022

This PR is an attempt at moving away from virtualbox to docker as a provider to ensure an easier acceptance testing of the puppet provisioning.

The main target are macOS ARM CPUs for the first iteration, to allow team members with such a setup to be able to test their system.

Ping @smerle33 @timja if you are able to test this on your M1 machines:

# Checkout this PR locally
gh pr checkout 2235

# Bootstrap dependencies (requires `bundle` command installed and in your PATH)
./vagrant-bootstrap

# Install vagrant - https://www.vagrantup.com/downloads or "bundle install vagrant" if no option

# Try to start the pkg VM
vagrant up pkg

@timja
Copy link
Member

timja commented Jul 1, 2022

I get this error:
rapid7/metasploit-framework#11368

Trying to run the suggested fix, (quite slow though)

@timja
Copy link
Member

timja commented Jul 1, 2022

Next error is around installing r10k, nothing seems to install it and running gem install r10k doesn't add it to the path / I haven't found where it installs to

@dduportal
Copy link
Contributor Author

Next error is around installing r10k, nothing seems to install it and running gem install r10k doesn't add it to the path / I haven't found where it installs to

Can you try prepending bundle exec on the r10k command? I remember cases where bundler maintains its own path

@timja
Copy link
Member

timja commented Jul 1, 2022

tried to create Proc object without a block

I suspect it needs an old version of ruby? possible to update it?

@dduportal
Copy link
Contributor Author

tried to create Proc object without a block

I suspect it needs an old version of ruby? possible to update it?

Gotta check, thanks for the feedback!

@dduportal
Copy link
Contributor Author

@timja we juste tested on @smerle33 's M1 machine, with an installation from scratch (so with the macOS default ruby) and did not had these issues: I'll need help for reproduction (to provide the correct fix).

We succesfully tried (and pushed) the following:

  • Fixed the r10k issue: since the Gemfile specifies r10k, we prepended the bundle exec to make sure it's not required to be installed before. On Stephan's machine, we had to cleanup r10k with sudo gem uninstall r10k before as he already had it installed and it was conflicting. I did not had any conflict (tested successfully) on my intel mac.
  • Succesfully started the pkg "vagrant machine" (vagrant up pkg) which provisionned successully the role, with an amd64 Ubuntu 18.04 container on my machine and an arm64 Ubuntu 18.04 container on @smerle's machine.
  • We had the jenkins::master vagrant machine failing when installing the Docker in Docker installation. I was able to fix this and test it successfully on my machine (vagrant up jenkins::master) but I was not able to validate on a M1 CPU though

@smerle33
Copy link
Contributor

smerle33 commented Jul 4, 2022

I can confirm that it's working perfectly : "vagrant up jenkins::master"
Capture d’écran 2022-07-04 à 10 16 02

@timja
Copy link
Member

timja commented Jul 4, 2022

I have a 3.x ruby not sure what the default one is.

@dduportal
Copy link
Contributor Author

I have a 3.x ruby not sure what the default one is.

On my amd64 macOS 12.4, I got the following system ruby installation (which works) for reference:

$ which ruby && ruby --version
/usr/bin/ruby
ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.x86_64-darwin21]

Let me try with a ruby 3.0 (using asdf). But it means that I should write the requirement in this PR.

@dduportal
Copy link
Contributor Author

OK, README updated to mention the Ruby constraints (I've double checked my machine AND the Docker image).

Tested with success the vagrant up pkg and vagrant up jenkins::master on @smerle33 's M1 macOS + my AMD64 machine.

As it incrases the amount of environments where the vagrant stuff can be done, I'm setting this PR ready to review as it should be usable.

In order to improve this project and share knowledge, I've opened some issues:

@dduportal dduportal requested review from smerle33 and timja July 4, 2022 10:34
timja
timja previously approved these changes Jul 4, 2022
dist/profile/manifests/docker.pp Show resolved Hide resolved
@dduportal
Copy link
Contributor Author

Putting as draft until #2251 is merged + wip

@dduportal dduportal marked this pull request as draft July 4, 2022 13:19
@dduportal dduportal force-pushed the chore/vagrant-docker branch 2 times, most recently from 9ffb08d to 6595fd6 Compare July 4, 2022 13:26
timja
timja previously approved these changes Jul 4, 2022
smerleCB and others added 4 commits July 4, 2022 16:11
Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
@dduportal dduportal marked this pull request as ready for review July 4, 2022 14:57
@dduportal dduportal merged commit efb6092 into jenkins-infra:production Jul 4, 2022
@dduportal dduportal deleted the chore/vagrant-docker branch July 4, 2022 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants