Skip to content

Commit 3c93c74

Browse files
authored
Merge pull request #32 from sql-machine-learning/modify_doc
Update doc according to user feedbck
2 parents d7c6b39 + 7fae593 commit 3c93c74

File tree

4 files changed

+25
-14
lines changed

4 files changed

+25
-14
lines changed

dev.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,23 @@
22

33
### For Developers
44

5-
1. Install VirtualBox and Vagrant on a computer with a relatively large memory size.
5+
1. Install [VirtualBox](https://www.virtualbox.org/) and [Vagrant](https://www.vagrantup.com/) on a computer with a relatively large memory size. As a recommendation, a host with 16G memory and 8 cores is preferred.
66
1. Clone and update `SQLFlow playground` project.
77
```bash
88
git clone https://github.com/sql-machine-learning/playground.git
99
cd playground
1010
git submodule update --init
1111
```
12-
1. Run the `play.sh` under playgound's root directory. This script will guide you to install SQLFlow on a virtualbox VM. If you have a slow Internet connection to Vagrant Cloud, you might want to download the Ubuntu VirtualBox image manually from some mirror sites into `~/.cache/sqlflow/` before running the above script. We use `get -c` here for continuing get the file from last breakpoint, so if this command fail, just re-run it.
12+
1. Run the `play.sh` under playgound's root directory. This script will guide you to install SQLFlow on a virtualbox VM. If you have a slow Internet connection to Vagrant Cloud, you might want to download the Ubuntu VirtualBox image manually from some mirror sites into `~/.cache/sqlflow/` before running the above script. We use `wget -c` here for continuing get the file from last breakpoint, so if this command fail, just re-run it.
1313
```bash
14+
# download Vagrant image manually, optional
1415
mkdir -p $HOME/.cache/sqlflow
1516
wget -c -O $HOME/.cache/sqlflow/ubuntu-bionic64.box \
1617
"https://mirrors.ustc.edu.cn/ubuntu-cloud-images/bionic/current/bionic-server-cloudimg-amd64-vagrant.box"
18+
19+
./play.sh
1720
```
18-
The `start.sh` add some extensions for Vagrant, like `vagrant-disksize` which enlarge the disk size of the VM. The script will then call `vagrant up` command to bootup the VM. After the VM is up, the `provision.sh` will be automatically executed which will install the dependencies for SQLFlow. Provision is a one-shot work, after it is done, we will have an environment with SQLFlow, docker and minikube installed.
21+
The `play.sh` add some extensions for Vagrant, like `vagrant-disksize` which enlarges the disk size of the VM. The script will then call `vagrant up` command to bootup the VM. After the VM is up, the `provision.sh` will be automatically executed which will install the dependencies for SQLFlow. Provision is a one-shot work, after it is done, we will have an environment with SQLFlow, docker and minikube installed.
1922
2023
1. Log on the VM and start SQLFlow playground. Run the `start.bash` script, it will pull some docker images and start the playground minikube cluster. As the images pulling may be slow, the script might fail sometimes. Feel free to re-run the script until gou get some output like `Access Jupyter Notebook at ...`.
2124
```bash
@@ -24,7 +27,7 @@
2427
cd desktop
2528
./start.bash
2629
```
27-
1. After the minikube is started up. You can and access the `Jupyter Notebook` from your desktop. Or you can use SQLFlow command-line tool `sqlflow` to access the `SQLFlow server`. Just follow the output of the `start.bash`, it will give you some hint.
30+
1. After the minikube is started up. You can access the `Jupyter Notebook` from your desktop. Or you can use SQLFlow command-line tool [sqlflow](https://github.com/sql-machine-learning/sqlflow/blob/develop/doc/run/cli.md) to access the `SQLFlow server`. Just follow the output of the `start.bash`, it will give you some hint.
2831
1. After playing a while, you may want to stop SQLFlow playground, just log on the VM again and stop the minikube cluster.
2932
```bash
3033
vagrant ssh # optional if you already logged on

play.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ EOF
3636
exit 1
3737
fi
3838

39-
if [[ -n "$(vagrant global-status --prune | grep -o 'playground')" ]]; then
39+
if [[ -n "$(vagrant global-status --prune | grep 'playground' | grep 'running')" ]]; then
4040
echo "The playground VM is running."
41+
echo "You may want to log on the VM with: vagrant ssh"
42+
echo "Or stop the playground with: vagrant halt"
4143
exit 0
4244
fi
4345

@@ -56,3 +58,13 @@ fi
5658

5759
echo "Start and provision the playgound VM ..."
5860
vagrant up
61+
62+
echo -e "\033[32m
63+
Playground VM has been successfully set up. You may want to go into the VM and start the SQLFlow playground using the following command:
64+
65+
vagrant ssh
66+
sudo su
67+
cd desktop && ./start.bash
68+
69+
\033[0m"
70+

provision.bash

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ VAGRANT_SHARED_FOLDER=/home/vagrant/desktop
88
source $VAGRANT_SHARED_FOLDER/sqlflow/docker/dev/find_fastest_resources.sh
99

1010
echo "Setting apt-get mirror..."
11+
rm /etc/apt/sources.list && sync
1112
find_fastest_apt_source >/etc/apt/sources.list
1213
apt-get update
1314

@@ -63,9 +64,3 @@ else
6364
fi
6465
echo "Done."
6566

66-
echo "Configure minikube ..."
67-
mkdir -p /home/vagrant/.kube /home/vagrant/.minikube
68-
touch /home/vagrant/.kube/config
69-
chown -R vagrant /home/vagrant/.bashrc
70-
echo "Done."
71-

start.bash

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
cat <<EOF
15+
echo -e "
16+
\033[32m
1617
This script is safe to re-run, feel free to retry when it exits abnormally.
1718
Especially when we are waiting for a pod in Kubernetes cluster, it may
1819
pull image from registry and take a lot of time to startup.
19-
20-
EOF
20+
\033[0m
21+
"
2122

2223
if [[ "$(whoami)" != "root" ]]; then
2324
echo "Please change to root user and retry."

0 commit comments

Comments
 (0)