Skip to content

Commit

Permalink
Add Upgrade testing workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
DharmitD committed Sep 5, 2023
1 parent dfa32f7 commit 730d096
Show file tree
Hide file tree
Showing 15 changed files with 524 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/actions/kind/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: "Set up KinD"
description: "Step to start and configure KinD cluster"

runs:
using: "composite"
steps:
- name: Init directories
shell: bash
run: |
TEMP_DIR="$(pwd)/tmp"
mkdir -p "${TEMP_DIR}"
echo "TEMP_DIR=${TEMP_DIR}" >> $GITHUB_ENV
mkdir -p "$(pwd)/bin"
echo "$(pwd)/bin" >> $GITHUB_PATH
- name: Container image registry
shell: bash
run: |
podman run -d -p 5000:5000 --name registry registry:2.8.1
export REGISTRY_ADDRESS=$(hostname -i):5000
echo "REGISTRY_ADDRESS=${REGISTRY_ADDRESS}" >> $GITHUB_ENV
echo "Container image registry started at ${REGISTRY_ADDRESS}"
KIND_CONFIG_FILE=${{ env.TEMP_DIR }}/kind.yaml
echo "KIND_CONFIG_FILE=${KIND_CONFIG_FILE}" >> $GITHUB_ENV
envsubst < .github/resources-kind/kind.yaml > ${KIND_CONFIG_FILE}
sudo --preserve-env=REGISTRY_ADDRESS sh -c 'cat > /etc/containers/registries.conf.d/local.conf <<EOF
[[registry]]
prefix = "$REGISTRY_ADDRESS"
insecure = true
location = "$REGISTRY_ADDRESS"
EOF'
- name: Setup KinD cluster
uses: helm/kind-action@v1.8.0
with:
cluster_name: cluster
version: v0.17.0
config: ${{ env.KIND_CONFIG_FILE }}

- name: Print cluster info
shell: bash
run: |
echo "KinD cluster:"
kubectl cluster-info
kubectl describe nodes
- name: Install Ingress controller
shell: bash
run: |
VERSION=controller-v1.6.4
echo "Deploying Ingress controller into KinD cluster"
curl https://raw.githubusercontent.com/kubernetes/ingress-nginx/"${VERSION}"/deploy/static/provider/kind/deploy.yaml | sed "s/--publish-status-address=localhost/--report-node-internal-ip-address\\n - --status-update-interval=10/g" | kubectl apply -f -
kubectl annotate ingressclass nginx "ingressclass.kubernetes.io/is-default-class=true"
kubectl -n ingress-nginx wait --timeout=300s --for=condition=Available deployments --all
23 changes: 23 additions & 0 deletions .github/resources-bc/buildconfig-crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: buildconfigs.build.openshift.io
spec:
group: build.openshift.io
versions:
- name: v1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
scope: Namespaced
names:
plural: buildconfigs
singular: buildconfig
kind: BuildConfig
shortNames:
- bc
23 changes: 23 additions & 0 deletions .github/resources-crds/buildconfig-crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: buildconfigs.build.openshift.io
spec:
group: build.openshift.io
versions:
- name: v1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
scope: Namespaced
names:
plural: buildconfigs
singular: buildconfig
kind: BuildConfig
shortNames:
- bc
23 changes: 23 additions & 0 deletions .github/resources-crds/deploymentconfig-crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: deploymentconfigs.apps.openshift.io
spec:
group: apps.openshift.io
versions:
- name: v1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
scope: Namespaced
names:
plural: deploymentconfigs
singular: deploymentconfig
kind: DeploymentConfig
shortNames:
- dc
23 changes: 23 additions & 0 deletions .github/resources-crds/imagestream-crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: imagestreams.image.openshift.io
spec:
group: image.openshift.io
versions:
- name: v1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
scope: Namespaced
names:
plural: imagestreams
singular: imagestream
kind: ImageStream
shortNames:
- is
21 changes: 21 additions & 0 deletions .github/resources-crds/servicemonitor-crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: servicemonitors.monitoring.coreos.com
spec:
group: monitoring.coreos.com
versions:
- name: v1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
scope: Namespaced
names:
plural: servicemonitors
singular: servicemonitor
kind: ServiceMonitor
23 changes: 23 additions & 0 deletions .github/resources-dc/deploymentconfig-crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: deploymentconfigs.apps.openshift.io
spec:
group: apps.openshift.io
versions:
- name: v1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
scope: Namespaced
names:
plural: deploymentconfigs
singular: deploymentconfig
kind: DeploymentConfig
shortNames:
- dc
23 changes: 23 additions & 0 deletions .github/resources-is/imagestream-crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: imagestreams.image.openshift.io
spec:
group: image.openshift.io
versions:
- name: v1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
scope: Namespaced
names:
plural: imagestreams
singular: imagestream
kind: ImageStream
shortNames:
- is
14 changes: 14 additions & 0 deletions .github/resources-kfdef/kfdef.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: kfdef.apps.kubeflow.org/v1
kind: KfDef
metadata:
name: data-science-pipelines-operator
spec:
applications:
- kustomizeConfig:
repoRef:
name: manifests
path: config
name: data-science-pipelines-operator
repos:
- name: manifests
uri: "https://github.com/opendatahub-io/data-science-pipelines-operator/tarball/main"
31 changes: 31 additions & 0 deletions .github/resources-kind/kind.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# ---------------------------------------------------------------------------
# Copyright 2023.
#
# 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.
# ---------------------------------------------------------------------------

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
image: kindest/node:v1.25.3@sha256:f52781bc0d7a19fb6c405c2af83abfeb311f130707a0e219175677e366cc45d1
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "ingress-ready=true"
containerdConfigPatches:
- |-
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."${REGISTRY_ADDRESS}"]
endpoint = ["http://${REGISTRY_ADDRESS}"]
12 changes: 12 additions & 0 deletions .github/resources-olm-install/catalogsource.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: odh-olm-test
namespace: olm
spec:
displayName: ''
grpcPodConfig:
securityContextConfig: restricted
image: "${CATALOG_BASE_IMG}"
publisher: ''
sourceType: grpc
5 changes: 5 additions & 0 deletions .github/resources-olm-install/operatorgroup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: openshift-operators
namespace: openshift-operators
11 changes: 11 additions & 0 deletions .github/resources-olm-install/subscription.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: opendatahub-operator
namespace: openshift-operators
spec:
channel: rolling
installPlanApproval: Automatic
name: opendatahub-operator
source: odh-olm-test
sourceNamespace: olm
21 changes: 21 additions & 0 deletions .github/resources-servicemonitor/servicemonitor-crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: servicemonitors.monitoring.coreos.com
spec:
group: monitoring.coreos.com
versions:
- name: v1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
scope: Namespaced
names:
plural: servicemonitors
singular: servicemonitor
kind: ServiceMonitor
Loading

0 comments on commit 730d096

Please sign in to comment.