Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
384 commits
Select commit Hold shift + click to select a range
ecd64a1
simplify fastai tests imports
rosbo Oct 15, 2018
2b4f933
Merge pull request #343 from Kaggle/simplify-test-ai-imports
rosbo Oct 15, 2018
79e96f0
Install fastai from source and pinned version
rosbo Oct 15, 2018
e37e359
Merge pull request #344 from Kaggle/fast-from-src
rosbo Oct 15, 2018
bcda2d4
Prevent fastai install from downgrading pytorch
rosbo Oct 15, 2018
23270a6
Merge pull request #345 from Kaggle/pip-install-fix
rosbo Oct 15, 2018
8a430bb
Remove fastai tests using 1.x api
rosbo Oct 15, 2018
81c9412
Merge pull request #346 from Kaggle/fix-fastai-tests
rosbo Oct 15, 2018
2aa9b9c
Prune images previously built to prevent permanent gpu worker from fi…
rosbo Oct 15, 2018
5a4e43c
Merge pull request #347 from Kaggle/rosbo-patch-1
rosbo Oct 15, 2018
6eb31c1
Update README to mention that GCR is the source of truth for our dock…
rosbo Oct 15, 2018
580df78
Merge pull request #348 from Kaggle/gcr
rosbo Oct 15, 2018
549f89a
Prevent upgrade of matplotlib
rosbo Oct 19, 2018
037c1d2
Merge pull request #350 from Kaggle/rosbo-patch-1
rosbo Oct 19, 2018
8048a37
Upgrade anaconda base to 5.2.0
rosbo Oct 19, 2018
6213dce
Merge pull request #352 from Kaggle/bump-anaconda-base
rosbo Oct 22, 2018
eb7b055
install fasttesxt using pip git feature
rosbo Oct 26, 2018
1aaf589
Merge pull request #354 from Kaggle/fix-fasttext
rosbo Oct 26, 2018
736bad3
Don't preload tensorflow and torch
rosbo Oct 26, 2018
6694e89
Merge pull request #355 from Kaggle/sitecustomize
rosbo Oct 26, 2018
f9c4830
Add libGl1 to satisfy vtk depenencies
chrisgorgo Oct 28, 2018
5389746
adding xvfb
chrisgorgo Oct 28, 2018
035f3d1
adding xvfbwrapper test
chrisgorgo Oct 29, 2018
8b04aae
adding test for dipy renderer
chrisgorgo Oct 29, 2018
1e73362
adding vtk import test
chrisgorgo Oct 29, 2018
4092ef1
Merge pull request #360 from chrisfilo/enh/add_xvfb
rosbo Oct 29, 2018
95adc6d
Merge branch 'master' into fix/vtk_deps
rosbo Oct 29, 2018
9f93f20
Merge pull request #358 from chrisfilo/fix/vtk_deps
rosbo Oct 29, 2018
67b8d33
Preload tensorflow
rosbo Oct 30, 2018
756a888
Merge pull request #363 from Kaggle/rosbo-patch-1
rosbo Oct 30, 2018
ff8079a
Fix broken link in README
jruales Oct 31, 2018
4c6ed0f
Install latest version of seaborn
rosbo Nov 12, 2018
3a2c839
fix-typo-comment
rosbo Nov 12, 2018
6feb35f
Merge pull request #371 from Kaggle/seaborn-min-requirements
rosbo Nov 12, 2018
429dec5
Install h2o dependencies
rosbo Nov 13, 2018
5b9224e
Add tests for h2o
rosbo Nov 13, 2018
3fc7e45
Merge pull request #372 from Kaggle/fix-h2o
rosbo Nov 13, 2018
0020fba
close h2o session in test
rosbo Nov 13, 2018
a0a46be
Merge pull request #373 from Kaggle/add-talos
rosbo Nov 13, 2018
b0fb47d
Merge pull request #364 from jruales/patch-1
rosbo Nov 16, 2018
8fcae61
adding kaggle api
wendykan Nov 19, 2018
4049932
Update ImageMagick binary url
rosbo Nov 20, 2018
f51e841
Merge pull request #378 from Kaggle/rosbo-patch-1
rosbo Nov 20, 2018
922c5a9
Remove the kaggle api package
rosbo Nov 21, 2018
e10c4bc
Merge pull request #381 from Kaggle/rosbo-patch-1
rosbo Nov 21, 2018
5976f3c
Create process to prebuild tensorflow wheels
rosbo Sep 18, 2018
3773879
Add TODOs and improve build/push script
rosbo Nov 27, 2018
52b051e
fix typo
rosbo Nov 27, 2018
24765fc
add comment about copying cuda libraries binaries from the tensorflow…
rosbo Nov 27, 2018
35139f6
Merge pull request #302 from Kaggle/build-tensorflow-whl
rosbo Nov 27, 2018
d36e68d
Install rgf
rosbo Nov 29, 2018
cb2a936
add test
rosbo Nov 29, 2018
4cfa745
formatting
rosbo Nov 29, 2018
970af04
Merge pull request #386 from Kaggle/rgf
rosbo Nov 29, 2018
f9974b2
Add basic import tests for packages installed in editable mode
rosbo Nov 30, 2018
dd6ff75
Install all packages in non-editable mode
rosbo Nov 30, 2018
df732ac
Merge pull request #389 from Kaggle/non-editable-installs
rosbo Nov 30, 2018
0e0a2dc
Put back bq_helper in editable mode and install cleverhans from pypi.
rosbo Nov 30, 2018
604efce
Merge pull request #390 from Kaggle/rosbo-patch-1
rosbo Nov 30, 2018
eb3f09f
Cleanup useless files for each image layers
rosbo Nov 30, 2018
bf0bac6
Merge pull request #391 from Kaggle/reduce-image-size
rosbo Dec 3, 2018
c1b8c5b
Compare package versions with prod
rosbo Dec 6, 2018
ab4f793
fix Jenkinsfile
rosbo Dec 6, 2018
f18077a
compare gpu package versions
rosbo Dec 6, 2018
b504891
Improve description
rosbo Dec 6, 2018
fd68e18
fix jenkins file
rosbo Dec 6, 2018
4a03d2b
set agent properly for GPU
rosbo Dec 6, 2018
f8f62fc
Fix Jenkinsfile
rosbo Dec 6, 2018
2d67869
Expect failures
rosbo Dec 6, 2018
c33c004
improve corner cases handling
rosbo Dec 6, 2018
fd1f373
fix jenkinsfile to properly diff gpu
rosbo Dec 7, 2018
f924d1c
Merge pull request #394 from Kaggle/package-diff-ci
rosbo Dec 7, 2018
7863e78
Use single quote whenever possible
rosbo Dec 7, 2018
3c87d00
Merge pull request #396 from Kaggle/use-single-quote-whenever-possible
rosbo Dec 7, 2018
ea63ad9
install fastai 1.0
rosbo Dec 7, 2018
e1049f3
update fastai tests to use 1.0 api
rosbo Dec 10, 2018
f0f882e
Merge pull request #399 from Kaggle/torch-v1
rosbo Dec 11, 2018
35d4df0
Pin dipy to 0.14.0
rosbo Dec 14, 2018
801533b
Merge pull request #401 from Kaggle/rosbo-patch-1
rosbo Dec 14, 2018
ac9f0c1
Reduce wget verbosiness
rosbo Dec 14, 2018
153c087
Merge pull request #402 from Kaggle/rosbo-patch-1
rosbo Dec 14, 2018
4ac55e3
Explicitly install bazel version 0.15.0
pricebenjamin Dec 17, 2018
0779625
Merge pull request #405 from pricebenjamin/master
rosbo Dec 17, 2018
213051a
Add comments about Bazel version pinning.
rosbo Dec 17, 2018
276d4aa
Merge pull request #406 from Kaggle/rosbo-patch-1
rosbo Dec 17, 2018
78053be
Build tensorflow wheels with Jenkins
rosbo Dec 15, 2018
df12b19
Upgrade to cuda 9.2 and tf 0.12.0
rosbo Dec 15, 2018
e2d4b7e
Add CHANGELOG entry
rosbo Dec 17, 2018
d9181d4
Update NVIDIA_REQUIRE_CUDA
rosbo Dec 17, 2018
901f759
Standardized changelog entry
rosbo Dec 17, 2018
16ff81a
Allow running test suites against arbitrary images
rosbo Dec 17, 2018
a8b31f3
Merge pull request #409 from Kaggle/test-gcr-images
rosbo Dec 18, 2018
d3feadc
Merge pull request #408 from Kaggle/cuda-9.2-ci
rosbo Dec 18, 2018
aa64f17
Update to cuda 9.2 & tensorflow 1.12
rosbo Dec 17, 2018
580dec4
add cudart-dev package
rosbo Dec 17, 2018
f528061
Add gitignore with pyc extension
vimota Dec 19, 2018
e301c2a
Push image to gcr.io even if tests fail
rosbo Dec 19, 2018
6aaafdf
Merge pull request #412 from Kaggle/push-untested-gcr
rosbo Dec 19, 2018
523749c
Pin fbprophet to 0.3post2
rosbo Dec 20, 2018
f27e6f1
add link to gh issue
rosbo Dec 20, 2018
2923549
Merge pull request #413 from Kaggle/fix-fbprophet
rosbo Dec 20, 2018
694c413
Merge pull request #410 from Kaggle/upgrade-tf-cuda-ci
rosbo Dec 20, 2018
b9de164
Merge branch 'master' into bigquery
vimota Dec 20, 2018
4bd7c38
Adds initial monkeypatching of BigQuery client with skeleton support …
vimota Dec 20, 2018
50fe9eb
Added cupy-cuda91 and pynvrtc to GPU Dockerfile.
guitarmind Dec 15, 2018
02ffc7d
install cupy for cuda 9.2
rosbo Dec 21, 2018
b3c2954
Merge pull request #416 from Kaggle/cupy
rosbo Dec 21, 2018
a160884
Overhaul our README file
rosbo Dec 21, 2018
ac1d799
Update tensorflow wheels documentation
rosbo Dec 21, 2018
81b0994
Merge pull request #417 from Kaggle/rosbo-patch-2
rosbo Dec 21, 2018
6273f93
Add instructions to run the kernels images
rosbo Dec 21, 2018
7756f7d
Merge pull request #418 from Kaggle/rosbo-patch-1
rosbo Dec 21, 2018
114f59a
Add link to diagnostics instructions when running our GPU image
rosbo Dec 21, 2018
eef661a
Merge pull request #419 from Kaggle/rosbo-patch-1
rosbo Dec 21, 2018
a1c5b9c
Cron trigger Jenkins pipeline less frequently
rosbo Dec 21, 2018
a7c9360
Merge pull request #420 from Kaggle/rosbo-patch-1
rosbo Dec 21, 2018
002b910
Apply suggestions from code review
rosbo Dec 21, 2018
469992b
remove tensorflow preloading
rosbo Dec 21, 2018
dbbc5ed
Merge pull request #421 from Kaggle/rm-tf-preloading
rosbo Dec 21, 2018
90547dc
add option to run specific tests
rosbo Dec 21, 2018
34006f2
Merge pull request #422 from Kaggle/test-p-flag
rosbo Dec 21, 2018
e193ccc
Make BigQuery tests more robust: use scoped environment variables and…
vimota Dec 21, 2018
9e15f68
Merge branch 'bigquery' of github.com:Kaggle/docker-python into bigquery
vimota Dec 21, 2018
0688619
Update readme wiki link
nlathia Dec 22, 2018
40f1b8c
Add pytext-nlp
nlathia Dec 22, 2018
38b348e
Update README.md
rosbo Jan 2, 2019
eae8caa
docs: fix broken link
orisano Jan 3, 2019
38f2f6c
Update tag from untested to pretest
rosbo Jan 3, 2019
15c43b4
Merge pull request #427 from Kaggle/rosbo-patch-1
rosbo Jan 3, 2019
499a7ea
Merge pull request #426 from orisano/patch-1
rosbo Jan 3, 2019
55caf21
add tsfresh
rosbo Jan 3, 2019
e22fafe
Merge pull request #428 from Kaggle/add-tsfresh
rosbo Jan 3, 2019
d734b86
Merge branch 'master' into master
nlathia Jan 3, 2019
5eb393a
Add pytext smoke test
nlathia Jan 3, 2019
ce9a9fe
Merge pull request #423 from nlathia/master
rosbo Jan 4, 2019
ddf0170
Merge branch 'master' into bigquery
vimota Jan 4, 2019
ba8e462
Addressed mostly nits from code review and made tests safer but unset…
vimota Jan 6, 2019
da1b91e
Add docstring and another nit.
vimota Jan 7, 2019
be0a51d
Add magnitude and tests
alexsands Jan 8, 2019
2922af0
Merge pull request #430 from acsands13/acsands13/add-magnitude
rosbo Jan 8, 2019
956d924
Increase verbosity of test log
rosbo Jan 8, 2019
152df47
Merge pull request #431 from Kaggle/verbose-test
rosbo Jan 8, 2019
f40cb02
Add pykalman and tests
Jan 9, 2019
cbadf5c
Add conv2d test for tensorflow
rosbo Jan 9, 2019
2e4e184
add tensorflow cudnn test
rosbo Jan 9, 2019
72fb1a0
init tf session
rosbo Jan 9, 2019
669ebe7
add kernel initializer
rosbo Jan 9, 2019
32f5297
call build on gru
rosbo Jan 9, 2019
f541160
reduce sum
rosbo Jan 9, 2019
c00785c
switch to cudnn lstm test
rosbo Jan 10, 2019
dab6b38
Merge pull request #435 from Kaggle/tf-cudnn-fix
rosbo Jan 10, 2019
50936e4
Separate Data Proxy monkeypatching into a distinct kaggle library and…
vimota Jan 10, 2019
6c9e75d
Merge branch 'master' into bigquery
vimota Jan 10, 2019
3855cf7
Remove HOST and PORT constant from test, get from env var instead.
vimota Jan 10, 2019
fba9b05
Make Connection object private and rename DataProxyClient to PublicBi…
vimota Jan 11, 2019
69dbd81
Remove unnecessary file
marketneutral Jan 11, 2019
89265ba
Merge pull request #433 from marketneutral/pykalman
rosbo Jan 11, 2019
2653b37
Rename kaggle.py to kaggle_gcp.py which will then be imported into th…
vimota Jan 12, 2019
96ed865
Add todo and bigquery client issue I created.
vimota Jan 12, 2019
411b654
Add comment about kaggle_gcp module path.
vimota Jan 15, 2019
e3ed97a
Pin numpy
rosbo Jan 15, 2019
d7e7375
Merge pull request #440 from Kaggle/rosbo-patch-1
rosbo Jan 15, 2019
8720d3f
Merge pull request #414 from Kaggle/bigquery
vimota Jan 15, 2019
e6d8c2b
Leave the numpy version from anaconda (1.15.4)
rosbo Jan 16, 2019
1335b5d
Merge pull request #441 from Kaggle/rosbo-patch-1
rosbo Jan 16, 2019
a766f9e
Upgrade numpy and scikit-image
rosbo Jan 16, 2019
44a71ce
Merge pull request #442 from Kaggle/fix-scikit
rosbo Jan 16, 2019
8c988ed
upgrade numpy later in the build process
rosbo Jan 16, 2019
16330bb
Merge pull request #443 from Kaggle/rosbo-patch-1
rosbo Jan 16, 2019
8805a1b
ignore .idea for pycharm users
Jan 19, 2019
b51d13c
Remove pin for scikit-image
rosbo Jan 29, 2019
a192699
Merge pull request #459 from Kaggle/rosbo-patch-1
rosbo Jan 29, 2019
5fe2113
Pin pip to 18.1
rosbo Jan 30, 2019
b424565
Merge pull request #460 from Kaggle/rosbo-patch-1
rosbo Jan 30, 2019
8ac8bd2
install keras and keras-rl from pip
rosbo Jan 30, 2019
4d7b4e1
Merge pull request #461 from Kaggle/fix-keras
rosbo Jan 30, 2019
428c6e9
pin fitter to 1.0.9
rosbo Jan 30, 2019
7e8193c
Merge pull request #462 from Kaggle/fix-fitter
rosbo Jan 30, 2019
976b4cf
install latest version of skikit-image
rosbo Jan 30, 2019
46200e1
pin pandas to fix tsfresh
rosbo Jan 30, 2019
641c8ac
pin geoviews
rosbo Jan 30, 2019
0741d0f
Merge pull request #463 from Kaggle/fix-build
rosbo Jan 30, 2019
a4b1920
Pin flake8 to a specific version
rosbo Jan 30, 2019
beb760f
Merge pull request #464 from Kaggle/rosbo-patch-1
rosbo Jan 30, 2019
d52c6f9
Adds UserSecretsClient library to communicate with WebTier UserSecret…
vimota Jan 31, 2019
5438d79
Addresses nits from PR. Mostly naming and spaces.
vimota Feb 1, 2019
b8ab09e
Rename purpose to Target. Remove the general user secret case.
vimota Feb 1, 2019
13f4f99
Merge pull request #465 from Kaggle/bigquery
vimota Feb 1, 2019
01ffe60
R
rosbo Feb 2, 2019
7030951
Run the Jenkins pipeline 3x a week
rosbo Feb 7, 2019
3745c76
Merge pull request #468 from Kaggle/rosbo-patch-1
rosbo Feb 7, 2019
bdb4d1e
Remove pin for keras_(applicatons|preprocessing)
rosbo Feb 8, 2019
72ed9c7
Merge pull request #469 from Kaggle/remove-keras-app-pre-pin
rosbo Feb 8, 2019
61e8e8a
Merge branch 'master' into gitignore
rosbo Feb 8, 2019
8609af8
Merge pull request #448 from corochann/gitignore
rosbo Feb 8, 2019
9b137a0
Adds better error handling to kaggle_secrets.py and calls UserSecrets…
vimota Feb 9, 2019
51a3826
keep pandas to version compatible with tsfresh
rosbo Feb 11, 2019
19427dd
Merge pull request #474 from Kaggle/fix-tsfresh
rosbo Feb 11, 2019
cb59011
Add back spaces to end of file.
vimota Feb 11, 2019
570cbd1
Merge pull request #473 from Kaggle/user_secrets
vimota Feb 11, 2019
ede9d48
Update test_user_secrets to expect a POST request instead of GET.
vimota Feb 11, 2019
f92a4a0
Merge pull request #476 from Kaggle/user_secrets
vimota Feb 11, 2019
6a8587b
Allow overriding target in diff script
rosbo Feb 12, 2019
539e275
Merge pull request #477 from Kaggle/diff-target
rosbo Feb 12, 2019
a6e8cdd
Tag @kernels-backend-ops on pipeline failure.
rosbo Feb 13, 2019
49a71ed
Don't post to slack at every steps
rosbo Feb 13, 2019
6be9b50
Merge pull request #478 from Kaggle/quiet-jenkins-ping
rosbo Feb 14, 2019
c9a6240
Fix @kernels-backend-ops tagging
rosbo Feb 14, 2019
02f8400
Merge pull request #479 from Kaggle/fix-tag
rosbo Feb 14, 2019
fcdbd18
Add optuna.
toshihikoyanase Feb 20, 2019
e93e2fb
Add MXNet-GPU and GluonCV & GluonNLP
Feb 20, 2019
d4dbd12
Remove MKL in case it is not supported by the host
Feb 20, 2019
9fa062c
Install PyTorch for cuda 9
rosbo Feb 20, 2019
7d2b481
Merge pull request #483 from Kaggle/rosbo-patch-1
rosbo Feb 20, 2019
306e7e1
Install torch with cudatoolkit 9.2
rosbo Feb 20, 2019
fd376af
Merge pull request #485 from Kaggle/rosbo-patch-1
rosbo Feb 20, 2019
e65f73e
Move JWE to request body instead of header.
vimota Feb 21, 2019
2def008
Add tests to MXNet-GPU, GLuonNLP, GluonCV
Feb 22, 2019
71e51d1
Add tesseract and pytesseract
Feb 22, 2019
3b88789
Add clean-layer.sh to tesseract layer
Feb 22, 2019
60d7581
add pdf for pytesseract test
Feb 22, 2019
98c6588
Add unittest for pytesseract
Feb 22, 2019
cefa1c2
Add wand, pdf2image, PyPDF, pyocr
Feb 22, 2019
cd4fcc4
Change tesseract comment
Feb 22, 2019
8dc2d4e
Merge pull request #484 from Ishitori/master
rosbo Feb 25, 2019
055c613
Merge branch 'master' of https://github.com/Kaggle/docker-python into…
rosbo Feb 26, 2019
504f8ba
prevent mxnet from downgrading numpy
rosbo Feb 26, 2019
8bc2ec3
Merge branch 'master' into add-optuna
toshihikoyanase Feb 26, 2019
7780a6f
Merge pull request #493 from Kaggle/fix-numpy-downgrade-ci
rosbo Feb 26, 2019
d378a8f
Add TensorBoard to Kaggle Kernels
emzeq Feb 26, 2019
eb7c4fa
Allow parallel branch builds
rosbo Feb 26, 2019
d6ca2b0
Update PRETEST_TAG to avoid duplication
rosbo Feb 26, 2019
ed0dea4
Merge pull request #492 from Kaggle/allow-parallel-branch-build-ci
rosbo Feb 26, 2019
a16bc4b
Changes what kaggle_secrets expects to receive from Web Tier, looks f…
vimota Feb 26, 2019
fe26648
Add timeout to UserSecretsClient
vimota Feb 26, 2019
4cd0b76
Increase timeout for usersecretsclient, add test case for wasSuccesfu…
vimota Feb 26, 2019
8ae0efa
Apply PR suggestions
emzeq Feb 27, 2019
4cbaed2
Merge pull request #486 from toshihikoyanase/add-optuna
rosbo Feb 27, 2019
38d95db
Updates pip version as the latest version doesn't seem to have issues…
vimota Feb 27, 2019
69c9d08
Merge pull request #496 from Kaggle/pip
rosbo Feb 28, 2019
7d4e871
Hide IFrame in published notebook to avoid empty output cell
emzeq Feb 28, 2019
33ddc9d
Leave comment about replacing patch with worker tunneling
emzeq Feb 28, 2019
def9436
Document cuda compute compabilities
rosbo Feb 28, 2019
6d5f6a1
Merge pull request #498 from Kaggle/rosbo-patch-2
rosbo Feb 28, 2019
a6ba32e
Merge pull request #494 from Kaggle/tensorboard
Feb 28, 2019
513ccea
Properly store access token so it can be used by creds
ifigotin Mar 7, 2019
263903f
Merge pull request #500 from Kaggle/fix-token-retrieval
ifigotin Mar 7, 2019
e4024b9
Fix tesseract unit test
rosbo Mar 7, 2019
3adbbe3
Merge pull request #502 from Kaggle/add-tesseract-ci
rosbo Mar 7, 2019
f24718f
Adds support for expiry of bigquery access token. (#501)
vimota Mar 8, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.pyc
.idea/
.vscode
.mypy_cache
366 changes: 178 additions & 188 deletions Dockerfile

Large diffs are not rendered by default.

102 changes: 93 additions & 9 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
String cron_string = BRANCH_NAME == "master" ? "H 12 * * 1-5" : ""
String cron_string = BRANCH_NAME == "master" ? "H 12 * * 1,3,5" : ""

pipeline {
agent { label 'ephemeral-linux' }
options {
// The Build GPU stage depends on the image from the Push CPU stage
disableConcurrentBuilds()
}
triggers {
Expand All @@ -14,12 +15,13 @@ pipeline {
GIT_COMMIT_AUTHOR = sh(returnStdout: true, script:"git log --format='%an' -n 1 HEAD").trim()
GIT_COMMIT_SUMMARY = "`<https://github.com/Kaggle/docker-python/commit/${GIT_COMMIT}|${GIT_COMMIT_SHORT}>` ${GIT_COMMIT_SUBJECT} - ${GIT_COMMIT_AUTHOR}"
SLACK_CHANNEL = sh(returnStdout: true, script: "if [[ \"${GIT_BRANCH}\" == \"master\" ]]; then echo \"#kernelops\"; else echo \"#builds\"; fi").trim()
PRETEST_TAG = sh(returnStdout: true, script: "if [[ \"${GIT_BRANCH}\" == \"master\" ]]; then echo \"ci-pretest\"; else echo \"${GIT_BRANCH}-pretest\"; fi").trim()
STAGING_TAG = sh(returnStdout: true, script: "if [[ \"${GIT_BRANCH}\" == \"master\" ]]; then echo \"staging\"; else echo \"${GIT_BRANCH}-staging\"; fi").trim()
}

stages {
stage('Docker Build') {
stage('Docker CPU Build') {
steps {
slackSend color: 'none', message: "*<${env.BUILD_URL}console|${JOB_NAME} docker build>* ${GIT_COMMIT_SUMMARY}", channel: env.SLACK_CHANNEL
sh '''#!/bin/bash
set -exo pipefail

Expand All @@ -28,9 +30,19 @@ pipeline {
}
}

stage('Test Image') {
stage('Push CPU Pretest Image') {
steps {
sh '''#!/bin/bash
set -exo pipefail

date
./push ${PRETEST_TAG}
'''
}
}

stage('Test CPU Image') {
steps {
slackSend color: 'none', message: "*<${env.BUILD_URL}console|${JOB_NAME} test image>* ${GIT_COMMIT_SUMMARY}", channel: env.SLACK_CHANNEL
sh '''#!/bin/bash
set -exo pipefail

Expand All @@ -40,22 +52,94 @@ pipeline {
}
}

stage('Push Image') {
stage('Push CPU Image') {
steps {
slackSend color: 'none', message: "*<${env.BUILD_URL}console|${JOB_NAME} pushing image>* ${GIT_COMMIT_SUMMARY}", channel: env.SLACK_CHANNEL
sh '''#!/bin/bash
set -exo pipefail

date
./push staging
./push ${STAGING_TAG}
'''
}
}

stage('Docker GPU Build') {
// A GPU is not required to build this image. However, in our current setup,
// the default runtime is set to nvidia (as opposed to runc) and there
// is no option to specify a runtime for the `docker build` command.
//
// TODO(rosbo) don't set `nvidia` as the default runtime and use the
// `--runtime=nvidia` flag for the `docker run` command when GPU support is needed.
agent { label 'ephemeral-linux-gpu' }
steps {
sh '''#!/bin/bash
set -exo pipefail
docker image prune -f # remove previously built image to prevent disk from filling up
./build --gpu --base-image-tag ${STAGING_TAG} | ts
'''
}
}

stage('Push GPU Pretest Image') {
agent { label 'ephemeral-linux-gpu' }
steps {
sh '''#!/bin/bash
set -exo pipefail

date
./push --gpu ${PRETEST_TAG}
'''
}
}

stage('Test GPU Image') {
agent { label 'ephemeral-linux-gpu' }
steps {
sh '''#!/bin/bash
set -exo pipefail

date
./test --gpu
'''
}
}

stage('Push GPU Image') {
agent { label 'ephemeral-linux-gpu' }
steps {
sh '''#!/bin/bash
set -exo pipefail

date
./push --gpu ${STAGING_TAG}
'''
}
}

stage('Package Versions') {
parallel {
stage('CPU Diff') {
steps {
sh '''#!/bin/bash
./diff
'''
}
}
stage('GPU Diff') {
agent { label 'ephemeral-linux-gpu' }
steps {
sh '''#!/bin/bash
./diff --gpu
'''
}
}
}
}
}

post {
failure {
slackSend color: 'danger', message: "*<${env.BUILD_URL}console|${JOB_NAME} failed>* ${GIT_COMMIT_SUMMARY}", channel: env.SLACK_CHANNEL
slackSend color: 'danger', message: "*<${env.BUILD_URL}console|${JOB_NAME} failed>* ${GIT_COMMIT_SUMMARY} @kernels-backend-ops", channel: env.SLACK_CHANNEL
}
success {
slackSend color: 'good', message: "*<${env.BUILD_URL}console|${JOB_NAME} passed>* ${GIT_COMMIT_SUMMARY}", channel: env.SLACK_CHANNEL
Expand Down
92 changes: 60 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,88 @@
**Kaggle Kernels** allow users to run scripts against our competitions and datasets without having to download data or set up their environment. Here's [an example](https://www.kaggle.com/devinanzelmo/d/devinanzelmo/dota-2-matches/setting-up-a-prediction-problem-dota-2):
[Kaggle Kernels](https://www.kaggle.com/kernels) allow users to run a Python Notebook in the cloud against our competitions and datasets without having to download data or set up their environment.

![example script](http://i.imgur.com/yrWycNA.png)
This repository includes our Dockerfiles for building the [CPU-only](Dockerfile) and [GPU](gpu.Dockerfile) image that runs Python Kernels on Kaggle.

This is the Dockerfile (etc.) used for building the image that runs python scripts on Kaggle. [Here's](https://registry.hub.docker.com/u/kaggle/python/) the Docker image on Dockerhub.
Our Python Docker images are stored on Google Container Registry at:

* CPU-only: [gcr.io/kaggle-images/python](https://gcr.io/kaggle-images/python)
* GPU: private for now, we will make it public soon.

Note: The base image for the GPU image is our CPU-only image. The [gpu.Dockerfile](gpu.Dockerfile) adds a few extra layers to install GPU related libraries and packages (cuda, libcudnn, pycuda etc.) and reinstall packages with specific GPU builds (torch, tensorflow and a few mores).

## Getting started

To get started with this image, read our [guide](http://blog.kaggle.com/2016/02/05/how-to-get-started-with-data-science-in-containers/) to using it yourself, or browse [Kaggle Kernels](https://www.kaggle.com/kernels) for ideas.

## Requesting new features
## Requesting new packages

**We welcome pull requests** if there are any packages you'd like to add!
First, evaluate whether installing the package yourself in your own Kernels suits your needs. See [guide](https://github.com/Kaggle/docker-python/wiki/Missing-Packages).

We can merge your request quickly if you check that it builds correctly. Here's how to do that.
If you the first step above doesn't work for your use case, [open an issue](https://github.com/Kaggle/docker-python/issues/new) or a [pull request](https://github.com/Kaggle/docker-python/pulls).

Start by running this image on your system:
## Opening a pull request

```
me@my-computer:/home$ docker run --rm -it kaggle/python
root@d72b81a003e1:/#
```
1. Update the *Dockerfile*
1. For changes specific to the GPU image, update the [gpu.Dockerfile](gpu.Dockerfile).
1. Otherwise, update the [Dockerfile](Dockerfile).
1. Follow the instructions below to build a new image.
1. Add tests for your new package. See this [example](https://github.com/Kaggle/docker-python/blob/master/tests/test_fastai.py).
1. Follow the instructions below to test the new image.
1. Open a PR on this repo and you are all set!

Then follow the package's installation instructions for a Linux system. It could be as simple as installing via Pip:
## Building a new image

```
root@d72b81a003e1:/# pip install coolpackage
Collecting coolpackage
[...etc...]
```sh
./build
```

Once that's done, check that you can import it correctly. (Sometimes, if a package is missing a dependency, it throws an error when you try to import it.)
Flags:

```
root@d72b81a003e1:/# python
Python 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul 2 2016, 17:53:06)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import coolpackage
>>>
```
* `--gpu` to build an image for GPU.
* `--use-cache` for faster iterative builds.

Once that's working, add the necessary lines to our [Dockerfile](https://github.com/Kaggle/docker-python/blob/master/Dockerfile). (In this case, that would mean adding `pip install coolpackage` to the last section.)
## Testing a new image

Next run the build:
A suite of tests can be found under the `/tests` folder. You can run the test using this command:

```sh
./test
```
./build
```

Finally run the tests:
Flags:

* `--gpu` to test the GPU image.

## Running the image

For the CPU-only image:

```sh
# Run the image built locally:
docker run --rm -it kaggle/python-build /bin/bash
# Run the pre-built image from gcr.io
docker run --rm -it gcr.io/kaggle-images/python /bin/bash
```
./tests

For the GPU image:

```sh
# Run the image built locally:
docker run --runtime nvidia --rm -it kaggle/python-gpu-build /bin/bash
# Run the image pre-built image from gcr.io
# TODO: Our GPU images are not yet publicly available.
```

Then submit your pull request, and you're all set!
To ensure your container can access the GPU, follow the instructions posted [here](https://github.com/Kaggle/docker-python/issues/361#issuecomment-448093930).

## Tensorflow custom pre-built wheel

A Tensorflow custom pre-built wheel is used mainly for:

* Faster build time: Building tensorflow from sources takes ~1h. Keeping this process outside the main build allows faster iterations when working on our Dockerfiles.

Building Tensorflow from sources:

* Increase performance: When building from sources, we can leverage CPU specific optimizations
* Is required: Tensorflow with GPU support must be built from sources

The [Dockerfile](tensorflow-whl/Dockerfile) and the [instructions](tensorflow-whl/README.md) can be found in the [tensorflow-whl folder/](tensorflow-whl/).
66 changes: 58 additions & 8 deletions build
Original file line number Diff line number Diff line change
@@ -1,11 +1,61 @@
#!/bin/bash
set -e

# Default behavior is to do everything from scratch.
# The --use-cache option is useful if you're iterating on a broken build.
if [[ "$1" == "--use-cache" ]]; then
docker build --rm -t kaggle/python-build .
else
docker pull continuumio/anaconda3:latest
docker build --rm --no-cache -t kaggle/python-build .
fi
usage() {
cat << EOF
Usage: $0 [OPTIONS]
Build a new Python Docker image.

Options:
-g, --gpu Build an image with GPU support.
-c, --use-cache Use layer cache when building a new image.
-b, --base-image-tag TAG Base image tag. Defaults to value defined in DOCKERFILE.
EOF
}

CACHE_FLAG='--no-cache'
DOCKERFILE='Dockerfile'
IMAGE_TAG='kaggle/python-build'
BUILD_ARGS=''

while :; do
case "$1" in
-h|--help)
usage
exit
;;
-g|--gpu)
IMAGE_TAG='kaggle/python-gpu-build'
DOCKERFILE='gpu.Dockerfile'
;;
-c|--use-cache)
CACHE_FLAG=''
;;
-b|--base-image-tag)
if [[ -z $2 ]]; then
usage
printf 'ERROR: No TAG specified after the %s flag.\n' "$1" >&2
exit
fi
BUILD_ARGS="--build-arg BASE_TAG=$2"
shift # skip the flag value
;;
-?*)
usage
printf 'ERROR: Unknown option: %s\n' "$1" >&2
exit
;;
*)
break
esac

shift
done

readonly CACHE_FLAG
readonly DOCKERFILE
readonly IMAGE_TAG
readonly BUILD_ARGS

set -x
docker build --rm --pull $CACHE_FLAG -t "$IMAGE_TAG" -f "$DOCKERFILE" $BUILD_ARGS .
22 changes: 22 additions & 0 deletions clean-layer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
#
# This scripts should be called at the end of each RUN command
# in the Dockerfiles.
#
# Each RUN command creates a new layer that is stored separately.
# At the end of each command, we should ensure we clean up downloaded
# archives and source files used to produce binary to reduce the size
# of the layer.
set -e
set -x

# Delete files that pip caches when installing a package.
rm -rf /root/.cache/pip/*
# Delete old downloaded archive files
apt-get autoremove -y
# Delete downloaded archive files
apt-get clean
# Delete source files used for building binaries
rm -rf /usr/local/src/*
# Delete conda downloaded tarballs
conda clean -y --tarballs
Loading