Skip to content

Commit

Permalink
feat: optimize image pulls with stargz
Browse files Browse the repository at this point in the history
  • Loading branch information
rahuldesai1 committed Feb 10, 2024
1 parent a308c4d commit ea01ac9
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions 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}/k8s_${var.k8s_version}/images/hvm-ssd/ubuntu-${var.ubuntu_version}-amd64-server"
ami_name = "latch-bio/sysbox-eks_${var.sysbox_version}/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}), on Ubuntu ${var.ubuntu_version}, amd64 image"

tags = {
Expand Down Expand Up @@ -187,11 +187,12 @@ build {
# }

# provisioner "shell" {
# inline_shebang = "/usr/bin/env bash"
# inline = [
# "echo >>> Installing prebuilt patched CRI-O",
# "echo '>>> Installing prebuilt patched CRI-O'",
# "sudo mv crio /usr/bin/crio",
#
# "echo Setting permissions",

# "echo 'Setting permissions'",
# "sudo chmod u+x /usr/bin/crio"
# ]
# }
Expand Down Expand Up @@ -282,6 +283,23 @@ 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 = [
Expand Down

0 comments on commit ea01ac9

Please sign in to comment.