Skip to content

Commit

Permalink
Merge pull request kubernetes#31628 from Random-Liu/move-image-logic-…
Browse files Browse the repository at this point in the history
…to-remote-run

Automatic merge from submit-queue

Node E2E: Move the image and host related logic to be remote run specific.

This PR addresses kubernetes#31597, and better fixes kubernetes#31588.

With this PR:
1) All remote logic is moved into remote mode.
2) All gci related logic is only called when `HOSTS` and `IMAGES` are not specified.
3) Run node e2e against other node e2e images will work again - `make test-e2e-node REMOET=true IMAGES=e2e-node-containervm-v20160321-image`.
4) List images will work again - `make test-e2e-node REMOTE=true LIST_IMAGES=true`.

Mark 1.4, because kubernetes#31588 is marked as 1.4. And this makes the node e2e work as is described in the [doc ](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/e2e-node-tests.md#run-tests-using-different-images).

@yujuhong @vishh 
/cc @kubernetes/sig-node
  • Loading branch information
Kubernetes Submit Queue authored Aug 30, 2016
2 parents 02e0bdc + 4c9587b commit 5c332e0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
42 changes: 22 additions & 20 deletions hack/make-rules/test-e2e-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,9 @@ parallelism=${PARALLELISM:-8}
report=${REPORT:-"/tmp/"}
artifacts=${ARTIFACTS:-"/tmp/_artifacts"}
remote=${REMOTE:-"false"}
images=${IMAGES:-""}
hosts=${HOSTS:-""}
metadata=${INSTANCE_METADATA:-""}
gubernator=${GUBERNATOR:-"false"}
if [[ $hosts == "" && $images == "" ]]; then
gci_image=$(gcloud compute images list --project google-containers \
--no-standard-images --regexp="gci-dev.*" --format="table[no-heading](name)")
images=$gci_image
metadata="user-data<${KUBE_ROOT}/test/e2e_node/jenkins/gci-init.yaml"
fi
image_project=${IMAGE_PROJECT:-"google-containers"}
instance_prefix=${INSTANCE_PREFIX:-"test"}
cleanup=${CLEANUP:-"true"}
delete_instances=${DELETE_INSTANCES:-"false"}
run_until_failure=${RUN_UNTIL_FAILURE:-"false"}
list_images=${LIST_IMAGES:-"false"}
test_args=${TEST_ARGS:-""}

if [[ $list_images == "true" ]]; then
gcloud compute images list --project="${image_project}" | grep "e2e-node"
exit 0
fi

# Parse the flags to pass to ginkgo
ginkgoflags=""
if [[ $parallelism > 1 ]]; then
Expand All @@ -72,6 +52,28 @@ fi


if [ $remote = true ] ; then
# The following options are only valid in remote run.
images=${IMAGES:-""}
hosts=${HOSTS:-""}
image_project=${IMAGE_PROJECT:-"kubernetes-node-e2e-images"}
metadata=${INSTANCE_METADATA:-""}
list_images=${LIST_IMAGES:-false}
if [[ $list_images == "true" ]]; then
gcloud compute images list --project="${image_project}" | grep "e2e-node"
exit 0
fi
gubernator=${GUBERNATOR:-"false"}
if [[ $hosts == "" && $images == "" ]]; then
image_project=${IMAGE_PROJECT:-"google-containers"}
gci_image=$(gcloud compute images list --project $image_project \
--no-standard-images --regexp="gci-dev.*" --format="table[no-heading](name)")
images=$gci_image
metadata="user-data<${KUBE_ROOT}/test/e2e_node/jenkins/gci-init.yaml"
fi
instance_prefix=${INSTANCE_PREFIX:-"test"}
cleanup=${CLEANUP:-"true"}
delete_instances=${DELETE_INSTANCES:-"false"}

# Setup the directory to copy test artifacts (logs, junit.xml, etc) from remote host to local host
if [[ $gubernator = true && -d "${artifacts}" ]]; then
echo "Removing artifacts directory at ${artifacts}"
Expand Down
3 changes: 3 additions & 0 deletions hack/verify-flags/exceptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ hack/local-up-cluster.sh: advertise_address="--advertise_address=${API_HO
hack/local-up-cluster.sh: runtime_config="--runtime-config=${RUNTIME_CONFIG}"
hack/local-up-cluster.sh: advertise_address=""
hack/local-up-cluster.sh: runtime_config=""
hack/make-rules/test-e2e-node.sh: image_project=${IMAGE_PROJECT:-"google-containers"}
hack/make-rules/test-e2e-node.sh: delete_instances=${DELETE_INSTANCES:-"false"}
hack/make-rules/test-e2e-node.sh: image_project=${IMAGE_PROJECT:-"kubernetes-node-e2e-images"}
hack/test-update-storage-objects.sh: local storage_backend=${1:-"${STORAGE_BACKEND_ETCD2}"}
hack/test-update-storage-objects.sh: local storage_media_type=${3:-""}
hack/test-update-storage-objects.sh: local storage_versions=${2:-""}
Expand Down

0 comments on commit 5c332e0

Please sign in to comment.