Skip to content

Commit 78570e5

Browse files
committed
Fixed #xxx: Run Skupper integration tests for skupper-router image
1 parent 0e2c88b commit 78570e5

File tree

8 files changed

+208
-681
lines changed

8 files changed

+208
-681
lines changed

.github/actions/README.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
https://docs.github.com/en/actions/creating-actions/creating-a-javascript-action
2+
3+
https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions
4+
5+
https://github.com/actions/toolkit
6+
7+
https://github.com/actions/hello-world-javascript-action
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
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+
# waits:
21+
# first wait to have at least one of a type, then wait for all to be in a state; if waiting for state with empty set, kubectl fails
22+
23+
name: Test skupper-router main
24+
description: Execute skupper integration testing
25+
26+
inputs:
27+
28+
qdrouterdImage:
29+
required: true
30+
description: Image to use in skupper integration tests
31+
32+
skupperGitRef:
33+
required: false
34+
description: Reference to skupper version
35+
default: "0.8.7"
36+
37+
runs:
38+
using: "composite"
39+
steps:
40+
41+
# As of version 18.03, you can use host.docker.internal as the host's IP.
42+
43+
# - name: push image
44+
# run: sudo microk8s ctr k8s.io image import myimage.tgz
45+
46+
# Use currently built image
47+
# also consider https://github.com/google/go-containerregistry/blob/main/cmd/crane/doc/crane.md but likely overkill
48+
# $ docker save hello-web > hello-web.tar
49+
# sudo microk8s.ctr -n k8s.io image import hello-web.tar
50+
# sudo microk8s.ctr -n k8s.io images ls --name~=hello-web
51+
# sudo docker build . -t localhost:32000/hello-web:v3
52+
53+
- name: Get Go cache paths
54+
id: go-cache-paths
55+
run: |
56+
echo "::set-output name=go-build::$(go env GOCACHE)"
57+
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
58+
shell: bash
59+
60+
# https://microk8s.io/docs/addon-metallb
61+
- name: Install microk8s
62+
run: |
63+
sudo snap install microk8s --classic --channel=1.21/stable
64+
sudo microk8s enable dns ingress storage registry:size=20Gi host-access:ip=10.0.1.1 metallb:10.64.140.43-10.64.140.49
65+
sudo microk8s status --wait-ready
66+
shell: bash
67+
68+
- name: Export microk8s config
69+
if: "${{ always() }}"
70+
run: |
71+
mkdir -p $HOME/.kube
72+
sudo microk8s config > $HOME/.kube/config
73+
shell: bash
74+
75+
- name: Push image into microk8s
76+
run: |
77+
docker tag "${{ inputs.qdrouterdImage }}" localhost:32000/skupper-router:registry
78+
timeout 5m bash -c 'until nc -z localhost 32000; do sleep 1; done' || :
79+
docker push localhost:32000/skupper-router:registry
80+
shell: bash
81+
82+
- name: Checkout Skupper
83+
uses: actions/checkout@v2
84+
with:
85+
repository: 'skupperproject/skupper'
86+
ref: "${{ inputs.skupperGitRef }}"
87+
path: 'skupper'
88+
89+
- name: Restore Go cache
90+
uses: actions/cache@v2
91+
with:
92+
path: |
93+
${{ steps.go-cache-paths.outputs.go-build }}
94+
${{ steps.go-cache-paths.outputs.go-mod }}
95+
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
96+
97+
- name: Compile Skupper
98+
run: |
99+
make all
100+
sudo install skupper /usr/local/bin
101+
working-directory: skupper
102+
shell: bash
103+
104+
- name: Run Skupper integration tests
105+
run: |
106+
export PUBLIC_1_INGRESS_HOST=10.0.1.1
107+
export QDROUTERD_IMAGE=localhost:32000/skupper-router:registry
108+
109+
go test -count=1 -p=1 -timeout=60m -tags=integration -v ./test/integration/...
110+
working-directory: skupper
111+
shell: bash
112+
113+
# https://github.com/canonical/microk8s/issues/1660
114+
- name: Dump microk8s log (apiserver)
115+
if: "${{ always() }}"
116+
run: |
117+
sudo journalctl -u snap.microk8s.daemon-apiserver
118+
shell: bash
119+
120+
- name: Dump microk8s log (kubelet)
121+
if: "${{ always() }}"
122+
run: |
123+
sudo journalctl -u snap.microk8s.daemon-kubelet
124+
shell: bash
125+
126+
- name: Dump microk8s log (kubelite)
127+
if: "${{ always() }}"
128+
run: |
129+
sudo journalctl -u snap.microk8s.daemon-kubelite
130+
shell: bash

.github/scripts/Dockerfile

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,44 +17,8 @@
1717
# under the License.
1818
#
1919

20-
FROM registry.access.redhat.com/ubi8/ubi:latest as builder
21-
22-
RUN dnf -y --setopt=tsflags=nodocs install \
23-
http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/centos-gpg-keys-8-4.el8.noarch.rpm \
24-
http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/centos-stream-repos-8-4.el8.noarch.rpm \
25-
&& dnf -y --setopt=tsflags=nodocs install epel-release \
26-
&& dnf config-manager --set-enabled powertools \
27-
&& dnf clean all
28-
29-
RUN dnf -y --setopt=tsflags=nodocs install gcc gcc-c++ make cmake cyrus-sasl-devel openssl-devel libuuid-devel swig wget patch findutils git valgrind libwebsockets-devel python3-devel libnghttp2-devel && dnf clean all -y
30-
WORKDIR /build
31-
COPY . .
32-
ENV PROTON_VERSION=0.36.0
33-
ENV PROTON_SOURCE_URL=${PROTON_SOURCE_URL:-http://archive.apache.org/dist/qpid/proton/${PROTON_VERSION}/qpid-proton-${PROTON_VERSION}.tar.gz}
34-
RUN .github/scripts/compile.sh
35-
36-
3720
FROM registry.access.redhat.com/ubi8/ubi:latest
3821

39-
RUN dnf -y --setopt=tsflags=nodocs update \
40-
&& dnf -y --setopt=tsflags=nodocs install \
41-
http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/centos-gpg-keys-8-4.el8.noarch.rpm \
42-
http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/centos-stream-repos-8-4.el8.noarch.rpm \
43-
&& dnf -y --setopt=tsflags=nodocs install epel-release \
44-
&& dnf config-manager --set-enabled powertools \
45-
&& dnf clean all
46-
47-
# gdb and valgrind are part of final image as they can be used as debug options for Skupper
48-
RUN dnf -y --setopt=tsflags=nodocs install glibc cyrus-sasl-lib cyrus-sasl-plain cyrus-sasl-gssapi libuuid openssl gettext hostname iputils python3 libwebsockets libnghttp2 gdb valgrind && dnf clean all
49-
50-
WORKDIR /
51-
COPY --from=builder /qpid-proton-image.tar.gz /skupper-router-image.tar.gz /
52-
RUN tar zxpf qpid-proton-image.tar.gz && tar zxpf skupper-router-image.tar.gz && rm -f /qpid-proton-image.tar.gz /skupper-router-image.tar.gz
53-
54-
WORKDIR /home/qdrouterd/etc
55-
WORKDIR /home/qdrouterd/bin
56-
COPY ./scripts/* /home/qdrouterd/bin/
57-
5822
ARG version=latest
5923
ENV VERSION=${version}
6024
ENV QDROUTERD_HOME=/home/qdrouterd

.github/scripts/image-build.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
. ./.github/scripts/common.sh
21+
22+
# Building the skupper-router image
23+
${DOCKER} build -t ${PROJECT_NAME}:${PROJECT_TAG} -f ./.github/scripts/Dockerfile .
24+
25+
echo "::set-output name=image-tag::${PROJECT_NAME}:${PROJECT_TAG}"
26+

.github/scripts/image.sh renamed to .github/scripts/image-push.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919

2020
. ./.github/scripts/common.sh
2121

22-
# Building the skupper-router image
23-
${DOCKER} build -t ${PROJECT_NAME}:${PROJECT_TAG} -f ./.github/scripts/Dockerfile .
24-
2522
# Pushing only when credentials available
2623
if [[ -n "${DOCKER_USER}" && -n "${DOCKER_PASSWORD}" ]]; then
2724
${DOCKER} login -u ${DOCKER_USER} -p ${DOCKER_PASSWORD} ${DOCKER_REGISTRY}

0 commit comments

Comments
 (0)