From a31f3be3f149e4c7684727afd2e82bbccd28b8f5 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Wed, 13 Jan 2021 14:20:31 +0000 Subject: [PATCH 1/3] Move from Travis to Semaphore CI We need somewhere that will let us run `kvm`; that excludes GitHub actions and CircleCI (unless we set up our own machines as runners) --- .semaphore/semaphore.yml | 35 +++++++++++++++++++++++++++++++++++ .travis.yml | 31 ------------------------------- 2 files changed, 35 insertions(+), 31 deletions(-) create mode 100644 .semaphore/semaphore.yml delete mode 100644 .travis.yml diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml new file mode 100644 index 000000000..3b7773f15 --- /dev/null +++ b/.semaphore/semaphore.yml @@ -0,0 +1,35 @@ +version: v1.0 +name: CI Build + +agent: + machine: + type: e1-standard-2 + os_image: ubuntu1804 + +blocks: + - name: Run tests + task: + env_vars: + - name: GIMME_GO_VERSION + value: "1.14.2" + jobs: + - name: Tests + commands: + - eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | bash)" # install specific go version + - | + # https://ignite.readthedocs.io/en/latest/installation.html + sudo apt-get install -y cpu-checker + sudo apt-get install -y --no-install-recommends dmsetup openssh-client git binutils + # Install containerd if it's not present -- prevents breaking docker-ce installations + sudo which containerd || sudo apt-get install -y --no-install-recommends containerd + - kvm-ok + - | + export CNI_VERSION=v0.8.7 + export ARCH=$([ $(uname -m) = "x86_64" ] && echo amd64 || echo arm64) + sudo mkdir -p /opt/cni/bin + curl -sSL https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-linux-${ARCH}-${CNI_VERSION}.tgz | sudo tar -xz -C /opt/cni/bin + - checkout + - make ignite ignite-spawn ignited bin/amd64/Dockerfile GO_MAKE_TARGET=local + - make test + - make root-test + - make e2e-nobuild # this depends on Semaphore CI's support for nested virtualization diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 818dcb595..000000000 --- a/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -language: minimal # git checkout will not be in a GOPATH -dist: bionic # Ubuntu 18.04 required for nested-virt - -services: -- docker - -env: -- GIMME_GO_VERSION=1.14.2 - -install: -- eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | bash)" # install specific go version -- | - # https://ignite.readthedocs.io/en/latest/installation.html - sudo apt-get install -y cpu-checker - sudo apt-get install -y --no-install-recommends dmsetup openssh-client git binutils - sudo which containerd || sudo apt-get install -y --no-install-recommends containerd - # Install containerd if it's not present -- prevents breaking docker-ce installations -- kvm-ok -- | - export CNI_VERSION=v0.8.7 - export ARCH=$([ $(uname -m) = "x86_64" ] && echo amd64 || echo arm64) - sudo mkdir -p /opt/cni/bin - curl -sSL https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-linux-${ARCH}-${CNI_VERSION}.tgz | sudo tar -xz -C /opt/cni/bin - -before_script: -- make ignite ignite-spawn ignited bin/amd64/Dockerfile GO_MAKE_TARGET=local - -script: -- make test -- make root-test -- make e2e-nobuild # this depends on Travis CI's support for nested virtualization From 3345a6022bc21f47909c4fcca458e6cf9f4b36e5 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Wed, 13 Jan 2021 17:59:21 +0000 Subject: [PATCH 2/3] Update tests that have a dependency on current year --- cmd/ignite/run/testdata/output/ps-filtered-table.txt | 2 +- cmd/ignite/run/testdata/output/ps-table.txt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/ignite/run/testdata/output/ps-filtered-table.txt b/cmd/ignite/run/testdata/output/ps-filtered-table.txt index 4c96fb52e..5f9d51b64 100644 --- a/cmd/ignite/run/testdata/output/ps-filtered-table.txt +++ b/cmd/ignite/run/testdata/output/ps-filtered-table.txt @@ -1,2 +1,2 @@ VM ID IMAGE KERNEL SIZE CPUS MEMORY CREATED STATUS IPS PORTS NAME -bfc80c948b1e2419 foo/bar:latest foo/bar:latest 0 B 0 0 B 20y ago Stopped vm2 +bfc80c948b1e2419 foo/bar:latest foo/bar:latest 0 B 0 0 B 21y ago Stopped vm2 diff --git a/cmd/ignite/run/testdata/output/ps-table.txt b/cmd/ignite/run/testdata/output/ps-table.txt index d69208282..b4a77dfe1 100644 --- a/cmd/ignite/run/testdata/output/ps-table.txt +++ b/cmd/ignite/run/testdata/output/ps-table.txt @@ -1,4 +1,4 @@ VM ID IMAGE KERNEL SIZE CPUS MEMORY CREATED STATUS IPS PORTS NAME -20e1d566ce318ada foo/bar:latest foo/bar:latest 0 B 0 0 B 20y ago Stopped vm1 -bfc80c948b1e2419 foo/bar:latest foo/bar:latest 0 B 0 0 B 20y ago Stopped vm2 -cddc37ba657766e3 foo/bar:latest foo/bar:latest 0 B 0 0 B 20y ago Stopped vm3 +20e1d566ce318ada foo/bar:latest foo/bar:latest 0 B 0 0 B 21y ago Stopped vm1 +bfc80c948b1e2419 foo/bar:latest foo/bar:latest 0 B 0 0 B 21y ago Stopped vm2 +cddc37ba657766e3 foo/bar:latest foo/bar:latest 0 B 0 0 B 21y ago Stopped vm3 From 01d86c5ddc33e62c77ace83ca886b7b724637c96 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Wed, 13 Jan 2021 18:12:38 +0000 Subject: [PATCH 3/3] Inherit environment to root-test So it can find Go commands and libraries --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6440ee9f0..c54bd3544 100644 --- a/Makefile +++ b/Makefile @@ -192,7 +192,7 @@ test-in-docker: # Run tests that require root. root-test: - sudo $(shell which go) test -mod=vendor -v $(TEST_REQUIRES_ROOT_PACKAGES) -count=$(TEST_COUNT) + sudo -E $(shell which go) test -mod=vendor -v $(TEST_REQUIRES_ROOT_PACKAGES) -count=$(TEST_COUNT) graph: hack/graph.sh @@ -278,7 +278,7 @@ bin/docs/builder-image.tar: e2e: build-all e2e-nobuild e2e-nobuild: - sudo IGNITE_E2E_HOME=$(shell pwd) \ + sudo -E IGNITE_E2E_HOME=$(shell pwd) \ $(shell which go) test \ $(TEST_E2E_PACKAGES) -v -mod=vendor \ -count $(E2E_COUNT) \