update kubeflow dip-catalog
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
---
|
||||
---
|
||||
apiVersion: kubeflow.org/v1beta1
|
||||
kind: Experiment
|
||||
metadata:
|
||||
namespace: kubeflow-user
|
||||
name: grid
|
||||
spec:
|
||||
objective:
|
||||
type: minimize
|
||||
goal: 0.1
|
||||
objectiveMetricName: loss
|
||||
algorithm:
|
||||
algorithmName: grid
|
||||
parallelTrialCount: 2
|
||||
maxTrialCount: 2
|
||||
maxFailedTrialCount: 2
|
||||
parameters:
|
||||
- name: lr
|
||||
parameterType: double
|
||||
feasibleSpace:
|
||||
min: "0.01"
|
||||
step: "0.005"
|
||||
max: "0.05"
|
||||
- name: momentum
|
||||
parameterType: double
|
||||
feasibleSpace:
|
||||
min: "0.5"
|
||||
step: "0.1"
|
||||
max: "0.9"
|
||||
trialTemplate:
|
||||
primaryContainerName: training-container
|
||||
trialParameters:
|
||||
- name: learningRate
|
||||
description: Learning rate for the training model
|
||||
reference: lr
|
||||
- name: momentum
|
||||
description: Momentum for the training model
|
||||
reference: momentum
|
||||
trialSpec:
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: training-container
|
||||
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest
|
||||
command:
|
||||
- "python3"
|
||||
- "/opt/pytorch-mnist/mnist.py"
|
||||
- "--epochs=1"
|
||||
- "--batch-size=16"
|
||||
- "--lr=${trialParameters.learningRate}"
|
||||
- "--momentum=${trialParameters.momentum}"
|
||||
restartPolicy: Never
|
||||
@@ -0,0 +1,15 @@
|
||||
apiVersion: "serving.kserve.io/v1beta1"
|
||||
kind: "InferenceService"
|
||||
metadata:
|
||||
name: "sklearn-iris"
|
||||
spec:
|
||||
predictor:
|
||||
sklearn:
|
||||
resources:
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: 2Gi
|
||||
requests:
|
||||
cpu: "0.1"
|
||||
memory: 200M
|
||||
storageUri: "gs://kfserving-examples/models/sklearn/1.0/model"
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
apiVersion: kubeflow.org/v1
|
||||
kind: Notebook
|
||||
metadata:
|
||||
annotations:
|
||||
notebooks.kubeflow.org/creator: user@example.com
|
||||
notebooks.kubeflow.org/server-type: jupyter
|
||||
generation: 1
|
||||
labels:
|
||||
access-ml-pipeline: "true"
|
||||
app: test
|
||||
name: test
|
||||
namespace: kubeflow-user-example-com
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: test
|
||||
image: kubeflownotebookswg/jupyter-scipy:v1.9.0-rc.1
|
||||
imagePullPolicy: IfNotPresent
|
||||
resources:
|
||||
limits:
|
||||
cpu: "0.6"
|
||||
memory: 1.2Gi
|
||||
requests:
|
||||
cpu: "0.5"
|
||||
memory: 1Gi
|
||||
serviceAccountName: default-editor
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
apiVersion: kubeflow.org/v1alpha1
|
||||
kind: PodDefault
|
||||
metadata:
|
||||
name: access-ml-pipeline
|
||||
namespace: kubeflow-user-example-com
|
||||
spec:
|
||||
desc: Allow access to Kubeflow Pipelines
|
||||
selector:
|
||||
matchLabels:
|
||||
access-ml-pipeline: "true"
|
||||
env:
|
||||
- name: KF_PIPELINES_SA_TOKEN_PATH
|
||||
value: /var/run/secrets/kubeflow/pipelines/token
|
||||
volumes:
|
||||
- name: volume-kf-pipeline-token
|
||||
projected:
|
||||
sources:
|
||||
- serviceAccountToken:
|
||||
path: token
|
||||
expirationSeconds: 7200
|
||||
audience: pipelines.kubeflow.org
|
||||
volumeMounts:
|
||||
- mountPath: /var/run/secrets/kubeflow/pipelines
|
||||
name: volume-kf-pipeline-token
|
||||
readOnly: true
|
||||
@@ -0,0 +1,29 @@
|
||||
import kfp
|
||||
from kfp import dsl
|
||||
import kfp.components as comp
|
||||
|
||||
|
||||
@comp.create_component_from_func
|
||||
def echo_op():
|
||||
print("Test pipeline")
|
||||
|
||||
|
||||
@dsl.pipeline(name="test-pipeline", description="A test pipeline.")
|
||||
def hello_world_pipeline():
|
||||
echo_task = echo_op()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Run the Kubeflow Pipeline in the user's namespace.
|
||||
kfp_client = kfp.Client(
|
||||
host="http://localhost:3000", namespace="kubeflow-user-example-com"
|
||||
)
|
||||
kfp_client.runs.api_client.default_headers.update(
|
||||
{"kubeflow-userid": "kubeflow-user-example-com"}
|
||||
)
|
||||
# create the KFP run
|
||||
run_id = kfp_client.create_run_from_pipeline_func(
|
||||
hello_world_pipeline,
|
||||
namespace="kubeflow-user-example-com",
|
||||
arguments={},
|
||||
).run_id
|
||||
@@ -0,0 +1,21 @@
|
||||
apiVersion: "kubeflow.org/v1"
|
||||
kind: TFJob
|
||||
metadata:
|
||||
name: tfjob-simple
|
||||
namespace: kubeflow
|
||||
spec:
|
||||
tfReplicaSpecs:
|
||||
Worker:
|
||||
replicas: 2
|
||||
restartPolicy: OnFailure
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: tensorflow
|
||||
image: gcr.io/kubeflow-ci/tf-mnist-with-summaries:1.0
|
||||
command:
|
||||
- "python"
|
||||
- "/var/tf_mnist/mnist_with_summaries.py"
|
||||
- "--log_dir=/train/logs"
|
||||
- "--learning_rate=0.01"
|
||||
- "--batch_size=150"
|
||||
Reference in New Issue
Block a user