Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
book
提交
e7d2ad90
B
book
项目概览
PaddlePaddle
/
book
通知
16
Star
4
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
40
列表
看板
标记
里程碑
合并请求
37
Wiki
5
Wiki
分析
仓库
DevOps
项目成员
Pages
B
book
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
40
Issue
40
列表
看板
标记
里程碑
合并请求
37
合并请求
37
Pages
分析
分析
仓库分析
DevOps
Wiki
5
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e7d2ad90
编写于
3月 21, 2017
作者:
G
gongweibao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
copy cache data
上级
dcd4070a
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
27 addition
and
7 deletion
+27
-7
.tools/build_docker.sh
.tools/build_docker.sh
+25
-5
.tools/convert-markdown-into-ipynb-and-test.sh
.tools/convert-markdown-into-ipynb-and-test.sh
+2
-2
未找到文件。
.tools/build_docker.sh
浏览文件 @
e7d2ad90
...
@@ -2,24 +2,32 @@
...
@@ -2,24 +2,32 @@
cur_path
=
"
$(
cd
"
$(
dirname
"
$0
"
)
"
&&
pwd
-P
)
"
cur_path
=
"
$(
cd
"
$(
dirname
"
$0
"
)
"
&&
pwd
-P
)
"
cd
$cur_path
/../
cd
$cur_path
/../
#check cache data
cache_data_path
=
.cache/paddle/dataset
if
[
${
COPY_CACHE_DATA
}
]
&&
[
!
-d
$cache_data_path
]
;
then
echo
2>&1
"Check the cache_data_path:
${
cache_data_path
}
"
exit
1
fi
#convert md to ipynb
#convert md to ipynb
.tools/convert-markdown-into-ipynb-and-test.sh
.tools/convert-markdown-into-ipynb-and-test.sh
paddle_version
=
0.10.0rc2
paddle_version
=
0.10.0rc2
latest_label
=
latest
#generate docker file
#generate docker file
if
[
${
USE_UBUNTU_REPO_MIRROR
}
]
;
then
if
[
${
USE_UBUNTU_REPO_MIRROR
}
]
;
then
UPDATE_MIRROR_CMD
=
"sed 's@http:
\/\/
archive.ubuntu.com
\/
ubuntu
\/
@mirror:
\/\/
mirrors.ubuntu.com
\/
mirrors.txt@' -i /etc/apt/sources.list &&
\\
"
update_mirror_cmd
=
"sed 's@http:
\/\/
archive.ubuntu.com
\/
ubuntu
\/
@mirror:
\/\/
mirrors.ubuntu.com
\/
mirrors.txt@' -i /etc/apt/sources.list &&
\\
"
else
else
UPDATE_MIRROR_CMD
=
"
\\
"
update_mirror_cmd
=
"
\\
"
fi
fi
mkdir
-p
build
mkdir
-p
build
cat
>
build/Dockerfile
<<
EOF
cat
>
build/Dockerfile
<<
EOF
1
FROM paddlepaddle/paddle:
${
paddle_version
}
FROM paddlepaddle/paddle:
${
paddle_version
}
MAINTAINER PaddlePaddle Authors <paddle-dev@baidu.com>
MAINTAINER PaddlePaddle Authors <paddle-dev@baidu.com>
RUN
${
UPDATE_MIRROR_CMD
}
RUN
${
update_mirror_cmd
}
apt-get install locales
apt-get install locales
RUN localedef -f UTF-8 -i en_US en_US.UTF-8
RUN localedef -f UTF-8 -i en_US en_US.UTF-8
...
@@ -30,6 +38,18 @@ RUN pip install -U matplotlib jupyter numpy requests scipy
...
@@ -30,6 +38,18 @@ RUN pip install -U matplotlib jupyter numpy requests scipy
COPY . /book
COPY . /book
RUN rm -rf /book/build
RUN rm -rf /book/build
EOF1
if
[
${
COPY_CACHE_DATA
}
]
;
then
cat
>>
build/Dockerfile
<<
EOF2
RUN mkdir -p /root/
${
cache_data_path
}
RUN mv /book/
${
cache_data_path
}
/* /root/
${
cache_data_path
}
/ && rm -rf /book/
${
cache_data_path
}
EOF2
fi
cat
>>
build/Dockerfile
<<
EOF
EXPOSE 8888
EXPOSE 8888
CMD ["sh", "-c", "jupyter notebook --ip=0.0.0.0 --no-browser --NotebookApp.token='' --NotebookApp.disable_check_xsrf=True /book/"]
CMD ["sh", "-c", "jupyter notebook --ip=0.0.0.0 --no-browser --NotebookApp.token='' --NotebookApp.disable_check_xsrf=True /book/"]
...
@@ -37,4 +57,4 @@ EOF
...
@@ -37,4 +57,4 @@ EOF
#build docker image
#build docker image
echo
"paddle_version:"
$paddle_version
echo
"paddle_version:"
$paddle_version
docker build
--no-cache
-t
paddlepaddle/book:
${
paddle_version
}
-t
paddlepaddle/book:
latest
-f
./build/Dockerfile
.
docker build
--no-cache
-t
paddlepaddle/book:
${
paddle_version
}
-t
paddlepaddle/book:
${
latest_label
}
-f
./build/Dockerfile
.
.tools/convert-markdown-into-ipynb-and-test.sh
浏览文件 @
e7d2ad90
...
@@ -5,14 +5,14 @@ if [ $? -ne 0 ]; then
...
@@ -5,14 +5,14 @@ if [ $? -ne 0 ]; then
exit
1
exit
1
fi
fi
GOPATH
=
~/.go go get
-u
github.com/wangkuiyi/ipynb/markdown-to-ipynb
GOPATH
=
~/.
cache/
go go get
-u
github.com/wangkuiyi/ipynb/markdown-to-ipynb
cur_path
=
"
$(
cd
"
$(
dirname
"
$0
"
)
"
&&
pwd
-P
)
"
cur_path
=
"
$(
cd
"
$(
dirname
"
$0
"
)
"
&&
pwd
-P
)
"
cd
$cur_path
/../
cd
$cur_path
/../
#convert md to ipynb
#convert md to ipynb
for
file
in
*
/
{
README,README
\.
en
}
.md
;
do
for
file
in
*
/
{
README,README
\.
en
}
.md
;
do
/tmp
/go/bin/markdown-to-ipynb <
$file
>
${
file
%.*
}
".ipynb"
~/.cache
/go/bin/markdown-to-ipynb <
$file
>
${
file
%.*
}
".ipynb"
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
echo
>
&2
"markdown-to-ipynb
$file
error"
echo
>
&2
"markdown-to-ipynb
$file
error"
exit
1
exit
1
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录