Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
- name: Smoke Test Docker Image
run: |
docker pull ${{ secrets.ECR_REPOSITORY_URL }}:${{ env.version }}-${{ github.run_number }}
./release/smoke-tests/run-smoke-tests.sh -v ${{ env.version }}-${{ github.run_number }} -i ${{ secrets.ECR_REPOSITORY_URL }}
./release/smoke-tests/run-smoke-tests.sh -v ${{ env.version }}-${{ github.run_number }} -i ${{ secrets.ECR_REPOSITORY_URL }} -a ${{ matrix.architecture }}

validate-archive:
strategy:
Expand Down
31 changes: 30 additions & 1 deletion release/smoke-tests/run-smoke-tests.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#!/bin/bash

#
# Copyright OpenSearch Contributors
# SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.
#

set -e

Expand Down Expand Up @@ -31,11 +37,12 @@ function usage() {
echo "Optional arguments:"
echo -e "-h\t\tPrint this message."
echo -e "-i IMAGE_NAME\tOverride the docker image name name (ex: opensearch-data-prepper or data-prepper)."
echo -e "-a ARCHITECTURE\tSpecify the architecture (x64 or arm64)."
echo "--------------------------------------------------------------------------"
}


while getopts "hv:r::o::i::" arg; do
while getopts "hv:r::o::i::a::" arg; do
case $arg in
h)
usage
Expand All @@ -47,17 +54,39 @@ while getopts "hv:r::o::i::" arg; do
i)
export IMAGE_NAME=$OPTARG
;;
a)
export ARCHITECTURE=$OPTARG
;;
?)
echo "Invalid option: -${arg}"
end_tests 1
;;
esac
done

# Set Docker platform based on architecture
if [ "${ARCHITECTURE}" = "arm64" ]; then
export DOCKER_DEFAULT_PLATFORM="linux/arm64"
else
export DOCKER_DEFAULT_PLATFORM="linux/amd64"
fi

export DOCKER_IMAGE="${IMAGE_NAME}:${TAG_NAME}"

echo "Will smoke test image \"${DOCKER_IMAGE}\""

if [ -n "${ARCHITECTURE}" ]; then
echo "Validating image architecture..."
ACTUAL_ARCH=$(docker run --rm --entrypoint uname "${DOCKER_IMAGE}" -m)
EXPECTED_UNAME=$([ "${ARCHITECTURE}" = "arm64" ] && echo "aarch64" || echo "x86_64")

if [ "${ACTUAL_ARCH}" != "${EXPECTED_UNAME}" ]; then
echo -e "\033[0;31mArchitecture mismatch: expected ${ARCHITECTURE} (${EXPECTED_UNAME}) but image is ${ACTUAL_ARCH}\033[0m"
end_tests 1
fi
echo "Architecture validated: ${ACTUAL_ARCH}"
fi

./gradlew -PendToEndDataPrepperImage=${IMAGE_NAME} -PendToEndDataPrepperTag=${TAG_NAME} :e2e-test:log:basicLogEndToEndTest
sleep 1

Expand Down
2 changes: 1 addition & 1 deletion release/smoke-tests/run-tarball-files-smoke-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ function run_smoke_test() {
local CURRENT_DIR
CURRENT_DIR=$(pwd)

eval "${REPO_DIR}/release/smoke-tests/run-smoke-tests.sh -i ${SMOKE_IMAGE_NAME} -v ${DATA_PREPPER_VERSION}"
eval "${REPO_DIR}/release/smoke-tests/run-smoke-tests.sh -i ${SMOKE_IMAGE_NAME} -v ${DATA_PREPPER_VERSION} -a ${ARCHITECTURE}"

echo echo "Completed smoke testing tar ${TAR_FILE}"

Expand Down
Loading