-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a shell script to build and test #7
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
# | ||
# Locally builds the docker container and runs tests. | ||
# | ||
# The test sets to run (gpu, cpu, tpu) can be specified as arguments. By | ||
# default all tests are executed. | ||
|
||
PROJECT_ID="$(gcloud config get-value project)" | ||
if [ -z "${PROJECT_ID}" ]; then | ||
echo "You must set a project ID with `gcloud config set`" | ||
exit 1 | ||
fi | ||
|
||
MODEL="gs://deepvariant/models/DeepVariant/0.7.2/DeepVariant-inception_v3-0.7.2+data-wgs_standard" | ||
IMAGE="gcr.io/${PROJECT_ID}/gcp-deepvariant-docker:HEAD" | ||
|
||
docker build -t "${IMAGE}" . | ||
docker push "${IMAGE}" | ||
|
||
for profile in ${@:-cpu gpu tpu}; do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For TPU, one need to configure its project such that cloud-tpu has read access to the GCS bucket. Please add a comment on top with the following link https://cloud.google.com/tpu/docs/storage-buckets#storage_access There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was another thing I hit that made me feel the TPU runner wasn't quite ready for user consumption. This error wasn't surfaced in a very friendly way - I had to dig into the GKE logs to find out what the problem was. I can add a comment to the build file but it seems unlikely that anyone will see it. I think the better path is to check the IAM policy and issue a warning if it's not set properly (it's what our tooling should do, too). I'll look at doing that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a requirements for using cloud TPU explained in the cloud page. Automatically detecting it and issuing warning is a good feature. We also have a bug for better GKE error reporting, maybe we should convert all the outstanding bugs into Github issues. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes any outstanding bugs should be migrated to Github issues: please assign all the outstanding bugs to me and I'll migrate them. |
||
echo "Running ${profile} tests" | ||
docker run -v "${HOME}/.config:/root/.config" \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Copy pasting from prv PR " @kemp-google This is also significantly faster than using cloud build. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The benefit is in line with DRY principals, this script is basically replicating what is instructed in cloudbuild.yaml. For example, upon new model release, you need to update model var in both places. If you still thinks having it here outweighs what I mentioned, you may want to model var and anything else can be moved to run_and_verify.sh (so we have a single point of future change). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both cloudbuild.yaml and this script pass model value to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I understand what you were trying to say above now. Yes, moving it into run_and_verify seems like a reasonable change. I'll send a PR to do that and then rebase this change. |
||
"${IMAGE}" \ | ||
/opt/deepvariant_runner/bin/run_and_verify.sh \ | ||
"${PROJECT_ID}" HEAD "${MODEL}" "${profile}" | ||
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify, we are going to have all these 3 tests regardless of whether or not we have GPU or TPU in our public docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, as long as the code is in the repository we should test it.