Skip to content

Commit 5daa47c

Browse files
authored
Replace support-tools image with custom one (#67)
* Replace support-tools image with custom one Using the support-tools image for debug partner pods restricts us to OpenShift environments in some tests, like diagnostic. We can swap that one with a UBI8-based image, so those tests can be executed on minikube or other environments as well. * Additional debug partner image fixes - Remove unnecessary REDHAT_RHEL_REGISTRY env var - In Dockerfile, run yum update before yum install * Add procps-ng package to debug partner image It contains the sysctl binary, required for some tests.
1 parent c93553b commit 5daa47c

File tree

5 files changed

+80
-13
lines changed

5 files changed

+80
-13
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: 'Test/push the `debug-partner` image'
2+
on:
3+
push:
4+
paths:
5+
- 'test-partner/Dockerfile.debug-partner'
6+
pull_request:
7+
defaults:
8+
run:
9+
shell: bash
10+
working-directory: test-partner
11+
env:
12+
REGISTRY: quay.io
13+
IMAGE_NAME: testnetworkfunction/debug-partner
14+
IMAGE_TAG: latest
15+
IMAGE_CONTAINER_FILE_PATH: test-partner/Dockerfile.debug-partner
16+
17+
jobs:
18+
test-debug-partner-image:
19+
name: 'Build and test the `debug-partner` image'
20+
runs-on: ubuntu-20.04
21+
22+
steps:
23+
- uses: actions/checkout@v2
24+
25+
- name: 'Build the `debug-partner` image'
26+
run: docker build --no-cache -f Dockerfile.debug-partner -t $IMAGE_NAME:$IMAGE_TAG .
27+
28+
- name: 'Test: Check if lscpu is installed'
29+
run: docker run $IMAGE_NAME:$IMAGE_TAG which lscpu
30+
31+
- name: 'Test: Check if lsblk is installed'
32+
run: docker run $IMAGE_NAME:$IMAGE_TAG which lsblk
33+
34+
- name: 'Test: Check if lspci is installed'
35+
run: docker run $IMAGE_NAME:$IMAGE_TAG which lspci
36+
37+
push-debug-partner-image:
38+
if: ${{ github.ref == 'refs/heads/main' }}
39+
name: 'Push the new `debug-partner` image to Quay.io'
40+
needs: test-debug-partner-image
41+
runs-on: ubuntu-20.04
42+
43+
steps:
44+
- name: Checkout the main branch
45+
uses: actions/checkout@v2
46+
with:
47+
ref: main
48+
49+
- name: Authenticate against Quay.io
50+
uses: docker/login-action@v1
51+
with:
52+
registry: ${{ env.REGISTRY }}
53+
# Use a Robot Account to authenticate against Quay.io
54+
# https://docs.quay.io/glossary/robot-accounts.html
55+
username: ${{ secrets.QUAY_ROBOT_USERNAME }}
56+
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
57+
58+
- name: 'Build and push the new `debug-partner` image'
59+
uses: docker/build-push-action@v2
60+
with:
61+
push: true
62+
file: ${{ env.IMAGE_CONTAINER_FILE_PATH }}
63+
tags: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Together, they make up the basic infrastructure required for "testing the tester
1111
* Pod Under Test (PUT): The Vendor Pod, usually provided by a CNF Partner.
1212
* Operator Under Test (OT): The Vendor Operator, usually provided by a CNF Partner.
1313
* Test Partner Pod (TPP): A Universal Base Image (UBI) Pod containing the test tools and dependencies to act as a traffic workload generator or receiver. For generic cases, this currently includes ICMPv4 only.
14-
* Debug Pod (DP): A Pod running [RHEL support tool image](https://catalog.redhat.com/software/containers/rhel8/support-tools/5ba3eaf9bed8bd6ee819b78b) deployed as part of a daemon set for accessing node information. DPs is deployed in "default" namespace
14+
* Debug Pod (DP): A Pod running [a UBI8-based support image](https://quay.io/repository/testnetworkfunction/debug-partner) deployed as part of a daemon set for accessing node information. DPs is deployed in "default" namespace
1515
* CRD Under Test (CRD): A basic CustomResourceDefinition.
1616

1717

scripts/deploy-debug-ds.sh

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,11 @@
44
SCRIPT_DIR=$(dirname "$0")
55
source $SCRIPT_DIR/init-env.sh
66

7-
export REDHAT_RHEL_REGISTRY="${REDHAT_RHEL_REGISTRY:-registry.redhat.io/rhel8}"
7+
export SUPPORT_IMAGE="${SUPPORT_IMAGE:-debug-partner:latest}"
88
# check if we're using minikube by looking for kube-apiserver-minikube pod
99
# if it's minikube, don't install debug partner
10-
if $TNF_NON_OCP_CLUSTER
11-
then
12-
echo "minikube detected, skip installing debug daemonSet"
13-
else
14-
echo "use registry $REDHAT_RHEL_REGISTRY"
15-
mkdir -p ./temp
16-
cat ./test-partner/debugpartner.yaml | $SCRIPT_DIR/mo > ./temp/debugpartner.yaml
17-
oc apply -f ./temp/debugpartner.yaml
18-
rm ./temp/debugpartner.yaml
19-
fi
10+
echo "using registry $TNF_PARTNER_REPO"
11+
mkdir -p ./temp
12+
cat ./test-partner/debugpartner.yaml | $SCRIPT_DIR/mo > ./temp/debugpartner.yaml
13+
oc apply -f ./temp/debugpartner.yaml
14+
rm ./temp/debugpartner.yaml
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM registry.access.redhat.com/ubi8/ubi:latest
2+
3+
RUN \
4+
yum -y update && \
5+
yum -y install pciutils util-linux net-tools procps-ng && \
6+
yum clean all -y && \
7+
rm -rf /var/cache/yum
8+
9+
VOLUME ["/host"]

test-partner/debugpartner.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ spec:
2323
containers:
2424
- command:
2525
- /bin/sh
26-
image: "{{REDHAT_RHEL_REGISTRY}}/support-tools:latest"
26+
image: "{{TNF_PARTNER_REPO}}/{{SUPPORT_IMAGE}}"
2727
imagePullPolicy: IfNotPresent
2828
name: container-00
2929
resources: {}

0 commit comments

Comments
 (0)