Skip to content

Commit 70ceb54

Browse files
authored
Merge pull request opendatahub-io#13 from anishasthana/add_manifests
Copy ML Pipelines manifests from odh-manifests to this repository
2 parents ff2f038 + 81a50ea commit 70ceb54

File tree

70 files changed

+2026
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+2026
-0
lines changed

manifests/opendatahub/README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# ML Pipelines
2+
3+
ML Pipelines is the Open Data Hub's pipeline solution for data scientists. It is built on top of the upstream [Kubeflow Piplines](https://github.com/kubeflow/pipelines) and [kfp-tekton](https://github.com/kubeflow/kfp-tekton) projects. The Open Data Hub community has a [fork](https://github.com/opendatahub-io/ml-pipelines) of this upstream under the Open Data Hub org.
4+
5+
6+
## Installation
7+
8+
### Prerequisites
9+
10+
1. The cluster needs to be OpenShift 4.9 or higher
11+
2. OpenShift Pipelines 1.7.2 or higher needs to be installed on the cluster
12+
3. The Open Data Hub operator needs to be installed
13+
4. The default installation namespace for ML Pipelines is `odh-applications`. This namespace will need to be created. In case you wish to install in a custom location, create it and update the kfdef as documented below.
14+
15+
### Installation Steps
16+
17+
1. Ensure that the prerequisites are met.
18+
2. Apply the kfdef at [kfctl_openshift_ml-pipelines.yaml](https://github.com/opendatahub-io/odh-manifests/blob/master/kfdef/kfctl_openshift_ml-pipelines.yaml). You may need to update the `namespace` field under `metadata` in case you want to deploy in a namespace that isn't `odh-applications`.
19+
3. To find the url for ML pipelines, you can run the following command.
20+
```bash
21+
$ oc get route -n <kdef_namespace> ml-pipeline-ui -o jsonpath='{.spec.host}'
22+
```
23+
The value of `<kfdef_namespace>` should match the namespace field of the kfdef that you applied.
24+
4. Alternatively, you can access the route via the console. To do so:
25+
26+
1. Go to `<kfdef_namespace>`
27+
2. Click on `Networking` in the sidebar on the left side.
28+
3. Click on `Routes`. It will take you to a new page in the console.
29+
4. Click the url under the `Location` column for the row item matching `ml-pipeline-ui`
30+
31+
32+
## Directory Structure
33+
34+
### Base
35+
36+
This directory contains artifacts for deploying all backend components of ML Pipelines. This deployment currently includes the kfp-tekton backend as well as a Minio deployment to act as an object store. The Minio deployment will be moved to an overlay at some point in the near future.
37+
38+
### Overlays
39+
40+
1. metadata-store-mysql: This overlay contains artifacts for deploying a MySQL database. MySQL is currently the only supported backend for ML Pipelines, so if you don't have an existing MySQL database deployed, this overlay needs to be applied.
41+
2. metadata-store-postgresql: This overlay contains artifacts for deploying a PostgreSQL database. ML Pipelines does not currently support PostgreSQL as a backend, so deploying this overlay will not actually modify ML Pipelines behaviour.
42+
3. ml-pipeline-ui: This overlay contains deployment artifacts for the ML Pipelines UI. Deploying ML Pipelines without this overlay will result in only the backend artifacts being created.
43+
4. object-store-minio: This overlay contains artifacts for deploying Minio as the Object Store to store Pipelines artifacts.
44+
45+
### Prometheus
46+
47+
This directory contains the service monitor definition for ML Pipelines. It is always deployed by base, so this will eventually be moved into the base directory itself.
48+
49+
## Configuration
50+
51+
* It is possible to configure what S3 storage is being used by Pipeline Runs. Detailed instructions on how to configure this will be added once Minio is moved to an overlay.
52+
53+
## Usage
54+
55+
### These instructions will be updated once ML Pipelines has a tile available in odh-dashboard
56+
57+
1. Go to the ml-pipelines-ui route.
58+
2. Click on `Pipelines` on the left side.
59+
3. There will be a `[Demo] flip-coin` Pipeline already available. Click on it.
60+
4. Click on the blue `Create run` button towards the top of the screen.
61+
5. You can leave all the fields untouched. If desired, you can create a new experiment to link the pipeline run to, or rename the run itself.
62+
6. Click on the blue `Start` button.
63+
7. You will be taken to the `Runs` page. You will see a row matching the `Run name` you previously picked. Click on the `Run name` in that row.
64+
8. Once the Pipeline is done running, you can see a graph of all the pods that were created as well as the paths that were followed.
65+
9. For further verification, you can view all the pods that were created as part of the Pipeline Run in the `<kfdef_namespace>`. They will all show up as `Completed`.
66+
67+
## ML Pipelines Architecture
68+
69+
A complete architecture can be found at [ODH ML Pipelines Architecture and Design](https://docs.google.com/document/d/1o-JS1uZKLZsMY3D16kl5KBdyBb-aV-kyD_XycdJOYpM/edit#heading=h.3aocw3evrps0). This document will be moved to GitHub once the corresponding ML Ops SIG repos are created.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apiVersion: v1
2+
data:
3+
apply_tekton_custom_resource: "true"
4+
archive_logs: "false"
5+
artifact_bucket: mlpipeline
6+
artifact_endpoint: minio-service:9000
7+
artifact_endpoint_scheme: http://
8+
artifact_image: quay.io/thoth-station/document-sync-job:v0.1.0
9+
artifact_script: |-
10+
#!/usr/bin/env sh
11+
push_artifact() {
12+
if [ -f "$2" ]; then
13+
tar -cvzf $1.tgz $2
14+
aws s3 --endpoint ${ARTIFACT_ENDPOINT_SCHEME}${ARTIFACT_ENDPOINT} cp $1.tgz s3://$ARTIFACT_BUCKET/artifacts/$PIPELINERUN/$PIPELINETASK/$1.tgz
15+
else
16+
echo "$2 file does not exist. Skip artifact tracking for $1"
17+
fi
18+
}
19+
push_log() {
20+
cat /var/log/containers/$PODNAME*$NAMESPACE*step-main*.log > step-main.log
21+
push_artifact main-log step-main.log
22+
}
23+
strip_eof() {
24+
if [ -f "$2" ]; then
25+
awk 'NF' $2 | head -c -1 > $1_temp_save && cp $1_temp_save $2
26+
fi
27+
}
28+
inject_default_script: "true"
29+
strip_eof: "true"
30+
terminate_status: Cancelled
31+
track_artifacts: "true"
32+
kind: ConfigMap
33+
metadata:
34+
labels:
35+
application-crd-id: kubeflow-pipelines
36+
name: kfp-tekton-config
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
apiVersion: v1
2+
data:
3+
ConMaxLifeTimeSec: "120"
4+
appName: pipeline
5+
appVersion: 1.7.0
6+
autoUpdatePipelineDefaultVersion: "true"
7+
bucketName: mlpipeline
8+
cacheDb: cachedb
9+
cacheImage: registry.access.redhat.com/ubi8/ubi-minimal
10+
cacheNodeRestrictions: "false"
11+
cronScheduleTimezone: UTC
12+
dbHost: mysql
13+
dbPort: "3306"
14+
defaultPipelineRoot: ""
15+
mlmdDb: metadb
16+
pipelineDb: mlpipeline
17+
warning: |
18+
1. Do not use kubectl to edit this configmap, because some values are used
19+
during kustomize build. Instead, change the configmap and apply the entire
20+
kustomize manifests again.
21+
2. After updating the configmap, some deployments may need to be restarted
22+
until the changes take effect. A quick way to restart all deployments in a
23+
namespace: `kubectl rollout restart deployment -n <your-namespace>`.
24+
kind: ConfigMap
25+
metadata:
26+
labels:
27+
application-crd-id: kubeflow-pipelines
28+
name: pipeline-install-config
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
labels:
5+
application-crd-id: kubeflow-pipelines
6+
kubeflow/crd-install: "true"
7+
name: scheduledworkflows.kubeflow.org
8+
spec:
9+
conversion:
10+
strategy: None
11+
group: kubeflow.org
12+
names:
13+
kind: ScheduledWorkflow
14+
listKind: ScheduledWorkflowList
15+
plural: scheduledworkflows
16+
shortNames:
17+
- swf
18+
singular: scheduledworkflow
19+
scope: Namespaced
20+
versions:
21+
- name: v1beta1
22+
schema:
23+
openAPIV3Schema:
24+
properties:
25+
apiVersion:
26+
type: string
27+
kind:
28+
type: string
29+
metadata:
30+
type: object
31+
spec:
32+
type: object
33+
x-kubernetes-map-type: atomic
34+
x-kubernetes-preserve-unknown-fields: true
35+
status:
36+
type: object
37+
x-kubernetes-map-type: atomic
38+
x-kubernetes-preserve-unknown-fields: true
39+
required:
40+
- spec
41+
- status
42+
type: object
43+
served: true
44+
storage: true
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
labels:
5+
application-crd-id: kubeflow-pipelines
6+
kubeflow/crd-install: "true"
7+
name: viewers.kubeflow.org
8+
spec:
9+
conversion:
10+
strategy: None
11+
group: kubeflow.org
12+
names:
13+
kind: Viewer
14+
listKind: ViewerList
15+
plural: viewers
16+
shortNames:
17+
- vi
18+
singular: viewer
19+
scope: Namespaced
20+
versions:
21+
- name: v1beta1
22+
schema:
23+
openAPIV3Schema:
24+
properties:
25+
apiVersion:
26+
type: string
27+
kind:
28+
type: string
29+
metadata:
30+
type: object
31+
spec:
32+
type: object
33+
x-kubernetes-map-type: atomic
34+
x-kubernetes-preserve-unknown-fields: true
35+
required:
36+
- spec
37+
type: object
38+
served: true
39+
storage: true
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
labels:
5+
application-crd-id: kubeflow-pipelines
6+
component: metadata-envoy
7+
name: metadata-envoy-deployment
8+
spec:
9+
replicas: 1
10+
selector:
11+
matchLabels:
12+
application-crd-id: kubeflow-pipelines
13+
component: metadata-envoy
14+
template:
15+
metadata:
16+
annotations:
17+
sidecar.istio.io/inject: "false"
18+
labels:
19+
application-crd-id: kubeflow-pipelines
20+
component: metadata-envoy
21+
spec:
22+
containers:
23+
- image: metadata-envoy
24+
name: container
25+
ports:
26+
- containerPort: 9090
27+
name: md-envoy
28+
- containerPort: 9901
29+
name: envoy-admin
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
labels:
5+
application-crd-id: kubeflow-pipelines
6+
component: metadata-grpc-server
7+
name: metadata-grpc-deployment
8+
spec:
9+
replicas: 1
10+
selector:
11+
matchLabels:
12+
application-crd-id: kubeflow-pipelines
13+
component: metadata-grpc-server
14+
template:
15+
metadata:
16+
labels:
17+
application-crd-id: kubeflow-pipelines
18+
component: metadata-grpc-server
19+
spec:
20+
containers:
21+
- args:
22+
- --grpc_port=8080
23+
- --mysql_config_database=$(MYSQL_DATABASE)
24+
- --mysql_config_host=$(MYSQL_HOST)
25+
- --mysql_config_port=$(MYSQL_PORT)
26+
- --mysql_config_user=$(DBCONFIG_USER)
27+
- --mysql_config_password=$(DBCONFIG_PASSWORD)
28+
- --enable_database_upgrade=true
29+
command:
30+
- /bin/metadata_store_server
31+
env:
32+
- name: DBCONFIG_USER
33+
valueFrom:
34+
secretKeyRef:
35+
key: username
36+
name: mysql-secret
37+
- name: DBCONFIG_PASSWORD
38+
valueFrom:
39+
secretKeyRef:
40+
key: password
41+
name: mysql-secret
42+
- name: MYSQL_DATABASE
43+
valueFrom:
44+
configMapKeyRef:
45+
key: mlmdDb
46+
name: pipeline-install-config
47+
- name: MYSQL_HOST
48+
valueFrom:
49+
configMapKeyRef:
50+
key: dbHost
51+
name: pipeline-install-config
52+
- name: MYSQL_PORT
53+
valueFrom:
54+
configMapKeyRef:
55+
key: dbPort
56+
name: pipeline-install-config
57+
image: metadata-grpc
58+
livenessProbe:
59+
initialDelaySeconds: 3
60+
periodSeconds: 5
61+
tcpSocket:
62+
port: grpc-api
63+
timeoutSeconds: 2
64+
name: container
65+
ports:
66+
- containerPort: 8080
67+
name: grpc-api
68+
readinessProbe:
69+
initialDelaySeconds: 3
70+
periodSeconds: 5
71+
tcpSocket:
72+
port: grpc-api
73+
timeoutSeconds: 2
74+
serviceAccountName: metadata-grpc-server
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
labels:
5+
app: metadata-writer
6+
application-crd-id: kubeflow-pipelines
7+
name: metadata-writer
8+
spec:
9+
replicas: 1
10+
selector:
11+
matchLabels:
12+
app: metadata-writer
13+
application-crd-id: kubeflow-pipelines
14+
template:
15+
metadata:
16+
labels:
17+
app: metadata-writer
18+
application-crd-id: kubeflow-pipelines
19+
spec:
20+
containers:
21+
- env:
22+
- name: NAMESPACE_TO_WATCH
23+
valueFrom:
24+
fieldRef:
25+
fieldPath: metadata.namespace
26+
- name: PIPELINE_RUNTIME
27+
value: tekton
28+
- name: ARCHIVE_LOGS
29+
valueFrom:
30+
configMapKeyRef:
31+
key: archive_logs
32+
name: kfp-tekton-config
33+
image: metadata-writer
34+
name: main
35+
serviceAccountName: kubeflow-pipelines-metadata-writer

0 commit comments

Comments
 (0)