-
Notifications
You must be signed in to change notification settings - Fork 596
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
Refactored the docker build script to only only include the gatk bundle in order to shrink the docker image size #4955
Conversation
@jamesemery How big was the docker and how big is it now? |
@lbergelson |
@jamesemery So to clarify: including the size reductions to the base image, the total reduction will be around 1.6-1.8 GB, correct? |
Codecov Report
@@ Coverage Diff @@
## master #4955 +/- ##
================================================
- Coverage 80.797% 60.173% -20.624%
+ Complexity 17952 12779 -5173
================================================
Files 1095 1095
Lines 64609 64609
Branches 10394 10394
================================================
- Hits 52202 38877 -13325
- Misses 8379 21497 +13118
- Partials 4028 4235 +207
|
@droazen correct. |
4a44ec7
to
f2c2253
Compare
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.
@jamesemery A bunch of cleanup type things. I do think you should rename that second gradle script. Sharing code between them might be tricky, but at least put a comment in.
Looks good. Ready to merge once the final changes are resolved and the base image is updated.
.travis.yml
Outdated
@@ -20,7 +20,8 @@ env: | |||
#gradle needs this | |||
- TERM=dumb | |||
#limit gradle jvm memory and disable daemon | |||
- GRADLE_OPTS="-Xmx1024m -Dorg.gradle.daemon=false" | |||
- GRADLE_OPTS="-Xmx1024m" | |||
#Dorg.gradle.daemon=false" |
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.
delete
scripts/docker/gatkbase/Dockerfile
Outdated
apt-get upgrade -y && \ | ||
apt-get install -y python && \ | ||
apt-get install -y python3-pip && \ | ||
apt-get install --no-install-recommends -y wget curl unzip gcc python-dev python-setuptools git less lynx ## hdfview && \ |
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.
remove hdfview
build_docker.sh
Outdated
@@ -113,8 +112,22 @@ if [ -n "${IS_PUSH}" ]; then | |||
else | |||
RELEASE=false | |||
fi | |||
./gradlew clean bundle pythonPackageArchive shadowTestClassJar shadowTestJar -Drelease=$DRELEASE |
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.
it shouldn't do all the test jar stuff if you're not running tests
build.gradle
Outdated
* cloud, integration, unit : run one of the three disjoint partitions of the test suite | ||
* all : run all the tests | ||
* anything else : run the non-cloud tests | ||
* cloud, integration, unit, spark, python, bucket, funcotatorValidation : run one of the several disjoint partitions of the test suite |
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.
bucket and funcotatorValidation aren't valid options to TEST_TYPE
.travis.yml
Outdated
DOCKER_TAG=$TRAVIS_COMMIT; | ||
fi; | ||
sudo docker images; | ||
echo ${TEST_TYPE}; | ||
sudo mkdir -p build/reports/; | ||
sudo chmod -R a+w build/reports/; | ||
sudo docker run -v $(pwd)/src/test/resources:/testdata -v $(pwd)/build/reports/:/gatk/build/reports/ --rm -e "TEST_VERBOSITY=minimal" -e "TEST_TYPE=${TEST_TYPE}" -t broadinstitute/gatk:${DOCKER_TAG} bash --init-file /gatk/gatkenv.rc /root/run_unit_tests.sh; | ||
sudo docker run -v $(pwd):/gatksrc -v $(pwd)/testJars:/jars --rm -e "TEST_VERBOSITY=minimal" -e "TEST_TYPE=${TEST_TYPE}" -t broadinstitute/gatk:${DOCKER_TAG} bash --init-file /gatk/gatkenv.rc /root/run_unit_tests.sh; |
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.
Would this be better named gatk_root? its not just the source is it?
scripts/docker/build.gradle
Outdated
|
||
plugins { | ||
id "java" // set up default java compile and test tasks | ||
id 'maven' |
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.
I doubt we need maven here
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.
i think we need it to download jacoco? we point to maven central still.
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.
The maven plugin is for releasing to maven, not downloading from it. That's a core gradle thing I think.
scripts/docker/build.gradle
Outdated
buildscript { | ||
repositories { | ||
mavenCentral() | ||
jcenter() // for shadow plugin |
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.
You can drop jcenter from this one
scripts/docker/build.gradle
Outdated
} | ||
|
||
repositories { | ||
mavenCentral() |
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.
You can remove this whole block I think.
scripts/docker/build.gradle
Outdated
|
||
task unpackTestJar(type: Copy){ | ||
String testClassesJar = "$System.env.TEST_JAR" | ||
String testClassesDir = "$System.env.CP_DIR" |
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.
Add a comment explaining why this is necessary for future generations.
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.
and a description line
build.gradle
Outdated
} | ||
} | ||
|
||
tasks.withType(Test) { |
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.
You can put this back as just a modification of the test task since there's no second one here anymore.
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.
i'd actually rather leave it, because we are using warnings i would rather the two test methods that need to be updated in lock step are byte identical so its as easy as possible for someone to update.
…r necessary files for space concerns
0f0958d
to
63ec7e4
Compare
fixes #3930