-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement bare-metal Mac M1 podman-machine testing
Setup and execute podman machine testing on bare-metal M1 Macs using a pool of shared and semi-persistent hosts. Automated and manual processes outside this repository are responsible for providing and maintaining all hosts. Ref: https://github.com/containers/automation/tree/2aea32e1a413e8cfc5876fa5f8093f7b5b8cf306/mac_pw_pool Update the `localmachine` make target to standardize execution across platforms. Update/simplify podman-machine e2e README to reflect current reality. Warning: This CI setup and supporting architecture was developed with GA-expediency in favor of stability. There are many possible failure-modes (known and unknown) which may lead to undefined behaviors. Future work may address some of these as they are encountered or discovered. [NO NEW TESTS NEEDED] Signed-off-by: Chris Evich <cevich@redhat.com>
- Loading branch information
Showing
7 changed files
with
161 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
# This script is intended to be called by Cirrus-CI on a Mac M1 persistent workier. | ||
# It performs a best-effort attempt at cleaning up from one task execution to the next. | ||
# Since it run both before and after tasks, it must exit cleanly if there was a cleanup | ||
# failure (i.e. file or directory not found). | ||
|
||
set +ex | ||
|
||
# These are the main processes which could leak out of testing. | ||
killall podman vfkit gvproxy make go ginkgo | ||
|
||
# This is defined as $TMPDIR during setup. Name must be kept | ||
# "short" as sockets may reside here. Darwin suffers from | ||
# the same limited socket-pathname character-length restriction | ||
# as Linux. | ||
rm -rf /private/tmp/ci/* /private/tmp/ci/.??* | ||
|
||
# Don't clobber the $CIRRUS_WORKING_DIR for this (running) task. | ||
# shellcheck disable=SC2154 | ||
find "${ORIGINAL_HOME:-$HOME}/ci" -mindepth 1 -maxdepth 1 \ | ||
-not -name "*task-${CIRRUS_TASK_ID}*" -prune -exec rm -rf '{}' + | ||
|
||
# Bash scripts exit with the status of the last command. | ||
true |
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,25 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
# This script is intended to be called by Cirrus-CI on a Mac M1 persistent workier. | ||
# It builds all the bits necessary for testing. | ||
|
||
# Many variables can affect operations, make them all known to assist debugging. | ||
echo "Selection of current env. vars:" | ||
for env_var_name in $(awk 'BEGIN{for(v in ENVIRON) print v}' | grep -Eiv '(^PATH$)|(^BASH_FUNC)|(^_.*)' | sort -u) | ||
do | ||
echo " ${env_var_name}=${!env_var_name}" | ||
done | ||
|
||
# The latest toolchain is always installed when instances are created. Make it known | ||
# what version that actually is. | ||
go version | ||
|
||
# Golang is sensitive to a collection of key variables. Make them known to assist | ||
# with any debugging. N/B: Most filepath values should point somewhere under $HOME/ci/ | ||
go env | ||
|
||
# The latest version is installed system-wide when instances are created. Make the | ||
# current version known. | ||
vfkit --version |
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,30 @@ | ||
#!/bin/bash | ||
|
||
# This script is intended to be called by Cirrus-CI on a Mac M1 persistent workier. | ||
# It performs all the user-level setup required to execute testing. It assumes | ||
# an admin has already installed all system-wide testing dependencies on the host. | ||
|
||
set -euo pipefail | ||
|
||
# Persist env. vars required during testing steps. These cannot be set in the | ||
# task YAML because they would interfere with repo. cloning and task preperation. | ||
# Note: None of the values below will become active until the next "script" section starts. | ||
# Ref: | ||
# https://cirrus-ci.org/guide/tips-and-tricks/#setting-environment-variables-from-scripts | ||
|
||
# Tests expect to call compiled binaries first, make sure they're found first. | ||
# shellcheck disable=SC2154 | ||
echo "PATH=$CIRRUS_WORKING_DIR/bin/darwin:$PATH" >> $CIRRUS_ENV | ||
|
||
# Post-task cleanup needs to know the actual user home directory | ||
# shellcheck disable=SC2154 | ||
echo "ORIGINAL_HOME=$HOME" >> $CIRRUS_ENV | ||
|
||
# Help isolate CI-operations from system-operations and simplify task cleanup. | ||
# shellcheck disable=SC2154 | ||
echo "HOME=$HOME/ci" >> $CIRRUS_ENV | ||
# shellcheck disable=SC2154 | ||
echo "TMPDIR=/private/tmp/ci" >> $CIRRUS_ENV | ||
|
||
# Removed completely during cleanup. | ||
mkdir -p /private/tmp/ci |
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,15 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
# This script is intended to be called by Cirrus-CI on a Mac M1 persistent workier. | ||
# It executes all mac tests. Ref: pkg/machine/e2e/README.md | ||
|
||
# There's no point in more extensive testing if the basics don't work | ||
|
||
set -x # Show complete command-line to assist debugging | ||
# TODO: Initial image download and VM resize causes test-timeout (90s default). | ||
# Tests should probably deal with this internally. | ||
MACHINE_TEST_TIMEOUT=500 make localmachine FOCUS_FILE="basic_test.go" | ||
|
||
make localmachine |
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