Skip to content

Instantly share code, notes, and snippets.

@leblancd
Last active April 18, 2018 21:02
Show Gist options
  • Save leblancd/62ad517a01049ba9c614af4b500077f3 to your computer and use it in GitHub Desktop.
Save leblancd/62ad517a01049ba9c614af4b500077f3 to your computer and use it in GitHub Desktop.
Testing GCE DinD IPv6 CI Prow Container
Set up a GCE account, and create a json service account key, and store in /etc/service-account/service-account.json
========================================================
Set up a GCE bucket (I used "gs://my-kubernetes-jenkins")
========================================================
Patch in the following temporary change before building Prow container:
cd $GOPATH/src/k8s.io/test-infra
cat << EOT > temp_patch.txt
images/gce-dind/runner
21c21,25
< git clone https://github.com/kubernetes/test-infra
---
> #### TEMP CHANGE: Since the changes that we want to test have not been
> #### merged, we need to clone the test-infra scripts from
> #### our own fork, rather than the upstream HEAD.
> #### git clone https://github.com/kubernetes/test-infra
> git clone -b testing_gce_dind https://github.com/leblancd/test-infra
EOT
patch -p1 < temp_patch.txt
========================================================
Build the Prow container:
cd $GOPATH/src/k8s.io/test-infra/images/gce-dind
make
========================================================
NOTE: The following instructions use this Kubernetes commit to test:
master:97892854cfa736315378cc2c206a7f4b3e190d05,61987:0f23756d4955f221547f5de4f0b1f9e323a160cc
========================================================
Set up Environment Variable list to Pass to Container:
cd <SOME-ARBITRARY-WORKSPACE-DIRECTORY>
cat << EOT > ./env.list
# Simulate Environment Variables Being Set by Prow
JOB_NAME=pull-kubernetes-e2e-gce-dind-ipv6
PROJECT=dind-v6
REPO_OWNER=kubernetes
REPO_NAME=$REPO_NAME
PULL_BASE_REF=master
PULL_BASE_SHA=97892854cfa736315378cc2c206a7f4b3e190d05
PULL_NUMBER=61987
PULL_PULL_SHA=0f23756d4955f221547f5de4f0b1f9e323a160cc
PULL_REFS=$PULL_REFS
WORKSPACE=/workspace
# Simulate Environment Variables Being Set by Pod Manifest in test-infra/prow/config.yaml
USER=prow
GOOGLE_APPLICATION_CREDENTIALS=/etc/service-account/service-account.json
JENKINS_GCE_SSH_PRIVATE_KEY_FILE=/etc/ssh-key-secret/ssh-private
JENKINS_GCE_SSH_PUBLIC_KEY_FILE=/etc/ssh-key-secret/ssh-public
SKIP_RELEASE_VALIDATION=true
EOT
========================================================
Simulate Addition of Command Line Arguments by Pod Manifest in test-infra/prow/config.yaml
export REPO_NAME=kubernetes
export PULL_REFS=master:97892854cfa736315378cc2c206a7f4b3e190d05,61987:0f23756d4955f221547f5de4f0b1f9e323a160cc
export MY_GS_BUCKET=gs://my-kubernetes-jenkins
export ARG_LIST="--repo=k8s.io/$REPO_NAME=$PULL_REFS --repo=github.com/Mirantis/kubeadm-dind-cluster=k8s-1.10 --upload=$MY_GS_BUCKET --git-cache=/root/.cache/git --timeout=75 --clean"
========================================================
Run the Container:
NOTE: Set the PROW_IMAGE_VERSION to the version of Prow container that was built above
export PROW_IMAGE=e2e-gce-dind
export PROW_IMAGE_VERSION=v20180417-c11fd8c
docker run --privileged --env-file ./env.list -v /workspace/service-account:/etc/service-account -v /workspace/.ssh:/etc/ssh-key-secret gcr.io/k8s-testimages/$PROW_IMAGE:$PROW_IMAGE_VERSION $ARG_LIST
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment