Skip to content
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

add pfsserver dockerfile #148

Merged
merged 26 commits into from
Jul 26, 2017
Merged

add pfsserver dockerfile #148

merged 26 commits into from
Jul 26, 2017

Conversation

gongweibao
Copy link
Collaborator

No description provided.

go/README_CN.md Outdated
@@ -0,0 +1,20 @@
1. 如何创建pfsserver的DockerImage
Copy link
Collaborator

Choose a reason for hiding this comment

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

pfsserver => PFSServer ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

go/README_CN.md Outdated
@@ -0,0 +1,20 @@
1. 如何创建pfsserver的DockerImage
- 创建pfsserver的编译环境
Copy link
Collaborator

Choose a reason for hiding this comment

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

创建pfsserver的编译环境
==>
构建PFSServer的开发环境镜像

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

go/README_CN.md Outdated
docker run --rm -v $(pwd):/root/gopath/src/github.com/PaddlePaddle/cloud/go pfsserver:dev
```

- 创建pfsserver的DockerImage
Copy link
Collaborator

Choose a reason for hiding this comment

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

创建pfsserver的DockerImage
=>
构建PFSServer的生产环境镜像

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@@ -0,0 +1,5 @@
FROM ubuntu:16.04
Copy link
Collaborator

Choose a reason for hiding this comment

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

This Dockerfile is used for PFSServer, so we can move this to ./cmd/pfsserver ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

目前还不行,依赖了./tools/gen_config.sh,用来生成配置文件。后续解耦合以后可以放到./cmd/pfsserver下。
我在这里创建了一个ISSUE:#157

@@ -0,0 +1,17 @@
cat > ./Dockerfile << EOF
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can use golang:1.8 as the base Docker image so that it will reduce the Image size.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

golang:1.8最小的257M,这个只有125M。

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yep, but you should wget golang.tar.gz if you use ubuntu as the base image. and we also need VPN so that we can download the tar file from storage.googleapis.com.

Copy link
Collaborator Author

@gongweibao gongweibao Jun 20, 2017

Choose a reason for hiding this comment

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

编译环境和运行环境是分开的。运行环境不需要wget任何东西。
编译环境很长时间才需要构建一次。

@@ -0,0 +1,19 @@
apiVersion: extensions/v1beta1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ingress 和python django部分现在可以完成分发了么?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

cat > ~/.paddle/config << EOF
datacenters:
- name: datacenter1
username: user@baidu.com
Copy link
Collaborator

Choose a reason for hiding this comment

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

user@baidu.com should not exist, use your-user-name instead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

datacenters:
- name: datacenter1
username: user@baidu.com
password: T123
Copy link
Collaborator

Choose a reason for hiding this comment

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

T123 have no meaning, use your-secret instead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@@ -0,0 +1,61 @@
1. 如何构建PFSServer的DockerImage
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just a mark, we need to put pfs and pcloud in the same image later.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK

@@ -0,0 +1,19 @@
cat > ./Dockerfile << EOF
Copy link
Collaborator

Choose a reason for hiding this comment

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

Having both go/docker/ and docker/ seems confusing, move to the same direcotry or use docker/build_docker.sh.

if len(a) < 3 {
func checkUser(pathStr string, user string) error {
pathStr = path.Clean(strings.TrimSpace(pathStr))
a := strings.Split(pathStr, "/")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should use os.PathSeparator instead of "/" to support Windows, or use filepath.Split()

Copy link
Collaborator Author

@gongweibao gongweibao Jul 24, 2017

Choose a reason for hiding this comment

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

这个地方的路径是server端路径,格式是固定的。

username: user@baidu.com
password: T123
endpoint: http://127.0.0.1:8080
pfsendpoint: http://127.0.0.1:8080
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's not simple enough for users to configure if we have two "endpoints", just use static paths like http://127.0.0.1:8080/api/v1/jobs and http://127.0.0.1:8080/api/v1/pfs, so users only need to configure endpoint to http://127.0.0.1:8080

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@@ -39,7 +39,7 @@ spec:
containers:
- name: paddle-cloud
imagePullPolicy: Always
image: paddlepaddle/cloud
image: gongweibao/pcloud
Copy link
Collaborator

Choose a reason for hiding this comment

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

gongweibao/pcloud should not appear.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@@ -4,10 +4,15 @@ metadata:
name: paddle-cloud-ingress
spec:
rules:
- host: cloud.paddlepaddle.org
- host: cloud1.paddlepaddle.org
Copy link
Collaborator

Choose a reason for hiding this comment

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

cloud1.paddlepaddle.org is confusing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

containers:
- name: pfs
imagePullPolicy: Always
image: gongweibao/pfsserver:latest
Copy link
Collaborator

Choose a reason for hiding this comment

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

gongweibao/pfsserver:latest should not appear.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator Author

@gongweibao gongweibao left a comment

Choose a reason for hiding this comment

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

改的次数太多,忘记把测试环境的改过来了。汗。

Copy link
Collaborator

@typhoonzero typhoonzero left a comment

Choose a reason for hiding this comment

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

LGTM++
except for one small comment

image: paddlepaddle/pfsserver:latest
env:
- name: CURRENT_DATACENTER
value: "meiyan"
Copy link
Collaborator

Choose a reason for hiding this comment

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

"meiyan" should be a template too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

我单独搞一个PR来处理template的问题

@gongweibao gongweibao merged commit 0148f0f into PaddlePaddle:develop Jul 26, 2017
@gongweibao gongweibao deleted the docker branch July 26, 2017 06:43
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.

3 participants