-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Argo workflow to run E2E tests (#72)
* Create an Argo workflow to run the E2E test for Kubeflow deployment * Create a ksonnet app for deploying Argo in our test infrastructure * Create a ksonnet component to trigger the E2E workflow. * Add tensorflow/k8s as a git submodule because we want to reuse some python scripts in that project to write our tests. * bootstrap.sh is the entrypoint for our prow jobs It will be used to check out the repo at the commit corresponding to the prow job and then invoke a test script in the repo. This ensures that the bulk of our test logic is pulled from the repo at the commit being tested. * checkout.sh is a script for checking out the source to be used as the first step in our workflows The Argo workflow uses an NFS share to store test data so that we can have multiple steps running in parallel and accessing the same files.
- Loading branch information
Showing
28 changed files
with
77,025 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "tensorflow_k8s"] | ||
path = tensorflow_k8s | ||
url = https://github.com/tensorflow/k8s.git |
Submodule tensorflow_k8s
added at
ed7cae
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# Docker image for running E2E tests using Argo. | ||
|
||
FROM python:2.7-slim | ||
MAINTAINER Jeremy Lewi | ||
|
||
# Never prompt the user for choices on installation/configuration of packages | ||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV TERM linux | ||
|
||
# Define en_US. | ||
ENV LANGUAGE=en_US.UTF-8 \ | ||
LANG=en_US.UTF-8 \ | ||
LC_ALL=en_US.UTF-8 \ | ||
LC_CTYPE=en_US.UTF-8 \ | ||
LC_MESSAGES=en_US.UTF-8 \ | ||
LC_ALL=en_US.UTF-8 | ||
|
||
|
||
# buildDeps should be packages needed only to build some other packages as | ||
# these packages are purged in a later step. | ||
# | ||
# gcc & python-dev are needed so we can install crcmod for gsutil | ||
RUN set -ex \ | ||
&& apt-get update -yqq \ | ||
&& apt-get install -yqq --no-install-recommends \ | ||
curl \ | ||
locales \ | ||
wget \ | ||
ca-certificates \ | ||
git \ | ||
zip \ | ||
unzip \ | ||
gcc python-dev \ | ||
python-setuptools \ | ||
&& apt-get clean \ | ||
&& rm -rf \ | ||
/var/lib/apt/lists/* \ | ||
/tmp/* \ | ||
/var/tmp/* \ | ||
/usr/share/man \ | ||
/usr/share/doc \ | ||
/usr/share/doc-base | ||
|
||
# Set the locale | ||
RUN sed -i 's/^# en_US.UTF-8 UTF-8$/en_US.UTF-8 UTF-8/g' /etc/locale.gen \ | ||
&& locale-gen \ | ||
&& update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 | ||
|
||
# Install go | ||
RUN cd /tmp && \ | ||
wget -O /tmp/go.tar.gz https://redirector.gvt1.com/edgedl/go/go1.9.2.linux-amd64.tar.gz && \ | ||
tar -C /usr/local -xzf go.tar.gz | ||
|
||
# Install gcloud | ||
ENV PATH=/google-cloud-sdk/bin:/workspace:${PATH} \ | ||
CLOUDSDK_CORE_DISABLE_PROMPTS=1 | ||
|
||
RUN wget -q https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.tar.gz && \ | ||
tar xzf google-cloud-sdk.tar.gz -C / && \ | ||
rm google-cloud-sdk.tar.gz && \ | ||
/google-cloud-sdk/install.sh \ | ||
--disable-installation-options \ | ||
--bash-completion=false \ | ||
--path-update=false \ | ||
--usage-reporting=false && \ | ||
gcloud components install alpha beta kubectl | ||
|
||
# Install CRCMOD for gsutil | ||
RUN easy_install -U pip && \ | ||
pip install -U crcmod | ||
|
||
# Install Helm | ||
RUN wget -O /tmp/get_helm.sh \ | ||
https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get && \ | ||
chmod 700 /tmp/get_helm.sh && \ | ||
/tmp/get_helm.sh && \ | ||
rm /tmp/get_helm.sh | ||
|
||
# Initialize helm | ||
RUN helm init --client-only | ||
|
||
# Install ksonnet | ||
RUN curl -o /usr/local/bin/ks -L \ | ||
https://github.com/ksonnet/ksonnet/releases/download/v0.8.0/ks-linux-amd64 && \ | ||
chmod a+x /usr/local/bin/ks | ||
|
||
# Install various python libraries. | ||
RUN pip install --upgrade six pyyaml google-api-python-client \ | ||
google-cloud-storage google-auth-httplib2 pylint kubernetes==4.0.0 mock retrying | ||
|
||
COPY bootstrap.sh /usr/local/bin | ||
RUN chmod a+x /usr/local/bin/bootstrap.sh | ||
|
||
COPY checkout.sh /usr/local/bin | ||
RUN chmod a+x /usr/local/bin/checkout.sh | ||
|
||
ENTRYPOINT ["/usr/local/bin/bootstrap.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Copyright 2017 The Kubernetes Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# Requirements: | ||
# https://github.com/mattrobenolt/jinja2-cli | ||
# pip install jinja2-clie | ||
IMG = gcr.io/mlkube-testing/kubeflow-testing | ||
TAG := $(shell date +v%Y%m%d)-$(shell git describe --tags --always --dirty)-$(shell git diff | sha256sum | cut -c -6) | ||
DIR := ${CURDIR} | ||
|
||
all: build | ||
|
||
# To build without the cache set the environment variable | ||
# export DOCKER_BUILD_OPTS=--no-cache | ||
build: | ||
@echo {\"image\": \"$(IMG):$(TAG)\"} > version.json | ||
docker build ${DOCKER_BUILD_OPTS} -t $(IMG):$(TAG) . | ||
docker tag $(IMG):$(TAG) $(IMG):latest | ||
@echo Built $(IMG):$(TAG) and tagged with latest | ||
|
||
push: build | ||
gcloud docker -- push $(IMG):$(TAG) | ||
gcloud docker -- push $(IMG):latest | ||
@echo Pushed $(IMG) with :latest and :$(TAG) tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
# | ||
# This script is used to bootstrap our prow jobs. | ||
# The point of this script is to check out the google/kubeflow repo | ||
# at the commit corresponding to the Prow job. We can then | ||
# invoke the launcher script at that commit to submit and | ||
# monitor an Argo workflow | ||
set -xe | ||
|
||
mkdir -p /src | ||
git clone https://github.com/google/kubeflow.git /src/google_kubeflow | ||
|
||
cd /src/google_kubeflow | ||
|
||
echo Job Name = ${JOB_NAME} | ||
|
||
# See https://github.com/kubernetes/test-infra/tree/master/prow#job-evironment-variables | ||
if [ ! -z ${PULL_NUMBER} ]; then | ||
git fetch origin pull/${PULL_NUMBER}/head:pr | ||
git checkout ${PULL_PULL_SHA} | ||
else | ||
if [ ! -z ${PULL_BASE_SHA} ]; then | ||
# Its a post submit; checkout the commit to test. | ||
git checkout ${PULL_BASE_SHA} | ||
fi | ||
fi | ||
|
||
# Update submodules. | ||
git submodule init | ||
git submodule update | ||
|
||
# Print out the commit so we can tell from logs what we checked out. | ||
echo Repo is at `git describe --tags --always --dirty` | ||
git submodule | ||
git status |
Oops, something went wrong.