Skip to content

Fixed failing gatk-nightly Docker builds. #5759

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

Merged
merged 7 commits into from
Mar 7, 2019

Conversation

jamesemery
Copy link
Collaborator

Resolves #4965

…lt docker images rather than using the docker build

machinery
@jamesemery
Copy link
Collaborator Author

https://travis-ci.com/broadinstitute/gatk/builds/103260089 for an example of a running cron job docker build (it uploaded to both repos correctly)

@codecov-io
Copy link

codecov-io commented Mar 5, 2019

Codecov Report

Merging #5759 into master will decrease coverage by 0.003%.
The diff coverage is n/a.

@@               Coverage Diff               @@
##              master     #5759       +/-   ##
===============================================
- Coverage     86.985%   86.982%   -0.003%     
+ Complexity     31864     31861        -3     
===============================================
  Files           1943      1943               
  Lines         146770    146768        -2     
  Branches       16223     16223               
===============================================
- Hits          127668    127662        -6     
- Misses         13190     13192        +2     
- Partials        5912      5914        +2
Impacted Files Coverage Δ Complexity Δ
...utils/smithwaterman/SmithWatermanIntelAligner.java 50% <0%> (-30%) 1% <0%> (-2%)
...nder/utils/runtime/StreamingProcessController.java 67.299% <0%> (-1.422%) 33% <0%> (-1%)
...itute/hellbender/tools/walkers/mutect/Mutect2.java 84.091% <0%> (ø) 22% <0%> (ø) ⬇️
...ender/tools/walkers/annotator/InbreedingCoeff.java 86.207% <0%> (ø) 10% <0%> (ø) ⬇️
...ithwaterman/SmithWatermanIntelAlignerUnitTest.java 60% <0%> (ø) 2% <0%> (ø) ⬇️
.../broadinstitute/hellbender/engine/LocusWalker.java 79.245% <0%> (+1.467%) 15% <0%> (ø) ⬇️
...tute/hellbender/engine/spark/LocusWalkerSpark.java 87.179% <0%> (+2.179%) 13% <0%> (ø) ⬇️

Copy link
Contributor

@droazen droazen left a comment

Choose a reason for hiding this comment

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

@jamesemery Back to you with my comments

.travis.yml Outdated
- if [[ $TRAVIS_BRANCH == master && $TRAVIS_EVENT_TYPE == cron && $UPLOAD == true ]]; then
docker login --username=$DOCKER_SERVICE_LOGIN --password=$DOCKER_SERVICE_PASS;
$GCLOUD_HOME/gcloud components -q update gsutil;
gsutil ls -l gs://gatk-nightly-builds | grep gatk | sort -r -k 2 | grep -o '\S\+$' | tail -n +11 | xargs -I {} gsutil rm {};
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we currently mention the gs://gatk-nightly-builds bucket anywhere in our README? If not can we mention it?

.travis.yml Outdated
@@ -175,16 +175,24 @@ after_success:
fi;

