-
Notifications
You must be signed in to change notification settings - Fork 78
add pfsserver dockerfile #148
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
Changes from 12 commits
765d0d8
e760269
b0de563
eac9ffc
22d0a8d
122ee25
a520967
612f53c
03f244d
91b4426
64fbb84
d896844
79862db
a61462d
9655d39
473f7ab
2f6e9aa
a7db6e7
de757f8
b88dfe5
bef6072
2633ad4
e121c53
1a9d15e
d4ce648
1ccc748
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #/bin/bash | ||
| mkdir -p ~/.paddle | ||
| cat > ~/.paddle/config << EOF | ||
| datacenters: | ||
| - name: datacenter1 | ||
| username: [email protected] | ||
| password: T123 | ||
|
||
| endpoint: http://127.0.0.1:8080 | ||
| current-datacenter: datacenter1 | ||
| EOF | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| FROM ubuntu:16.04 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 目前还不行,依赖了 |
||
|
|
||
| ADD .tools /pfsserver/.tools | ||
| RUN bash /pfsserver/.tools/gen_config.sh | ||
|
|
||
| ADD ./cmd/pfsserver/pfsserver /pfsserver/ | ||
| RUN mkdir /pfsserver/log | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| 1. 如何构建PFSServer的DockerImage | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK |
||
| - 构建PFSServer的编译环境 | ||
|
|
||
| ``` | ||
| cd docker | ||
| bash build.sh | ||
| ``` | ||
|
|
||
| - 编译PFSServer | ||
|
|
||
| ``` | ||
| docker run --rm -v $(pwd):/root/gopath/src/github.com/PaddlePaddle/cloud/go pfsserver:dev | ||
| ``` | ||
|
|
||
| - 构建PFSServer的DockerImage | ||
|
|
||
| ``` | ||
| docker build . -t pfsserver:latest | ||
| ``` | ||
| - PFSServer启动命令 | ||
|
|
||
| ``` | ||
| docker run pfsserver:latest /pfsserver/pfsserver -tokenuri http://cloud.paddlepaddle.org -logtostderr=false -log_dir=./log -v=3 | ||
| ``` | ||
|
|
||
| 2. 如何部署PFSServer | ||
|
|
||
| ``` | ||
| cd ../k8s | ||
| kuberctl create -f cloud_pfsserver.yaml | ||
| ``` | ||
|
|
||
| 3. 如何使用PFSClient | ||
| - cp | ||
|
|
||
| ``` | ||
| upload: | ||
| paddlecloud cp ./file /pfs/$DATACENTER/home/$USER/file | ||
|
|
||
| download: | ||
| paddlecloud cp /pfs/$DATACENTER/home/$USER/file ./file | ||
| ``` | ||
| - ls | ||
|
|
||
| ``` | ||
| paddlecloud ls /pfs/$DATACENTER/home/$USER/folder | ||
| ``` | ||
|
|
||
| - rm | ||
|
|
||
| ``` | ||
| paddlecloud rm /pfs/$DATACENTER/home/$USER/file | ||
| paddlecloud rm -r /pfs/$DATACENTER/home/$USER/folder | ||
| ``` | ||
|
|
||
| - mkdir | ||
|
|
||
| ``` | ||
| paddlecloud mkdir /pfs/$DATACENTER/home/$USER/folder | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| cat > ./Dockerfile << EOF | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can use
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, but you should
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 编译环境和运行环境是分开的。运行环境不需要wget任何东西。
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Having both |
||
| FROM ubuntu:16.04 | ||
|
|
||
| RUN apt-get update && \ | ||
| apt-get install -y wget git && \ | ||
| wget -O go.tgz https://storage.googleapis.com/golang/go1.8.1.linux-amd64.tar.gz && \ | ||
| tar -C /usr/local -xzf go.tgz && \ | ||
| mkdir /root/gopath && \ | ||
| rm go.tgz | ||
|
|
||
| ENV GOROOT=/usr/local/go GOPATH=/root/gopath | ||
| ENV PATH=${PATH}:${GOROOT}/bin | ||
|
|
||
| CMD ["sh", "-c", "cd /root/gopath/src/github.com/PaddlePaddle/cloud/go/cmd/pfsserver && go get ./... && go build"] | ||
| EOF | ||
|
|
||
| docker build . -t pfsserver:dev | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,3 +11,4 @@ spec: | |
| backend: | ||
| serviceName: paddle-cloud-service | ||
| servicePort: 8000 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| apiVersion: extensions/v1beta1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: pfsserver | ||
| namespace: pfs | ||
| spec: | ||
| replicas: 1 | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: pfsserver | ||
| spec: | ||
| containers: | ||
| - name: pfs | ||
| imagePullPolicy: Always | ||
| image: gongweibao/pfsserver:latest | ||
| ports: | ||
| - containerPort: 8080 | ||
| command: ["/pfsserver/pfsserver", "-tokenuri", "http://paddle-cloud-service", "-alsologtostderr=true", "-log_dir=./log", "-v=3"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| apiVersion: extensions/v1beta1 | ||
|
||
| kind: Ingress | ||
| metadata: | ||
| name: pfs-ingress | ||
| namespace: pfs | ||
| spec: | ||
| tls: | ||
| - hosts: | ||
| - pfs.paddlpaddle.org | ||
| secretName: pfs-secret | ||
| rules: | ||
| - host: pfs.paddlepaddle.org | ||
| http: | ||
| paths: | ||
| - backend: | ||
| serviceName: pfs-service | ||
| servicePort: 8080 | ||
| path: / | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| kind: Service | ||
| apiVersion: v1 | ||
| metadata: | ||
| name: pfs-service | ||
| namespace: pfs | ||
| spec: | ||
| selector: | ||
| app: pfsserver | ||
| ports: | ||
| - protocol: TCP | ||
| port: 8080 | ||
| targetPort: 8080 | ||
| type: NodePort |
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.
[email protected]should not exist, useyour-user-nameinstead.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.
Done