You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.2 KiB
35 lines
1.2 KiB
#!/bin/bash
|
|
|
|
set -Eeuo pipefail
|
|
|
|
ARM64_BASE_IMAGE="nvcr.io/nvidia/l4t-jetpack:r36.4.0"
|
|
AMD64_BASE_IMAGE="nvcr.io/nvidia/base/ubuntu:22.04_20240212"
|
|
TARGET_IMAGE="quay.io/nmasse-redhat/jetpack-multiarch:r36.4.0"
|
|
NAME=jetpack
|
|
|
|
# Login to registries
|
|
export REGISTRY_AUTH_FILE="$PWD/auth.json"
|
|
if [ ! -f "$REGISTRY_AUTH_FILE" ]; then
|
|
echo "Logging in nvcr.io registry"
|
|
podman login nvcr.io
|
|
echo "Logging in quay.io registry"
|
|
podman login quay.io
|
|
echo "Done"
|
|
read -p "Press enter to continue "
|
|
fi
|
|
|
|
# Fetch the ARM64 image from Nvidia
|
|
podman pull --platform linux/arm64/v8 "$ARM64_BASE_IMAGE"
|
|
podman tag "$ARM64_BASE_IMAGE" localhost/$NAME-aarch64
|
|
|
|
# Package a similar version for x86 without all the CUDA libraries
|
|
podman pull --platform linux/amd64 "$AMD64_BASE_IMAGE"
|
|
buildah build --platform linux/amd64 --from "$AMD64_BASE_IMAGE" -t localhost/$NAME-x86_64 .
|
|
|
|
if podman manifest exists localhost/$NAME; then
|
|
podman manifest rm localhost/$NAME
|
|
fi
|
|
podman manifest create localhost/$NAME
|
|
podman manifest add localhost/$NAME localhost/$NAME-x86_64
|
|
podman manifest add localhost/$NAME localhost/$NAME-aarch64
|
|
podman manifest push --all --format v2s2 localhost/$NAME "docker://$TARGET_IMAGE"
|
|
|