Skip to content

Commit 5ed2f21

Browse files
committed
feat(devtool): pull latest test artifacts
Instead of using fixed artifact path for a current FC version pull latest artifacts from S3. This way we can update them independently while keeping old versions around. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
1 parent bf2ae25 commit 5ed2f21

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tools/devtool

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,14 @@ TARGET_PREFIX="$(uname -m)-unknown-linux-"
133133
# Container path to directory where we store built CI artifacts.
134134
CTR_CI_ARTIFACTS_PATH="${CTR_FC_ROOT_DIR}/resources/$(uname -m)"
135135

136+
DEFAULT_ARTIFACTS_S3_BUCKET=s3://spec.ccfc.min/firecracker-ci
137+
138+
# Query default S3 bucket with artifacts and return the most recient path
139+
get_newest_s3_artifacts() {
140+
echo $(aws s3 ls $DEFAULT_ARTIFACTS_S3_BUCKET/ --no-sign-request | grep "PRE" | sort -k2 | tail -1 | awk -v bucket="$DEFAULT_ARTIFACTS_S3_BUCKET" '{print bucket "/" $2}')
141+
}
142+
143+
136144
# Check if Docker is available and exit if it's not.
137145
# Upon returning from this call, the caller can be certain Docker is available.
138146
#
@@ -571,9 +579,8 @@ ensure_ci_artifacts() {
571579
fi
572580

573581
# Fetch all the artifacts so they are local
574-
say "Fetching CI artifacts from S3"
575-
FC_VERSION=$(cmd_sh "cd src/firecracker/src; cargo pkgid | cut -d# -f2 | cut -d. -f1-2")
576-
S3_URL=s3://spec.ccfc.min/firecracker-ci/v$FC_VERSION/$(uname -m)
582+
S3_URL=$(get_newest_s3_artifacts)/$(uname -m)
583+
say "Fetching CI artifacts from S3: " $S3_URL
577584
ARTIFACTS=$MICROVM_IMAGES_DIR/$(uname -m)
578585
if [ ! -d "$ARTIFACTS" ]; then
579586
mkdir -pv $ARTIFACTS

0 commit comments

Comments
 (0)