forked from kubeflow/model-registry
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(gha): prevent race condition on port-forward (kubeflow#485)
* fix(gha): prevent race condition on port-forward Signed-off-by: Alessio Pragliola <[email protected]> * chore(gha): make it faster by waiting for db before mr Signed-off-by: Alessio Pragliola <[email protected]> Co-authored-by: Matteo Mortari <[email protected]> --------- Signed-off-by: Alessio Pragliola <[email protected]> Co-authored-by: Matteo Mortari <[email protected]>
- Loading branch information
1 parent
d53528c
commit cc9b33d
Showing
3 changed files
with
51 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,15 +125,15 @@ jobs: | |
uses: helm/[email protected] | ||
with: | ||
node_image: "kindest/node:v1.27.11" | ||
cluster_name: chart-testing-py-${{ matrix.python }} | ||
- name: Load Local Registry Test Image | ||
if: matrix.session == 'tests' | ||
env: | ||
IMG: "docker.io/${{ env.IMG_ORG }}/${{ env.IMG_REPO }}:${{ steps.tags.outputs.tag }}" | ||
IMG: "${{ env.IMG_ORG }}/${{ env.IMG_REPO }}:${{ steps.tags.outputs.tag }}" | ||
run: | | ||
kind load docker-image -n chart-testing ${IMG} | ||
kind load docker-image -n chart-testing-py-${{ matrix.python }} ${IMG} | ||
- name: Deploy Model Registry using manifests | ||
env: | ||
IMG: "docker.io/${{ env.IMG_ORG }}/${{ env.IMG_REPO }}:${{ steps.tags.outputs.tag }}" | ||
IMG: "${{ env.IMG_ORG }}/${{ env.IMG_REPO }}:${{ steps.tags.outputs.tag }}" | ||
run: ./scripts/deploy_on_kind.sh | ||
- name: Nox test end-to-end | ||
working-directory: clients/python | ||
|
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -o xtrace | ||
|
||
repeat_cmd_until() { | ||
local cmd=$1 | ||
local condition=$2 | ||
local max_wait_secs=$3 | ||
local debug_cmd=$4 | ||
local interval_secs=2 | ||
local start_time=$(date +%s) | ||
local output | ||
|
||
while true; do | ||
|
||
current_time=$(date +%s) | ||
if (( (current_time - start_time) > max_wait_secs )); then | ||
echo "Waited for expression "$1" to satisfy condition "$2" for $max_wait_secs seconds without luck. Returning with error." | ||
if [ -n "$debug_cmd" ]; then | ||
echo "Running debug command: $debug_cmd" | ||
eval $debug_cmd | ||
fi | ||
return 1 | ||
fi | ||
|
||
output=$(eval $cmd) | ||
|
||
if [ $output $condition ]; then | ||
break | ||
else | ||
sleep $interval_secs | ||
fi | ||
done | ||
} |