-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add container runtime archive configuration (#476)
This change adds container runtime archive configuration as a tracked dependency with weekly update automation against upstream nerdctl full archives. Signed-off-by: Austin Vazquez <[email protected]>
- Loading branch information
1 parent
016abfe
commit fb8861c
Showing
10 changed files
with
166 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,17 +8,23 @@ SOCKET_VMNET_TEMP_PREFIX ?= $(OUTDIR)/dependencies/lima-socket_vmnet/opt/finch | |
|
||
include $(CURDIR)/deps/full-os.conf | ||
ifeq ($(ARCH),x86_64) | ||
FINCH_OS_BASENAME ?= $(X86_64_ARTIFACT) | ||
FINCH_OS_DIGEST ?= $(X86_64_512_DIGEST) | ||
FINCH_OS_BASENAME := $(X86_64_ARTIFACT) | ||
FINCH_OS_DIGEST := $(X86_64_512_DIGEST) | ||
LIMA_ARCH = x86_64 | ||
else | ||
FINCH_OS_BASENAME ?= $(AARCH64_ARTIFACT) | ||
FINCH_OS_DIGEST ?= $(AARCH64_512_DIGEST) | ||
FINCH_OS_BASENAME := $(AARCH64_ARTIFACT) | ||
FINCH_OS_DIGEST := $(AARCH64_512_DIGEST) | ||
LIMA_ARCH = aarch64 | ||
endif | ||
|
||
FINCH_IMAGE_LOCATION := $(OS_OUTDIR)/$(FINCH_OS_BASENAME) | ||
FINCH_IMAGE_DIGEST := "sha512:$(FINCH_OS_DIGEST)" | ||
FINCH_IMAGE_LOCATION ?= $(OS_OUTDIR)/$(FINCH_OS_BASENAME) | ||
FINCH_IMAGE_DIGEST ?= "sha512:$(FINCH_OS_DIGEST)" | ||
|
||
include $(CURDIR)/deps/container-runtime-full-archive.conf | ||
CONTAINER_RUNTIME_ARCHIVE_AARCH64_LOCATION ?= "$(ARTIFACT_BASE_URL)/$(AARCH64_ARTIFACT)" | ||
CONTAINER_RUNTIME_ARCHIVE_AARCH64_DIGEST ?= "sha256:$(AARCH64_256_DIGEST)" | ||
CONTAINER_RUNTIME_ARCHIVE_X86_64_LOCATION ?= "$(ARTIFACT_BASE_URL)/$(X86_64_ARTIFACT)" | ||
CONTAINER_RUNTIME_ARCHIVE_X86_64_DIGEST ?= "sha256:$(X86_64_256_DIGEST)" | ||
|
||
# Virtualization framework is the default virtual machine type on Finch on macOS | ||
# This is only used for testing of Finch core bundles. | ||
|
@@ -55,6 +61,10 @@ $(LIMA_TEMPLATE_OUTDIR)/fedora.yaml: $(LIMA_TEMPLATE_OUTDIR) | |
sed -i.bak -e "s|<image_location>|$(FINCH_IMAGE_LOCATION)|g" [email protected] | ||
sed -i.bak -e "s/<image_arch>/$(LIMA_ARCH)/g" [email protected] | ||
sed -i.bak -e "s/<image_digest>/$(FINCH_IMAGE_DIGEST)/g" [email protected] | ||
sed -i.bak -e "s|<container_runtime_archive_aarch64_location>|$(CONTAINER_RUNTIME_ARCHIVE_AARCH64_LOCATION)|g" [email protected] | ||
sed -i.bak -e "s/<container_runtime_archive_aarch64_digest>/$(CONTAINER_RUNTIME_ARCHIVE_AARCH64_DIGEST)/g" [email protected] | ||
sed -i.bak -e "s|<container_runtime_archive_x86_64_location>|$(CONTAINER_RUNTIME_ARCHIVE_X86_64_LOCATION)|g" [email protected] | ||
sed -i.bak -e "s/<container_runtime_archive_x86_64_digest>/$(CONTAINER_RUNTIME_ARCHIVE_X86_64_DIGEST)/g" [email protected] | ||
|
||
# Replace was successful, so cleanup .bak files | ||
rm $(LIMA_TEMPLATE_OUTDIR)/*.yaml.template.bak | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# A script to update the container runtime full archive used for Finch on macOS and Windows. | ||
# | ||
# Usage: bash update-container-runtime-full-archive.sh -t <Git tag> | ||
|
||
set -euxo pipefail | ||
|
||
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
PROJECT_ROOT="$(cd -- "${CURRENT_DIR}/.." && pwd)" | ||
|
||
while getopts t: flag | ||
do | ||
case "${flag}" in | ||
t) tag=${OPTARG};; | ||
*) echo "Error: unknown flag" && exit 1;; | ||
esac | ||
done | ||
[[ -z "$tag" ]] && { echo "Error: Git tag not set"; exit 1; } | ||
|
||
DEPENDENCY_DOWNLOAD_BASE_URL="https://github.com/containerd/nerdctl/releases/download" | ||
dependency_download_url="${DEPENDENCY_DOWNLOAD_BASE_URL}/${tag}" | ||
|
||
# Pull upstream's published release shasums and save for later artifact verification. | ||
mkdir -p "${PROJECT_ROOT}/downloads" | ||
downloaded_shasums="${PROJECT_ROOT}/downloads/nerdctl-${tag}.sha256sums" | ||
curl -L --fail "${dependency_download_url}/SHA256SUMS" > "${downloaded_shasums}" | ||
|
||
version=${tag#v} | ||
aarch64_deps="nerdctl-full-${version}-linux-arm64.tar.gz" | ||
aarch64_deps_shasum=$(grep "${aarch64_deps}" "${downloaded_shasums}" | cut -d ' ' -f 1) | ||
amd64_deps="nerdctl-full-${version}-linux-amd64.tar.gz" | ||
amd64_deps_shasum=$(grep "${amd64_deps}" "${downloaded_shasums}" | cut -d ' ' -f 1) | ||
|
||
# Update archive file with latest artifacts and digests. | ||
ARCHIVE_FILE="${PROJECT_ROOT}/deps/container-runtime-full-archive.conf" | ||
truncate -s 0 "${ARCHIVE_FILE}" | ||
{ | ||
echo "ARTIFACT_BASE_URL=${dependency_download_url}" | ||
echo "" | ||
echo "AARCH64_ARTIFACT=${aarch64_deps}" | ||
echo "AARCH64_256_DIGEST=${aarch64_deps_shasum}" | ||
echo "" | ||
echo "X86_64_ARTIFACT=${amd64_deps}" | ||
echo "X86_64_256_DIGEST=${amd64_deps_shasum}" | ||
} >> "${ARCHIVE_FILE}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
ARTIFACT_BASE_URL=https://github.com/containerd/nerdctl/releases/download/v1.7.7 | ||
|
||
AARCH64_ARTIFACT=nerdctl-full-1.7.7-linux-arm64.tar.gz | ||
AARCH64_256_DIGEST=b161a20c0e41f9ad999e8411e23c58ece4b3e584ae90b4252b76a39eee4a0c31 | ||
|
||
X86_64_ARTIFACT=nerdctl-full-1.7.7-linux-amd64.tar.gz | ||
X86_64_256_DIGEST=a731eac93e8e9dda1a0d76dc1606438deb0668ea7d6bd5c5af436353ed9f65c5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters