Skip to content

Commit 9063ba3

Browse files
committed
Run Skupper integration tests with the skupper-router image
1 parent deebf7a commit 9063ba3

File tree

2 files changed

+164
-0
lines changed

2 files changed

+164
-0
lines changed
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
name: Test skupper-router main
21+
description: Execute skupper integration testing
22+
23+
inputs:
24+
25+
qdrouterdImage:
26+
required: true
27+
description: Image to use in skupper integration tests
28+
29+
skupperGitRef:
30+
required: false
31+
description: Reference to skupper version
32+
default: "master"
33+
34+
runs:
35+
using: "composite"
36+
steps:
37+
38+
- name: Install gotestsum
39+
run: |
40+
curl -OL https://github.com/gotestyourself/gotestsum/releases/download/v1.8.0/gotestsum_1.8.0_linux_amd64.tar.gz
41+
sudo tar -xvf gotestsum_1.8.0_linux_amd64.tar.gz -C /usr/bin gotestsum
42+
shell: bash
43+
44+
- name: Get Go cache paths
45+
id: go-cache-paths
46+
run: |
47+
echo "::set-output name=go-build::$(go env GOCACHE)"
48+
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
49+
shell: bash
50+
51+
- name: Install microk8s
52+
run: |
53+
sudo snap install microk8s --classic --channel=1.23/stable
54+
sudo microk8s enable dns ingress storage registry:size=20Gi host-access:ip=10.0.1.1 metallb:10.64.140.18-10.64.140.88
55+
sudo microk8s status --wait-ready
56+
shell: bash
57+
58+
- name: Export microk8s config
59+
if: "${{ always() }}"
60+
run: |
61+
mkdir -p $HOME/.kube
62+
sudo microk8s config > $HOME/.kube/config
63+
shell: bash
64+
65+
- name: Push image into microk8s
66+
run: |
67+
docker tag "${{ inputs.qdrouterdImage }}" localhost:32000/skupper-router:registry
68+
timeout 5m bash -c 'until nc -z localhost 32000; do sleep 1; done' || :
69+
docker push localhost:32000/skupper-router:registry
70+
podman pull --tls-verify=false localhost:32000/skupper-router:registry
71+
shell: bash
72+
73+
- name: Checkout Skupper
74+
uses: actions/checkout@v2
75+
with:
76+
repository: 'skupperproject/skupper'
77+
ref: "${{ inputs.skupperGitRef }}"
78+
path: 'skupper'
79+
80+
- name: Restore Go cache
81+
uses: actions/cache@v2
82+
with:
83+
path: |
84+
${{ steps.go-cache-paths.outputs.go-build }}
85+
${{ steps.go-cache-paths.outputs.go-mod }}
86+
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
87+
88+
- name: Compile Skupper
89+
run: |
90+
make all
91+
sudo install skupper /usr/local/bin
92+
working-directory: skupper
93+
shell: bash
94+
95+
# https://www.gnu.org/software/make/manual/make.html#Environment
96+
- name: Build and push the controller image
97+
run: |
98+
make -e docker-build
99+
make -e docker-push
100+
shell: bash
101+
working-directory: skupper
102+
env:
103+
# not used, so far; but have to build somewhere we have perms to push
104+
TEST_IMAGE: 'localhost:32000/skupper-test:registry'
105+
106+
SERVICE_CONTROLLER_IMAGE: 'localhost:32000/skupper-service-controller:registry'
107+
SITE_CONTROLLER_IMAGE: 'localhost:32000/skupper-site-controller:registry'
108+
CONFIG_SYNC_IMAGE: 'localhost:32000/skupper-config-sync:registry'
109+
110+
- name: Run Skupper integration tests
111+
run: |
112+
gotestsum --format=standard-verbose -- -p=1 -count=1 -tags=integration -timeout=60m -v ./...
113+
working-directory: skupper
114+
shell: bash
115+
env:
116+
PUBLIC_1_INGRESS_HOST: '10.0.1.1'
117+
QDROUTERD_IMAGE: 'localhost:32000/skupper-router:registry'
118+
SKUPPER_SERVICE_CONTROLLER_IMAGE: 'localhost:32000/skupper-service-controller:registry'
119+
SKUPPER_CONFIG_SYNC_IMAGE: 'localhost:32000/skupper-config-sync:registry'
120+
SKUPPER_SITE_CONTROLLER_IMAGE: 'localhost:32000/skupper-site-controller:registry'
121+
122+
- name: Dump microk8s log (apiserver)
123+
if: "${{ always() }}"
124+
run: |
125+
sudo journalctl -u snap.microk8s.daemon-apiserver > apiserver.log
126+
shell: bash
127+
128+
- name: Dump microk8s log (kubelet)
129+
if: "${{ always() }}"
130+
run: |
131+
sudo journalctl -u snap.microk8s.daemon-kubelet > kubelet.log
132+
shell: bash
133+
134+
- name: Dump microk8s log (kubelite)
135+
if: "${{ always() }}"
136+
run: |
137+
sudo journalctl -u snap.microk8s.daemon-kubelite > kubelite.log
138+
shell: bash
139+
140+
- name: archive logs
141+
if: "${{ always() }}"
142+
uses: actions/upload-artifact@v3
143+
with:
144+
name: TestLogs
145+
path: |
146+
**/*.tar.gz
147+
**/*.log

.github/workflows/build.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,23 @@ jobs:
570570
run: |
571571
docker build -f ./Containerfile .
572572
573+
skupper:
574+
name: Skupper Integration Tests
575+
runs-on: ubuntu-latest
576+
steps:
577+
578+
- uses: actions/checkout@v3
579+
580+
- name: Build the skupper-router image
581+
run: |
582+
docker build -t local/skupper-router:local -f ./Containerfile .
583+
584+
- name: Run the Skupper integration tests with the image
585+
uses: ./.github/actions/skupper-integration-tests
586+
with:
587+
qdrouterdImage: "local/skupper-router:local"
588+
skupperGitRef: "a618477ff6f0b74dd1583f0af04eb9d8d36ecf09"
589+
573590
rpm:
574591
name: 'Build and test RPM (${{ matrix.container }}:${{ matrix.containerTag }})'
575592
runs-on: '${{ matrix.os }}'

0 commit comments

Comments
 (0)