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
28 changes: 28 additions & 0 deletions infra/scripts/setup-common-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,31 @@ $1
============================================================
"
}

wait_for_docker_image(){
# This script will block until a docker image is ready

[[ -z "$1" ]] && { echo "Please pass the docker image URI as the first parameter" ; exit 1; }
oldopt=$-
set +e

DOCKER_IMAGE=$1
poll_count=0
maximum_poll_count=150

# Wait for Feast Core to be available on GCR
until docker pull "$DOCKER_IMAGE"
do
# Exit when we have tried enough times
if [[ "$poll_count" -gt "$maximum_poll_count" ]]; then
set -$oldopt
exit 1
fi
# Sleep and increment counter on failure
echo "${DOCKER_IMAGE} could not be found";
sleep 5;
((poll_count++))
done

set -$oldopt
}
7 changes: 7 additions & 0 deletions infra/scripts/test-end-to-end-batch-dataflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,13 @@ export HELM_COMMON_NAME=$HELM_COMMON_NAME
export IMAGE_TAG=$PULL_PULL_SHA
export SPECS_TOPIC=$SPECS_TOPIC

export PROJECT_ROOT_DIR=$(git rev-parse --show-toplevel)
export SCRIPTS_DIR=${PROJECT_ROOT_DIR}/infra/scripts
source ${SCRIPTS_DIR}/setup-common-functions.sh

wait_for_docker_image gcr.io/kf-feast/feast-core:"${IMAGE_TAG}"
wait_for_docker_image gcr.io/kf-feast/feast-serving:"${IMAGE_TAG}"

envsubst $'$TEMP_BUCKET $DATASET_NAME $GCLOUD_PROJECT $GCLOUD_NETWORK $SPECS_TOPIC \
$GCLOUD_SUBNET $GCLOUD_REGION $IMAGE_TAG $HELM_COMMON_NAME $feast_kafka_1_ip
$feast_kafka_2_ip $feast_kafka_3_ip $feast_redis_ip $feast_statsd_ip' < $ORIGINAL_DIR/infra/scripts/test-templates/values-end-to-end-batch-dataflow.yaml > $ORIGINAL_DIR/infra/charts/feast/values-end-to-end-batch-dataflow-updated.yaml
Expand Down
13 changes: 8 additions & 5 deletions infra/scripts/test-load.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ clean_up() {
exit $ARG
}

# Get Feast project repository root and scripts directory
export PROJECT_ROOT_DIR=$(git rev-parse --show-toplevel)
export SCRIPTS_DIR=${PROJECT_ROOT_DIR}/infra/scripts
export COMPOSE_INTERACTIVE_NO_CLI=1
source ${SCRIPTS_DIR}/setup-common-functions.sh

if [ -z "$1" ] ; then
echo "No SHA provided as argument, using local HEAD";
CURRENT_SHA=$(git rev-parse HEAD);
Expand All @@ -34,11 +40,8 @@ else
export CURRENT_SHA
fi

export PROJECT_ROOT_DIR=$(git rev-parse --show-toplevel)
export COMPOSE_INTERACTIVE_NO_CLI=1

# Wait for docker images to be available
"${PROJECT_ROOT_DIR}"/infra/scripts/wait-for-docker-images.sh "${CURRENT_SHA}"
wait_for_docker_image gcr.io/kf-feast/feast-core:"${CURRENT_SHA}"
wait_for_docker_image gcr.io/kf-feast/feast-serving:"${CURRENT_SHA}"

# Clean up Docker Compose if failure
trap clean_up EXIT
Expand Down
40 changes: 0 additions & 40 deletions infra/scripts/wait-for-docker-images.sh

This file was deleted.