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: add support for arm #50

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 24 additions & 22 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

unless Vagrant.has_plugin?("vagrant-disksize")
puts "vagrant-disksize plugin unavailable\n" +
"please install it via 'vagrant plugin install vagrant-disksize'"
exit 1
Vagrant.configure('2') do |config|
config.vm.box = 'ubuntu/focal64'
config.vm.disk :disk, size: "50GB", primary: true
config.vm.box_check_update = false
config.vm.host_name = 'sumologic-kafka-push'
config.vm.network :private_network, ip: "192.168.52.35"

config.vm.provider 'virtualbox' do |vb|
vb.gui = false
vb.cpus = 8
vb.memory = 16384
vb.name = 'sumologic-kafka-push'
end

Vagrant.configure('2') do |config|
config.vm.box = 'ubuntu/focal64'
config.disksize.size = '50GB'
config.vm.box_check_update = false
config.vm.host_name = 'sumologic-kafka-push'
config.vm.network :private_network, ip: "192.168.52.35"

config.vm.provider 'virtualbox' do |vb|
vb.gui = false
vb.cpus = 8
vb.memory = 16384
vb.name = 'sumologic-kafka-push'
end

config.vm.provision 'shell', path: 'vagrant/provision.sh'

config.vm.synced_folder ".", "/sumologic"

config.vm.provider "qemu" do |qe, override|
override.vm.box = "perk/ubuntu-2204-arm64"
qe.gui = false
qe.smp = 8
qe.memory = 16384
qe.name = 'sumologic-kafka-push'
end

config.vm.provision 'shell', path: 'vagrant/provision.sh'

config.vm.synced_folder ".", "/sumologic"
end
22 changes: 15 additions & 7 deletions vagrant/provision.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

set -x
ARCH="$(dpkg --print-architecture)"

export DEBIAN_FRONTEND=noninteractive
apt-get update
Expand All @@ -9,7 +10,7 @@ apt-get --yes install apt-transport-https jq

echo "export EDITOR=vim" >> /home/vagrant/.bashrc

snap install microk8s --classic --channel=1.20/stable
snap install microk8s --classic --channel=1.30/stable
microk8s.status --wait-ready
ufw allow in on cbr0
ufw allow out on cbr0
Expand Down Expand Up @@ -47,27 +48,34 @@ echo "export KUBECONFIG=/var/snap/microk8s/current/credentials/kubelet.config" >
HELM_3_VERSION=v3.5.4

mkdir /opt/helm3
curl "https://get.helm.sh/helm-${HELM_3_VERSION}-linux-amd64.tar.gz" | tar -xz -C /opt/helm3
curl "https://get.helm.sh/helm-${HELM_3_VERSION}-linux-${ARCH}.tar.gz" | tar -xz -C /opt/helm3

ln -s /opt/helm3/linux-amd64/helm /usr/bin/helm3
ln -s /opt/helm3/linux-${ARCH}/helm /usr/bin/helm3
ln -s /usr/bin/helm3 /usr/bin/helm

usermod -a -G microk8s vagrant

# install yq with access to file structure
curl https://github.com/mikefarah/yq/releases/download/3.4.1/yq_linux_amd64 -L -o /usr/local/bin/yq-3.4.1
curl https://github.com/mikefarah/yq/releases/download/3.4.1/yq_linux_${ARCH} -L -o /usr/local/bin/yq-3.4.1
chmod +x /usr/local/bin/yq-3.4.1
ln -s /usr/local/bin/yq-3.4.1 /usr/local/bin/yq

# Install docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
"deb [arch=${ARCH}] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
apt-get install -y docker-ce docker-ce-cli containerd.io
usermod -aG docker vagrant

echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list
echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo -H gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/scalasbt-release.gpg --import
sudo chmod 644 /etc/apt/trusted.gpg.d/scalasbt-release.gpg

sudo apt-get install -y sbt default-jre

# Install docker-compose
DOCKER_COMPOSE_VERSION=1.29.2
curl -fsSL "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
Expand All @@ -85,9 +93,9 @@ done

apt-get install -y yamllint

K9S_VERSION=v0.24.15
K9S_VERSION=v0.32.4
mkdir /opt/k9s
curl -Lo- "https://github.com/derailed/k9s/releases/download/${K9S_VERSION}/k9s_Linux_x86_64.tar.gz" | tar -C /opt/k9s -xzf -
curl -Lo- "https://github.com/derailed/k9s/releases/download/${K9S_VERSION}/k9s_Linux_${ARCH}.tar.gz" | tar -C /opt/k9s -xzf -
ln -s /opt/k9s/k9s /usr/bin/k9s

# Install Apache Kafka
Expand Down
Loading