Skip to content

Commit 1b95a3e

Browse files
committed
fixup: Respond to comments in PR enabling push
1 parent bac5306 commit 1b95a3e

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

.github/workflows/publish_antithesis_images.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
TAG: latest
3333
TEST_SETUP: avalanchego
3434

35-
- name: Build images for xsvm test setup
35+
- name: Build and push images for xsvm test setup
3636
run: bash -x ./scripts/build_antithesis_images.sh
3737
env:
3838
IMAGE_PREFIX: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}

scripts/build_antithesis_images.sh

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@ GO_VERSION="$(go list -m -f '{{.GoVersion}}')"
3030
function build_images {
3131
local test_setup=$1
3232
local uninstrumented_node_dockerfile=$2
33-
local node_only=${3:-}
33+
local image_prefix=$3
34+
local node_only=${4:-}
3435

3536
# Define image names
3637
local base_image_name="antithesis-${test_setup}"
3738
local avalanchego_node_image_name="antithesis-avalanchego-node:${TAG}"
38-
if [[ -n "${IMAGE_PREFIX}" ]]; then
39-
base_image_name="${IMAGE_PREFIX}/${base_image_name}"
40-
avalanchego_node_image_name="${IMAGE_PREFIX}/${avalanchego_node_image_name}"
39+
if [[ -n "${image_prefix}" ]]; then
40+
base_image_name="${image_prefix}/${base_image_name}"
41+
avalanchego_node_image_name="${image_prefix}/${avalanchego_node_image_name}"
4142
fi
4243
local node_image_name="${base_image_name}-node:${TAG}"
4344
local workload_image_name="${base_image_name}-workload:${TAG}"
@@ -63,6 +64,10 @@ function build_images {
6364

6465
# Build node image first to allow the workload image to use it.
6566
${docker_cmd} -t "${node_image_name}" -f "${node_dockerfile}" "${AVALANCHE_PATH}"
67+
if [[ -n "${image_prefix}" ]]; then
68+
# Push images with an image prefix since the prefix defines a registry location
69+
docker_cmd="${docker_cmd} --push"
70+
fi
6671

6772
if [[ -n "${node_only}" ]]; then
6873
# Skip building the config and workload images. Supports building the avalanchego
@@ -99,13 +104,14 @@ function build_images {
99104

100105
TEST_SETUP="${TEST_SETUP:-}"
101106
if [[ "${TEST_SETUP}" == "avalanchego" ]]; then
102-
build_images avalanchego "${AVALANCHE_PATH}/Dockerfile" "${NODE_ONLY:-}"
107+
build_images avalanchego "${AVALANCHE_PATH}/Dockerfile" "${IMAGE_PREFIX}" "${NODE_ONLY:-}"
103108
elif [[ "${TEST_SETUP}" == "xsvm" ]]; then
104-
# Only build the node image to use as the base for the xsvm image
109+
# Only build the node image to use as the base for the xsvm image. Provide an empty
110+
# image prefix (the 3rd argument) to prevent the image from being pushed
105111
NODE_ONLY=1
106-
build_images avalanchego "${AVALANCHE_PATH}/Dockerfile" "${NODE_ONLY}"
112+
build_images avalanchego "${AVALANCHE_PATH}/Dockerfile" "" "${NODE_ONLY}"
107113

108-
build_images xsvm "${AVALANCHE_PATH}/vms/example/xsvm/Dockerfile"
114+
build_images xsvm "${AVALANCHE_PATH}/vms/example/xsvm/Dockerfile" "${IMAGE_PREFIX}"
109115
else
110116
echo "TEST_SETUP must be set. Valid values are 'avalanchego' or 'xsvm'"
111117
exit 255

0 commit comments

Comments
 (0)