Skip to content

Commit

Permalink
testing ubuntu noble, adding dmidecode for nomad cpu detection, addin…
Browse files Browse the repository at this point in the history
…g --cap-add=SYS_RAWIO to Vagrantfile, testing
  • Loading branch information
star3am committed Aug 13, 2024
1 parent 609d15b commit 1bad837
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# https://betterprogramming.pub/managing-virtual-machines-under-vagrant-on-a-mac-m1-aebc650bc12c
# https://github.com/rofrano/vagrant-docker-provider

FROM ubuntu:jammy
FROM ubuntu:noble

ENV DEBIAN_FRONTEND noninteractive

Expand Down
6 changes: 4 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Vagrant::configure("2") do |config|

machines.each_with_index do |machine, index|

config.vm.box = "generic/ubuntu2204"
config.vm.box = "generic/ubuntu2404"
config.vm.define machine[:name] do |config|

# config.disksize.size = machine[:disksize] # deprecated
Expand Down Expand Up @@ -176,7 +176,9 @@ Vagrant::configure("2") do |config|
# BUG: https://github.com/hashicorp/vagrant/issues/12602
# moved to create_args
# docker.volumes = ['/sys/fs/cgroup:/sys/fs/cgroup:rw']
docker.create_args = ['-v', '/sys/fs/cgroup:/sys/fs/cgroup:rw', '--cgroupns=host', '--tmpfs=/tmp:exec,dev', '--tmpfs=/var/lib/docker:mode=0777,dev,size=15g,suid,exec', '--tmpfs=/run', '--tmpfs=/run/lock'] # '--memory=10g', '--memory-swap=14g', '--oom-kill-disable'
# BUG: https://github.com/hashicorp/nomad/issues/19343 dmidecode
# https://stackoverflow.com/questions/54068234/cant-run-dmidecode-on-docker-container
docker.create_args = ['-v', '/sys/fs/cgroup:/sys/fs/cgroup:rw', '--cap-add=SYS_RAWIO', '--cgroupns=host', '--tmpfs=/tmp:exec,dev', '--tmpfs=/var/lib/docker:mode=0777,dev,size=15g,suid,exec', '--tmpfs=/run', '--tmpfs=/run/lock'] # '--memory=10g', '--memory-swap=14g', '--oom-kill-disable'
# Uncomment to force arm64 for testing images on Intel
# docker.create_args = ["--platform=linux/arm64"]
docker.env = { "PROVIDER": "docker", "NAME": "hashiqube" }
Expand Down
17 changes: 16 additions & 1 deletion nomad/nomad.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ elif [[ $arch == aarch64 ]]; then
fi
echo -e '\e[38;5;198m'"CPU is $ARCH"

sudo DEBIAN_FRONTEND=noninteractive apt-get --assume-yes install -qq curl unzip jq < /dev/null > /dev/null
# https://github.com/hashicorp/nomad/issues/19343 nomad needs dmidecode
sudo DEBIAN_FRONTEND=noninteractive apt-get --assume-yes install -qq dmidecode curl unzip jq < /dev/null > /dev/null

echo -e '\e[38;5;198m'"++++ "
echo -e '\e[38;5;198m'"++++ Cleanup any Nomad if found"
Expand Down Expand Up @@ -184,6 +185,20 @@ client {
}
}
plugin "docker" {
config {
endpoint = "unix:///var/run/docker.sock"
volumes {
enabled = true
selinuxlabel = "z"
}
allow_privileged = true
allow_caps = ["chown", "net_raw"]
}
}
plugin "raw_exec" {
config {
enabled = true
Expand Down

0 comments on commit 1bad837

Please sign in to comment.