Skip to content

Commit 730a9e5

Browse files
authored
Merge pull request #50 from sql-machine-learning/modify_doc
Add cache for vm, update doc.
2 parents d6b8621 + cc59aa7 commit 730a9e5

File tree

5 files changed

+29
-13
lines changed

5 files changed

+29
-13
lines changed

dev.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
### For Developers
44

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.
5+
1. Install [VirtualBox 6.1.6](https://www.virtualbox.org/) and [Vagrant 2.2.7](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
@@ -47,9 +47,10 @@ According to this [tutorial](https://www.techrepublic.com/article/how-to-import-
4747
4848
### For End-users
4949
50-
To run SQLFlow on a desktop computer running Windows, Linux, or macOS, you need to download
50+
To run SQLFlow on a desktop computer running Windows, Linux, or macOS, follow below steps:
51+
1. install [VirtualBox](https://www.virtualbox.org/) (v6.1.6 is recommended)
5152
52-
1. the released VirtualBox `.ova` file, you have two choices:
53+
1. download the released VirtualBox `.ova` file, you have two choices:
5354
- the minimized image (about 600M): shipped with all bootstrap files but no dependency docker images. When you start the playground, you will wait for a while to download the latest docker images, minikube framework and other packages.
5455
```bash
5556
wget -c http://cdn.sqlflow.tech/latest/SQLFlowPlaygroundBare.ova
@@ -58,9 +59,9 @@ To run SQLFlow on a desktop computer running Windows, Linux, or macOS, you need
5859
```bash
5960
wget -c http://cdn.sqlflow.tech/latest/SQLFlowPlaygroundFull.ova
6061
```
61-
1. optional, the [sqlflow](https://github.com/sql-machine-learning/sqlflow/blob/develop/doc/run/cli.md) command-line tool released by SQLFlow CI.
62+
1. optional, download the [sqlflow](https://github.com/sql-machine-learning/sqlflow/blob/develop/doc/run/cli.md) command-line tool released by SQLFlow CI.
6263
63-
If you have VirtualBox installed, you can import the `SQLFlowPlayground.ova` file and start a VM. After that, you can log in the system through the VirtualBox GUI or through a ssh connection like below. The default password of `root` is `sqlflow`.
64+
After VirtualBox is installed, you can import the `.ova` file and start a VM. If you have a relative lower configuration, you can adjust the CPU core and RAM amount in VirtualBox's setting panel, say, to 2 cores and 4G RAM. After that, you can log in the system through the VirtualBox GUI or through a ssh connection like below. The default password of `root` is `sqlflow`.
6465
```bash
6566
ssh -p2222 root@127.0.0.1
6667
root@127.0.0.1's password: sqlflow

provision.bash

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +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 -rf /var/lib/apt/lists/*
11+
rm -rf /var/lib/apt/lists/* /etc/apt/sources.list
1212
find_fastest_apt_source >/etc/apt/sources.list
1313
apt-get update
1414

@@ -91,3 +91,11 @@ sed -i -e 's/^PasswordAuthentication no/PasswordAuthentication yes/g' \
9191
/etc/ssh/sshd_config
9292
service ssh restart
9393
echo "Done."
94+
95+
96+
echo "Disable cloudimg grub settings ..."
97+
sed -i -e 's/^GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"/GRUB_CMDLINE_LINUX_DEFAULT="quiet"/g' \
98+
-e 's/^#GRUB_TERMINAL=console$/GRUB_TERMINAL=console/g' /etc/default/grub
99+
rm /etc/default/grub.d/50-cloudimg-settings.cfg
100+
update-grub
101+
echo "Done."

release.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ VBoxManage sharedfolder remove "$vm" --name home_vagrant_desktop
3232
VBoxManage sharedfolder remove "$vm" --name vagrant
3333
echo "Done."
3434

35-
echo "Rebind serial port file"
35+
echo "Rebind serial port file and disable it because it does not work on Windows"
3636
VBoxManage modifyvm "$vm" --uartmode1 file /tmp/playground.log
37+
VBoxManage modifyvm "$vm" --uart1 off
3738
echo "Done."
3839

3940
echo "Exporting vm ..."

sqlflow

Submodule sqlflow updated 397 files

start.bash

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,25 @@ fi
2929
filebase=/root/scripts
3030

3131
echo "Docker pull dependency images, you can comment this if already have them ..."
32-
if [[ -d "/root/.cache" ]]; then
33-
echo "Cache found at /root/.cache ..."
34-
if [[ ! -f "/root/.cache/.loaded" ]]; then
35-
find /root/.cache/* | xargs -I'{}' docker load -i '{}'
36-
touch /root/.cache/.loaded
32+
if [[ -d "/root/.sqlflow" ]]; then
33+
echo "Cache found at /root/.sqlflow ..."
34+
if [[ ! -f "/root/.sqlflow/.loaded" ]]; then
35+
find /root/.sqlflow/* | xargs -I'{}' sh -c "docker load -i '{}' && sleep 10"
36+
touch /root/.sqlflow/.loaded
3737
fi
38+
# use local step images for model zoo model
39+
docker tag sqlflow/sqlflow:step sqlflow/sqlflow:latest
3840
else
3941
# c.f. https://github.com/sql-machine-learning/sqlflow/blob/develop/.travis.yml
4042
docker pull sqlflow/sqlflow:jupyter
4143
docker pull sqlflow/sqlflow:mysql
4244
docker pull sqlflow/sqlflow:server
4345
docker pull sqlflow/sqlflow:step
46+
docker pull sqlflow/sqlflow:modelzooserver
4447
docker pull argoproj/argoexec:v2.7.7
4548
docker pull argoproj/argocli:v2.7.7
4649
docker pull argoproj/workflow-controller:v2.7.7
50+
docker tag sqlflow/sqlflow:modelzooserver sqlflow/sqlflow:model_zoo
4751
fi
4852
echo "Done."
4953

@@ -163,6 +167,7 @@ expose argo service/argo-server 9001:2746
163167
expose default pod/sqlflow-server 8888:8888
164168
expose default pod/sqlflow-server 3306:3306
165169
expose default pod/sqlflow-server 50051:50051
170+
expose default pod/sqlflow-server 50055:50055
166171

167172
# Get Jupyter Notebook's token, for single-user mode, we disabled the token checking
168173
# jupyter_addr=$(kubectl logs pod/sqlflow-server notebook | grep -o -E "http://127.0.0.1[^?]+\?token=.*" | head -1)
@@ -176,6 +181,7 @@ Access Jupyter Notebook at: http://localhost:8888
176181
Access Kubernetes Dashboard at: http://localhost:9000
177182
Access Argo Dashboard at: http://localhost:9001
178183
Access SQLFlow with cli: ./sqlflow --data-source="\"$mysql_addr\""
184+
Access SQLFlow Model Zoo at: localhost:50055
179185
180186
Stop minikube with: minikube stop
181187
Stop vagrant vm with: vagrant halt

0 commit comments

Comments
 (0)