diff --git a/e2e/provision/README.md b/e2e/provision/README.md new file mode 100644 index 00000000..f54b2b4f --- /dev/null +++ b/e2e/provision/README.md @@ -0,0 +1,49 @@ +# Quick Start for GCE + +1. Create a VM: + +```bash +$ gcloud compute instances create --machine-type e2-standard-8 --boot-disk-size 60GB nephio-r1-e2e +``` + +2. SSH to the VM: + +Googlers (you also need to run `gcert`): +```bash +$ gcloud compute ssh nephio-r1-e2e -- -o ProxyCommand='corp-ssh-helper %h %p' -L 7007:localhost:7007 +``` + +Everyone else: +```bash +$ gcloud compute ssh nephio-r1-e2e -- -L 7007:localhost:7007 +``` + +3. On the machine, run this: + +```bash +$ sudo apt-get install -y git +$ git clone https://github.com/nephio-project/test-infra.git +$ sed -e "s/vagrant/$USER/" < test-infra/e2e/provision/nephio.yaml > ~/nephio.yaml +$ cd test-infra/e2e/provision/ +$ ./gce_run.sh +$ kubectl --kubeconfig ~/.kube/mgmt-config port-forward --namespace=nephio-webui svc/nephio-webui 7007 +``` + +You can now navigate to +[http://localhost:7007/config-as-data](http://localhost:7007/config-as-data) to +browse the UI. + +You probably want a second ssh window open to run `kubectl` commands, etc., +without the port forwarding (which would fail if you try to open a second ssh +connection with that setting). + +Googlers: +```bash +$ gcloud compute ssh nephio-r1-e2e -- -o ProxyCommand='corp-ssh-helper %h %p' +``` + +Everyone else: +```bash +$ gcloud compute ssh nephio-r1-e2e +``` + diff --git a/e2e/provision/gce_run.sh b/e2e/provision/gce_run.sh index 14656f2e..ebfbb768 100755 --- a/e2e/provision/gce_run.sh +++ b/e2e/provision/gce_run.sh @@ -30,6 +30,8 @@ rm -f ~/.ssh/id_rsa* echo -e "\n\n\n" | ssh-keygen -t rsa -N "" cat "$HOME/.ssh/id_rsa.pub" >>"$HOME/.ssh/authorized_keys" +KVER=$(uname -r) + if ! lsmod | grep -q gtp5g; then [[ -d "$HOME/gtp5g" ]] || git clone --depth 1 -b v0.6.8 https://github.com/free5gc/gtp5g.git "$HOME/gtp5g" @@ -38,6 +40,9 @@ if ! lsmod | grep -q gtp5g; then sudo apt-get update sudo apt-get -y install gcc fi + if [[ ! -d "/lib/modules/$KVER/build" ]]; then + sudo apt-get -y install "linux-headers-$KVER" + fi make sudo make install sudo modprobe gtp5g