diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..94143827ed065ca0d7d5be1b765d255c5c32cd9a --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +Dockerfile diff --git a/.tools/build_docker.sh b/.tools/build_docker.sh index 123318a1d3557bd93f379f0e69c932a889de4eaa..0b7735967ff2aae90a3f6597917e51517a8eba44 100755 --- a/.tools/build_docker.sh +++ b/.tools/build_docker.sh @@ -6,7 +6,7 @@ cd $cur_path/../ .tools/convert-markdown-into-ipynb-and-test.sh paddle_tag=0.10.0rc2 -latest_tag=latest +book_tag=latest #generate docker file if [ ${USE_UBUNTU_REPO_MIRROR} ]; then @@ -15,14 +15,18 @@ else update_mirror_cmd="\\" fi -mkdir -p build +#build docker image +echo "paddle_tag:"$paddle_tag +echo "book_tag:"$book_tag -cat > ./build/Dockerfile << EOF +cat > Dockerfile < COPY . /book -RUN python /book/.tools/cache_dataset.py + +RUN pip install -U nltk \ + && python /book/.tools/cache_dataset.py RUN ${update_mirror_cmd} apt-get update && \ @@ -36,6 +40,4 @@ EXPOSE 8888 CMD ["sh", "-c", "jupyter notebook --ip=0.0.0.0 --no-browser --NotebookApp.token='' --NotebookApp.disable_check_xsrf=True /book/"] EOF -#build docker image -echo "paddle_tag:"$paddle_tag -echo $dockerfile | docker build --no-cache -t paddlepaddle/book:${paddle_tag} -t paddlepaddle/book:${latest_tag} -f ./build/Dockerfile . +docker build --no-cache -t paddlepaddle/book:${paddle_tag} -t paddlepaddle/book:${book_tag} . diff --git a/.tools/cache_dataset.py b/.tools/cache_dataset.py index f1d196e2cbd2615decda554f7f43d8ef09d596f2..0c552f84f635c8beb4538c08af153f76e5c5cff5 100755 --- a/.tools/cache_dataset.py +++ b/.tools/cache_dataset.py @@ -1,6 +1,16 @@ #!/bin/env python import paddle.v2.dataset as dataset -import ntlk +import nltk + +#cifar +dataset.common.download(dataset.cifar.CIFAR100_URL, 'cifar', + dataset.cifar.CIFAR100_MD5) +dataset.common.download(dataset.cifar.CIFAR100_URL, 'cifar', + dataset.cifar.CIFAR100_MD5) +dataset.common.download(dataset.cifar.CIFAR10_URL, 'cifar', + dataset.cifar.CIFAR10_MD5) +dataset.common.download(dataset.cifar.CIFAR10_URL, 'cifar', + dataset.cifar.CIFAR10_MD5) # Cache conll05 dataset.common.download(dataset.conll05.WORDDICT_URL, 'conll05st', \ @@ -28,5 +38,5 @@ dataset.common.download(dataset.uci_housing.URL, "uci_housing", \ dataset.uci_housing.MD5) # Cache vmt14 -dataset.common.download(dataset.vmt14.URL_TRAIN, "wmt14",\ - dataset.vmt14.MD5_TRAIN) +dataset.common.download(dataset.wmt14.URL_TRAIN, "wmt14",\ + dataset.wmt14.MD5_TRAIN)