Skip to content

Commit

Permalink
Merge pull request #321 from networkservicemesh/remove-cloudtest
Browse files Browse the repository at this point in the history
feat: get rid of cloudtest
  • Loading branch information
edwarnicke authored Oct 3, 2022
2 parents a703e19 + 28affb7 commit b9c29ce
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 107 deletions.
59 changes: 41 additions & 18 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ jobs:
name: Amazon Elastic Kubernetes Service
runs-on: ubuntu-latest
steps:
- name: Checkout deployments
uses: actions/checkout@v2
with:
repository: networkservicemesh/deployments-k8s
path: networkservicemesh/deployments-k8s
- name: Checkout files
uses: actions/checkout@v2
with:
Expand All @@ -85,30 +80,58 @@ jobs:
uses: actions/setup-go@v1
with:
go-version: 1.16
- name: Install cloudtest
- name: Install deps
working-directory: ${{ github.repository }}
run: |
apt-get update && apt-get -y install curl dnsutils
curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp
mv /tmp/eksctl /usr/local/bin
eksctl version
curl -o aws-iam-authenticator https://s3.us-west-2.amazonaws.com/amazon-eks/1.21.2/2021-07-05/bin/linux/amd64/aws-iam-authenticator
chmod 755 aws-iam-authenticator
mv ./aws-iam-authenticator /usr/local/bin
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.23.6/bin/linux/amd64/kubectl
chmod +x kubectl
mkdir -p ~/.local/bin
mv ./kubectl ~/.local/bin/kubectl
kubectl version --client
- name: Create clusters
working-directory: ${{ github.repository }}
run: |
go get github.com/networkservicemesh/cloudtest@master
eksctl create cluster \
--name "${AWS_CLUSTER_NAME}" \
--version 1.22 \
--nodegroup-name "${AWS_CLUSTER_NAME}-workers" \
--node-type t3.xlarge \
--nodes 2
env:
GO111MODULE: on
GOBIN: /bin
- name: Run tests with cloudtest
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-2
AWS_CLUSTER_NAME: aws-${{ github.run_id }}-${{ github.run_number }}
- name: Run tests
working-directory: ${{ github.repository }}
run: |
cloudtest
go test -count 1 -timeout 1h55m -race -v ./...
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-2
- name: Publish test report
uses: mikepenz/action-junit-report@v2.1.0
- name: Cleanup
if: ${{ always() }}
with:
report_paths: "**/cloud_test/results/junit.xml"
suite_regex: "Test*"
github_token: ${{ secrets.GITHUB_TOKEN }}
working-directory: ${{ github.repository }}
run: |
eksctl delete cluster --name "${AWS_CLUSTER_NAME}"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-2
AWS_CLUSTER_NAME: aws-${{ github.run_id }}-${{ github.run_number }}
- name: Upload logs
uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: logs-${{ github.run_number }}
path: ${{ github.repository }}/.tests/cloud_test/
path: ${{ github.repository }}/logs
27 changes: 18 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,27 @@

Integration K8s AWS runs NSM system tests on an AWS EKS instance.

[cloudtest](https://github.com/networkservicemesh/cloudtest) is used to run the tests from [deployments-k8s](https://github.com/networkservicemesh/deployments-k8s/) in GKE.

You can see exactly what cloudtest does to setup a cluster in AWS [here](cloudtest/aws.yaml).

Effectively it just sets the indicated environment variables
Effectively you need just set these environment variables and create clusters
```bash
AWS_CLUSTER_NAME=$(cluster-name)-$(date)-${GITHUB_RUN_NUMBER}-$(rands10)
KUBECONFIG
NSM_AWS_SERVICE_SUFFIX=${AWS_CLUSTER_NAME}
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
GITHUB_RUN_NUMBER
AWS_CLUSTER_NAME
```

## Create cluster

```bash
eksctl create cluster \
--name "${AWS_CLUSTER_NAME}" \
--version 1.22 \
--nodegroup-name "${AWS_CLUSTER_NAME}-workers" \
--node-type t3.xlarge \
--nodes 2
```

and then runs the [aws-start.sh](scripts/aws-start.sh)
## Destroy cluster

```bash
eksctl delete cluster --name "${AWS_CLUSTER_NAME}"
```
25 changes: 0 additions & 25 deletions cloudtest/aws.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions cloudtest/tests.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.16

require (
github.com/googleapis/gnostic v0.5.1 // indirect
github.com/networkservicemesh/integration-tests v0.0.0-20220714003210-d16a4757525e
github.com/networkservicemesh/integration-tests v0.0.0-20220930092315-f9efc3226eb0
github.com/stretchr/testify v1.7.0
gopkg.in/yaml.v2 v2.4.0 // indirect
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8m
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
github.com/networkservicemesh/gotestmd v0.0.0-20220628095933-eabbdc09e0dc h1:1L/OisEFsOyhwaqeJpYmM1nlJ2dBusUMiszPDBlUip0=
github.com/networkservicemesh/gotestmd v0.0.0-20220628095933-eabbdc09e0dc/go.mod h1:8EWnekTRNX+NxBdTFE24WqUoM7SgJHbiafDBrIIdOmQ=
github.com/networkservicemesh/integration-tests v0.0.0-20220714003210-d16a4757525e h1:lR+fcrqtBDoBEKQW39mtrMTLRFKOYfoY2ZLTPjayQkI=
github.com/networkservicemesh/integration-tests v0.0.0-20220714003210-d16a4757525e/go.mod h1:FiN76Emti1ZyhWMIG6vg6kXG//0wSCoKokBvp6i8bjM=
github.com/networkservicemesh/integration-tests v0.0.0-20220930092315-f9efc3226eb0 h1:TQ8aBy09s5Cu6YRDp7QILUK4QWCKhmkBs1kIs7rORj4=
github.com/networkservicemesh/integration-tests v0.0.0-20220930092315-f9efc3226eb0/go.mod h1:FiN76Emti1ZyhWMIG6vg6kXG//0wSCoKokBvp6i8bjM=
github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
Expand Down
3 changes: 0 additions & 3 deletions scripts/aws-destroy.sh

This file was deleted.

25 changes: 0 additions & 25 deletions scripts/aws-start.sh

This file was deleted.

12 changes: 0 additions & 12 deletions scripts/destroy-old-clusters.sh

This file was deleted.

0 comments on commit b9c29ce

Please sign in to comment.