Skip to content

Commit 2320054

Browse files
Please work man
1 parent e32ce27 commit 2320054

24 files changed

+1172
-4
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
run: echo "${{ secrets.GITHUB_TOKEN}}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
2020

2121
- name: Build Docker image
22-
run: docker build -t custom-mlflow:0.6 .
22+
run: docker build -t custom-mlflow:0.7 .
2323

2424
- name: Tag Docker image
25-
run: docker tag custom-mlflow:0.6 ghcr.io/slaclab/mlflow-latest/custom-mlflow:0.6
25+
run: docker tag custom-mlflow:0.7 ghcr.io/slaclab/mlflow-latest/custom-mlflow:0.7
2626

2727
- name: Push Docker image
28-
run: docker push ghcr.io/slaclab/mlflow-latest/custom-mlflow:0.6
28+
run: docker push ghcr.io/slaclab/mlflow-latest/custom-mlflow:0.7

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
# mlflow-latest
1+
# MLFLOW
2+
3+
MLflow is an open-source platform to manage the complete ML lifecycle.
4+
5+
## Deployment
6+
The [NCSA](https://github.com/ncsa/charts/tree/main/charts/mlflow) helm chart is used for this deployment.
7+
8+
```bash
9+
helm upgrade mlflow ncsa/mlflow --values values.yaml -n mlflow
10+
```
11+
12+
Don't forget to update the image version in Dockerfile and Helm charts.

helm-chart/mlflow/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

helm-chart/mlflow/Chart.lock

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
dependencies:
2+
- name: postgresql
3+
repository: https://charts.bitnami.com/bitnami
4+
version: 11.9.13
5+
- name: minio
6+
repository: https://charts.bitnami.com/bitnami
7+
version: 11.10.26
8+
digest: sha256:510d2733eeefedce7d3f6da9bec18934e91a7db4387dae104c625d3b60981002
9+
generated: "2023-02-25T16:11:02.948482-06:00"

helm-chart/mlflow/Chart.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
apiVersion: v2
2+
name: mlflow
3+
icon: https://mlflow.org/images/MLflow-logo-final-white-TM.png
4+
home: https://mlflow.org/
5+
description: An open source platform for the machine learning lifecycle
6+
type: application
7+
8+
# This is the chart version. This version number should be incremented each time you make changes
9+
# to the chart and its templates, including the app version.
10+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
11+
version: 1.2.1
12+
13+
# This is the version number of the application being deployed. This version number should be
14+
# incremented each time you make changes to the application. Versions are not expected to
15+
# follow Semantic Versioning. They should reflect the version the application is using.
16+
appVersion: 2.2.1
17+
18+
# List of people that maintain this helm chart.
19+
maintainers:
20+
- name: Rob Kooper
21+
22+
- name: Ben Galewsky
23+
24+
25+
# location of source code
26+
sources:
27+
- https://github.com/mlflow/mlflow
28+
29+
# dependencies for the helm chart, use helm dep install to the install them.
30+
dependencies:
31+
- name: postgresql
32+
version: ~11
33+
repository: https://charts.bitnami.com/bitnami
34+
condition: services.postgres.enabled
35+
- name: minio
36+
version: ~11
37+
repository: https://charts.bitnami.com/bitnami
38+
condition: services.minio.enabled
39+
40+
# annotations for artifact.io
41+
annotations:
42+
artifacthub.io/links: |
43+
- name: Helm Chart
44+
url: https://github.com/ncsa/charts
45+
artifacthub.io/changes: |
46+
- Fix deployment to listen on 0.0.0.0 interface

helm-chart/mlflow/README.MD

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# MLflow deployment in vlcuster
2+
## Installation
3+
Install krew - https://krew.sigs.k8s.io/docs/user-guide/setup/install/
4+
Search for MinIO plugin -
5+
```
6+
kubectl krew search
7+
kubectl krew install minio
8+
kubectl krew info minio
9+
~/.krew/bin/kubectl-minio init
10+
kubectl minio tenant create mlflow-minio --interactive
11+
kubectl create secret generic minio-credentials --from-literal=user=<username>--from-literal=key=<password> -n mlflow
12+
```
13+
14+
Next, Create mlflow bucket in minio and reference the secret and minio hl url in values.yaml for s3.
15+
16+
```
17+
MLFlow:
18+
artifacts:
19+
bucketName: mlflow
20+
.
21+
.
22+
.
23+
24+
s3:
25+
url: http://mlflow-minio-hl.mlflow.svc.cluster.local:9000
26+
# Secret with values for 'user' and 'key'
27+
secret: minio-credentials
28+
```
29+
30+
Finally, install mlflow with custom values.yaml.
31+
```
32+
helm install mlflow ncsa/mlflow --values values.yaml -n mlflow
33+
```
34+
This is using [NCSA](https://github.com/ncsa/charts/tree/main) mlflow chart.
35+
```
36+
helm repo add ncsa https://opensource.ncsa.illinois.edu/charts/
37+
helm repo add bitnami https://charts.bitnami.com/bitnami
38+
helm dep update #to get the minio and postgresql charts referenced in the Chart.yaml
39+
```
40+
41+
### Future Task
42+
Get minio ingress running

helm-chart/mlflow/README.MD-ncsa

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# MLFlow Helm Chart
2+
This chart deploys a complete MLFlow instance along with a postgres database
3+
and minio object store. It can optionally use OAuth2-Proxy to secure access to
4+
the tracking server for both web browsers and the MLFlow API.
5+
6+
The deployed service will proxy artifact server requests to the object store
7+
back end so you don't need to distribute AWS_ACCESS_KEYs to users.
8+
9+
## Notes on Authentication
10+
This chart has been tested out using a [Keycloak](https://www.keycloak.org) as
11+
the backend identity and access management service. It turns out that teaching
12+
OAuth2-proxy to accept JWTs from many common providers is problematic. We
13+
settled on Keycloak as the best way to offer the features we want.
14+
15+
It is possible to use Keycloak with a
16+
[Device Flow](https://www.rfc-editor.org/rfc/rfc8628) to make it eash to get a
17+
valid token from the command line. We developed a
18+
[tool](https://pypi.org/project/mlflow-token/) to support this. It assumes that
19+
the MLflow instance in the user's `MLFLOW_TRACKING_URI` points to a deployment
20+
made with this chart. It uses an oauth2 endpoint to find the URL of the
21+
Keycloak realm and starts a device flow against that realm.
22+
23+
### OAuth2-Proxy Secret
24+
In order for the device flow to work, the OAuth client must be public and not
25+
require a secret. If you have a deployment that depends on a OAuth secret then
26+
you can create a kubernetes secret in the namespace. This secret must have the
27+
following two properties:
28+
- cookie_secret
29+
- client_secret
30+
31+
These values will be read and passed on to the OAuth2-Proxy as environment
32+
variables.
33+
34+
35+
## Configurable Values
36+
Here are some of the useful settings in `values.yaml` - there are many other
37+
settings which are typical of most helm charts.
38+
39+
| Value | Description | Default Value |
40+
|-----------------------------|------------------------------------------------------------------------------------|---------------|
41+
| MLFlow.artifacts.bucketName | The bucket where the artifacts will be stored | |
42+
| services.postgres.enabled | Deploy a postgres subchart with this chart? | true |
43+
| services.minio.enabled | Deploy a minio subchart with this chart? | true |
44+
| oauth2Proxy.enabled | Protect the tracking server with an OAuth2 Proxy? | true |
45+
| oauth2Proxy.secret | Kubernetes secret holding values to configure the proxy | |
46+
| oauth2Proxy.clientID | Client ID string for the value in your OAuth2 client. | |
47+
| oauth2Proxy.provider | A valid setting for OAuth2-Proxy | keycloak-oidc |
48+
| oauth2Proxy.emailDomains | List of domain names for users that will be automatically accepted | * |
49+
| oauth2Proxy.allowedGroups | YAML List of groups that will be accepted (best to set oidc_groups_claim with this | |
50+

helm-chart/mlflow/Starting

Whitespace-only changes.
51.4 KB
Binary file not shown.
56 KB
Binary file not shown.

0 commit comments

Comments
 (0)