-
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.
Add the option to read the token from disk to the performance tests (#24
) * Performance tests, add the option to read the token from file * Add so you can use the local env to pass parameters to the performance tests Co-authored-by: George Palasanu <palasanu@adobe.com>
- Loading branch information
Showing
4 changed files
with
63 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,48 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This script is so we can pass the enviorment variables from the /local/.env.local | ||
# file to the container that runs the benchmark.sh script when ran from the Makefile | ||
# file to the container that runs the benchmark.sh script when ran from the Makefile. | ||
# | ||
# The env variables with the prefix LOCAL_ENV are from the env of the user that ran | ||
# the make target, and the ones without the prefix are from the /local/.env.local file. | ||
# | ||
# Only the container run env variables have defaults in this script the APISERVER_ENDPOINT | ||
# and PERFORMANCE_TEST_TIME have defaults inside the container. The APISERVER_AUTH_TOKEN | ||
# is required. | ||
|
||
if [ -z "${TAG}" ]; then | ||
TAG="v$(cat "$(git rev-parse --show-toplevel)/VERSION")-$(git rev-parse --short HEAD)" | ||
# If LOCAL_ENV_ exists and is not empty | ||
if [[ -n "${LOCAL_ENV_APISERVER_ENDPOINT}" ]]; then | ||
APISERVER_ENDPOINT="${LOCAL_ENV_APISERVER_ENDPOINT}" | ||
fi | ||
|
||
if [ -z "${IMAGE_PERFORMANCE_TESTS}" ]; then | ||
IMAGE_PERFORMANCE_TESTS="ghcr.io/adobe/performance-tests" | ||
if [[ -n "${LOCAL_ENV_APISERVER_AUTH_TOKEN}" ]]; then | ||
APISERVER_AUTH_TOKEN="${LOCAL_ENV_APISERVER_AUTH_TOKEN}" | ||
fi | ||
|
||
if [ -z "${NETWORK}" ]; then | ||
if [[ -n "${LOCAL_ENV_PERFORMANCE_TEST_TIME}" ]]; then | ||
PERFORMANCE_TEST_TIME="${LOCAL_ENV_PERFORMANCE_TEST_TIME}" | ||
fi | ||
|
||
if [[ -n "${LOCAL_ENV_NETWORK}" ]]; then | ||
NETWORK="${LOCAL_ENV_NETWORK}" | ||
elif [ -z "${NETWORK}" ]; then | ||
NETWORK="cluster-registry-net" | ||
fi | ||
|
||
if [[ -n "${LOCAL_ENV_IMAGE_PERFORMANCE_TESTS}" ]]; then | ||
IMAGE_PERFORMANCE_TESTS="${LOCAL_ENV_IMAGE_PERFORMANCE_TESTS}" | ||
elif [ -z "${IMAGE_PERFORMANCE_TESTS}" ]; then | ||
IMAGE_PERFORMANCE_TESTS="ghcr.io/adobe/performance-tests" | ||
fi | ||
|
||
if [[ -n "${LOCAL_ENV_TAG}" ]]; then | ||
TAG="${LOCAL_ENV_TAG}" | ||
elif [ -z "${TAG}" ]; then | ||
TAG="v$(cat "$(git rev-parse --show-toplevel)/VERSION")-$(git rev-parse --short HEAD)" | ||
fi | ||
|
||
docker run --rm --network="${NETWORK}" \ | ||
-e APISERVER_ENDPOINT \ | ||
-e PERFORMANCE_TEST_TIME \ | ||
-e APISERVER_AUTH_TOKEN \ | ||
"${IMAGE_PERFORMANCE_TESTS}:${TAG}" | ||
"${IMAGE_PERFORMANCE_TESTS}:${TAG}" |