-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: verify shasum for finch dependencies (#326)
Issue #, if available: Some of Finch's dependencies are not verified at pull time. e.g. the file monitor application, the lima tarball for Finch on Mac, and the rootfs tarball for Finch on Windows. *Description of changes:* This change adds a mechanism for pulling and verifying dependencies for such as lima and rootfs via configuration files. This mechanism is a refactor of existing logic pulled out of Makefile into bash scripts to simplify and enable local testing. This change also fixes rootfs update automation which has broken with the swap from zstd compression to gzip compression of rootfs tarballs. *Testing done:* Ran shellcheck on `bin/update-rootfs.sh`, `bin/update-deps.sh`, `bin/install-file-monitor.sh`, and `deps/install.sh`. Tested on MacOS 14.4.1 Test install rootfs: ``` BUILD_OS=Windows_NT make install.rootfs ``` Test install lima dependencies: ``` make install.lima-dependencies ``` Test download OS: ``` make download.os ``` - [x] I've reviewed the guidance in CONTRIBUTING.md #### License Acceptance By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Signed-off-by: Austin Vazquez <[email protected]>
- Loading branch information
1 parent
6d9e482
commit ab5fc46
Showing
18 changed files
with
457 additions
and
249 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
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,56 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
OS_OUTDIR := $(OUTDIR)/os | ||
LIMA_TEMPLATE_OUTDIR := $(OUTDIR)/lima-template | ||
OUTPUT_DIRECTORIES += $(OS_OUTDIR) $(LIMA_TEMPLATE_OUTDIR) | ||
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) | ||
LIMA_ARCH = x86_64 | ||
else | ||
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)" | ||
FEDORA_YAML := fedora.yaml | ||
|
||
dependencies: download.os install.lima-dependencies lima-socket-vmnet lima-template | ||
|
||
.PHONY: download.os | ||
download.os: $(OS_OUTDIR)/$(FINCH_OS_BASENAME) | ||
|
||
$(OS_OUTDIR)/$(FINCH_OS_BASENAME): $(OS_OUTDIR) $(CURDIR)/deps/full-os.conf | ||
bash deps/install.sh --output $@ $(CURDIR)/deps/full-os.conf | ||
|
||
.PHONY: install.lima-dependencies | ||
install.lima-dependencies: download.lima-dependencies $(OUTDIR) | ||
tar -xvzf ${LIMA_DOWNLOAD_DIR}/${LIMA_DEPENDENCY_FILE_NAME} -C $(OUTDIR) | ||
|
||
.PHONY: download.lima-dependencies | ||
download.lima-dependencies: $(LIMA_DOWNLOAD_DIR)/$(LIMA_DEPENDENCY_FILE_NAME) | ||
|
||
$(LIMA_DOWNLOAD_DIR)/$(LIMA_DEPENDENCY_FILE_NAME): $(LIMA_DOWNLOAD_DIR) $(CURDIR)/deps/lima-bundles.conf | ||
bash deps/install.sh --output $@ $(CURDIR)/deps/lima-bundles.conf | ||
|
||
.PHONY: lima-socket-vmnet | ||
lima-socket-vmnet: | ||
git submodule update --init --recursive src/socket_vmnet | ||
cd src/socket_vmnet && git clean -f -d | ||
cd src/socket_vmnet && PREFIX=$(SOCKET_VMNET_TEMP_PREFIX) "$(MAKE)" install.bin | ||
|
||
.PHONY: lima-template | ||
lima-template: $(LIMA_TEMPLATE_OUTDIR) | ||
cp lima-template/fedora.yaml $(LIMA_TEMPLATE_OUTDIR) | ||
# using -i.bak is very intentional, it allows the following commands to succeed for both GNU / BSD sed | ||
# this sed command uses the alternative separator of "|" because the image location uses "/" | ||
sed -i.bak -e "s|<image_location>|$(FINCH_IMAGE_LOCATION)|g" $(LIMA_TEMPLATE_OUTDIR)/fedora.yaml | ||
sed -i.bak -e "s/<image_arch>/$(LIMA_ARCH)/g" $(LIMA_TEMPLATE_OUTDIR)/fedora.yaml | ||
sed -i.bak -e "s/<image_digest>/$(FINCH_IMAGE_DIGEST)/g" $(LIMA_TEMPLATE_OUTDIR)/fedora.yaml | ||
rm $(LIMA_TEMPLATE_OUTDIR)/*.yaml.bak |
Oops, something went wrong.