# This creates and uploads the gatk zip file to the nightly build bucket, only keeping the 10 newest entries
# This also pokes the Dockerhub web api which is securely stored in the travis API with the variable "DOCKERHUB_URL"
# This also constructs the Docker image and uploads it to https://cloud.docker.com/u/broadinstitute/repository/docker/broadinstitute/gatk-nightly/
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we mention the nightly dockerhub repo in our README (if we don't already)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Its already mentioned. I added a line about the nightly zip folder in there.

.travis.yml Outdated
- if [[ $TRAVIS_BRANCH == master && $TRAVIS_EVENT_TYPE == cron && $UPLOAD == true ]]; then
docker login --username=$DOCKER_SERVICE_LOGIN --password=$DOCKER_SERVICE_PASS;
Copy link
Contributor

Choose a reason for hiding this comment

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

Are the values of these variables properly secured in travis?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, if you go into settings on travis you can see them. There is no way to extract the plaintext for the password (louis entered the username as unsecured). Furthermore perusing the logs it doesn't expose it when I type that command. Travis internally hides these variable names from the logs through some magic as well.

.travis.yml Outdated
echo "Triggering an automatic build on dockerhub";
curl -H "Content-Type:application/json" --data '{"build":true}' -X POST ${DOCKERHUB_URL};

sudo bash build_docker.sh -e ${TRAVIS_COMMIT} -s -u;
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to be run as root? If not, can you change this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, should you be specifying a staging dir via -d, or did you deliberately want to use the working dir?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The working dir in this case saves us having to pull from lfs again. The travis environment is also essentially an untouched gatk repo at this point anyway.

.travis.yml Outdated
$GCLOUD_HOME/gcloud components -q update gsutil;
gsutil ls -l gs://gatk-nightly-builds | grep gatk | sort -r -k 2 | grep -o '\S\+$' | tail -n +11 | xargs -I {} gsutil rm {};
./gradlew bundle;
ZIP_FILE="$(ls build/ | grep .zip)";
ZIP_FILE="$(ls build/ | grep SNAPSHOT.zip)";
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this grep will fail if we happen to be on a commit in master with a tag (eg., we are on version 4.1.0.0 exactly). Can you just grep for a zip file that starts with "gatk" instead?

.travis.yml Outdated
curl -H "Content-Type:application/json" --data '{"build":true}' -X POST ${DOCKERHUB_URL};

sudo bash build_docker.sh -e ${TRAVIS_COMMIT} -s -u;
DOCKER_TAG=$(docker images -q | head -n 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this guaranteed to be in the right order?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. It only builds one docker image on this machine (it will have downloaded the base image but its in descending order by newest)

.travis.yml Outdated

sudo bash build_docker.sh -e ${TRAVIS_COMMIT} -s -u;
DOCKER_TAG=$(docker images -q | head -n 1);
DATE=`date +%Y-%m-%d`;
Copy link
Contributor

Choose a reason for hiding this comment

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

Be consistent in your command substitution convention (backticks vs. $() )

.travis.yml Outdated
sudo bash build_docker.sh -e ${TRAVIS_COMMIT} -s -u;
DOCKER_TAG=$(docker images -q | head -n 1);
DATE=`date +%Y-%m-%d`;
DOCKER_UPLOAD=broadinstitute/gatk-nightly:$DATE-$(git describe)-SNAPSHOT;
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps this should end in -NIGHTLY-SNAPSHOT?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, rename DOCKER_UPLOAD to DOCKER_NIGHTLY_TAG

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay, its inconsistent with the previous syntax but only a handful of people use these so its probably fine chaning things up

.travis.yml Outdated
DATE=`date +%Y-%m-%d`;
DOCKER_UPLOAD=broadinstitute/gatk-nightly:$DATE-$(git describe)-SNAPSHOT;

echo "Pushing Docker image";
Copy link
Contributor

Choose a reason for hiding this comment

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

Pushing nightly docker image

@droazen droazen assigned jamesemery and unassigned droazen and lbergelson Mar 5, 2019
@jamesemery
Copy link
Collaborator Author

@droazen responded to your comments

Copy link
Member

@lbergelson lbergelson left a comment

Choose a reason for hiding this comment

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

Seems good to me.

@@ -103,7 +103,7 @@ releases of the toolkit.

You can download and run pre-built versions of GATK4 from the following places:

* A zip archive with everything you need to run GATK4 can be downloaded for each release from the [github releases page](https://github.com/broadinstitute/gatk/releases).
* A zip archive with everything you need to run GATK4 can be downloaded for each release from the [github releases page](https://github.com/broadinstitute/gatk/releases). We also host unstable archives generated nightly in the Google bucket gs://gatk-nightly-builds.
Copy link
Member

Choose a reason for hiding this comment

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

Do nightly builds ever age away or is dockerhub hosting all of our builds for all eternity?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

They just sit forever I believe. Its smart about compressing them/reusing layers but it doesn't seem like dockerhubs pricing scheme cares about the number of images hosted compared the the number of repositories but I could be wrong about that.

.travis.yml Outdated
$GCLOUD_HOME/gcloud components -q update gsutil;
gsutil ls -l gs://gatk-nightly-builds | grep gatk | sort -r -k 2 | grep -o '\S\+$' | tail -n +11 | xargs -I {} gsutil rm {};
./gradlew bundle;
ZIP_FILE="$(ls build/ | grep .zip)";
ZIP_FILE="$(ls build/ | grep '^gatk.*.zip$' | grep -iv python)";
Copy link
Member

Choose a reason for hiding this comment

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

One other option... we could make building /pushing the docker a gradle command. Probably best saved for another time though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thats not a bad idea. There are some nuances that wold be a bit of a pain to resolve

.travis.yml Outdated

echo "Pushing Nightly Docker image";
docker tag $DOCKER_TAG $DOCKER_NIGHTLY_TAG;
docker push $DOCKER_NIGHTLY_TAG;
Copy link
Member

Choose a reason for hiding this comment

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

Can we push these to our gcr test repo as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Having a discussion about this with @droazen I think we should do this in a separate PR.

@jamesemery
Copy link
Collaborator Author

@droazen do you have any final thoughts on this branch? I would like to get this in so I can reactivate the cron job tonight

Copy link
Contributor

@droazen droazen left a comment

Choose a reason for hiding this comment

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

👍 Merge when ready @jamesemery

@jamesemery jamesemery merged commit bd61efb into master Mar 7, 2019
@jamesemery jamesemery deleted the je_restoreKnightlyImages branch March 7, 2019 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants