Skip to content

Instantly share code, notes, and snippets.

@junjie-landing
Created July 16, 2021 18:04
Show Gist options
  • Save junjie-landing/0849ef27370d3ff754927e7b6ea8a7e3 to your computer and use it in GitHub Desktop.
Save junjie-landing/0849ef27370d3ff754927e7b6ea8a7e3 to your computer and use it in GitHub Desktop.

Run on mac to get VM

brew install --cask virtualbox-extension-pack
wget https://sourceforge.net/projects/osboxes/files/v/vb/59-U-u-svr/20.04/20.04.2/64bit.7z/download
# Create a VirtualBox VM and name it "LL Single Node" (use default NAT networking)
VBoxManage modifyvm "LL Single Node" --natpf1 "SSH,tcp,127.0.0.1,2522,10.0.2.15,22"
VBoxManage modifyvm "LL Single Node" --natpf1 "Web,tcp,127.0.0.1,8080,10.0.2.15,30000"
VBoxManage modifyvm "LL Single Node" --natpf1 "S3,tcp,127.0.0.1,9000,10.0.2.15,9000"
VBoxManage showvminfo "LL Single Node" 

Enable SSH on VM

apt-get update
apt-get upgrade
apt install openssh-server
ufw allow ssh
echo 'PermitRootLogin yes' >>  /etc/ssh/sshd_config
service sshd restart

Log into the VM ssh -p 2522 root@localhost

apt-get install -y apt-transport-https ca-certificates curl wget
curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
apt-get update
apt-get install -y make docker.io awscli kubectl conntrack jq npm
usermod -aG docker osboxes
cd /tmp;wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
#cd /tmp;wget https://storage.googleapis.com/minikube/releases/v1.18.20/minikube-linux-amd64
cp minikube-linux-amd64 /usr/local/bin/minikube
chmod +x /usr/local/bin/minikube
wget https://get.helm.sh/helm-v3.6.2-linux-amd64.tar.gz
tar xvf helm-v3.6.2-linux-amd64.tar.gz
cp linux-amd64/helm /usr/local/bin/
apt remove -y nodejs
npm install --global yarn
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
apt-get install -y nodejs

Log into the VM ssh -p 2522 osboxes@localhost

git clone https://github.com/landing-ai/landing-platform.git
edit line 2 of the Makefile to `machine := $(shell hostname)`
# Matias's API key (staging account)
export AWS_DEFAULT_REGION=us-east-2
export AWS_ACCESS_KEY_ID="ASIA4CMWA5S62XSPVNKZ"
export AWS_SECRET_ACCESS_KEY="YOY2QK64q3TKpKhCLeDTd1U8TudivrrzLmRlhFd1"
export AWS_SESSION_TOKEN="IQoJb3JpZ2luX2VjEHkaCXVzLXdlc3QtMiJHMEUCIHnLXIaugLb3PtEmHPRB6LOIe8k67Zg+F+tLxt98ZCzqAiEA/DQ1YTgriglYxvSSx4KBXv+1S1N7W98dNyAbfkOn3iMqjAMIYhABGgw4Mjk3ODAxOTI0NDUiDIBLlc4qJuYOPcQwzSrpAilJsg5FnsHFpq1OZf+Tw0A1hpKkil/6GSW+t7fyqWZYOsFUz8zMEpV4gflFAIP2r5p2eDwPwvy1IoQb9c1vMm5X+u+vS3geyLC3rSkiiAF7lg6SmHLHRAAT8hYxboH6ig7Z01QuaASpTnC8rtix1BzgfUOdt57iggUUsT70TqEm1Mca1EW36FxVDT5biR2Jsb3M2MQhJMfSx73c/PBsa+QYGwcnqg34xLUcG/QwpDrpurHHgdOTbbt+LdDNNguchoyFy8j1Vhfnq0Ipha7WOJ8VlqVehCO+mJTU511jooxLJr//g+1RlaBPFOwvlNocp3KOhH+vEJTm2ju+JPoYZJAMJGh7ePas2i/QpgibgoAHBTqOAt541UDGLHz0AKS0nlCX9zlLw8WZgXO3ZQUhE2fmFjM09Ez2FGB4lYxkyXIRPkv3dCPuj/oEc4oVSHV8d+helaJQgeh+TBtjGz0vUWDq+LkUun82LKYw87iXhwY6pgGHs75jDB7RMmsDaB+Aaq7AcDmfh9B/zPxrOg2TW6HfZhsZO2nZ4uQqtZoEfRwdsdgFtGUYOiLSbbHesa19tRvfH8Hb0p37wQKLPVX2WGNOQjAS//Ijwfyqk0jeDYtwmT+/2OTOYWi+LxV21ChpKJsdhGqHmjI/4b1pfrdDcK5fPoMlfcTZ05iuiSdyDK6SmBsbxTF+/GJAiEL5eN1AvN5T7K1DHocp"
cd landing-platform/
make init-minikube
helm repo add bitnami https://charts.bitnami.com/bitnami
make init-pgdb
#yarn db:migrate localhost  (this step failed so I call the script manually)
kubectl port-forward --namespace default svc/platform-pgdb-postgresql-ha-pgpool 5432:5432 &
./scripts/db-migration/migrate.sh localhost
#kubectl delete pvc -l release=platform-pgdb
make run-datastores
ADD a bucket on localhost:9000 (U: minioadmin , P: minioadmin)  named landing-platform-test-data
/usr/local/bin/yarn
make all
#make deploy-clef

Utilities

Show cluster services `kubectl get po,deploy,svc,pvc,pv -n default`
Show minikube status `  minikube status`
Shell into a pod `kubectl exec -it pod/clef-server-55fc655785-pwb4k -- fish`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment