Skip to content

Commit

Permalink
Merge pull request #50 from sql-machine-learning/modify_doc
Browse files Browse the repository at this point in the history
Add cache for vm, update doc.
  • Loading branch information
lhw362950217 authored Jul 30, 2020
2 parents d6b8621 + cc59aa7 commit 730a9e5
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 13 deletions.
11 changes: 6 additions & 5 deletions dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### For Developers

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.
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.
1. Clone and update `SQLFlow playground` project.
```bash
git clone https://github.com/sql-machine-learning/playground.git
Expand Down Expand Up @@ -47,9 +47,10 @@ According to this [tutorial](https://www.techrepublic.com/article/how-to-import-
### For End-users
To run SQLFlow on a desktop computer running Windows, Linux, or macOS, you need to download
To run SQLFlow on a desktop computer running Windows, Linux, or macOS, follow below steps:
1. install [VirtualBox](https://www.virtualbox.org/) (v6.1.6 is recommended)
1. the released VirtualBox `.ova` file, you have two choices:
1. download the released VirtualBox `.ova` file, you have two choices:
- 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.
```bash
wget -c http://cdn.sqlflow.tech/latest/SQLFlowPlaygroundBare.ova
Expand All @@ -58,9 +59,9 @@ To run SQLFlow on a desktop computer running Windows, Linux, or macOS, you need
```bash
wget -c http://cdn.sqlflow.tech/latest/SQLFlowPlaygroundFull.ova
```
1. optional, the [sqlflow](https://github.com/sql-machine-learning/sqlflow/blob/develop/doc/run/cli.md) command-line tool released by SQLFlow CI.
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.
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`.
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`.
```bash
ssh -p2222 [email protected]
[email protected]'s password: sqlflow
Expand Down
10 changes: 9 additions & 1 deletion provision.bash
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ VAGRANT_SHARED_FOLDER=/home/vagrant/desktop
source $VAGRANT_SHARED_FOLDER/sqlflow/docker/dev/find_fastest_resources.sh

echo "Setting apt-get mirror..."
rm -rf /var/lib/apt/lists/*
rm -rf /var/lib/apt/lists/* /etc/apt/sources.list
find_fastest_apt_source >/etc/apt/sources.list
apt-get update

Expand Down Expand Up @@ -91,3 +91,11 @@ sed -i -e 's/^PasswordAuthentication no/PasswordAuthentication yes/g' \
/etc/ssh/sshd_config
service ssh restart
echo "Done."


echo "Disable cloudimg grub settings ..."
sed -i -e 's/^GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"/GRUB_CMDLINE_LINUX_DEFAULT="quiet"/g' \
-e 's/^#GRUB_TERMINAL=console$/GRUB_TERMINAL=console/g' /etc/default/grub
rm /etc/default/grub.d/50-cloudimg-settings.cfg
update-grub
echo "Done."
3 changes: 2 additions & 1 deletion release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ VBoxManage sharedfolder remove "$vm" --name home_vagrant_desktop
VBoxManage sharedfolder remove "$vm" --name vagrant
echo "Done."

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

echo "Exporting vm ..."
Expand Down
2 changes: 1 addition & 1 deletion sqlflow
Submodule sqlflow updated 397 files
16 changes: 11 additions & 5 deletions start.bash
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,25 @@ fi
filebase=/root/scripts

echo "Docker pull dependency images, you can comment this if already have them ..."
if [[ -d "/root/.cache" ]]; then
echo "Cache found at /root/.cache ..."
if [[ ! -f "/root/.cache/.loaded" ]]; then
find /root/.cache/* | xargs -I'{}' docker load -i '{}'
touch /root/.cache/.loaded
if [[ -d "/root/.sqlflow" ]]; then
echo "Cache found at /root/.sqlflow ..."
if [[ ! -f "/root/.sqlflow/.loaded" ]]; then
find /root/.sqlflow/* | xargs -I'{}' sh -c "docker load -i '{}' && sleep 10"
touch /root/.sqlflow/.loaded
fi
# use local step images for model zoo model
docker tag sqlflow/sqlflow:step sqlflow/sqlflow:latest
else
# c.f. https://github.com/sql-machine-learning/sqlflow/blob/develop/.travis.yml
docker pull sqlflow/sqlflow:jupyter
docker pull sqlflow/sqlflow:mysql
docker pull sqlflow/sqlflow:server
docker pull sqlflow/sqlflow:step
docker pull sqlflow/sqlflow:modelzooserver
docker pull argoproj/argoexec:v2.7.7
docker pull argoproj/argocli:v2.7.7
docker pull argoproj/workflow-controller:v2.7.7
docker tag sqlflow/sqlflow:modelzooserver sqlflow/sqlflow:model_zoo
fi
echo "Done."

Expand Down Expand Up @@ -163,6 +167,7 @@ expose argo service/argo-server 9001:2746
expose default pod/sqlflow-server 8888:8888
expose default pod/sqlflow-server 3306:3306
expose default pod/sqlflow-server 50051:50051
expose default pod/sqlflow-server 50055:50055

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

0 comments on commit 730a9e5

Please sign in to comment.