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: use nix for installing tools in Vagrant #3343

Merged
merged 3 commits into from
Oct 23, 2023
Merged

Conversation

swiatekm
Copy link

Use nix for installing tools in the Vagrant box. This gives us:

  • consistent versions between the Nix environment and the VM
  • single source of truth for said version
  • support for ARM, relevant for M1 Macs

You need to do some slight weirdness to force Nix to pull packages during VM provisioning rather than at startup, but otherwise this is fairly straightforward. There's probably a more idiomatic way to do this (install packages from shell.nix into a user environment), but the current way works fine.

Checklist

  • Changelog updated or skip changelog label added

@swiatekm swiatekm requested a review from a team as a code owner October 20, 2023 10:51
@dbado-sumologic
Copy link

Below is my vagrant.configure section for arm & qemu, which works just fine in this setup :)

Vagrant.configure('2') do |config|
  config.vm.box = "perk/ubuntu-2204-arm64"
  config.disksize.size = '50GB'
  config.vm.box_check_update = false
  config.vm.host_name = 'sumologic-kubernetes-collection'
  # Vbox 6.1.28+ restricts host-only adapters to 192.168.56.0/21
  # See: https://www.virtualbox.org/manual/ch06.html#network_hostonly
  config.vm.network :private_network, ip: "192.168.56.2"

  config.vm.provider "qemu" do |qe|
    qe.gui = false
    qe.smp = 8
    qe.memory = 16384
    qe.name = 'sumologic-kubernetes-collection'
  end
  
  config.vm.provision 'shell', path: 'vagrant/provision.sh'

  config.vm.synced_folder ".", "/sumologic"
  config.vbguest.auto_update = false
end

Copy link

@dbado-sumologic dbado-sumologic left a comment

Choose a reason for hiding this comment

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

tested on ARM and works fine

@github-actions github-actions bot added the documentation documentation label Oct 20, 2023
Copy link
Contributor

@sumo-drosiek sumo-drosiek left a comment

Choose a reason for hiding this comment

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

Works :)

.gitignore Outdated Show resolved Hide resolved
Co-authored-by: Dominik Rosiek <[email protected]>
@swiatekm swiatekm enabled auto-merge (squash) October 23, 2023 12:12
@swiatekm swiatekm merged commit 4b17d85 into main Oct 23, 2023
32 checks passed
@swiatekm swiatekm deleted the chore/vagrant-nix branch October 23, 2023 12:16
sumo-backporter bot pushed a commit that referenced this pull request Oct 23, 2023
* chore: use nix for installing tools in Vagrant

* Add QEMU support for vagrant

* Update .gitignore

Co-authored-by: Dominik Rosiek <[email protected]>

---------

Co-authored-by: Dominik Rosiek <[email protected]>
(cherry picked from commit 4b17d85)
swiatekm added a commit that referenced this pull request Oct 23, 2023
* chore: use nix for installing tools in Vagrant

* Add QEMU support for vagrant

* Update .gitignore

Co-authored-by: Dominik Rosiek <[email protected]>

---------

Co-authored-by: Dominik Rosiek <[email protected]>
(cherry picked from commit 4b17d85)
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.

3 participants