From 64b46b8738ec63e8c722095a75d8132f13cd60b3 Mon Sep 17 00:00:00 2001 From: Rahul Desai Date: Sat, 10 Feb 2024 14:42:18 -0800 Subject: [PATCH 1/2] feat: optimize image pulls with stargz for gpus --- sysbox-eks.pkr.hcl | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/sysbox-eks.pkr.hcl b/sysbox-eks.pkr.hcl index 3462dd8..4f7e44a 100644 --- a/sysbox-eks.pkr.hcl +++ b/sysbox-eks.pkr.hcl @@ -38,7 +38,7 @@ packer { } source "amazon-ebs" "ubuntu-eks" { - ami_name = "latch-bio/sysbox-eks_${var.sysbox_version}-gpu/k8s_${var.k8s_version}/images/hvm-ssd/ubuntu-${var.ubuntu_version}-amd64-server" + ami_name = "latch-bio/sysbox-eks_${var.sysbox_version}-gpu/k8s_${var.k8s_version}/images/hvm-ssd/ubuntu-${var.ubuntu_version}-amd64-server/v2" ami_description = "Latch Bio, Sysbox EKS Node (k8s_${var.k8s_version}) with NVIDIA GPU support, on Ubuntu ${var.ubuntu_version}, amd64 image" tags = { @@ -284,6 +284,24 @@ build { ] } + + provisioner "shell" { + inline_shebang = "/usr/bin/env bash" + inline = [ + "set -o pipefail -o errexit", + + "echo '>>> Configuring CRI-O for StarGZ'", + + "sudo dasel put string --parser toml --file /etc/containers/storage.conf --selector 'storage.options.additionallayerstores.[]' --multiple /var/lib/stargz-store/store:ref", + + "sudo curl --location https://github.com/containerd/stargz-snapshotter/releases/download/v0.15.1/stargz-snapshotter-v0.15.1-linux-amd64.tar.gz --output stargz-snapshotter-v0.15.1-linux-amd64.tar.gz", + "sudo tar -C /usr/local/bin -xvf stargz-snapshotter-v0.15.1-linux-amd64.tar.gz stargz-store", + + "sudo wget -O /etc/systemd/system/stargz-store.service https://raw.githubusercontent.com/containerd/stargz-snapshotter/main/script/config-cri-o/etc/systemd/system/stargz-store.service", + "sudo systemctl enable stargz-store", + ] + } + provisioner "shell" { inline_shebang = "/usr/bin/env bash" inline = [ From 80f48f243dadef7a3a4544e1bcc9280fcccb97c0 Mon Sep 17 00:00:00 2001 From: Rahul Desai Date: Wed, 14 Feb 2024 10:36:16 -0800 Subject: [PATCH 2/2] add ecr login credentials --- sysbox-eks.pkr.hcl | 8 ++++++++ test | 0 2 files changed, 8 insertions(+) create mode 100644 test diff --git a/sysbox-eks.pkr.hcl b/sysbox-eks.pkr.hcl index 4f7e44a..1eff798 100644 --- a/sysbox-eks.pkr.hcl +++ b/sysbox-eks.pkr.hcl @@ -290,6 +290,14 @@ build { inline = [ "set -o pipefail -o errexit", + "echo '>>> Configuring ECR Credentials for StarGZ'", + + "sudo apt-get install amazon-ecr-credential-helper -y", + + "sudo mkdir /root/.docker", + "sudo touch /root/.docker/config.json", + "sudo dasel put string --parser json --file /root/.docker/config.json --selector 'credsStore' -v 'ecr-login'", + "echo '>>> Configuring CRI-O for StarGZ'", "sudo dasel put string --parser toml --file /etc/containers/storage.conf --selector 'storage.options.additionallayerstores.[]' --multiple /var/lib/stargz-store/store:ref", diff --git a/test b/test new file mode 100644 index 0000000..e69de29