Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add calico #611

Merged
merged 2 commits into from
Mar 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,64 @@ jobs:
with:
name: Containers logs
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/${{ matrix.image }}-logs
calico-kind:
runs-on: ubuntu-latest
env:
KUBERNETES_VERSION: ${{ secrets.NSM_KUBERNETES_VERSION }}
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/setup-go@v1
with:
go-version: 1.16
github-token: ${{ github.token }}
- name: Set go env
run: |
echo GOPATH=$GITHUB_WORKSPACE >> $GITHUB_ENV
echo GO111MODULE=on >> $GITHUB_ENV
echo $GITHUB_WORKSPACE/bin >> $GITHUB_PATH
- name: Set kubernetes version
run: |
if [[ $KUBERNETES_VERSION=="" ]]; then
echo "KUBERNETES_VERSION=v1.22.1" >> $GITHUB_ENV
fi
- uses: actions/checkout@v2
with:
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}
- uses: engineerd/[email protected]
with:
config: src/github.com/${{ github.repository }}/cluster-config-calico.yaml
version: v0.11.1
image: kindest/node:${{ env.KUBERNETES_VERSION }}
wait: 0s
- name: Setup external CNI plugin
run: |
kubectl apply -f https://projectcalico.docs.tigera.io/v3.22/manifests/tigera-operator.yaml
kubectl apply -f https://raw.githubusercontent.com/projectcalico/vpp-dataplane/master/yaml/calico/installation-default.yaml
kubectl apply -k ${{ github.workspace }}/src/github.com/${{ github.repository }}/calico
kubectl rollout status -n calico-vpp-dataplane ds/calico-vpp-node --timeout=5m
- name: Check kind cluster
run: |
kubectl version
kubectl cluster-info
kubectl get pods --all-namespaces
echo "current-context:" $(kubectl config current-context)
echo "environment-kubeconfig:" ${KUBECONFIG}
working-directory: ${{ github.workspace }}/src/github.com/${{ github.repository }}
- name: Integration tests
run: |
go test -count 1 -timeout 1h20m -race -v -run Calico
env:
ARTIFACTS_DIR: calico-logs/${{ env.KUBERNETES_VERSION }}
working-directory: ${{ github.workspace }}/src/github.com/${{ github.repository }}
- name: Upload artifacts
if: ${{ success() || failure() || cancelled() }}
uses: actions/upload-artifact@v2
with:
name: Containers logs
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/calico-logs
interdomain-kind:
runs-on: ubuntu-latest
env:
Expand Down
9 changes: 9 additions & 0 deletions calico/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- https://raw.githubusercontent.com/projectcalico/vpp-dataplane/master/yaml/generated/calico-vpp-kind.yaml

patchesStrategicMerge:
- patch.yaml
19 changes: 19 additions & 0 deletions calico/patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
# For our purposes it is sufficient to use fewer resources. Using default values can lead to lack of resources.
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: calico-vpp-node
namespace: calico-vpp-dataplane
spec:
template:
spec:
containers:
- name: agent
resources:
requests:
cpu: 150m
- name: vpp
resources:
requests:
cpu: 250m
44 changes: 44 additions & 0 deletions calico_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright (c) 2022 Cisco and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package main

import (
"testing"

"github.com/stretchr/testify/suite"

"github.com/networkservicemesh/integration-tests/suites/basic"
"github.com/networkservicemesh/integration-tests/suites/heal"
"github.com/networkservicemesh/integration-tests/suites/memory"
"github.com/networkservicemesh/integration-tests/suites/observability"
)

func TestRunHealSuiteCalico(t *testing.T) {
suite.Run(t, new(heal.Suite))
}

func TestRunBasicSuiteCalico(t *testing.T) {
suite.Run(t, new(basic.Suite))
}

func TestRunMemorySuiteCalico(t *testing.T) {
suite.Run(t, new(memory.Suite))
}

func TestRunObservabilitySuiteCalico(t *testing.T) {
suite.Run(t, new(observability.Suite))
}
10 changes: 10 additions & 0 deletions cluster-config-calico.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
- role: worker
networking:
disableDefaultCNI: true
ipFamily: dual
31 changes: 31 additions & 0 deletions interdomain_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright (c) 2021-2022 Doc.ai and/or its affiliates.
//
// Copyright (c) 2022 Cisco and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package main

import (
"testing"

"github.com/stretchr/testify/suite"

"github.com/networkservicemesh/integration-tests/suites/interdomain"
)

func TestRunInterdomainSuite(t *testing.T) {
suite.Run(t, new(interdomain.Suite))
}
9 changes: 3 additions & 6 deletions entry_point_test.go → main_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright (c) 2021-2022 Doc.ai and/or its affiliates.
//
// Copyright (c) 2022 Cisco and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -14,7 +16,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package test
package main

import (
"testing"
Expand All @@ -24,7 +26,6 @@ import (
"github.com/networkservicemesh/integration-tests/suites/basic"
"github.com/networkservicemesh/integration-tests/suites/features"
"github.com/networkservicemesh/integration-tests/suites/heal"
"github.com/networkservicemesh/integration-tests/suites/interdomain"
"github.com/networkservicemesh/integration-tests/suites/memory"
"github.com/networkservicemesh/integration-tests/suites/observability"
)
Expand All @@ -48,7 +49,3 @@ func TestRunMemorySuiteSingle(t *testing.T) {
func TestRunObservabilitySuiteSingle(t *testing.T) {
suite.Run(t, new(observability.Suite))
}

func TestRunInterdomainSuite(t *testing.T) {
suite.Run(t, new(interdomain.Suite))
}