diff --git a/.github/workflows/auto-cherrypick.yaml b/.github/workflows/auto-cherrypick.yaml index e2d4ba8b00..68fb6ec96f 100644 --- a/.github/workflows/auto-cherrypick.yaml +++ b/.github/workflows/auto-cherrypick.yaml @@ -45,7 +45,7 @@ jobs: echo "try to get PR from commit" COMMIT=` echo "${JSON}" | jq '.event.commits[0].id' | tr -d '"' ` || true if [ -n "${COMMIT}" ]; then - PR_NUMBER=`curl -s -H "Accept: application/vnd.github.groot-preview+json" https://api.github.com/repos/${{ github.repository }}/commits/${COMMIT}/pulls | jq -r '.[].number' ` + PR_NUMBER=`curl --retry 10 -s -H "Accept: application/vnd.github.groot-preview+json" https://api.github.com/repos/${{ github.repository }}/commits/${COMMIT}/pulls | jq -r '.[].number' ` else echo "error, failed to get any commit ID" fi @@ -63,7 +63,7 @@ jobs: # [ -n "${PR_AUTHOR}" ] || { echo "no PR_AUTHOR, ignore" ; } # fi - RP_API_BODY=` curl https://api.github.com/repos/${{ github.repository }}/pulls/${PR_NUMBER} -s -H "Accept: application/vnd.github.groot-preview+json" ` + RP_API_BODY=` curl --retry 10 https://api.github.com/repos/${{ github.repository }}/pulls/${PR_NUMBER} -s -H "Accept: application/vnd.github.groot-preview+json" ` PR_COMMITS=` echo "${RP_API_BODY}" | jq ' .merge_commit_sha ' | tr -d '"' ` PR_AUTHOR=` echo "${RP_API_BODY}" | jq ' .user.login ' | tr -d '"' ` PR_URL="https://github.com/${{ github.repository }}/pull/${PR_NUMBER}" diff --git a/.github/workflows/build-image-plugins.yaml b/.github/workflows/build-image-plugins.yaml index a2d7fd68c1..bffbdff3b7 100644 --- a/.github/workflows/build-image-plugins.yaml +++ b/.github/workflows/build-image-plugins.yaml @@ -72,16 +72,16 @@ jobs: id: get_event_version continue-on-error: false run: | - cni_latest_version=$(curl -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/containernetworking/plugins/releases/latest | jq '.tag_name' | tr -d '"') + cni_latest_version=$(curl --retry 10 -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/containernetworking/plugins/releases/latest | jq '.tag_name' | tr -d '"') if [ -z "${cni_latest_version}" ] ; then echo "unable to get cni version" && exit 1 fi - ovs_latest_version=$(curl -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/k8snetworkplumbingwg/ovs-cni/releases/latest | jq '.tag_name' | tr -d '"') + ovs_latest_version=$(curl --retry 10 -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/k8snetworkplumbingwg/ovs-cni/releases/latest | jq '.tag_name' | tr -d '"') if [ -z "${ovs_latest_version}" ] ; then echo "unable to get ovs version" && exit 1 fi - rdma_latest_version=$(curl -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/k8snetworkplumbingwg/rdma-cni/releases/latest | jq '.tag_name' | tr -d '"') + rdma_latest_version=$(curl --retry 10 -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/k8snetworkplumbingwg/rdma-cni/releases/latest | jq '.tag_name' | tr -d '"') if [ -z "${rdma_latest_version}" ] ; then echo "unable to get rdma version" && exit 1 fi diff --git a/test/Makefile b/test/Makefile index 59cd6a4048..b80eddff65 100644 --- a/test/Makefile +++ b/test/Makefile @@ -86,6 +86,8 @@ ifeq ($(INSTALL_KUBEVIRT),true) E2E_KUBECONFIG=$(E2E_KUBECONFIG) \ E2E_CLUSTER_NAME=$(E2E_CLUSTER_NAME) \ HTTP_PROXY=$(HTTP_PROXY) \ + KUBEVIRT_VERSION=$(KUBEVIRT_VERSION) \ + E2E_KUBEVIRT_IMAGE_REPO=$(E2E_KUBEVIRT_IMAGE_REPO) \ $(QUIET) bash scripts/install-kubevirt.sh endif @ echo "wait for the cluster ready" ; \ diff --git a/test/Makefile.defs b/test/Makefile.defs index 80d55e1b07..3e3b5483e6 100644 --- a/test/Makefile.defs +++ b/test/Makefile.defs @@ -57,8 +57,6 @@ INSTALL_SPIDERDOCTOR ?= true INSTALL_KUBEVIRT ?= false -CALICO_VERSION ?= v3.25.0 - CNI_PACKAGE_VERSION ?= v1.3.0 #============ ginkgo-custom-flag ==================== @@ -203,3 +201,14 @@ ifeq ($(E2E_CHINA_IMAGE_REGISTRY),true) else E2E_SRIOV_IMAGE_REPO ?= ghcr.io endif + +#=========== kubevrit ============ + +# empty for latest +KUBEVIRT_VERSION := + +ifeq ($(E2E_CHINA_IMAGE_REGISTRY),true) + E2E_KUBEVIRT_IMAGE_REPO ?= quay.m.daocloud.io +else + E2E_KUBEVIRT_IMAGE_REPO ?= quay.io +endif diff --git a/test/scripts/install-kubevirt.sh b/test/scripts/install-kubevirt.sh index 52b2d7e6f9..019f9d591d 100644 --- a/test/scripts/install-kubevirt.sh +++ b/test/scripts/install-kubevirt.sh @@ -9,10 +9,11 @@ CURRENT_FILENAME=$( basename $0 ) [ -z "${HTTP_PROXY}" ] || export https_proxy=${HTTP_PROXY} -export KUBEVIRT_VERSION=$(curl -s https://api.github.com/repos/kubevirt/kubevirt/releases | grep tag_name | grep -v -- '-rc' | sort -r | head -1 | awk -F': ' '{print $2}' | sed 's/,//' | xargs) - -# Should we set a fixed version just like "v1.1.0" ? +if [ -z "${KUBEVIRT_VERSION}" ] ; then + KUBEVIRT_VERSION=$( curl --retry 10 -s https://api.github.com/repos/kubevirt/kubevirt/releases/latest | jq '.tag_name' | tr -d '"' ) +fi [ -z "$KUBEVIRT_VERSION" ] && echo "error, miss KUBEVIRT_VERSION" && exit 1 + echo "$CURRENT_FILENAME : KUBEVIRT_VERSION $KUBEVIRT_VERSION " [ -z "$E2E_CLUSTER_NAME" ] && echo "error, miss E2E_CLUSTER_NAME " && exit 1 @@ -22,12 +23,14 @@ echo "$CURRENT_FILENAME : E2E_CLUSTER_NAME $E2E_CLUSTER_NAME " [ ! -f "$E2E_KUBECONFIG" ] && echo "error, could not find file $E2E_KUBECONFIG " && exit 1 echo "$CURRENT_FILENAME : E2E_KUBECONFIG $E2E_KUBECONFIG " -KUBEVIRT_OPERATOR_IMAGE=quay.io/kubevirt/virt-operator:${KUBEVIRT_VERSION} -KUBEVIRT_API_IMAGE=quay.io/kubevirt/virt-api:${KUBEVIRT_VERSION} -KUBEVIRT_CONTROLLER_IMAGE=quay.io/kubevirt/virt-controller:${KUBEVIRT_VERSION} -KUBEVIRT_HANDLER_IMAGE=quay.io/kubevirt/virt-handler:${KUBEVIRT_VERSION} -KUBEVIRT_LAUNCHER_IMAGE=quay.io/kubevirt/virt-launcher:${KUBEVIRT_VERSION} -KUBEVIRT_TEST_IMAGE=quay.io/kubevirt/cirros-container-disk-demo +echo "E2E_KUBEVIRT_IMAGE_REPO=${E2E_KUBEVIRT_IMAGE_REPO}" + +KUBEVIRT_OPERATOR_IMAGE=${E2E_KUBEVIRT_IMAGE_REPO}/kubevirt/virt-operator:${KUBEVIRT_VERSION} +KUBEVIRT_API_IMAGE=${E2E_KUBEVIRT_IMAGE_REPO}/kubevirt/virt-api:${KUBEVIRT_VERSION} +KUBEVIRT_CONTROLLER_IMAGE=${E2E_KUBEVIRT_IMAGE_REPO}/kubevirt/virt-controller:${KUBEVIRT_VERSION} +KUBEVIRT_HANDLER_IMAGE=${E2E_KUBEVIRT_IMAGE_REPO}/kubevirt/virt-handler:${KUBEVIRT_VERSION} +KUBEVIRT_LAUNCHER_IMAGE=${E2E_KUBEVIRT_IMAGE_REPO}/kubevirt/virt-launcher:${KUBEVIRT_VERSION} +KUBEVIRT_TEST_IMAGE=${E2E_KUBEVIRT_IMAGE_REPO}/kubevirt/cirros-container-disk-demo KUBEVIRT_IMAGE_LIST="${KUBEVIRT_OPERATOR_IMAGE} ${KUBEVIRT_API_IMAGE} ${KUBEVIRT_CONTROLLER_IMAGE} ${KUBEVIRT_HANDLER_IMAGE} ${KUBEVIRT_LAUNCHER_IMAGE}" LOCAL_IMAGE_LIST=`docker images | awk '{printf("%s:%s\n",$1,$2)}'` diff --git a/tools/scripts/changelog.sh b/tools/scripts/changelog.sh index 3c3cc3132e..76d0c7b23b 100755 --- a/tools/scripts/changelog.sh +++ b/tools/scripts/changelog.sh @@ -128,7 +128,7 @@ for COMMIT in ${ALL_COMMIT} ; do # https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#rate-limiting # When using GITHUB_TOKEN, the rate limit is 1,000 requests per hour per repository # GitHub Enterprise Cloud's rate limit applies, and the limit is 15,000 requests per hour per repository. - COMMIT_INFO=` curl -s -H "Accept: application/vnd.github.groot-preview+json" -H "Authorization: Bearer ${GH_TOKEN}" https://api.github.com/repos/${PROJECT_REPO}/commits/${COMMIT}/pulls ` + COMMIT_INFO=` curl --retry 10 -s -H "Accept: application/vnd.github.groot-preview+json" -H "Authorization: Bearer ${GH_TOKEN}" https://api.github.com/repos/${PROJECT_REPO}/commits/${COMMIT}/pulls ` PR=` jq -r '.[].number' <<< "${COMMIT_INFO}" ` [ -n "${PR}" ] || { echo "warning, failed to find PR number for commit ${COMMIT} " ; echo "${COMMIT_INFO}" ; echo "" ; continue ; } if grep " ${PR} " <<< " ${PR_LIST} " &>/dev/null ; then