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

Run PaddleCloud on minikube. #463

Merged
merged 12 commits into from
Nov 16, 2017
Merged

Conversation

gongweibao
Copy link
Collaborator

Fix #418

# Run PaddleCloud on your local machine

This documentation shows how to run PaddleCloud on minikube.
(This surports only mac now.On unbuntu-16.04,we met a bug of kubernetes when we use `hostpath` to volume a file.)
Copy link

@putcn putcn Nov 6, 2017

Choose a reason for hiding this comment

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

"Currently, This guide works with Mac OS only. On Ubuntu 16.04, the bug for Kubernetes to mount a single file with hostpath is a show stopper"
also, do we have a link for this bug in kubernetes repo?

Copy link

Choose a reason for hiding this comment

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

kubernetes/kubernetes#44815 (comment)
can this help solve the issue?

Copy link
Collaborator Author

@gongweibao gongweibao Nov 7, 2017

Choose a reason for hiding this comment

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

OK, I will test it later.
Thanks!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's amazing to find that we can volume a file on Linux now!

If you can't connect to minikube distribution server,add https_proxy like that:

```bash
https_proxy=<your's> minikube start --kubernetes-version v1.6.4
Copy link

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! Done.

```
mkdir <yourpath>
```
Minikube mount `$Home` path default,and you'd better to create path under it or you may find that it can't be changed in minikube virtual mathine or in kubertes pod.
Copy link

Choose a reason for hiding this comment

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

Since Minikube mounts $Home path by default, we recommend creating the path under $Home which offers the flexibility of switching between directories in your deployment without stopping the MiniKube and mounting another one.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! Done.

Minikube mount `$Home` path default,and you'd better to create path under it or you may find that it can't be changed in minikube virtual mathine or in kubertes pod.

1. Copy `ca` and generate `admin` certificate:
(We must use `ca` under `~/.minikube` instead of under `~/.minikube/certs`.)
Copy link

Choose a reason for hiding this comment

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

We must use ca under ~/.minikube rather than ~/.minikube/certs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! Done.

cp ~/.minikube/ca.key .
```

1. Copy and configure paddlecloud configures:
Copy link

Choose a reason for hiding this comment

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

Copy and update paddlecloud configurations:

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! Done.

kubectl create -f pfs_service.yaml
kubectl create -f cloud_deployment.yaml
```
1. Type `$(minikube ip)` into browser,and sign up a user.
Copy link

Choose a reason for hiding this comment

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

open cloud.testpcloud.org in your browser and sign up a user.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! Done.


## FAQ
1. We can't get anything when we type `$(minikube ip)` into browser.
You can use `minikube get po --all-namespaces` to check it,it should like:
Copy link

@putcn putcn Nov 6, 2017

Choose a reason for hiding this comment

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

One possible cause is: default-http-backend is not ready yet. Run minikube get po --all-namespaces to check its status.
If it's stuck at pulling the image, one alternative is to manually download the image and load it with minikube's docker.

  • run kubectrl describe po name --namespace=kube-system to get docker image uri.
  • docker save <docker-image-uri> > <tarname>.tar to save the image to a tar file. You may need to use proxy with this step
  • 'minikube ssh' to login to Minikube's command line
  • docker load < <tarname>.tar to load the image to Kubenetes' local docker image repo

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! Done.

- `minikube ssh`.
- `docker load < <tarname>.tar`.

1. I edit a file,but it not change in minikube virtual machine some times.
Copy link

Choose a reason for hiding this comment

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

Indention issue.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! Done.

- `minikube ssh`.
- `docker load < <tarname>.tar`.

1. I edit a file,but it not change in minikube virtual machine some times.
Copy link

Choose a reason for hiding this comment

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

I edited a file in host file system, but it remained unchanged in Minikube virtual machine sometimes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! Done.

- `docker load < <tarname>.tar`.

1. I edit a file,but it not change in minikube virtual machine some times.
Ye, it seems that minikube has a cache of files.You'd better `minikube stop` `minikube start --kubernetes-version v1.6.4` to fix it.
Copy link

Choose a reason for hiding this comment

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

That might be due to the files cache mechanism of Minikube. You can try to restart the Minikube with minikube stop minikube start --kubernetes-version v1.6.4 to fix it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! Done.


## TODO
1. The `mysql` docker runs `mysqld` under user `mysql` instead of `root`,so it's difficult to save `mysql` data to hostpath.
1. Fix bug: `kubernetes can't mount a file use host to volume a file` on linux.
Copy link

Choose a reason for hiding this comment

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

Kubernetes can't mount the volume with hostpath to a single file

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! Done.

@typhoonzero
Copy link
Collaborator

Setup paddle cloud on Kubernetes have so many steps, it would be great if you create a vagrant image containing pre-configured paddle cloud.

@gongweibao
Copy link
Collaborator Author

gongweibao commented Nov 7, 2017

It's a very useful idea. This will be done in the next PR. @typhoonzero

@gongweibao
Copy link
Collaborator Author

Thanks very much! @putcn

@gongweibao
Copy link
Collaborator Author

Add a new ISSUE:#497

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++

@gongweibao gongweibao merged commit ef384e9 into PaddlePaddle:develop Nov 16, 2017
@gongweibao gongweibao deleted the minicube branch November 16, 2017 04:42
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