Skip to content

Commit

Permalink
Use a consistent build id between bazel/kubeadm pull jobs.
Browse files Browse the repository at this point in the history
Since the kubeadm e2e job uses the CI artifacts pushed by the bazel job,
make sure we use a consistent id for their storage (the Kubernetes
version isn't stable for pull jobs since each job pulls and applies the
PR at different times, resulting in different commit SHAs).
  • Loading branch information
pipejakob committed May 11, 2017
1 parent d7418d3 commit 5cda592
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
6 changes: 3 additions & 3 deletions jobs/pull-kubernetes-bazel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ if [[ "${rc}" == 0 ]]; then
fi

if [[ "${rc}" == 0 ]]; then
version=$(cat bazel-genfiles/version || true)
if [[ -z "${version}" ]]; then
echo "Kubernetes version missing; not uploading ci artifacts."
if [[ -z "${PULL_NUMBER:-}" || -z "${PULL_REFS:-}" ]]; then
echo "\$PULL_NUMBER or \$PULL_REFS is empty; not uploading ci artifacts."
rc=1
else
version=${PULL_NUMBER:-}/${PULL_REFS:-}
bazel run //:ci-artifacts -- "gs://kubernetes-release-dev/bazel/${version}" && rc=$? || rc=$?
fi
fi
Expand Down
13 changes: 6 additions & 7 deletions jobs/pull-kubernetes-e2e-kubeadm-gce.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,17 @@ readonly testinfra="$(dirname "${0}")/.."

export PROJECT="k8s-jkns-pr-kubeadm"
export KUBERNETES_PROVIDER=kubernetes-anywhere

# This job only runs against the kubernetes repo, and bootstrap.py leaves the
# current working directory at the repository root. Grab the SCM_REVISION so we
# can use the .debs built during the bazel-build job that should have already
# succeeded.
export SCM_VERSION=$(./hack/print-workspace-status.sh | grep ^STABLE_BUILD_SCM_REVISION | cut -d' ' -f2)
# These deliberately do not use the :- syntax so that the nounset flag produces
# succinct errors if either is unset. This job depends on the artifacts created
# during pull-kubernetes-bazel, so these env vars must be set correctly to find
# this pull's build artifacts.
export VERSION=${PULL_NUMBER}/${PULL_REFS}

export E2E_NAME="e2e-kubeadm-${BUILD_NUMBER:-0}"
export E2E_OPT="--deployment kubernetes-anywhere --kubernetes-anywhere-path /workspace/kubernetes-anywhere"
export E2E_OPT+=" --kubernetes-anywhere-phase2-provider kubeadm --kubernetes-anywhere-cluster ${E2E_NAME}"
# The gs:// path given here should match jobs/pull-kubernetes-bazel.sh
export E2E_OPT+=" --kubernetes-anywhere-kubeadm-version gs://kubernetes-release-dev/bazel/${SCM_VERSION}/build/debs/"
export E2E_OPT+=" --kubernetes-anywhere-kubeadm-version gs://kubernetes-release-dev/bazel/${VERSION}/build/debs/"
export GINKGO_TEST_ARGS="--ginkgo.focus=\[Conformance\]"

# Resource leak detection is disabled because prow runs multiple instances of
Expand Down

0 comments on commit 5cda592

Please sign in to comment.