Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Create a prow test harness #40

Merged
merged 13 commits into from
Feb 8, 2018
Merged

Conversation

artasparks
Copy link
Contributor

Based off the kubeflow test harness, this is a container that'll get pulled down and run by prow. It currently:

  • Lints
  • Runs the python tests.

In the future, it'd be awesome to spin up clusters.

@artasparks
Copy link
Contributor Author

artasparks commented Feb 2, 2018

Partially addresses #24

@artasparks
Copy link
Contributor Author

Also, @cjwagner -- fyi

@@ -0,0 +1,41 @@
#!/bin/bash
#
# This script is used to bootstrap our prow jobs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's a prow job?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha, thanks. I meant i wanted a comment from @Kashomon here ;) I'm still looking for a one-sentence explanation of what it is and why i want it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How's this

# The point of this script is to check out the kubeflow/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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and what's an argo workflow. (1 sentence)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I need to remove that. That's some copy pasta.

testing/Makefile Outdated

build:
mkdir -p staging
cp ../requirements-cpu.txt staging/requirements-cpu.txt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you need to copy the python files in here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. Those are pulled in via bootstrap.sh from github. I pull in the requirements so I can preload them (which isn't strictly required).

RUN chmod a+x /usr/local/bin/bootstrap.sh

# We could pre-load requirements to make running the tests
# faster, but this requires rebuilding every time we have a new dep.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please forgive my ignorance: is this something that is run for automated tests only? Or is the idea that local devs also run their tests this way?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's only for automated tests, but I will probably create a local version for testing.

@@ -0,0 +1,41 @@
#!/bin/bash
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of writing your own bootstrap script to handle checking out the code you should consider using ours. In addition to checking out the repo at the correct commit and merging the PR changes before testing, our script uploads logs to a GCS bucket. This provides persistence (pod logs are only around until the pod is deleted by sinker) and allows logs and test results to be consumed by https://k8s-gubernator.appspot.com.

You can use the 'execute' bootstrap scenario to run your tests if you move the test commands (looks like the last 3 commands in this file) into a shell script.
To configure bootstrap to use the execute scenario to run your test you will need to add an entry like this to config.json. Here is the prowjob config for that same job so you have a complete example to look through.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know quite how to evaluate this option. I'll come chat with you about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I think probably the best way to go is to merge this as-is (since it's working locally) and then to rebase it to use your python runner.

@amj amj assigned amj and unassigned amj Feb 3, 2018
@@ -16,4 +16,17 @@

source ./common.sh

envsubst < gpu-player.yaml | kubectl apply -f -
# envsubst doesn't exist for OSX. needs to be brew-installed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

obsolete comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be changed any longer.


source ./common.sh

# envsubst doesn't exist for OSX. needs to be brew-installed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

obsolete comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be changed any longer.

@@ -53,8 +53,10 @@ RUN chmod a+x /usr/local/bin/bootstrap.sh

# We could pre-load requirements to make running the tests
# faster, but this requires rebuilding every time we have a new dep.
COPY staging/requirements-cpu.txt /tmp/requirements-cpu.txt
COPY staging/requirements.txt /tmp/requirements.txt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did this go into /tmp?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I dunno. Made the workdir /testing and put it there.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems fine.

@artasparks artasparks merged commit 71d5f4f into tensorflow:master Feb 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants