Skip to content

Commit

Permalink
Merge pull request #693 from HumairAK/stable
Browse files Browse the repository at this point in the history
Update stable to v2.5.0
  • Loading branch information
HumairAK authored Aug 19, 2024
2 parents 8469ebf + 4fbde7a commit 7304c92
Show file tree
Hide file tree
Showing 32 changed files with 723 additions and 151 deletions.
135 changes: 135 additions & 0 deletions .github/scripts/tests/kind-integration.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
#!/bin/bash
set -e

if [ "$GIT_WORKSPACE" = "" ]; then
echo "GIT_WORKSPACE variable not defined. Should be the root of the source code. Example GIT_WORKSPACE=/home/dev/git/data-science-pipelines-operator" && exit
fi

if [ "$REGISTRY_ADDRESS" = "" ]; then
echo "REGISTRY_ADDRESS variable not defined." && exit
fi

# Env vars
IMAGE_REPO_DSPO="data-science-pipelines-operator"
DSPA_NAMESPACE="test-dspa"
DSPA_EXTERNAL_NAMESPACE="dspa-ext"
MINIO_NAMESPACE="test-minio"
MARIADB_NAMESPACE="test-mariadb"
PYPISERVER_NAMESPACE="test-pypiserver"
DSPA_NAME="test-dspa"
DSPA_EXTERNAL_NAME="dspa-ext"
DSPA_DEPLOY_WAIT_TIMEOUT="300"
INTEGRATION_TESTS_DIR="${GIT_WORKSPACE}/tests"
DSPA_PATH="${GIT_WORKSPACE}/tests/resources/dspa-lite.yaml"
DSPA_EXTERNAL_PATH="${GIT_WORKSPACE}/tests/resources/dspa-external-lite.yaml"
CONFIG_DIR="${GIT_WORKSPACE}/config"
RESOURCES_DIR_CRD="${GIT_WORKSPACE}/.github/resources"
DSPO_IMAGE="${REGISTRY_ADDRESS}/data-science-pipelines-operator"
OPENDATAHUB_NAMESPACE="opendatahub"
RESOURCES_DIR_PYPI="${GIT_WORKSPACE}/.github/resources/pypiserver/base"

# TODO: Consolidate testing CRDS (2 locations)
echo "---------------------------------"
echo "# Apply OCP CRDs"
echo "---------------------------------"
kubectl apply -f ${RESOURCES_DIR_CRD}/crds
kubectl apply -f "${CONFIG_DIR}/crd/external/route.openshift.io_routes.yaml"

echo "---------------------------------"
echo "Build image"
echo "---------------------------------"
( cd $GIT_WORKSPACE && make podman-build -e IMG="${DSPO_IMAGE}" )

echo "---------------------------------"
echo "Create opendatahub namespace"
echo "---------------------------------"
kubectl create namespace $OPENDATAHUB_NAMESPACE

echo "---------------------------------"
echo "Deploy Argo Lite"
echo "---------------------------------"
( cd "${GIT_WORKSPACE}/.github/resources/argo-lite" && kustomize build . | kubectl -n $OPENDATAHUB_NAMESPACE apply -f - )

echo "---------------------------------"
echo "Deploy DSPO"
echo "---------------------------------"
( cd $GIT_WORKSPACE && make podman-push -e IMG="${DSPO_IMAGE}" )
( cd $GIT_WORKSPACE && make deploy-kind -e IMG="${DSPO_IMAGE}" )

echo "---------------------------------"
echo "Create Minio Namespace"
echo "---------------------------------"
kubectl create namespace $MINIO_NAMESPACE

echo "---------------------------------"
echo "Deploy Minio"
echo "---------------------------------"
( cd "${GIT_WORKSPACE}/.github/resources/minio" && kustomize build . | kubectl -n $MINIO_NAMESPACE apply -f - )

echo "---------------------------------"
echo "Create MariaDB Namespace"
echo "---------------------------------"
kubectl create namespace $MARIADB_NAMESPACE

echo "---------------------------------"
echo "Deploy MariaDB"
echo "---------------------------------"
( cd "${GIT_WORKSPACE}/.github/resources/mariadb" && kustomize build . | kubectl -n $MARIADB_NAMESPACE apply -f - )

echo "---------------------------------"
echo "Create Pypiserver Namespace"
echo "---------------------------------"
kubectl create namespace $PYPISERVER_NAMESPACE

echo "---------------------------------"
echo "Deploy pypi-server"
echo "---------------------------------"
( cd "${GIT_WORKSPACE}/.github/resources/pypiserver/base" && kustomize build . | kubectl -n $PYPISERVER_NAMESPACE apply -f - )

echo "---------------------------------"
echo "Wait for Dependencies (DSPO, Minio, Mariadb, Pypi server)"
echo "---------------------------------"
kubectl wait -n $OPENDATAHUB_NAMESPACE --timeout=60s --for=condition=Available=true deployment data-science-pipelines-operator-controller-manager
kubectl wait -n $MARIADB_NAMESPACE --timeout=60s --for=condition=Available=true deployment mariadb
kubectl wait -n $MINIO_NAMESPACE --timeout=60s --for=condition=Available=true deployment minio
kubectl wait -n $PYPISERVER_NAMESPACE --timeout=60s --for=condition=Available=true deployment pypi-server

echo "---------------------------------"
echo "Upload Python Packages to pypi-server"
echo "---------------------------------"
( cd "${GIT_WORKSPACE}/.github/scripts/python_package_upload" && sh package_upload.sh )

echo "---------------------------------"
echo "Create DSPA Namespace"
echo "---------------------------------"
kubectl create namespace $DSPA_NAMESPACE

echo "---------------------------------"
echo "Create Namespace for DSPA with External connections"
echo "---------------------------------"
kubectl create namespace $DSPA_EXTERNAL_NAMESPACE

echo "---------------------------------"
echo "Apply MariaDB and Minio Secrets and Configmaps in the External Namespace"
echo "---------------------------------"
( cd "${GIT_WORKSPACE}/.github/resources/external-pre-reqs" && kustomize build . | oc -n $DSPA_EXTERNAL_NAMESPACE apply -f - )

echo "---------------------------------"
echo "Apply PIP Server ConfigMap"
echo "---------------------------------"
( cd "${GIT_WORKSPACE}/.github/resources/pypiserver/base" && kubectl apply -f $RESOURCES_DIR_PYPI/nginx-tls-config.yaml -n $DSPA_NAMESPACE )

echo "---------------------------------"
echo "Run tests"
echo "---------------------------------"
( cd $GIT_WORKSPACE && make integrationtest K8SAPISERVERHOST=$(oc whoami --show-server) DSPANAMESPACE=${DSPA_NAMESPACE} DSPAPATH=${DSPA_PATH} )

echo "---------------------------------"
echo "Run tests for DSPA with External Connections"
echo "---------------------------------"
( cd $GIT_WORKSPACE && make integrationtest K8SAPISERVERHOST=$(oc whoami --show-server) DSPANAMESPACE=${DSPA_EXTERNAL_NAMESPACE} DSPAPATH=${DSPA_EXTERNAL_PATH} )

echo "---------------------------------"
echo "Clean up"
echo "---------------------------------"
( cd $GIT_WORKSPACE && make undeploy-kind )
128 changes: 7 additions & 121 deletions .github/workflows/kind-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:
- config/**
- tests/**
- .github/resources/**
- '.github/workflows/kind-integration.yml'
- Makefile
types:
- opened
- reopened
Expand All @@ -22,18 +24,8 @@ concurrency:
cancel-in-progress: true

env:
IMAGE_REPO_DSPO: data-science-pipelines-operator
DSPA_NAMESPACE: test-dspa
DSPA_EXTERNAL_NAMESPACE: dspa-ext
MINIO_NAMESPACE: test-minio
MARIADB_NAMESPACE: test-mariadb
PYPISERVER_NAMESPACE: test-pypiserver
DSPA_NAME: test-dspa
DSPA_EXTERNAL_NAME: dspa-ext
DSPA_DEPLOY_WAIT_TIMEOUT: 300
INTEGRATION_TESTS_DIR: ${{ github.workspace }}/tests
DSPA_PATH: ${{ github.workspace }}/tests/resources/dspa-lite.yaml
DSPA_EXTERNAL_PATH: ${{ github.workspace }}/tests/resources/dspa-external-lite.yaml
GIT_WORKSPACE: ${{ github.workspace }}

jobs:
dspo-tests:
runs-on: ubuntu-20.04
Expand All @@ -53,113 +45,7 @@ jobs:
- name: Setup and start KinD cluster
uses: ./.github/actions/kind

# TODO: Consolidate testing CRDS (2 locations)
- name: Apply OCP CRDs
env:
RESOURCES_DIR: ${{ github.workspace }}/.github/resources
CONFIG_DIR: ${{ github.workspace }}/config
run: |
kubectl apply -f ${{ env.RESOURCES_DIR }}/crds
kubectl apply -f ${{ env.CONFIG_DIR }}/crd/external/route.openshift.io_routes.yaml
- name: Build image
env:
DSPO_IMAGE: ${{env.REGISTRY_ADDRESS}}/data-science-pipelines-operator
run: |
make podman-build -e IMG="${DSPO_IMAGE}"
- name: Create opendatahub namespace
run: |
kubectl create namespace opendatahub
- name: Deploy Argo Lite
working-directory: ${{ github.workspace }}/.github/resources/argo-lite
run: |
kustomize build . | kubectl apply -f -
- name: Deploy DSPO
env:
DSPO_IMAGE: ${{env.REGISTRY_ADDRESS}}/data-science-pipelines-operator
run: |
make podman-push -e IMG="${DSPO_IMAGE}"
make deploy-kind -e IMG="${DSPO_IMAGE}"
- name: Create Minio Namespace
run: |
kubectl create namespace ${{ env.MINIO_NAMESPACE }}
- name: Deploy Minio
working-directory: ${{ github.workspace }}/.github/resources/minio
run: |
kustomize build . | oc -n ${{ env.MINIO_NAMESPACE }} apply -f -
- name: Create MariaDB Namespace
run: |
kubectl create namespace ${{ env.MARIADB_NAMESPACE }}
- name: Deploy MariaDB
working-directory: ${{ github.workspace }}/.github/resources/mariadb
run: |
kustomize build . | oc -n ${{ env.MARIADB_NAMESPACE }} apply -f -
- name: Create Pypiserver Namespace
run: |
kubectl create namespace ${{ env.PYPISERVER_NAMESPACE }}
- name: Deploy pypi-server
working-directory: ${{ github.workspace }}/.github/resources/pypiserver/base
run: |
kustomize build . | oc -n ${{ env.PYPISERVER_NAMESPACE }} apply -f -
- name: Wait for Dependencies (DSPO, Minio, Mariadb, Pypi server)
run: |
kubectl wait -n opendatahub --timeout=60s --for=condition=Available=true deployment data-science-pipelines-operator-controller-manager
kubectl wait -n ${{ env.MARIADB_NAMESPACE }} --timeout=60s --for=condition=Available=true deployment mariadb
kubectl wait -n ${{ env.MINIO_NAMESPACE }} --timeout=60s --for=condition=Available=true deployment minio
kubectl wait -n ${{ env.PYPISERVER_NAMESPACE }} --timeout=60s --for=condition=Available=true deployment pypi-server
- name: Upload Python Packages to pypi-server
working-directory: ${{ github.workspace }}/.github/scripts/python_package_upload
run: |
sh package_upload.sh
- name: Create DSPA Namespace
run: |
kubectl create namespace ${{ env.DSPA_NAMESPACE }}
- name: Create Namespace for DSPA with External connections
run: |
kubectl create namespace ${{ env.DSPA_EXTERNAL_NAMESPACE }}
- name: Apply MariaDB and Minio Secrets and Configmaps in the External Namespace
working-directory: ${{ github.workspace }}/.github/resources/external-pre-reqs
run: |
kustomize build . | oc -n ${{ env.DSPA_EXTERNAL_NAMESPACE }} apply -f -
- name: Apply PIP Server ConfigMap
env:
RESOURCES_DIR: ${{ github.workspace }}/.github/resources/pypiserver/base
run: |
kubectl apply -f $RESOURCES_DIR/nginx-tls-config.yaml -n ${{ env.DSPA_NAMESPACE }}
- name: Run tests
working-directory: ${{ github.workspace }}
env:
NAMESPACE: ${{ env.DSPA_NAMESPACE }}
DSPA_NAME: ${{ env.DSPA_NAME }}
DSPA_PATH: ${{ env.DSPA_PATH }}
run: |
make integrationtest K8SAPISERVERHOST=$(oc whoami --show-server) DSPANAMESPACE=${NAMESPACE} DSPAPATH=${DSPA_PATH}
- name: Run tests for DSPA with External Connections
working-directory: ${{ github.workspace }}
env:
NAMESPACE: ${{ env.DSPA_EXTERNAL_NAMESPACE }}
DSPA_NAME: ${{ env.DSPA_EXTERNAL_NAME }}
DSPA_EXTERNAL_PATH: ${{ env.DSPA_EXTERNAL_PATH }}
run: |
make integrationtest K8SAPISERVERHOST=$(oc whoami --show-server) DSPANAMESPACE=${NAMESPACE} DSPAPATH=${DSPA_EXTERNAL_PATH}
- name: Clean up
- name: Run test
working-directory: ${{ github.workspace }}/.github/scripts/tests
run: |
make undeploy-kind
sh kind-integration.sh
20 changes: 8 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,17 @@ undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/confi
$(KUSTOMIZE) build config/overlays/make-deploy | kubectl delete --ignore-not-found=$(ignore-not-found) -f -

.PHONY: deploy-kind
deploy-kind:
deploy-kind: manifests kustomize
cd config/overlays/kind-tests \
&& kustomize edit set image controller=${IMG} \
&& kustomize edit set namespace ${OPERATOR_NS}
kustomize build config/overlays/kind-tests | kubectl apply -f -
&& $(KUSTOMIZE) edit set image controller=${IMG} \
&& $(KUSTOMIZE) edit set namespace ${OPERATOR_NS}
$(KUSTOMIZE) build config/overlays/kind-tests | kubectl apply -f -

.PHONY: undeploy-kind
undeploy-kind: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
undeploy-kind: manifests kustomize ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
cd config/overlays/kind-tests \
&& kustomize edit set namespace ${OPERATOR_NS}
kustomize build config/overlays/kind-tests | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
&& $(KUSTOMIZE) edit set namespace ${OPERATOR_NS}
$(KUSTOMIZE) build config/overlays/kind-tests | kubectl delete --ignore-not-found=$(ignore-not-found) -f -

##@ Build Dependencies

Expand All @@ -204,11 +204,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
arch:= $(shell uname -m)

ifeq ($(arch), ppc64le)
KUSTOMIZE_VERSION ?= v5.1.0
else
KUSTOMIZE_VERSION ?= v3.8.7
endif
KUSTOMIZE_VERSION ?= v5.2.1
CONTROLLER_TOOLS_VERSION ?= v0.10.0

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
Expand Down
27 changes: 27 additions & 0 deletions api/v1alpha1/dspipeline_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,19 @@ type APIServer struct {
// for the api server to use instead.
CustomServerConfig *ScriptConfigMap `json:"customServerConfigMap,omitempty"`

// When specified, the `data` contents of the `kfp-launcher` ConfigMap that DSPO writes
// will be fully replaced with the `data` contents of the ConfigMap specified here.
// This allows the user to fully replace the `data` contents of the kfp-launcher ConfigMap.
// The `kfp-launcher` component requires a ConfigMap to exist in the namespace
// where it runs (i.e. the namespace where pipelines run). This ConfigMap contains
// object storage configuration, as well as pipeline root (object store root path
// where artifacts will be uploaded) configuration. Currently this ConfigMap *must*
// be named "kfp-launcher". We currently deploy a default copy of the kfp-launcher
// ConfigMap via DSPO, but a user may want to provide their own ConfigMap configuration,
// so that they can specify multiple object storage sources and paths.
// +kubebuilder:validation:Optional
CustomKfpLauncherConfigMap string `json:"customKfpLauncherConfigMap,omitempty"`

// Default: true
// Deprecated: DSP V1 only, will be removed in the future.
// +kubebuilder:default:=true
Expand Down Expand Up @@ -394,9 +407,23 @@ type SecretKeyValue struct {
}

type DSPAStatus struct {
// +kubebuilder:validation:Optional
Components ComponentStatus `json:"components,omitempty"`
Conditions []metav1.Condition `json:"conditions,omitempty"`
}

type ComponentStatus struct {
// +kubebuilder:validation:Optional
MLMDProxy ComponentDetailStatus `json:"mlmdProxy,omitempty"`
APIServer ComponentDetailStatus `json:"apiServer,omitempty"`
}

type ComponentDetailStatus struct {
Url string `json:"url,omitempty"`
// +kubebuilder:validation:Optional
ExternalUrl string `json:"externalUrl,omitempty"`
}

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:resource:shortName=dspa
Expand Down
Loading

0 comments on commit 7304c92

Please sign in to comment.