Skip to content

Commit

Permalink
feat: Updated kubevirtci s390x jobs to use GCS REST API
Browse files Browse the repository at this point in the history
As gsutils or glcoud cli aren't supported on s390x arch, using REST APIs to do file operations from s390x.

Signed-off-by: chandramerla <Chandra.Merla@ibm.com>
  • Loading branch information
chandramerla committed Sep 16, 2024
1 parent 735ba72 commit 32cb318
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ periodics:
SHORT_SHA=$(git rev-parse --short HEAD) &&
image_tag=$(cat cluster-provision/k8s/base-image | cut -d ':' -f 2) &&
echo "$image_tag" > amd64-centos9-$SHORT_SHA &&
#TODO: replace with methods which work on s390x as gsutil not supported for s390x.
gsutil cp ./amd64-centos9-$SHORT_SHA gs://kubevirt-prow/release/kubevirt/kubevirtci/amd64-centos9-$SHORT_SHA
# docker-in-docker needs privileged mode
env:
Expand Down Expand Up @@ -174,18 +173,19 @@ periodics:
- >
# For getting centos image tag from amd64 prow job and use same for xs390x and manifest-list images
SHORT_SHA=$(git rev-parse --short HEAD) &&
GCS_FILE_PATH=gs://kubevirt-prow/release/kubevirt/kubevirtci/amd64-centos9-$SHORT_SHA &&
GCS_FILE_PATH=release/kubevirt/kubevirtci/amd64-centos9-$SHORT_SHA &&
CHECK_INTERVAL=30 &&
source /usr/local/bin/gcs_restapi.sh &&
while true; do
if gsutil -q stat "$GCS_FILE_PATH"; then
if stat_gcs_file kubevirt-prow "$GCS_FILE_PATH"; then
echo "File $GCS_FILE_PATH is now available."
break
else
echo "File $GCS_FILE_PATH not found. Checking again in $CHECK_INTERVAL seconds."
sleep $CHECK_INTERVAL
fi
done &&
export KUBEVIRTCI_TAG=$(gsutil cat "$GCS_FILE_PATH") || echo "Failed to fetch KUBEVIRTCI_TAG" &&
export KUBEVIRTCI_TAG=$(cat_gcs_file kubevirt-prow "$GCS_FILE_PATH") || { echo "Failed to fetch KUBEVIRTCI_TAG"; exit 1; } &&
echo "Fetched KUBEVIRTCI_TAG: $KUBEVIRTCI_TAG" &&
cat $QUAY_PASSWORD | podman login --username $(<$QUAY_USER) --password-stdin quay.io &&
./hack/bump-centos-version.sh &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,24 @@ postsubmits:
- >
cat $QUAY_PASSWORD | podman login --username $(<$QUAY_USER) --password-stdin quay.io &&
SHORT_SHA=$(git rev-parse --short HEAD) &&
GCS_FILE_PATH=gs://kubevirt-prow/release/kubevirt/kubevirtci/amd64-$SHORT_SHA &&
GCS_FILE_PATH=release/kubevirt/kubevirtci/amd64-$SHORT_SHA &&
source /usr/local/bin/gcs_restapi.sh
CHECK_INTERVAL=30 &&
while true; do
if gsutil -q stat "$GCS_FILE_PATH"; then
if stat_gcs_file kubevirt-prow "$GCS_FILE_PATH"; then
echo "File $GCS_FILE_PATH is now available."
break
else
echo "File $GCS_FILE_PATH not found. Checking again in $CHECK_INTERVAL seconds."
sleep $CHECK_INTERVAL
fi
done &&
export KUBEVIRTCI_TAG=$(gsutil cat "$GCS_FILE_PATH") &&
export KUBEVIRTCI_TAG=$(cat_gcs_file kubevirt-prow "$GCS_FILE_PATH") || { echo "Failed to fetch KUBEVIRTCI_TAG"; exit 1; } &&
echo "Fetched KUBEVIRTCI_TAG: $KUBEVIRTCI_TAG" &&
./publish.sh &&
echo "$(git tag --points-at HEAD | head -1)" > latest &&
gsutil cp ./latest gs://kubevirt-prow/release/kubevirt/kubevirtci/latest
gsutil rm "$GCS_FILE_PATH"
upload_to_gcs ./latest kubevirt-prow release/kubevirt/kubevirtci/latest
rm_gcs_file kubevirt-prow "$GCS_FILE_PATH"
# docker-in-docker needs privileged mode
env:
- name: GIMME_GO_VERSION
Expand Down

0 comments on commit 32cb318

Please sign in to comment.