Skip to content

Commit

Permalink
Remove gce_* prefix (#97)
Browse files Browse the repository at this point in the history
* Remove gce_ prefix from *.sh scripts

Signed-off-by: Victor Morales <v.morales@samsung.com>

* Fix e2e CI execution

Signed-off-by: Victor Morales <v.morales@samsung.com>

---------

Signed-off-by: Victor Morales <v.morales@samsung.com>
  • Loading branch information
electrocucaracha authored Jun 14, 2023
1 parent a6baf9c commit 96e3c64
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .prow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ presubmits:
args:
- "-c"
- |
cd e2e/terraform && terraform init && terraform plan && \
terraform apply -auto-approve; terraform destroy -auto-approve
set -eE; cd e2e/terraform; trap 'terraform destroy -auto-approve' EXIT;
terraform init && timeout 45m terraform apply -auto-approve
volumeMounts:
- name: satoken
mountPath: "/etc/satoken"
Expand Down Expand Up @@ -225,8 +225,8 @@ periodics:
args:
- "-c"
- |
cd e2e/terraform && terraform init && terraform plan && \
terraform apply -auto-approve; terraform destroy -auto-approve
set -eE; cd e2e/terraform; trap 'terraform destroy -auto-approve' EXIT;
terraform init && timeout 45m terraform apply -auto-approve
volumeMounts:
- name: satoken
mountPath: "/etc/satoken"
Expand Down
2 changes: 1 addition & 1 deletion e2e/launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUNE2E=${2:-false}
REPO=${3:-nephio-project/test-infra}
BRANCH=${4:-main}

STARTUP_SCRIPT_URL="https://raw.githubusercontent.com/$REPO/$BRANCH/e2e/provision/gce_init.sh"
STARTUP_SCRIPT_URL="https://raw.githubusercontent.com/$REPO/$BRANCH/e2e/provision/init.sh"
FULLREPO="https://github.com/$REPO.git"

gcloud compute instances delete -q "$VM" || echo
Expand Down
6 changes: 3 additions & 3 deletions e2e/provision/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ gcloud compute instances create --machine-type e2-standard-8 \
--boot-disk-size 200GB \
--image-family=ubuntu-2004-lts \
--image-project=ubuntu-os-cloud \
--metadata=startup-script-url=https://raw.githubusercontent.com/nephio-project/test-infra/main/e2e/provision/gce_init.sh \
--metadata=startup-script-url=https://raw.githubusercontent.com/nephio-project/test-infra/main/e2e/provision/init.sh \
nephio-r1-e2e
```

Expand All @@ -43,7 +43,7 @@ comma-delimited key=value pairs in the `--metadata` flag).
- `nephio-test-infra-repo` defaults to
`https://github.com/nephio-project/test-infra.git` but you can set it to
your repository when testing changes to these scripts, and your repo will
then be pulled by the `gce_init.sh` instead.
then be pulled by the `init.sh` instead.
- `nephio-test-infra-branch` defaults to `main` but you can use it along with
the repo value to choose a branch in the repo for testing.

Expand Down Expand Up @@ -600,7 +600,7 @@ Order or create a VM with the following specification:

## Step 2: Kick off the install
```
wget -O - https://raw.githubusercontent.com/nephio-project/test-infra/main/e2e/provision/gce_init.sh | \
wget -O - https://raw.githubusercontent.com/nephio-project/test-infra/main/e2e/provision/init.sh | \
sudo NEPHIO_DEBUG=false \
NEPHIO_USER=ubuntu \
bash
2 changes: 1 addition & 1 deletion e2e/provision/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Vagrant.configure('2') do |config|
echo "StrictHostKeyChecking no" >> ~/.ssh/config
cd /vagrant/
cp nephio.yaml ~/nephio.yaml
./gce_install_sandbox.sh | tee ~/gce_install_sandbox.log
./install_sandbox.sh | tee ~/install_sandbox.log
SHELL
end

Expand Down
2 changes: 1 addition & 1 deletion e2e/provision/gce_init.sh → e2e/provision/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ chown $NEPHIO_USER:$NEPHIO_USER /home/$NEPHIO_USER/.bash_aliases
sed -e "s/vagrant/$NEPHIO_USER/" </home/$NEPHIO_USER/test-infra/e2e/provision/nephio.yaml >/home/$NEPHIO_USER/nephio.yaml
cd ./test-infra/e2e/provision
export DEBUG DEPLOYMENT_TYPE
runuser -u $NEPHIO_USER ./gce_install_sandbox.sh
runuser -u $NEPHIO_USER ./install_sandbox.sh

# Grant Docker permissions to current user
if ! getent group docker | grep -q "$NEPHIO_USER"; then
Expand Down
File renamed without changes.
7 changes: 3 additions & 4 deletions e2e/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ resource "google_compute_instance" "lab_instances" {
allow_stopping_for_update = true
metadata = {
ssh-keys = "${var.ansible_user}:${file(var.ssh_pub_key)}"
metadata_startup_script = file("${path.module}/../provision/gce_init.sh")
metadata_startup_script = file("${path.module}/../provision/init.sh")
nephio-run-e2e = false
}
boot_disk {
Expand Down Expand Up @@ -91,9 +91,8 @@ resource "google_compute_instance" "e2e_instances" {
}
inline = [
"cd provision/",
"chmod +x gce_install_sandbox.sh",
"export DEBUG=true",
"timeout --preserve-status 30m ./gce_install_sandbox.sh"
"chmod +x install_sandbox.sh",
"DEBUG=true ./install_sandbox.sh"
]
}
}

0 comments on commit 96e3c64

Please sign in to comment.