Skip to content

Commit 0439a7f

Browse files
committed
Add start.sh and make it call sqlflow/scripts/travis*.sh
1 parent 81a5177 commit 0439a7f

File tree

4 files changed

+27
-58
lines changed

4 files changed

+27
-58
lines changed

Vagrantfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ Vagrant.configure("2") do |config|
1111
config.vm.network "forwarded_port", guest: 50051, host: 50051
1212
config.vm.network "forwarded_port", guest: 8888, host: 8888
1313

14-
# public_network eases debugging -- I can SSH from iMac to the VM
15-
# without the need of forwarding port to the host workstation.
16-
config.vm.network "public_network", ip: "192.168.0.17"
17-
1814
config.vm.provider "virtualbox" do |v|
1915
v.memory = 16384
2016
v.cpus = 8
2117
end
18+
19+
# Bind the host directory ./ into the VM.
20+
config.vm.synced_folder "./", "/home/vagrant/desktop"
2221
end

provision.sh

100644100755
Lines changed: 4 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -20,40 +20,23 @@ docker pull --quiet sqlflow/sqlflow:latest
2020
echo "Done."
2121

2222

23-
echo "Set Kubernetes environment variables ..."
24-
cat >> /home/vagrant/.bashrc <<EOF
25-
export MINIKUBE_WANTUPDATENOTIFICATION=false
26-
export MINIKUBE_WANTREPORTERRORPROMPT=false
27-
export MINIKUBE_HOME=/home/vagrant
28-
export CHANGE_MINIKUBE_NONE_USER=true
29-
export KUBECONFIG=/home/vagrant/.kube/config
30-
export K8S_VERSION=v1.18.2
31-
export MINIKUBE_VERSION=1.1.1
32-
EOF
33-
export K8S_VERSION=v1.18.2
34-
echo "Done."
35-
23+
echo "Export Kubernetes environment variables ..."
24+
$(dirname $0)/sqlflow/scripts/travis/export_k8s_vars.sh
3625

3726
echo "Installing kubectl ..."
3827
if which kubectl > /dev/null; then
3928
echo "kubectl installed. Skip."
4029
else
41-
SITE="https://storage.googleapis.com/kubernetes-release/release"
42-
curl -sLo /usr/local/bin/kubectl \
43-
"$SITE/$K8S_VERSION/bin/linux/amd64/kubectl"
44-
chmod +x /usr/local/bin/kubectl
30+
$(dirname $0)/sqlflow/scripts/travis/install_kubectl.sh
4531
fi
4632
echo "Done."
4733

4834

4935
echo "Installing minikube ..."
50-
# c.f. https://kubernetes.io/docs/tasks/tools/install-minikube/
5136
if which minikube > /dev/null; then
5237
echo "minikube installed. Skip."
5338
else
54-
SITE="https://storage.googleapis.com/minikube/releases"
55-
curl -sLo /usr/local/bin/minikube "$SITE/latest/minikube-linux-amd64"
56-
chmod +x /usr/local/bin/minikube
39+
$(dirname $0)/sqlflow/scripts/travis/install_minikube.sh
5740
fi
5841
echo "Done."
5942

@@ -63,35 +46,3 @@ mkdir -p /home/vagrant/.kube /home/vagrant/.minikube
6346
touch /home/vagrant/.kube/config
6447
chown -R vagrant /home/vagrant/.bashrc
6548
echo "Done."
66-
67-
68-
echo "Start minikube cluster ..."
69-
if which conntrack > /dev/null; then
70-
echo "Skip installing contrack because it has been installed."
71-
else
72-
# Kubernetes 1.18.2 requires conntrack.
73-
sudo apt-get -qq install -y conntrack
74-
fi
75-
echo "Done."
76-
77-
78-
echo "Write /home/vagrant/start_minikube.sh ..."
79-
cat > /home/vagrant/start_minikube.sh <<EOF
80-
echo "Start minikube ..."
81-
sudo minikube start \
82-
--vm-driver=none \
83-
--kubernetes-version=$K8S_VERSION
84-
sudo chown -R vagrant: $HOME/.minikube/
85-
kubectl cluster-info
86-
87-
echo "Install Argo on minikube cluster ..."
88-
kubectl create namespace argo
89-
kubectl apply -n argo -f \
90-
https://raw.githubusercontent.com/argoproj/argo/v2.7.7/manifests/install.yaml
91-
kubectl create rolebinding default-admin \
92-
--clusterrole=admin \
93-
--serviceaccount=default:default
94-
echo "Done."
95-
EOF
96-
chmod +x /home/vagrant/start_minikube.sh
97-
chown -R vagrant /home/vagrant/start_minikube.sh

start.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
# Copyright 2020 The SQLFlow Authors. All rights reserved.
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
set -e
16+
17+
$(dirname $0)/sqlflow/scripts/travis/export_k8s_vars.sh
18+
$(dirname $0)/sqlflow/scripts/travis/start_minikube.sh
19+
$(dirname $0)/sqlflow/scripts/travis/start_argo.sh

0 commit comments

Comments
 (0)