Skip to content

Commit

Permalink
CI scripts improvements
Browse files Browse the repository at this point in the history
Updates to OCP:
* add a retry to the policy create to fix OCP CI flake
* add more ram to the OCP master single node
* add a wait for registry to be available
* update the ocp version to latest 4.14 rc release

Updates for K8s:
* switch to not use dockerhub for the registry image to overcome the pull limit
* add alias for golang to the dockerhub image

github actions:
* always remove the cluster

Signed-off-by: Sebastian Sch <[email protected]>
  • Loading branch information
SchSeba committed Oct 22, 2023
1 parent bf595e4 commit 6f54e23
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 10 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ jobs:
name: k8s-artifact
path: ./k8s-artifacts

- name: remove virtual cluster
if: always()
run: |
kcli delete cluster $CLUSTER_NAME -y
kcli delete network $CLUSTER_NAME -y
virtual-ocp:
name: ocp
needs: [
Expand All @@ -145,3 +151,9 @@ jobs:
with:
name: ocp-artifact
path: ./ocp-artifacts

- name: remove virtual cluster
if: always()
run: |
kcli delete cluster $CLUSTER_NAME -y
kcli delete network $CLUSTER_NAME -y
5 changes: 4 additions & 1 deletion hack/run-e2e-conformance-virtual-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ controller_ip=`kubectl get node -o wide | grep ctlp | awk '{print $6}'`
insecure_registry="[[registry]]
location = \"$controller_ip:5000\"
insecure = true
[aliases]
\"golang\" = \"docker.io/library/golang\"
"

cat << EOF > /etc/containers/registries.conf.d/003-${cluster_name}.conf
Expand Down Expand Up @@ -223,7 +226,7 @@ spec:
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
containers:
- image: docker.io/registry:latest
- image: quay.io/libpod/registry:2.8.2
imagePullPolicy: Always
name: registry
volumeMounts:
Expand Down
10 changes: 7 additions & 3 deletions hack/run-e2e-conformance-virtual-ocp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ kcli create network -c 192.168.123.0/24 ocp
kcli create network -c 192.168.${virtual_router_id}.0/24 --nodhcp -i $cluster_name

cat <<EOF > ./${cluster_name}-plan.yaml
tag: 4.14.0-rc.1
ctlplane_memory: 24576
tag: 4.14.0-rc.6
ctlplane_memory: 32768
worker_memory: 8192
pool: default
disk_size: 50
Expand Down Expand Up @@ -191,13 +191,17 @@ podman build -t "${SRIOV_NETWORK_CONFIG_DAEMON_IMAGE}" -f "${root}/Dockerfile.sr
echo "## build webhook image"
podman build -t "${SRIOV_NETWORK_WEBHOOK_IMAGE}" -f "${root}/Dockerfile.webhook" "${root}"

echo "## wait for registry to be available"
kubectl wait configs.imageregistry.operator.openshift.io/cluster --for=condition=Available --timeout=120s

dockercgf=`kubectl -n ${NAMESPACE} get sa builder -oyaml | grep imagePullSecrets -A 1 | grep -o "builder-.*"`
auth=`kubectl -n ${NAMESPACE} get secret ${dockercgf} -ojson | jq '.data.".dockercfg"'`
auth="${auth:1:-1}"
auth=`echo ${auth} | base64 -d`
echo ${auth} > registry-login.conf

pass=$( jq .\"$registry\".password registry-login.conf )
internal_registry="image-registry.openshift-image-registry.svc:5000"
pass=$( jq .\"$internal_registry\".password registry-login.conf )
podman login -u serviceaccount -p ${pass:1:-1} $registry --tls-verify=false

podman push --tls-verify=false "${SRIOV_NETWORK_OPERATOR_IMAGE}"
Expand Down
15 changes: 9 additions & 6 deletions test/conformance/tests/test_sriov_operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ var _ = Describe("[sriov] operator", func() {
cfg.Spec.ConfigDaemonNodeSelector = map[string]string{
"sriovenabled": "true",
}
err = clients.Update(context.TODO(), &cfg)
Expect(err).ToNot(HaveOccurred())
Eventually(func() error {
return clients.Update(context.TODO(), &cfg)
}, 1*time.Minute, 5*time.Second).ShouldNot(HaveOccurred())

By("Checking that a daemon is scheduled only on selected node")
Eventually(func() bool {
Expand All @@ -159,8 +160,9 @@ var _ = Describe("[sriov] operator", func() {
}, &cfg)
Expect(err).ToNot(HaveOccurred())
cfg.Spec.ConfigDaemonNodeSelector = map[string]string{}
err = clients.Update(context.TODO(), &cfg)
Expect(err).ToNot(HaveOccurred())
Eventually(func() error {
return clients.Update(context.TODO(), &cfg)
}, 1*time.Minute, 5*time.Second).ShouldNot(HaveOccurred())

By("Checking that a daemon is scheduled on each worker node")
Eventually(func() bool {
Expand Down Expand Up @@ -2316,8 +2318,9 @@ func createVanillaNetworkPolicy(node string, sriovInfos *cluster.EnabledNodes, n
DeviceType: "netdevice",
},
}
err = clients.Create(context.Background(), config)
Expect(err).ToNot(HaveOccurred())
Eventually(func() error {
return clients.Create(context.Background(), config)
}, 1*time.Minute, 5*time.Second).ShouldNot(HaveOccurred())

Eventually(func() sriovv1.Interfaces {
nodeState, err := clients.SriovNetworkNodeStates(operatorNamespace).Get(context.Background(), node, metav1.GetOptions{})
Expand Down

0 comments on commit 6f54e23

Please sign in to comment.