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

feat: optimize image pulls with stargz for gpus #10

Open
wants to merge 2 commits into
base: maximsmol/gpus
Choose a base branch
from
Open
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
28 changes: 27 additions & 1 deletion sysbox-eks.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -284,6 +284,32 @@ build {
]
}


provisioner "shell" {
inline_shebang = "/usr/bin/env bash"
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",

"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 = [
Expand Down
Empty file added test
Empty file.
Loading