forked from kubeflow/training-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add E2E tests that verify termination policy is handled correctly.
* Only the tests for v1alpha1 are enabled. A follow on PR will see if v1alpha2 is working and enable the tests for v1alpha2. * Fix versionTag logic; we need to allow for case where versionTag is an * To facilitate these E2E tests, we create a test server to be run as inside the replicas. This server allows us to control what the process does via RPC. This allows the test runner to control when a replica exits. * Test harness needs to route requests through the APIServer proxy * Events no longer appears to be showing up for all services / pods even though all services pods are being created. So we turn the failure into a warning instead of a test failure. * Print out the TFJob spec and events to aid debugging test failures. Fix kubeflow#653 test server Fixes: kubeflow#235 E2E test case for when chief is worker 0 Related: kubeflow#589 CI for v1alpha2
- Loading branch information
Showing
23 changed files
with
112,541 additions
and
65 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
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
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,11 @@ | ||
# Dockerfile used by out prow jobs. | ||
# The sole purpose of this image is to customize the command run. | ||
FROM python:3.6.5-slim | ||
MAINTAINER kubeflow-team | ||
|
||
RUN pip install flask requests | ||
RUN mkdir /opt/kubeflow | ||
COPY test_app.py /opt/kubeflow | ||
RUN chmod a+x /opt/kubeflow | ||
|
||
ENTRYPOINT ["python", "/opt/kubeflow/test_app.py"] |
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,52 @@ | ||
# 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/kubeflow-images-staging/tf-operator-test-server | ||
|
||
DIR := ${CURDIR} | ||
|
||
# List any changed files. We only include files in the notebooks directory. | ||
# because that is the code in the docker image. | ||
# In particular we exclude changes to the ksonnet configs. | ||
CHANGED_FILES := $(shell git diff-files --relative=test/test-server) | ||
|
||
ifeq ($(strip $(CHANGED_FILES)),) | ||
# Changed files is empty; not dirty | ||
# Don't include --dirty because it could be dirty if files outside the ones we care | ||
# about changed. | ||
TAG := $(shell date +v%Y%m%d)-$(shell git describe --always) | ||
else | ||
TAG := $(shell date +v%Y%m%d)-$(shell git describe --always --dirty)-$(shell git diff | shasum -a256 | cut -c -6) | ||
endif | ||
|
||
all: build | ||
|
||
# To build without the cache set the environment variable | ||
# export DOCKER_BUILD_OPTS=--no-cache | ||
build: | ||
docker build ${DOCKER_BUILD_OPTS} -t $(IMG):$(TAG) . | ||
@echo Built $(IMG):$(TAG) | ||
|
||
# Build but don't attach the latest tag. This allows manual testing/inspection of the image | ||
# first. | ||
push: build | ||
gcloud docker -- push $(IMG):$(TAG) | ||
@echo Pushed $(IMG):${TAG} | ||
|
||
push-latest: push | ||
gcloud container images add-tag --quiet $(IMG):$(TAG) $(IMG):latest --verbosity=info | ||
echo created $(IMG):latest |
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,7 @@ | ||
# Test Server | ||
|
||
This directory contains a simply python test server. This server is intended | ||
for use in E2E tests. The server is intended to run as the program invoked in the TFJob replicas. | ||
The server provides handlers like "/quit" that all allow the test harness to control what the | ||
process does (e.g. exit). This allows the test runner to create conditions intended to test | ||
various behaviors like restarts. |
Oops, something went wrong.