diff --git a/.devcontainer.json b/.devcontainer.json new file mode 100644 index 00000000..fbf96859 --- /dev/null +++ b/.devcontainer.json @@ -0,0 +1,13 @@ +{ + "image": "mcr.microsoft.com/vscode/devcontainers/base:ubuntu-20.04", + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:1": {}, + "ghcr.io/devcontainers/features/sshd:1": {} + }, + "hostRequirements": { + "cpus": 8, + "memory": "32gb" + }, + "postCreateCommand": "cd e2e/provision/; cp nephio.yaml ~/nephio.yaml && ./gce_install_sandbox.sh | tee ~/gce_install_sandbox.log", + "forwardPorts": [7007, 3000] +} diff --git a/e2e/provision/README.md b/e2e/provision/README.md index 86c8d450..dcfd074d 100644 --- a/e2e/provision/README.md +++ b/e2e/provision/README.md @@ -1,5 +1,7 @@ # Quick Start for GCE +[![Createte a Sandbox in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?repo=nephio-project/test-infra) + ## Step 0: Prerequisites You need a account in GCP and `gcloud` available on your local environment. diff --git a/e2e/provision/Vagrantfile b/e2e/provision/Vagrantfile index 3e14ea8d..39f3bbe8 100644 --- a/e2e/provision/Vagrantfile +++ b/e2e/provision/Vagrantfile @@ -43,7 +43,7 @@ Vagrant.configure('2') do |config| sh.inline = <<-SHELL set -o errexit set -o pipefail - echo "StrictHostKeyChecking no" >> ~/.ssh/config + cd /vagrant/ cp nephio.yaml ~/nephio.yaml ./gce_install_sandbox.sh | tee ~/gce_install_sandbox.log diff --git a/e2e/provision/gce_install_sandbox.sh b/e2e/provision/gce_install_sandbox.sh index 0fceff9c..74070aeb 100755 --- a/e2e/provision/gce_install_sandbox.sh +++ b/e2e/provision/gce_install_sandbox.sh @@ -56,7 +56,7 @@ cat "$HOME/.ssh/id_rsa.pub" >>"$HOME/.ssh/authorized_keys" KVER=$(uname -r) -if ! lsmod | grep -q gtp5g; then +if [[ "${LOAD_GTP5G_MODULE:-false}" == "true" ]] && ! lsmod | grep -q gtp5g; then [[ -d "$HOME/gtp5g" ]] || git clone --depth 1 -b v0.6.8 https://github.com/free5gc/gtp5g.git "$HOME/gtp5g" pushd "$HOME/gtp5g" >/dev/null @@ -91,6 +91,12 @@ if [ "${DEPLOYMENT_TYPE:-r1}" == "one-summit" ]; then done popd >/dev/null else + if ! grep -q "StrictHostKeyChecking no" ~/.ssh/config; then + echo "StrictHostKeyChecking no" >> ~/.ssh/config + fi + if [ "${CODESPACE_NAME-}" ] && ! grep -q "ansible_port: 2222" ~/nephio.yaml; then + echo " ansible_port: 2222" >> ~/nephio.yaml + fi # Management cluster creation if [[ ${DEBUG:-false} != "true" ]]; then ansible-playbook -i ~/nephio.yaml playbooks/cluster.yml diff --git a/e2e/provision/playbooks/cluster.yml b/e2e/provision/playbooks/cluster.yml index 4ef416a0..b00097ee 100644 --- a/e2e/provision/playbooks/cluster.yml +++ b/e2e/provision/playbooks/cluster.yml @@ -20,7 +20,9 @@ roles: - role: andrewrothstein.docker_engine become: true - when: ( container_engine is not defined ) or ( container_engine == "docker" ) + when: + - ( container_engine is not defined ) or ( container_engine == "docker" ) + - not lookup('ansible.builtin.env', 'CODESPACE_NAME') - role: andrewrothstein.podman when: container_engine == "podman" - andrewrothstein.kind