diff --git a/Makefile b/Makefile index 9bbd4d35720..d4a6a04e155 100644 --- a/Makefile +++ b/Makefile @@ -23,11 +23,11 @@ vet: update: hack/update-gofmt.sh -# Deploy Katib v1beta1 manifests into a k8s cluster +# Deploy Katib v1beta1 manifests using Kustomize into a k8s cluster. deploy: bash scripts/v1beta1/deploy.sh -# Undeploy Katib v1beta1 manifests from a k8s cluster +# Undeploy Katib v1beta1 manifests using Kustomize from a k8s cluster undeploy: bash scripts/v1beta1/undeploy.sh diff --git a/README.md b/README.md index e746a3a7571..0651be965da 100644 --- a/README.md +++ b/README.md @@ -202,7 +202,7 @@ kubectl create namespace kubeflow Clone Kubeflow manifest repository: ``` -git clone git@github.com:kubeflow/manifests.git +git clone -b v1.2-branch git@github.com:kubeflow/manifests.git Set `MANIFESTS_DIR` to the cloned folder. export MANIFESTS_DIR= ``` @@ -231,7 +231,8 @@ kustomize build . | kubectl apply -f - ### Katib -Finally, you can install Katib: +Note that your [kustomize](https://kustomize.io/) version should be >= 3.2. +To install Katib run: ``` git clone git@github.com:kubeflow/katib.git diff --git a/docs/developer-guide.md b/docs/developer-guide.md index bb19fb6c6a8..dd974cbdf78 100644 --- a/docs/developer-guide.md +++ b/docs/developer-guide.md @@ -30,6 +30,7 @@ see the following user guides: - [Go](https://golang.org/) (1.13 or later) - [Docker](https://docs.docker.com/) (17.05 or later.) +- [kustomize](https://kustomize.io/) (3.2 or later) ## Build from source code @@ -65,16 +66,16 @@ make generate Below is a list of command-line flags accepted by Katib controller: -| Name | Type | Default | Description | -| ------------------------------- | --------------------------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------- | -| cert-localfs | bool | false | Store the webhook cert in local file system | -| enable-grpc-probe-in-suggestion | bool | true | Enable grpc probe in suggestions | -| experiment-suggestion-name | string | "default" | The implementation of suggestion interface in experiment controller | -| metrics-addr | string | ":8080" | The address the metric endpoint binds to | -| trial-resources | []schema.GroupVersionKind | null | The list of resources that can be used as trial template, in the form: Kind.version.group (e.g. TFJob.v1.kubeflow.org) | -| webhook-inject-securitycontext | bool | false | Inject the securityContext of container[0] in the sidecar | -| webhook-port | int | 8443 | The port number to be used for admission webhook server | -| webhook-service-name | string | "katib-controller" | The service name which will be used in webhook | +| Name | Type | Default | Description | +| ------------------------------- | ------------------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------- | +| cert-localfs | bool | false | Store the webhook cert in local file system | +| enable-grpc-probe-in-suggestion | bool | true | Enable grpc probe in suggestions | +| experiment-suggestion-name | string | "default" | The implementation of suggestion interface in experiment controller | +| metrics-addr | string | ":8080" | The address the metric endpoint binds to | +| trial-resources | []schema.GroupVersionKind | null | The list of resources that can be used as trial template, in the form: Kind.version.group (e.g. TFJob.v1.kubeflow.org) | +| webhook-inject-securitycontext | bool | false | Inject the securityContext of container[0] in the sidecar | +| webhook-port | int | 8443 | The port number to be used for admission webhook server | +| webhook-service-name | string | "katib-controller" | The service name which will be used in webhook | ## Workflow design diff --git a/examples/v1beta1/bayesianoptimization-example.yaml b/examples/v1beta1/bayesianoptimization-example.yaml index 27ad3d7d7cf..38b7a19d224 100644 --- a/examples/v1beta1/bayesianoptimization-example.yaml +++ b/examples/v1beta1/bayesianoptimization-example.yaml @@ -56,7 +56,7 @@ spec: spec: containers: - name: training-container - image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-e294a90 + image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-c6c9172 command: - "python3" - "/opt/mxnet-mnist/mnist.py" diff --git a/examples/v1beta1/cmaes-example.yaml b/examples/v1beta1/cmaes-example.yaml index eda7dc995fe..2107ce9191b 100644 --- a/examples/v1beta1/cmaes-example.yaml +++ b/examples/v1beta1/cmaes-example.yaml @@ -53,7 +53,7 @@ spec: spec: containers: - name: training-container - image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-e294a90 + image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-c6c9172 command: - "python3" - "/opt/mxnet-mnist/mnist.py" diff --git a/examples/v1beta1/custom-metricscollector-example.yaml b/examples/v1beta1/custom-metricscollector-example.yaml index a0d9baf74c0..bbf03cfe79e 100644 --- a/examples/v1beta1/custom-metricscollector-example.yaml +++ b/examples/v1beta1/custom-metricscollector-example.yaml @@ -66,9 +66,7 @@ spec: spec: containers: - name: training-container - # TODO (andreyvelich): Add tag to the image. - image: docker.io/kubeflowkatib/pytorch-mnist:latest - imagePullPolicy: Always + image: docker.io/kubeflowkatib/pytorch-mnist:v1beta1-c6c9172 command: - "python3" - "/opt/pytorch-mnist/mnist.py" diff --git a/examples/v1beta1/early-stopping/median-stop.yaml b/examples/v1beta1/early-stopping/median-stop.yaml index 0cef18e8cd1..245c2536251 100644 --- a/examples/v1beta1/early-stopping/median-stop.yaml +++ b/examples/v1beta1/early-stopping/median-stop.yaml @@ -53,7 +53,7 @@ spec: spec: containers: - name: training-container - image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-e294a90 + image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-c6c9172 command: - "python3" - "/opt/mxnet-mnist/mnist.py" diff --git a/examples/v1beta1/file-metricscollector-example.yaml b/examples/v1beta1/file-metricscollector-example.yaml index 51b3745d1be..2661b1334a5 100644 --- a/examples/v1beta1/file-metricscollector-example.yaml +++ b/examples/v1beta1/file-metricscollector-example.yaml @@ -53,9 +53,7 @@ spec: spec: containers: - name: training-container - # TODO (andreyvelich): Add tag to the image. - image: docker.io/kubeflowkatib/pytorch-mnist:latest - imagePullPolicy: Always + image: docker.io/kubeflowkatib/pytorch-mnist:v1beta1-c6c9172 command: - "python3" - "/opt/pytorch-mnist/mnist.py" diff --git a/examples/v1beta1/grid-example.yaml b/examples/v1beta1/grid-example.yaml index 63000b2ce30..d5c49f25510 100644 --- a/examples/v1beta1/grid-example.yaml +++ b/examples/v1beta1/grid-example.yaml @@ -54,7 +54,7 @@ spec: spec: containers: - name: training-container - image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-e294a90 + image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-c6c9172 command: - "python3" - "/opt/mxnet-mnist/mnist.py" diff --git a/examples/v1beta1/hyperband-example.yaml b/examples/v1beta1/hyperband-example.yaml index 8d783d49272..a03f42a6197 100644 --- a/examples/v1beta1/hyperband-example.yaml +++ b/examples/v1beta1/hyperband-example.yaml @@ -68,7 +68,7 @@ spec: spec: containers: - name: training-container - image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-e294a90 + image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-c6c9172 command: - "python3" - "/opt/mxnet-mnist/mnist.py" diff --git a/examples/v1beta1/metric-strategy-example.yaml b/examples/v1beta1/metric-strategy-example.yaml index 21f18814071..0016339d5c8 100644 --- a/examples/v1beta1/metric-strategy-example.yaml +++ b/examples/v1beta1/metric-strategy-example.yaml @@ -58,7 +58,7 @@ spec: spec: containers: - name: training-container - image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-e294a90 + image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-c6c9172 command: - "python3" - "/opt/mxnet-mnist/mnist.py" diff --git a/examples/v1beta1/mxnet-mnist/mnist.py b/examples/v1beta1/mxnet-mnist/mnist.py index a0acc562767..111de1fb950 100644 --- a/examples/v1beta1/mxnet-mnist/mnist.py +++ b/examples/v1beta1/mxnet-mnist/mnist.py @@ -37,40 +37,19 @@ level=logging.DEBUG) -def read_data(label, image): - """ - download and read data into numpy - """ - base_url = 'http://yann.lecun.com/exdb/mnist/' - with gzip.open(utils.download_file(base_url+label, os.path.join('data', label))) as flbl: - magic, num = struct.unpack(">II", flbl.read(8)) - label = np.fromstring(flbl.read(), dtype=np.int8) - with gzip.open(utils.download_file(base_url+image, os.path.join('data', image)), 'rb') as fimg: - magic, num, rows, cols = struct.unpack(">IIII", fimg.read(16)) - image = np.fromstring(fimg.read(), dtype=np.uint8).reshape(len(label), rows, cols) - return (label, image) - - -def to4d(img): +def get_mnist_iter(args, kv): """ - reshape to 4D arrays + Create data iterator with NDArrayIter """ - return img.reshape(img.shape[0], 1, 28, 28).astype(np.float32)/255 + mnist = mx.test_utils.get_mnist() + # Get MNIST data. + train_data = mx.io.NDArrayIter( + mnist['train_data'], mnist['train_label'], args.batch_size, shuffle=True) + val_data = mx.io.NDArrayIter( + mnist['test_data'], mnist['test_label'], args.batch_size) -def get_mnist_iter(args, kv): - """ - create data iterator with NDArrayIter - """ - (train_lbl, train_img) = read_data( - 'train-labels-idx1-ubyte.gz', 'train-images-idx3-ubyte.gz') - (val_lbl, val_img) = read_data( - 't10k-labels-idx1-ubyte.gz', 't10k-images-idx3-ubyte.gz') - train = mx.io.NDArrayIter( - to4d(train_img), train_lbl, args.batch_size, shuffle=True) - val = mx.io.NDArrayIter( - to4d(val_img), val_lbl, args.batch_size) - return (train, val) + return (train_data, val_data) if __name__ == '__main__': diff --git a/examples/v1beta1/nas/darts-example-cpu.yaml b/examples/v1beta1/nas/darts-example-cpu.yaml index 879d87e9a57..eb797c57f87 100644 --- a/examples/v1beta1/nas/darts-example-cpu.yaml +++ b/examples/v1beta1/nas/darts-example-cpu.yaml @@ -59,8 +59,7 @@ spec: spec: containers: - name: training-container - image: docker.io/kubeflowkatib/darts-cnn-cifar10:v1beta1-e294a90 - imagePullPolicy: Always + image: docker.io/kubeflowkatib/darts-cnn-cifar10:v1beta1-c6c9172 command: - python3 - run_trial.py diff --git a/examples/v1beta1/nas/darts-example-gpu.yaml b/examples/v1beta1/nas/darts-example-gpu.yaml index 7b0a6e8b6bb..b0d297d2901 100644 --- a/examples/v1beta1/nas/darts-example-gpu.yaml +++ b/examples/v1beta1/nas/darts-example-gpu.yaml @@ -76,8 +76,7 @@ spec: spec: containers: - name: training-container - image: docker.io/kubeflowkatib/darts-cnn-cifar10:v1beta1-e294a90 - imagePullPolicy: Always + image: docker.io/kubeflowkatib/darts-cnn-cifar10:v1beta1-c6c9172 command: - python3 - run_trial.py diff --git a/examples/v1beta1/nas/enas-example-cpu.yaml b/examples/v1beta1/nas/enas-example-cpu.yaml index cd225ad20a7..ac3e87e7be3 100644 --- a/examples/v1beta1/nas/enas-example-cpu.yaml +++ b/examples/v1beta1/nas/enas-example-cpu.yaml @@ -139,7 +139,7 @@ spec: spec: containers: - name: training-container - image: docker.io/kubeflowkatib/enas-cnn-cifar10-cpu:v1beta1-e294a90 + image: docker.io/kubeflowkatib/enas-cnn-cifar10-cpu:v1beta1-c6c9172 command: - python3 - -u diff --git a/examples/v1beta1/nas/enas-example-gpu.yaml b/examples/v1beta1/nas/enas-example-gpu.yaml index e5612198f67..554b1919036 100644 --- a/examples/v1beta1/nas/enas-example-gpu.yaml +++ b/examples/v1beta1/nas/enas-example-gpu.yaml @@ -136,7 +136,7 @@ spec: spec: containers: - name: training-container - image: docker.io/kubeflowkatib/enas-cnn-cifar10-gpu:v1beta1-e294a90 + image: docker.io/kubeflowkatib/enas-cnn-cifar10-gpu:v1beta1-c6c9172 command: - python3 - -u diff --git a/examples/v1beta1/pytorch-mnist/mnist.py b/examples/v1beta1/pytorch-mnist/mnist.py index 738fa2c8bf3..b1c32de35bb 100644 --- a/examples/v1beta1/pytorch-mnist/mnist.py +++ b/examples/v1beta1/pytorch-mnist/mnist.py @@ -11,12 +11,6 @@ import torch.nn.functional as F import torch.optim as optim -# To fix this issue: https://github.com/pytorch/vision/issues/1938. -from six.moves import urllib -opener = urllib.request.build_opener() -opener.addheaders = [("User-agent", "Mozilla/5.0")] -urllib.request.install_opener(opener) - WORLD_SIZE = int(os.environ.get("WORLD_SIZE", 1)) @@ -138,18 +132,22 @@ def main(): dist.init_process_group(backend=args.backend) kwargs = {"num_workers": 1, "pin_memory": True} if use_cuda else {} + train_loader = torch.utils.data.DataLoader( - datasets.MNIST("../data", train=True, download=True, - transform=transforms.Compose([ - transforms.ToTensor(), - transforms.Normalize((0.1307,), (0.3081,)) - ])), + datasets.FashionMNIST("./data", + train=True, + download=True, + transform=transforms.Compose([ + transforms.ToTensor() + ])), batch_size=args.batch_size, shuffle=True, **kwargs) + test_loader = torch.utils.data.DataLoader( - datasets.MNIST("../data", train=False, transform=transforms.Compose([ - transforms.ToTensor(), - transforms.Normalize((0.1307,), (0.3081,)) - ])), + datasets.FashionMNIST("./data", + train=False, + transform=transforms.Compose([ + transforms.ToTensor() + ])), batch_size=args.test_batch_size, shuffle=False, **kwargs) model = Net().to(device) diff --git a/examples/v1beta1/pytorchjob-example.yaml b/examples/v1beta1/pytorchjob-example.yaml index 6c139d6354d..f206037da8c 100644 --- a/examples/v1beta1/pytorchjob-example.yaml +++ b/examples/v1beta1/pytorchjob-example.yaml @@ -45,9 +45,7 @@ spec: spec: containers: - name: pytorch - # TODO (andreyvelich): Add tag to the image. - image: docker.io/kubeflowkatib/pytorch-mnist:latest - imagePullPolicy: Always + image: docker.io/kubeflowkatib/pytorch-mnist:v1beta1-c6c9172 command: - "python3" - "/opt/pytorch-mnist/mnist.py" @@ -61,9 +59,7 @@ spec: spec: containers: - name: pytorch - # TODO (andreyvelich): Add tag to the image. - image: docker.io/kubeflowkatib/pytorch-mnist:latest - imagePullPolicy: Always + image: docker.io/kubeflowkatib/pytorch-mnist:v1beta1-c6c9172 command: - "python3" - "/opt/pytorch-mnist/mnist.py" diff --git a/examples/v1beta1/random-example.yaml b/examples/v1beta1/random-example.yaml index 1f3b0b3ef7c..dfb0e446d77 100644 --- a/examples/v1beta1/random-example.yaml +++ b/examples/v1beta1/random-example.yaml @@ -53,7 +53,7 @@ spec: spec: containers: - name: training-container - image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-e294a90 + image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-c6c9172 command: - "python3" - "/opt/mxnet-mnist/mnist.py" diff --git a/examples/v1beta1/resume-experiment/from-volume-resume.yaml b/examples/v1beta1/resume-experiment/from-volume-resume.yaml index 3df6a8689b7..2b69b531cb9 100644 --- a/examples/v1beta1/resume-experiment/from-volume-resume.yaml +++ b/examples/v1beta1/resume-experiment/from-volume-resume.yaml @@ -54,7 +54,7 @@ spec: spec: containers: - name: training-container - image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-e294a90 + image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-c6c9172 command: - "python3" - "/opt/mxnet-mnist/mnist.py" diff --git a/examples/v1beta1/resume-experiment/never-resume.yaml b/examples/v1beta1/resume-experiment/never-resume.yaml index 200bd0387a0..703a4f1620f 100644 --- a/examples/v1beta1/resume-experiment/never-resume.yaml +++ b/examples/v1beta1/resume-experiment/never-resume.yaml @@ -56,7 +56,7 @@ spec: spec: containers: - name: training-container - image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-e294a90 + image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-c6c9172 command: - "python3" - "/opt/mxnet-mnist/mnist.py" diff --git a/examples/v1beta1/tekton/pipeline-run.yaml b/examples/v1beta1/tekton/pipeline-run.yaml index 353fe2e5269..26af8351a7e 100644 --- a/examples/v1beta1/tekton/pipeline-run.yaml +++ b/examples/v1beta1/tekton/pipeline-run.yaml @@ -88,7 +88,7 @@ spec: description: Number of training examples steps: - name: model-training - image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-e294a90 + image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-c6c9172 command: - "python3" - "/opt/mxnet-mnist/mnist.py" diff --git a/examples/v1beta1/tfjob-example.yaml b/examples/v1beta1/tfjob-example.yaml index 5ec0090214a..4ea455c7d96 100644 --- a/examples/v1beta1/tfjob-example.yaml +++ b/examples/v1beta1/tfjob-example.yaml @@ -53,7 +53,6 @@ spec: containers: - name: tensorflow image: gcr.io/kubeflow-ci/tf-mnist-with-summaries:1.0 - imagePullPolicy: Always command: - "python" - "/var/tf_mnist/mnist_with_summaries.py" diff --git a/examples/v1beta1/tpe-example.yaml b/examples/v1beta1/tpe-example.yaml index 4e3d18b566a..8735a64f3a6 100644 --- a/examples/v1beta1/tpe-example.yaml +++ b/examples/v1beta1/tpe-example.yaml @@ -53,7 +53,7 @@ spec: spec: containers: - name: training-container - image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-e294a90 + image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-c6c9172 command: - "python3" - "/opt/mxnet-mnist/mnist.py" diff --git a/examples/v1beta1/trial-metadata-substitution.yaml b/examples/v1beta1/trial-metadata-substitution.yaml index 0f4aa7cf71c..2769826eb41 100644 --- a/examples/v1beta1/trial-metadata-substitution.yaml +++ b/examples/v1beta1/trial-metadata-substitution.yaml @@ -59,7 +59,7 @@ spec: spec: containers: - name: training-container - image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-e294a90 + image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-c6c9172 command: - "python3" - "/opt/mxnet-mnist/mnist.py" diff --git a/manifests/v1beta1/katib-controller/katib-controller.yaml b/manifests/v1beta1/components/controller/controller.yaml similarity index 95% rename from manifests/v1beta1/katib-controller/katib-controller.yaml rename to manifests/v1beta1/components/controller/controller.yaml index 356f1ffc33f..b50c1211db9 100644 --- a/manifests/v1beta1/katib-controller/katib-controller.yaml +++ b/manifests/v1beta1/components/controller/controller.yaml @@ -3,6 +3,7 @@ kind: Deployment metadata: name: katib-controller namespace: kubeflow + # TODO (andreyvelich): Modify labels to follow k8s guidelines. labels: app: katib-controller spec: @@ -21,7 +22,6 @@ spec: containers: - name: katib-controller image: docker.io/kubeflowkatib/katib-controller - imagePullPolicy: Always command: ["./katib-controller"] args: - "--webhook-port=8443" diff --git a/manifests/v1beta1/katib-controller/katib-config.yaml b/manifests/v1beta1/components/controller/katib-config.yaml similarity index 95% rename from manifests/v1beta1/katib-controller/katib-config.yaml rename to manifests/v1beta1/components/controller/katib-config.yaml index f8b02e5487b..8f62db1c9ec 100644 --- a/manifests/v1beta1/katib-controller/katib-config.yaml +++ b/manifests/v1beta1/components/controller/katib-config.yaml @@ -26,6 +26,9 @@ data: "random": { "image": "docker.io/kubeflowkatib/suggestion-hyperopt" }, + "tpe": { + "image": "docker.io/kubeflowkatib/suggestion-hyperopt" + }, "grid": { "image": "docker.io/kubeflowkatib/suggestion-chocolate" }, @@ -35,21 +38,17 @@ data: "bayesianoptimization": { "image": "docker.io/kubeflowkatib/suggestion-skopt" }, - "tpe": { - "image": "docker.io/kubeflowkatib/suggestion-hyperopt" + "cmaes": { + "image": "docker.io/kubeflowkatib/suggestion-goptuna" }, "enas": { "image": "docker.io/kubeflowkatib/suggestion-enas", - "imagePullPolicy": "Always", "resources": { "limits": { "memory": "200Mi" } } }, - "cmaes": { - "image": "docker.io/kubeflowkatib/suggestion-goptuna" - }, "darts": { "image": "docker.io/kubeflowkatib/suggestion-darts" } @@ -57,7 +56,6 @@ data: early-stopping: |- { "medianstop": { - "image": "docker.io/kubeflowkatib/earlystopping-medianstop", - "imagePullPolicy": "Always" + "image": "docker.io/kubeflowkatib/earlystopping-medianstop" } } diff --git a/manifests/v1beta1/katib-controller/rbac.yaml b/manifests/v1beta1/components/controller/rbac.yaml similarity index 84% rename from manifests/v1beta1/katib-controller/rbac.yaml rename to manifests/v1beta1/components/controller/rbac.yaml index da4e2ad5379..3d760395b7f 100644 --- a/manifests/v1beta1/katib-controller/rbac.yaml +++ b/manifests/v1beta1/components/controller/rbac.yaml @@ -13,11 +13,6 @@ rules: - namespaces - persistentvolumes - persistentvolumeclaims - verbs: - - "*" - - apiGroups: - - "" - resources: - pods - pods/log - pods/status @@ -30,19 +25,19 @@ rules: verbs: - "*" - apiGroups: - - batch + - rbac.authorization.k8s.io resources: - - jobs - - cronjobs + - roles + - rolebindings verbs: - "*" - apiGroups: - - apiextensions.k8s.io + - batch resources: - - customresourcedefinitions + - jobs + - cronjobs verbs: - - create - - get + - "*" - apiGroups: - kubeflow.org resources: @@ -55,11 +50,6 @@ rules: - suggestions - suggestions/status - suggestions/finalizers - verbs: - - "*" - - apiGroups: - - kubeflow.org - resources: - tfjobs - pytorchjobs - mpijobs @@ -72,13 +62,6 @@ rules: - taskruns verbs: - "*" - - apiGroups: - - rbac.authorization.k8s.io - resources: - - roles - - rolebindings - verbs: - - "*" --- apiVersion: v1 kind: ServiceAccount diff --git a/manifests/v1beta1/katib-controller/service.yaml b/manifests/v1beta1/components/controller/service.yaml similarity index 100% rename from manifests/v1beta1/katib-controller/service.yaml rename to manifests/v1beta1/components/controller/service.yaml diff --git a/manifests/v1beta1/katib-controller/trial-template-configmap.yaml b/manifests/v1beta1/components/controller/trial-templates.yaml similarity index 89% rename from manifests/v1beta1/katib-controller/trial-template-configmap.yaml rename to manifests/v1beta1/components/controller/trial-templates.yaml index a82e562a9d6..ffc191dd4c8 100644 --- a/manifests/v1beta1/katib-controller/trial-template-configmap.yaml +++ b/manifests/v1beta1/components/controller/trial-templates.yaml @@ -14,7 +14,7 @@ data: spec: containers: - name: training-container - image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-e294a90 + image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-c6c9172 command: - "python3" - "/opt/mxnet-mnist/mnist.py" @@ -32,7 +32,7 @@ data: spec: containers: - name: training-container - image: docker.io/kubeflowkatib/enas-cnn-cifar10-cpu:v1beta1-e294a90 + image: docker.io/kubeflowkatib/enas-cnn-cifar10-cpu:v1beta1-c6c9172 command: - python3 - -u @@ -53,8 +53,7 @@ data: spec: containers: - name: pytorch - # TODO (andreyvelich): Add tag to the image. - image: docker.io/kubeflowkatib/pytorch-mnist:latest + image: docker.io/kubeflowkatib/pytorch-mnist:v1beta1-c6c9172 imagePullPolicy: Always command: - "python3" @@ -69,8 +68,7 @@ data: spec: containers: - name: pytorch - # TODO (andreyvelich): Add tag to the image. - image: docker.io/kubeflowkatib/pytorch-mnist:latest + image: docker.io/kubeflowkatib/pytorch-mnist:v1beta1-c6c9172 imagePullPolicy: Always command: - "python3" diff --git a/manifests/v1beta1/components/katib-crds/experiment-crd.yaml b/manifests/v1beta1/components/crd/experiment.yaml similarity index 100% rename from manifests/v1beta1/components/katib-crds/experiment-crd.yaml rename to manifests/v1beta1/components/crd/experiment.yaml diff --git a/manifests/v1beta1/components/katib-crds/suggestion-crd.yaml b/manifests/v1beta1/components/crd/suggestion.yaml similarity index 100% rename from manifests/v1beta1/components/katib-crds/suggestion-crd.yaml rename to manifests/v1beta1/components/crd/suggestion.yaml diff --git a/manifests/v1beta1/components/katib-crds/trial-crd.yaml b/manifests/v1beta1/components/crd/trial.yaml similarity index 100% rename from manifests/v1beta1/components/katib-crds/trial-crd.yaml rename to manifests/v1beta1/components/crd/trial.yaml diff --git a/manifests/v1beta1/db-manager/deployment.yaml b/manifests/v1beta1/components/db-manager/db-manager.yaml similarity index 83% rename from manifests/v1beta1/db-manager/deployment.yaml rename to manifests/v1beta1/components/db-manager/db-manager.yaml index 28835c68d66..86a1b1be7e0 100644 --- a/manifests/v1beta1/db-manager/deployment.yaml +++ b/manifests/v1beta1/components/db-manager/db-manager.yaml @@ -3,26 +3,22 @@ kind: Deployment metadata: name: katib-db-manager namespace: kubeflow + # TODO (andreyvelich): Modify labels to follow k8s guidelines. labels: - app: katib - component: db-manager + app: katib-db-manager spec: replicas: 1 selector: matchLabels: - app: katib - component: db-manager + app: katib-db-manager template: metadata: - name: katib-db-manager labels: - app: katib - component: db-manager + app: katib-db-manager spec: containers: - name: katib-db-manager image: docker.io/kubeflowkatib/katib-db-manager - imagePullPolicy: IfNotPresent env: - name: DB_NAME value: "mysql" diff --git a/manifests/v1beta1/db-manager/service.yaml b/manifests/v1beta1/components/db-manager/service.yaml similarity index 70% rename from manifests/v1beta1/db-manager/service.yaml rename to manifests/v1beta1/components/db-manager/service.yaml index ca9e6ef78c3..429de359629 100644 --- a/manifests/v1beta1/db-manager/service.yaml +++ b/manifests/v1beta1/components/db-manager/service.yaml @@ -4,8 +4,7 @@ metadata: name: katib-db-manager namespace: kubeflow labels: - app: katib - component: db-manager + app: katib-db-manager spec: type: ClusterIP ports: @@ -13,5 +12,4 @@ spec: protocol: TCP name: api selector: - app: katib - component: db-manager + app: katib-db-manager diff --git a/manifests/v1beta1/components/katib-controller/katib-controller-deployment.yaml b/manifests/v1beta1/components/katib-controller/katib-controller-deployment.yaml deleted file mode 100644 index 43a5c67eee3..00000000000 --- a/manifests/v1beta1/components/katib-controller/katib-controller-deployment.yaml +++ /dev/null @@ -1,53 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: katib-controller - labels: - app: katib-controller -spec: - replicas: 1 - selector: - matchLabels: - app: katib-controller - template: - metadata: - labels: - app: katib-controller - annotations: - sidecar.istio.io/inject: "false" - prometheus.io/scrape: "true" - spec: - serviceAccountName: katib-controller - containers: - - name: katib-controller - image: docker.io/kubeflowkatib/katib-controller - imagePullPolicy: IfNotPresent - command: ["./katib-controller"] - args: - - "--webhook-port=8443" - - "--trial-resources=Job.v1.batch" - - "--trial-resources=TFJob.v1.kubeflow.org" - - "--trial-resources=PyTorchJob.v1.kubeflow.org" - - "--trial-resources=MPIJob.v1.kubeflow.org" - - "--trial-resources=PipelineRun.v1beta1.tekton.dev" - ports: - - containerPort: 8443 - name: webhook - protocol: TCP - - containerPort: 8080 - name: metrics - protocol: TCP - env: - - name: KATIB_CORE_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - volumeMounts: - - mountPath: /tmp/cert - name: cert - readOnly: true - volumes: - - name: cert - secret: - defaultMode: 420 - secretName: katib-controller diff --git a/manifests/v1beta1/components/katib-controller/katib-controller-rbac.yaml b/manifests/v1beta1/components/katib-controller/katib-controller-rbac.yaml deleted file mode 100644 index 49f87067034..00000000000 --- a/manifests/v1beta1/components/katib-controller/katib-controller-rbac.yaml +++ /dev/null @@ -1,163 +0,0 @@ -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: katib-controller -rules: - - apiGroups: - - "" - resources: - - configmaps - - serviceaccounts - - services - - secrets - - events - - namespaces - - persistentvolumes - - persistentvolumeclaims - verbs: - - "*" - - apiGroups: - - "" - resources: - - pods - - pods/log - - pods/status - verbs: - - "*" - - apiGroups: - - apps - resources: - - deployments - verbs: - - "*" - - apiGroups: - - batch - resources: - - jobs - - cronjobs - verbs: - - "*" - - apiGroups: - - apiextensions.k8s.io - resources: - - customresourcedefinitions - verbs: - - create - - get - - apiGroups: - - admissionregistration.k8s.io - resources: - - validatingwebhookconfigurations - - mutatingwebhookconfigurations - verbs: - - "*" - - apiGroups: - - kubeflow.org - resources: - - experiments - - experiments/status - - experiments/finalizers - - trials - - trials/status - - trials/finalizers - - suggestions - - suggestions/status - - suggestions/finalizers - verbs: - - "*" - - apiGroups: - - kubeflow.org - resources: - - tfjobs - - pytorchjobs - - mpijobs - verbs: - - "*" - - apiGroups: - - tekton.dev - resources: - - pipelineruns - - taskruns - verbs: - - "*" - - apiGroups: - - rbac.authorization.k8s.io - resources: - - roles - - rolebindings - verbs: - - "*" ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: katib-controller ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: katib-controller -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: katib-controller -subjects: - - kind: ServiceAccount - name: katib-controller - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: kubeflow-katib-admin - labels: - rbac.authorization.kubeflow.org/aggregate-to-kubeflow-admin: "true" -aggregationRule: - clusterRoleSelectors: - - matchLabels: - rbac.authorization.kubeflow.org/aggregate-to-kubeflow-katib-admin: "true" -rules: [] - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: kubeflow-katib-edit - labels: - rbac.authorization.kubeflow.org/aggregate-to-kubeflow-edit: "true" - rbac.authorization.kubeflow.org/aggregate-to-kubeflow-katib-admin: "true" -rules: - - apiGroups: - - kubeflow.org - resources: - - experiments - - trials - - suggestions - verbs: - - get - - list - - watch - - create - - delete - - deletecollection - - patch - - update - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: kubeflow-katib-view - labels: - rbac.authorization.kubeflow.org/aggregate-to-kubeflow-view: "true" -rules: - - apiGroups: - - kubeflow.org - resources: - - experiments - - trials - - suggestions - verbs: - - get - - list - - watch diff --git a/manifests/v1beta1/components/katib-controller/katib-controller-secret.yaml b/manifests/v1beta1/components/katib-controller/katib-controller-secret.yaml deleted file mode 100644 index 8341a6a15a3..00000000000 --- a/manifests/v1beta1/components/katib-controller/katib-controller-secret.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: katib-controller diff --git a/manifests/v1beta1/components/katib-controller/katib-controller-service.yaml b/manifests/v1beta1/components/katib-controller/katib-controller-service.yaml deleted file mode 100644 index 516d536e54e..00000000000 --- a/manifests/v1beta1/components/katib-controller/katib-controller-service.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: katib-controller - annotations: - prometheus.io/port: "8080" - prometheus.io/scheme: http - prometheus.io/scrape: "true" -spec: - ports: - - port: 443 - protocol: TCP - targetPort: 8443 - name: webhook - - name: metrics - port: 8080 - targetPort: 8080 - selector: - app: katib-controller diff --git a/manifests/v1beta1/components/katib-controller/katib-ui-deployment.yaml b/manifests/v1beta1/components/katib-controller/katib-ui-deployment.yaml deleted file mode 100644 index 7a999a2deda..00000000000 --- a/manifests/v1beta1/components/katib-controller/katib-ui-deployment.yaml +++ /dev/null @@ -1,39 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: katib-ui - labels: - app: katib - component: ui -spec: - replicas: 1 - selector: - matchLabels: - app: katib - component: ui - template: - metadata: - name: katib-ui - labels: - app: katib - component: ui - annotations: - sidecar.istio.io/inject: "false" - spec: - containers: - - name: katib-ui - image: docker.io/kubeflowkatib/katib-ui - imagePullPolicy: IfNotPresent - command: - - "./katib-ui" - args: - - "--port=8080" - env: - - name: KATIB_CORE_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - ports: - - name: ui - containerPort: 8080 - serviceAccountName: katib-ui diff --git a/manifests/v1beta1/components/katib-controller/katib-ui-rbac.yaml b/manifests/v1beta1/components/katib-controller/katib-ui-rbac.yaml deleted file mode 100644 index da76eb1b634..00000000000 --- a/manifests/v1beta1/components/katib-controller/katib-ui-rbac.yaml +++ /dev/null @@ -1,37 +0,0 @@ -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: katib-ui -rules: - - apiGroups: - - "" - resources: - - configmaps - - namespaces - verbs: - - "*" - - apiGroups: - - kubeflow.org - resources: - - experiments - - trials - - suggestions - verbs: - - "*" ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: katib-ui ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: katib-ui -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: katib-ui -subjects: - - kind: ServiceAccount - name: katib-ui diff --git a/manifests/v1beta1/components/katib-controller/katib-ui-service.yaml b/manifests/v1beta1/components/katib-controller/katib-ui-service.yaml deleted file mode 100644 index 8266a6faf68..00000000000 --- a/manifests/v1beta1/components/katib-controller/katib-ui-service.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: katib-ui - labels: - app: katib - component: ui -spec: - type: ClusterIP - ports: - - port: 80 - protocol: TCP - name: ui - targetPort: 8080 - selector: - app: katib - component: ui diff --git a/manifests/v1beta1/components/katib-controller/kustomization.yaml b/manifests/v1beta1/components/katib-controller/kustomization.yaml deleted file mode 100644 index 1e38bfaf4a1..00000000000 --- a/manifests/v1beta1/components/katib-controller/kustomization.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -namespace: kubeflow -resources: - - katib-configmap.yaml - - katib-controller-deployment.yaml - - katib-controller-rbac.yaml - - katib-controller-secret.yaml - - katib-controller-service.yaml - - katib-ui-deployment.yaml - - katib-ui-rbac.yaml - - katib-ui-service.yaml - - trial-template-configmap.yaml - - application.yaml - - katib-ui-virtual-service.yaml -images: - - name: docker.io/kubeflowkatib/katib-controller - newTag: v1beta1-a96ff59 - newName: docker.io/kubeflowkatib/katib-controller - - name: docker.io/kubeflowkatib/katib-ui - newTag: v1beta1-a96ff59 - newName: docker.io/kubeflowkatib/katib-ui -commonLabels: - app.kubernetes.io/component: katib - app.kubernetes.io/name: katib-controller -configurations: - - params.yaml diff --git a/manifests/v1beta1/components/katib-controller/trial-template-configmap.yaml b/manifests/v1beta1/components/katib-controller/trial-template-configmap.yaml deleted file mode 100644 index f094efbdf24..00000000000 --- a/manifests/v1beta1/components/katib-controller/trial-template-configmap.yaml +++ /dev/null @@ -1,79 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: trial-template - labels: - app: katib-trial-templates -data: - defaultTrialTemplate.yaml: |- - apiVersion: batch/v1 - kind: Job - spec: - template: - spec: - containers: - - name: training-container - image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-a96ff59 - command: - - "python3" - - "/opt/mxnet-mnist/mnist.py" - - "--batch-size=64" - - "--lr=${trialParameters.learningRate}" - - "--num-layers=${trialParameters.numberLayers}" - - "--optimizer=${trialParameters.optimizer}" - restartPolicy: Never - # For ConfigMap templates double quotes must set in commands to correct parse JSON parameters in Trial Template (e.g nn_config, architecture) - enasCPUTemplate: |- - apiVersion: batch/v1 - kind: Job - spec: - template: - spec: - containers: - - name: training-container - image: docker.io/kubeflowkatib/enas-cnn-cifar10-cpu:v1beta1-a96ff59 - command: - - python3 - - -u - - RunTrial.py - - --num_epochs=1 - - "--architecture=\"${trialParameters.neuralNetworkArchitecture}\"" - - "--nn_config=\"${trialParameters.neuralNetworkConfig}\"" - restartPolicy: Never - pytorchJobTemplate: |- - apiVersion: "kubeflow.org/v1" - kind: PyTorchJob - spec: - pytorchReplicaSpecs: - Master: - replicas: 1 - restartPolicy: OnFailure - template: - spec: - containers: - - name: pytorch - # TODO (andreyvelich): Add tag to the image. - image: docker.io/kubeflowkatib/pytorch-mnist:latest - imagePullPolicy: Always - command: - - "python3" - - "/opt/pytorch-mnist/mnist.py" - - "--epochs=1" - - "--lr=${trialParameters.learningRate}" - - "--momentum=${trialParameters.momentum}" - Worker: - replicas: 2 - restartPolicy: OnFailure - template: - spec: - containers: - - name: pytorch - # TODO (andreyvelich): Add tag to the image. - image: docker.io/kubeflowkatib/pytorch-mnist:latest - imagePullPolicy: Always - command: - - "python3" - - "/opt/pytorch-mnist/mnist.py" - - "--epochs=1" - - "--lr=${trialParameters.learningRate}" - - "--momentum=${trialParameters.momentum}" diff --git a/manifests/v1beta1/components/katib-crds/application.yaml b/manifests/v1beta1/components/katib-crds/application.yaml deleted file mode 100644 index 03b2ec53efd..00000000000 --- a/manifests/v1beta1/components/katib-crds/application.yaml +++ /dev/null @@ -1,63 +0,0 @@ -apiVersion: app.k8s.io/v1beta1 -kind: Application -metadata: - name: katib-crds -spec: - addOwnerRef: true - componentKinds: - - group: core - kind: Service - - group: apps - kind: Deployment - - group: core - kind: ServiceAccount - - group: kubeflow.org - kind: Experiment - - group: kubeflow.org - kind: Suggestion - - group: kubeflow.org - kind: Trial - descriptor: - description: Katib is a service for hyperparameter tuning and neural architecture search. - keywords: - - katib - - katib-controller - - hyperparameter tuning - links: - - description: About - url: https://github.com/kubeflow/katib - maintainers: - - email: gaoce@caicloud.io - name: Ce Gao - - email: johnugeo@cisco.com - name: Johnu George - - email: liuhougang6@126.com - name: Hougang Liu - - email: ricliu@google.com - name: Richard Liu - - email: yuji.oshima0x3fd@gmail.com - name: YujiOshima - - email: andrey.velichkevich@gmail.com - name: Andrey Velichkevich - owners: - - email: gaoce@caicloud.io - name: Ce Gao - - email: johnugeo@cisco.com - name: Johnu George - - email: liuhougang6@126.com - name: Hougang Liu - - email: ricliu@google.com - name: Richard Liu - - email: yuji.oshima0x3fd@gmail.com - name: YujiOshima - - email: andrey.velichkevich@gmail.com - name: Andrey Velichkevich - type: katib - version: v1beta1 - selector: - matchLabels: - app.kubernetes.io/component: katib - app.kubernetes.io/instance: katib-crds - app.kubernetes.io/managed-by: kfctl - app.kubernetes.io/name: katib-crds - app.kubernetes.io/part-of: kubeflow diff --git a/manifests/v1beta1/components/katib-crds/kustomization.yaml b/manifests/v1beta1/components/katib-crds/kustomization.yaml deleted file mode 100644 index 9ad6e8a618c..00000000000 --- a/manifests/v1beta1/components/katib-crds/kustomization.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -namespace: kubeflow -resources: - - experiment-crd.yaml - - suggestion-crd.yaml - - trial-crd.yaml - - application.yaml -commonLabels: - app.kubernetes.io/component: katib - app.kubernetes.io/name: katib-crds diff --git a/manifests/v1beta1/components/katib-db-manager/katib-db-manager-deployment.yaml b/manifests/v1beta1/components/katib-db-manager/katib-db-manager-deployment.yaml deleted file mode 100644 index 3f6b871d6c9..00000000000 --- a/manifests/v1beta1/components/katib-db-manager/katib-db-manager-deployment.yaml +++ /dev/null @@ -1,49 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: katib-db-manager - labels: - app: katib - component: db-manager -spec: - replicas: 1 - selector: - matchLabels: - app: katib - component: db-manager - template: - metadata: - name: katib-db-manager - labels: - app: katib - component: db-manager - annotations: - sidecar.istio.io/inject: "false" - spec: - containers: - - name: katib-db-manager - image: docker.io/kubeflowkatib/katib-db-manager - imagePullPolicy: IfNotPresent - env: - - name: DB_NAME - value: "mysql" - - name: DB_PASSWORD - valueFrom: - secretKeyRef: - name: katib-mysql-secrets - key: MYSQL_ROOT_PASSWORD - command: - - "./katib-db-manager" - ports: - - name: api - containerPort: 6789 - readinessProbe: - exec: - command: ["/bin/grpc_health_probe", "-addr=:6789"] - initialDelaySeconds: 5 - livenessProbe: - exec: - command: ["/bin/grpc_health_probe", "-addr=:6789"] - initialDelaySeconds: 10 - periodSeconds: 60 - failureThreshold: 5 diff --git a/manifests/v1beta1/components/katib-db-manager/katib-db-manager-service.yaml b/manifests/v1beta1/components/katib-db-manager/katib-db-manager-service.yaml deleted file mode 100644 index 589df9c12b3..00000000000 --- a/manifests/v1beta1/components/katib-db-manager/katib-db-manager-service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: katib-db-manager - labels: - app: katib - component: db-manager -spec: - type: ClusterIP - ports: - - port: 6789 - protocol: TCP - name: api - selector: - app: katib - component: db-manager diff --git a/manifests/v1beta1/components/katib-db-manager/kustomization.yaml b/manifests/v1beta1/components/katib-db-manager/kustomization.yaml deleted file mode 100644 index d118092b464..00000000000 --- a/manifests/v1beta1/components/katib-db-manager/kustomization.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -namespace: kubeflow -resources: - - katib-db-manager-deployment.yaml - - katib-db-manager-service.yaml -images: - - name: docker.io/kubeflowkatib/katib-db-manager - newTag: v1beta1-a96ff59 - newName: docker.io/kubeflowkatib/katib-db-manager -commonLabels: - app.kubernetes.io/component: katib - app.kubernetes.io/name: katib-controller diff --git a/manifests/v1beta1/components/katib-db-mysql/katib-mysql-deployment.yaml b/manifests/v1beta1/components/katib-db-mysql/katib-mysql-deployment.yaml deleted file mode 100644 index 44417ee12c1..00000000000 --- a/manifests/v1beta1/components/katib-db-mysql/katib-mysql-deployment.yaml +++ /dev/null @@ -1,68 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: katib-mysql - labels: - app: katib - component: mysql -spec: - replicas: 1 - selector: - matchLabels: - app: katib - component: mysql - strategy: - type: Recreate - template: - metadata: - name: katib-mysql - labels: - app: katib - component: mysql - annotations: - sidecar.istio.io/inject: "false" - spec: - containers: - - name: katib-mysql - image: mysql:8 - args: - - --datadir - - /var/lib/mysql/datadir - env: - - name: MYSQL_ROOT_PASSWORD - valueFrom: - secretKeyRef: - name: katib-mysql-secrets - key: MYSQL_ROOT_PASSWORD - - name: MYSQL_ALLOW_EMPTY_PASSWORD - value: "true" - - name: MYSQL_DATABASE - value: "katib" - ports: - - name: dbapi - containerPort: 3306 - readinessProbe: - exec: - command: - - "/bin/bash" - - "-c" - - "mysql -D ${MYSQL_DATABASE} -u root -p${MYSQL_ROOT_PASSWORD} -e 'SELECT 1'" - initialDelaySeconds: 5 - periodSeconds: 10 - timeoutSeconds: 1 - livenessProbe: - exec: - command: - - "/bin/bash" - - "-c" - - "mysqladmin ping -u root -p${MYSQL_ROOT_PASSWORD}" - initialDelaySeconds: 30 - periodSeconds: 10 - timeoutSeconds: 5 - volumeMounts: - - name: katib-mysql - mountPath: /var/lib/mysql - volumes: - - name: katib-mysql - persistentVolumeClaim: - claimName: katib-mysql diff --git a/manifests/v1beta1/components/katib-db-mysql/katib-mysql-pvc.yaml b/manifests/v1beta1/components/katib-db-mysql/katib-mysql-pvc.yaml deleted file mode 100644 index d8f8a82463a..00000000000 --- a/manifests/v1beta1/components/katib-db-mysql/katib-mysql-pvc.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: katib-mysql -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 10Gi diff --git a/manifests/v1beta1/components/katib-db-mysql/katib-mysql-service.yaml b/manifests/v1beta1/components/katib-db-mysql/katib-mysql-service.yaml deleted file mode 100644 index 5378f21a3d0..00000000000 --- a/manifests/v1beta1/components/katib-db-mysql/katib-mysql-service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: katib-mysql - labels: - app: katib - component: mysql -spec: - type: ClusterIP - ports: - - port: 3306 - protocol: TCP - name: dbapi - selector: - app: katib - component: mysql diff --git a/manifests/v1beta1/components/katib-db-mysql/kustomization.yaml b/manifests/v1beta1/components/katib-db-mysql/kustomization.yaml deleted file mode 100644 index cdd1a327935..00000000000 --- a/manifests/v1beta1/components/katib-db-mysql/kustomization.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -namespace: kubeflow -resources: - - katib-mysql-deployment.yaml - - katib-mysql-pvc.yaml - - katib-mysql-secret.yaml - - katib-mysql-service.yaml -images: - - name: mysql - newTag: "8" - newName: mysql -commonLabels: - app.kubernetes.io/component: katib - app.kubernetes.io/name: katib-controller diff --git a/manifests/v1beta1/mysql-db/deployment.yaml b/manifests/v1beta1/components/mysql/mysql.yaml similarity index 91% rename from manifests/v1beta1/mysql-db/deployment.yaml rename to manifests/v1beta1/components/mysql/mysql.yaml index 87f2b9005ef..8c189da00ec 100644 --- a/manifests/v1beta1/mysql-db/deployment.yaml +++ b/manifests/v1beta1/components/mysql/mysql.yaml @@ -3,23 +3,20 @@ kind: Deployment metadata: name: katib-mysql namespace: kubeflow + # TODO (andreyvelich): Modify labels to follow k8s guidelines. labels: - app: katib - component: mysql + app: katib-mysql spec: replicas: 1 selector: matchLabels: - app: katib - component: mysql + app: katib-mysql strategy: type: Recreate template: metadata: - name: katib-mysql labels: - app: katib - component: mysql + app: katib-mysql spec: containers: - name: katib-mysql diff --git a/manifests/v1beta1/pv/pv.yaml b/manifests/v1beta1/components/mysql/pv.yaml similarity index 93% rename from manifests/v1beta1/pv/pv.yaml rename to manifests/v1beta1/components/mysql/pv.yaml index a3afad40f31..42d63b03831 100644 --- a/manifests/v1beta1/pv/pv.yaml +++ b/manifests/v1beta1/components/mysql/pv.yaml @@ -4,7 +4,6 @@ metadata: name: katib-mysql labels: type: local - app: katib spec: storageClassName: katib capacity: diff --git a/manifests/v1beta1/pv/pvc.yaml b/manifests/v1beta1/components/mysql/pvc.yaml similarity index 89% rename from manifests/v1beta1/pv/pvc.yaml rename to manifests/v1beta1/components/mysql/pvc.yaml index c454826f51e..c53a015158c 100644 --- a/manifests/v1beta1/pv/pvc.yaml +++ b/manifests/v1beta1/components/mysql/pvc.yaml @@ -3,8 +3,6 @@ kind: PersistentVolumeClaim metadata: name: katib-mysql namespace: kubeflow - labels: - app: katib spec: storageClassName: katib accessModes: diff --git a/manifests/v1beta1/components/katib-db-mysql/katib-mysql-secret.yaml b/manifests/v1beta1/components/mysql/secret.yaml similarity index 100% rename from manifests/v1beta1/components/katib-db-mysql/katib-mysql-secret.yaml rename to manifests/v1beta1/components/mysql/secret.yaml diff --git a/manifests/v1beta1/mysql-db/service.yaml b/manifests/v1beta1/components/mysql/service.yaml similarity index 72% rename from manifests/v1beta1/mysql-db/service.yaml rename to manifests/v1beta1/components/mysql/service.yaml index 85827ca6c50..d06823e4e3e 100644 --- a/manifests/v1beta1/mysql-db/service.yaml +++ b/manifests/v1beta1/components/mysql/service.yaml @@ -4,8 +4,7 @@ metadata: name: katib-mysql namespace: kubeflow labels: - app: katib - component: mysql + app: katib-mysql spec: type: ClusterIP ports: @@ -13,5 +12,4 @@ spec: protocol: TCP name: dbapi selector: - app: katib - component: mysql + app: katib-mysql diff --git a/manifests/v1beta1/0-namespace.yaml b/manifests/v1beta1/components/namespace.yaml similarity index 100% rename from manifests/v1beta1/0-namespace.yaml rename to manifests/v1beta1/components/namespace.yaml diff --git a/manifests/v1beta1/ui/rbac.yaml b/manifests/v1beta1/components/ui/rbac.yaml similarity index 100% rename from manifests/v1beta1/ui/rbac.yaml rename to manifests/v1beta1/components/ui/rbac.yaml diff --git a/manifests/v1beta1/ui/service.yaml b/manifests/v1beta1/components/ui/service.yaml similarity index 75% rename from manifests/v1beta1/ui/service.yaml rename to manifests/v1beta1/components/ui/service.yaml index 40f1fbfbdc2..0b9038f69e8 100644 --- a/manifests/v1beta1/ui/service.yaml +++ b/manifests/v1beta1/components/ui/service.yaml @@ -4,8 +4,7 @@ metadata: name: katib-ui namespace: kubeflow labels: - app: katib - component: ui + app: katib-ui spec: type: ClusterIP ports: @@ -14,5 +13,4 @@ spec: name: ui targetPort: 8080 selector: - app: katib - component: ui + app: katib-ui diff --git a/manifests/v1beta1/ui/deployment.yaml b/manifests/v1beta1/components/ui/ui.yaml similarity index 78% rename from manifests/v1beta1/ui/deployment.yaml rename to manifests/v1beta1/components/ui/ui.yaml index e83b7bd47f3..70afafab4cd 100644 --- a/manifests/v1beta1/ui/deployment.yaml +++ b/manifests/v1beta1/components/ui/ui.yaml @@ -3,26 +3,22 @@ kind: Deployment metadata: name: katib-ui namespace: kubeflow + # TODO (andreyvelich): Modify labels to follow k8s guidelines. labels: - app: katib - component: ui + app: katib-ui spec: replicas: 1 selector: matchLabels: - app: katib - component: ui + app: katib-ui template: metadata: - name: katib-ui labels: - app: katib - component: ui + app: katib-ui spec: containers: - name: katib-ui image: docker.io/kubeflowkatib/katib-ui - imagePullPolicy: IfNotPresent command: - "./katib-ui" args: diff --git a/manifests/v1beta1/components/webhook/cert-generator.yaml b/manifests/v1beta1/components/webhook/cert-generator.yaml new file mode 100644 index 00000000000..ab4c7c6d427 --- /dev/null +++ b/manifests/v1beta1/components/webhook/cert-generator.yaml @@ -0,0 +1,20 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: katib-cert-generator + namespace: kubeflow +spec: + template: + spec: + serviceAccountName: katib-cert-generator + containers: + - name: cert-generator + image: docker.io/kubeflowkatib/cert-generator + imagePullPolicy: Always + env: + - name: KATIB_CORE_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + restartPolicy: Never + backoffLimit: 4 diff --git a/manifests/v1beta1/webhooks/cert-generator-job.yaml b/manifests/v1beta1/components/webhook/rbac.yaml similarity index 71% rename from manifests/v1beta1/webhooks/cert-generator-job.yaml rename to manifests/v1beta1/components/webhook/rbac.yaml index f385e3a99c5..bcf7f6204e5 100644 --- a/manifests/v1beta1/webhooks/cert-generator-job.yaml +++ b/manifests/v1beta1/components/webhook/rbac.yaml @@ -1,43 +1,3 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: katib-cert-generator - namespace: kubeflow -spec: - template: - spec: - serviceAccountName: katib-cert-generator - containers: - - name: cert-generator - image: docker.io/kubeflowkatib/cert-generator - imagePullPolicy: Always - env: - - name: KATIB_CORE_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - restartPolicy: Never - backoffLimit: 4 ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: katib-cert-generator - namespace: kubeflow ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: katib-cert-generator -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: katib-cert-generator -subjects: - - kind: ServiceAccount - name: katib-cert-generator - namespace: kubeflow ---- kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: @@ -87,3 +47,22 @@ rules: - kubernetes.io/* verbs: - approve +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: katib-cert-generator + namespace: kubeflow +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: katib-cert-generator +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: katib-cert-generator +subjects: + - kind: ServiceAccount + name: katib-cert-generator + namespace: kubeflow diff --git a/manifests/v1beta1/webhooks/webhooks.yaml b/manifests/v1beta1/components/webhook/webhooks.yaml similarity index 100% rename from manifests/v1beta1/webhooks/webhooks.yaml rename to manifests/v1beta1/components/webhook/webhooks.yaml diff --git a/manifests/v1beta1/installs/katib-external-db/katib-db-manager-deployment.yaml b/manifests/v1beta1/installs/katib-external-db/db-manager-patch.yaml similarity index 98% rename from manifests/v1beta1/installs/katib-external-db/katib-db-manager-deployment.yaml rename to manifests/v1beta1/installs/katib-external-db/db-manager-patch.yaml index c46c28274bd..da37112aceb 100644 --- a/manifests/v1beta1/installs/katib-external-db/katib-db-manager-deployment.yaml +++ b/manifests/v1beta1/installs/katib-external-db/db-manager-patch.yaml @@ -2,6 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: katib-db-manager + namespace: kubeflow spec: template: spec: diff --git a/manifests/v1beta1/installs/katib-external-db/kustomization.yaml b/manifests/v1beta1/installs/katib-external-db/kustomization.yaml index 4a513a0e7c4..7bd2b591fb0 100644 --- a/manifests/v1beta1/installs/katib-external-db/kustomization.yaml +++ b/manifests/v1beta1/installs/katib-external-db/kustomization.yaml @@ -2,15 +2,47 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization namespace: kubeflow resources: - - ../../components/katib-crds - - ../../components/katib-controller - - ../../components/katib-db-manager + # Namespace. + - ../../components/namespace.yaml + # Katib controller. + - ../../components/controller/controller.yaml + - ../../components/controller/service.yaml + - ../../components/controller/rbac.yaml + - ../../components/controller/katib-config.yaml + - ../../components/controller/trial-templates.yaml + # Katib CRDs. + - ../../components/crd/experiment.yaml + - ../../components/crd/suggestion.yaml + - ../../components/crd/trial.yaml + # Katib DB manager. + - ../../components/db-manager/db-manager.yaml + - ../../components/db-manager/service.yaml + # Katib UI. + - ../../components/ui/ui.yaml + - ../../components/ui/service.yaml + - ../../components/ui/rbac.yaml + # Katib webhooks. + - ../../components/webhook/cert-generator.yaml + - ../../components/webhook/rbac.yaml + - ../../components/webhook/webhooks.yaml +images: + - name: docker.io/kubeflowkatib/katib-controller + newTag: latest + newName: docker.io/kubeflowkatib/katib-controller + - name: docker.io/kubeflowkatib/katib-db-manager + newTag: latest + newName: docker.io/kubeflowkatib/katib-db-manager + - name: docker.io/kubeflowkatib/katib-ui + newTag: latest + newName: docker.io/kubeflowkatib/katib-ui + - name: docker.io/kubeflowkatib/cert-generator + newTag: latest + newName: docker.io/kubeflowkatib/cert-generator patchesStrategicMerge: - - katib-db-manager-deployment.yaml + - ../katib-standalone/katib-config-patch.yaml + - db-manager-patch.yaml +# Modify katib-mysql-secrets with parameters for the DB. secretGenerator: - name: katib-mysql-secrets envs: - secrets.env -commonLabels: - app.kubernetes.io/component: katib - app.kubernetes.io/name: katib-controller diff --git a/manifests/v1beta1/installs/katib-standalone-ibm/kustomization.yaml b/manifests/v1beta1/installs/katib-ibm/kustomization.yaml similarity index 84% rename from manifests/v1beta1/installs/katib-standalone-ibm/kustomization.yaml rename to manifests/v1beta1/installs/katib-ibm/kustomization.yaml index e62069d1776..572be3bc35e 100644 --- a/manifests/v1beta1/installs/katib-standalone-ibm/kustomization.yaml +++ b/manifests/v1beta1/installs/katib-ibm/kustomization.yaml @@ -3,7 +3,7 @@ kind: Kustomization bases: - ../katib-standalone patchesStrategicMerge: - - katib-mysql-deployment.yaml + - mysql-patch.yaml images: - name: mysql newTag: "5.6" diff --git a/manifests/v1beta1/installs/katib-standalone-ibm/katib-mysql-deployment.yaml b/manifests/v1beta1/installs/katib-ibm/mysql-patch.yaml similarity index 92% rename from manifests/v1beta1/installs/katib-standalone-ibm/katib-mysql-deployment.yaml rename to manifests/v1beta1/installs/katib-ibm/mysql-patch.yaml index 35039fc64fa..bb287612ef6 100644 --- a/manifests/v1beta1/installs/katib-standalone-ibm/katib-mysql-deployment.yaml +++ b/manifests/v1beta1/installs/katib-ibm/mysql-patch.yaml @@ -2,6 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: katib-mysql + namespace: kubeflow spec: template: spec: diff --git a/manifests/v1beta1/components/katib-controller/katib-configmap.yaml b/manifests/v1beta1/installs/katib-standalone/katib-config-patch.yaml similarity index 55% rename from manifests/v1beta1/components/katib-controller/katib-configmap.yaml rename to manifests/v1beta1/installs/katib-standalone/katib-config-patch.yaml index 1eb32495ef1..26bf87baebe 100644 --- a/manifests/v1beta1/components/katib-controller/katib-configmap.yaml +++ b/manifests/v1beta1/installs/katib-standalone/katib-config-patch.yaml @@ -2,17 +2,18 @@ apiVersion: v1 kind: ConfigMap metadata: name: katib-config + namespace: kubeflow data: metrics-collector-sidecar: |- { "StdOut": { - "image": "docker.io/kubeflowkatib/file-metrics-collector:v1beta1-a96ff59" + "image": "docker.io/kubeflowkatib/file-metrics-collector:latest" }, "File": { - "image": "docker.io/kubeflowkatib/file-metrics-collector:v1beta1-a96ff59" + "image": "docker.io/kubeflowkatib/file-metrics-collector:latest" }, "TensorFlowEvent": { - "image": "docker.io/kubeflowkatib/tfevent-metrics-collector:v1beta1-a96ff59", + "image": "docker.io/kubeflowkatib/tfevent-metrics-collector:latest", "resources": { "limits": { "memory": "1Gi" @@ -23,40 +24,38 @@ data: suggestion: |- { "random": { - "image": "docker.io/kubeflowkatib/suggestion-hyperopt:v1beta1-a96ff59" + "image": "docker.io/kubeflowkatib/suggestion-hyperopt:latest" + }, + "tpe": { + "image": "docker.io/kubeflowkatib/suggestion-hyperopt:latest" }, "grid": { - "image": "docker.io/kubeflowkatib/suggestion-chocolate:v1beta1-a96ff59" + "image": "docker.io/kubeflowkatib/suggestion-chocolate:latest" }, "hyperband": { - "image": "docker.io/kubeflowkatib/suggestion-hyperband:v1beta1-a96ff59" + "image": "docker.io/kubeflowkatib/suggestion-hyperband:latest" }, "bayesianoptimization": { - "image": "docker.io/kubeflowkatib/suggestion-skopt:v1beta1-a96ff59" + "image": "docker.io/kubeflowkatib/suggestion-skopt:latest" }, - "tpe": { - "image": "docker.io/kubeflowkatib/suggestion-hyperopt:v1beta1-a96ff59" + "cmaes": { + "image": "docker.io/kubeflowkatib/suggestion-goptuna:latest" }, "enas": { - "image": "docker.io/kubeflowkatib/suggestion-enas:v1beta1-a96ff59", - "imagePullPolicy": "Always", + "image": "docker.io/kubeflowkatib/suggestion-enas:latest", "resources": { "limits": { "memory": "200Mi" } } }, - "cmaes": { - "image": "docker.io/kubeflowkatib/suggestion-goptuna:v1beta1-a96ff59" - }, "darts": { - "image": "docker.io/kubeflowkatib/suggestion-darts:v1beta1-a96ff59" + "image": "docker.io/kubeflowkatib/suggestion-darts:latest" } } early-stopping: |- { "medianstop": { - "image": "docker.io/kubeflowkatib/earlystopping-medianstop:v1beta1-a96ff59", - "imagePullPolicy": "Always" + "image": "docker.io/kubeflowkatib/earlystopping-medianstop:latest" } } diff --git a/manifests/v1beta1/installs/katib-standalone/kustomization.yaml b/manifests/v1beta1/installs/katib-standalone/kustomization.yaml index 4e6a652e8e7..0a66eb69721 100644 --- a/manifests/v1beta1/installs/katib-standalone/kustomization.yaml +++ b/manifests/v1beta1/installs/katib-standalone/kustomization.yaml @@ -2,7 +2,47 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization namespace: kubeflow resources: - - ../../components/katib-crds - - ../../components/katib-controller - - ../../components/katib-db-manager - - ../../components/katib-db-mysql + # Namespace. + - ../../components/namespace.yaml + # Katib controller. + - ../../components/controller/controller.yaml + - ../../components/controller/service.yaml + - ../../components/controller/rbac.yaml + - ../../components/controller/katib-config.yaml + - ../../components/controller/trial-templates.yaml + # Katib CRDs. + - ../../components/crd/experiment.yaml + - ../../components/crd/suggestion.yaml + - ../../components/crd/trial.yaml + # Katib DB manager. + - ../../components/db-manager/db-manager.yaml + - ../../components/db-manager/service.yaml + # Katib DB mysql. + - ../../components/mysql/mysql.yaml + - ../../components/mysql/service.yaml + - ../../components/mysql/pv.yaml + - ../../components/mysql/pvc.yaml + - ../../components/mysql/secret.yaml + # Katib UI. + - ../../components/ui/ui.yaml + - ../../components/ui/service.yaml + - ../../components/ui/rbac.yaml + # Katib webhooks. + - ../../components/webhook/cert-generator.yaml + - ../../components/webhook/rbac.yaml + - ../../components/webhook/webhooks.yaml +images: + - name: docker.io/kubeflowkatib/katib-controller + newTag: latest + newName: docker.io/kubeflowkatib/katib-controller + - name: docker.io/kubeflowkatib/katib-db-manager + newTag: latest + newName: docker.io/kubeflowkatib/katib-db-manager + - name: docker.io/kubeflowkatib/katib-ui + newTag: latest + newName: docker.io/kubeflowkatib/katib-ui + - name: docker.io/kubeflowkatib/cert-generator + newTag: latest + newName: docker.io/kubeflowkatib/cert-generator +patchesStrategicMerge: + - katib-config-patch.yaml diff --git a/manifests/v1beta1/components/katib-controller/application.yaml b/manifests/v1beta1/installs/katib-with-kubeflow/katib-application.yaml similarity index 63% rename from manifests/v1beta1/components/katib-controller/application.yaml rename to manifests/v1beta1/installs/katib-with-kubeflow/katib-application.yaml index 2503b95d566..1378bb09293 100644 --- a/manifests/v1beta1/components/katib-controller/application.yaml +++ b/manifests/v1beta1/installs/katib-with-kubeflow/katib-application.yaml @@ -1,7 +1,7 @@ apiVersion: app.k8s.io/v1beta1 kind: Application metadata: - name: katib-controller + name: katib spec: addOwnerRef: true componentKinds: @@ -20,10 +20,10 @@ spec: - group: kubeflow.org kind: Trial descriptor: - description: Katib is a service for hyperparameter tuning and neural architecture search. + description: Katib is a service for AutoML. keywords: - katib - - katib-controller + - automl - hyperparameter tuning links: - description: About @@ -33,12 +33,6 @@ spec: name: Ce Gao - email: johnugeo@cisco.com name: Johnu George - - email: liuhougang6@126.com - name: Hougang Liu - - email: ricliu@google.com - name: Richard Liu - - email: yuji.oshima0x3fd@gmail.com - name: YujiOshima - email: andrey.velichkevich@gmail.com name: Andrey Velichkevich owners: @@ -46,12 +40,6 @@ spec: name: Ce Gao - email: johnugeo@cisco.com name: Johnu George - - email: liuhougang6@126.com - name: Hougang Liu - - email: ricliu@google.com - name: Richard Liu - - email: yuji.oshima0x3fd@gmail.com - name: YujiOshima - email: andrey.velichkevich@gmail.com name: Andrey Velichkevich type: katib @@ -59,7 +47,4 @@ spec: selector: matchLabels: app.kubernetes.io/component: katib - app.kubernetes.io/instance: katib-controller - app.kubernetes.io/managed-by: kfctl - app.kubernetes.io/name: katib-controller app.kubernetes.io/part-of: kubeflow diff --git a/manifests/v1beta1/installs/katib-with-kubeflow/kubeflow-katib-roles.yaml b/manifests/v1beta1/installs/katib-with-kubeflow/kubeflow-katib-roles.yaml new file mode 100644 index 00000000000..9cdad588e0b --- /dev/null +++ b/manifests/v1beta1/installs/katib-with-kubeflow/kubeflow-katib-roles.yaml @@ -0,0 +1,53 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: kubeflow-katib-admin + labels: + rbac.authorization.kubeflow.org/aggregate-to-kubeflow-admin: "true" +aggregationRule: + clusterRoleSelectors: + - matchLabels: + rbac.authorization.kubeflow.org/aggregate-to-kubeflow-katib-admin: "true" +rules: [] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: kubeflow-katib-edit + labels: + rbac.authorization.kubeflow.org/aggregate-to-kubeflow-edit: "true" + rbac.authorization.kubeflow.org/aggregate-to-kubeflow-katib-admin: "true" +rules: + - apiGroups: + - kubeflow.org + resources: + - experiments + - trials + - suggestions + verbs: + - get + - list + - watch + - create + - delete + - deletecollection + - patch + - update +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: kubeflow-katib-view + labels: + rbac.authorization.kubeflow.org/aggregate-to-kubeflow-view: "true" +rules: + - apiGroups: + - kubeflow.org + resources: + - experiments + - trials + - suggestions + verbs: + - get + - list + - watch diff --git a/manifests/v1beta1/installs/katib-with-kubeflow/kustomization.yaml b/manifests/v1beta1/installs/katib-with-kubeflow/kustomization.yaml new file mode 100644 index 00000000000..238fb145950 --- /dev/null +++ b/manifests/v1beta1/installs/katib-with-kubeflow/kustomization.yaml @@ -0,0 +1,53 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: kubeflow +resources: + # Katib controller. + - ../../components/controller/controller.yaml + - ../../components/controller/service.yaml + - ../../components/controller/rbac.yaml + - ../../components/controller/katib-config.yaml + - ../../components/controller/trial-templates.yaml + # Katib CRDs. + - ../../components/crd/experiment.yaml + - ../../components/crd/suggestion.yaml + - ../../components/crd/trial.yaml + # Katib DB manager. + - ../../components/db-manager/db-manager.yaml + - ../../components/db-manager/service.yaml + # Katib DB mysql. + - ../../components/mysql/mysql.yaml + - ../../components/mysql/service.yaml + - ../../components/mysql/pvc.yaml + - ../../components/mysql/secret.yaml + # Katib UI. + - ../../components/ui/ui.yaml + - ../../components/ui/service.yaml + - ../../components/ui/rbac.yaml + # Katib webhooks. + - ../../components/webhook/cert-generator.yaml + - ../../components/webhook/rbac.yaml + - ../../components/webhook/webhooks.yaml + # Kubeflow Katib components. + - katib-application.yaml + - kubeflow-katib-roles.yaml + - ui-virtual-service.yaml +images: + - name: docker.io/kubeflowkatib/katib-controller + newTag: latest + newName: docker.io/kubeflowkatib/katib-controller + - name: docker.io/kubeflowkatib/katib-db-manager + newTag: latest + newName: docker.io/kubeflowkatib/katib-db-manager + - name: docker.io/kubeflowkatib/katib-ui + newTag: latest + newName: docker.io/kubeflowkatib/katib-ui + - name: docker.io/kubeflowkatib/cert-generator + newTag: latest + newName: docker.io/kubeflowkatib/cert-generator +patchesStrategicMerge: + - ../katib-standalone/katib-config-patch.yaml +commonLabels: + app.kubernetes.io/component: katib +configurations: + - params.yaml diff --git a/manifests/v1beta1/components/katib-controller/params.yaml b/manifests/v1beta1/installs/katib-with-kubeflow/params.yaml similarity index 100% rename from manifests/v1beta1/components/katib-controller/params.yaml rename to manifests/v1beta1/installs/katib-with-kubeflow/params.yaml diff --git a/manifests/v1beta1/components/katib-controller/katib-ui-virtual-service.yaml b/manifests/v1beta1/installs/katib-with-kubeflow/ui-virtual-service.yaml similarity index 100% rename from manifests/v1beta1/components/katib-controller/katib-ui-virtual-service.yaml rename to manifests/v1beta1/installs/katib-with-kubeflow/ui-virtual-service.yaml diff --git a/manifests/v1beta1/katib-controller/crd-experiment.yaml b/manifests/v1beta1/katib-controller/crd-experiment.yaml deleted file mode 100644 index 5a7b06febd0..00000000000 --- a/manifests/v1beta1/katib-controller/crd-experiment.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: experiments.kubeflow.org -spec: - additionalPrinterColumns: - - JSONPath: .status.conditions[-1:].type - name: Type - type: string - - JSONPath: .status.conditions[-1:].status - name: Status - type: string - - JSONPath: .metadata.creationTimestamp - name: Age - type: date - group: kubeflow.org - version: v1beta1 - scope: Namespaced - subresources: - status: {} - names: - kind: Experiment - singular: experiment - plural: experiments - categories: - - all - - kubeflow - - katib diff --git a/manifests/v1beta1/katib-controller/crd-suggestion.yaml b/manifests/v1beta1/katib-controller/crd-suggestion.yaml deleted file mode 100644 index 8de13785c00..00000000000 --- a/manifests/v1beta1/katib-controller/crd-suggestion.yaml +++ /dev/null @@ -1,34 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: suggestions.kubeflow.org -spec: - additionalPrinterColumns: - - JSONPath: .status.conditions[-1:].type - name: Type - type: string - - JSONPath: .status.conditions[-1:].status - name: Status - type: string - - JSONPath: .spec.requests - name: Requested - type: string - - JSONPath: .status.suggestionCount - name: Assigned - type: string - - JSONPath: .metadata.creationTimestamp - name: Age - type: date - group: kubeflow.org - version: v1beta1 - scope: Namespaced - subresources: - status: {} - names: - kind: Suggestion - singular: suggestion - plural: suggestions - categories: - - all - - kubeflow - - katib diff --git a/manifests/v1beta1/katib-controller/crd-trial.yaml b/manifests/v1beta1/katib-controller/crd-trial.yaml deleted file mode 100644 index 6b7dd5347f0..00000000000 --- a/manifests/v1beta1/katib-controller/crd-trial.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: trials.kubeflow.org -spec: - additionalPrinterColumns: - - JSONPath: .status.conditions[-1:].type - name: Type - type: string - - JSONPath: .status.conditions[-1:].status - name: Status - type: string - - JSONPath: .metadata.creationTimestamp - name: Age - type: date - group: kubeflow.org - version: v1beta1 - scope: Namespaced - subresources: - status: {} - names: - kind: Trial - singular: trial - plural: trials - categories: - - all - - kubeflow - - katib diff --git a/manifests/v1beta1/mysql-db/secret.yaml b/manifests/v1beta1/mysql-db/secret.yaml deleted file mode 100644 index b6f36d50a10..00000000000 --- a/manifests/v1beta1/mysql-db/secret.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: v1 -kind: Secret -type: Opaque -metadata: - name: katib-mysql-secrets - namespace: kubeflow -data: - MYSQL_ROOT_PASSWORD: dGVzdA== # "test" diff --git a/operators/katib-controller/src/defaultTrialTemplate.yaml b/operators/katib-controller/src/defaultTrialTemplate.yaml index 00223ea5eb3..ddde5104dcb 100644 --- a/operators/katib-controller/src/defaultTrialTemplate.yaml +++ b/operators/katib-controller/src/defaultTrialTemplate.yaml @@ -5,7 +5,7 @@ spec: spec: containers: - name: training-container - image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-e294a90 + image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-c6c9172 command: - "python3" - "/opt/mxnet-mnist/mnist.py" diff --git a/operators/katib-controller/src/enasCPUTemplate.yaml b/operators/katib-controller/src/enasCPUTemplate.yaml index 588f4e98694..7ef1f429fae 100644 --- a/operators/katib-controller/src/enasCPUTemplate.yaml +++ b/operators/katib-controller/src/enasCPUTemplate.yaml @@ -5,7 +5,7 @@ spec: spec: containers: - name: training-container - image: docker.io/kubeflowkatib/enas-cnn-cifar10-cpu:v1beta1-e294a90 + image: docker.io/kubeflowkatib/enas-cnn-cifar10-cpu:v1beta1-c6c9172 command: - python3 - -u diff --git a/operators/katib-controller/src/pytorchJobTemplate.yaml b/operators/katib-controller/src/pytorchJobTemplate.yaml index 7362f61616a..461325539bf 100644 --- a/operators/katib-controller/src/pytorchJobTemplate.yaml +++ b/operators/katib-controller/src/pytorchJobTemplate.yaml @@ -9,8 +9,7 @@ spec: spec: containers: - name: pytorch - # TODO (andreyvelich): Add tag to the image. - image: docker.io/kubeflowkatib/pytorch-mnist:latest + image: docker.io/kubeflowkatib/pytorch-mnist:v1beta1-c6c9172 imagePullPolicy: Always command: - "python3" @@ -25,8 +24,7 @@ spec: spec: containers: - name: pytorch - # TODO (andreyvelich): Add tag to the image. - image: docker.io/kubeflowkatib/pytorch-mnist:latest + image: docker.io/kubeflowkatib/pytorch-mnist:v1beta1-c6c9172 imagePullPolicy: Always command: - "python3" diff --git a/pkg/controller.v1beta1/experiment/experiment_controller_suite_test.go b/pkg/controller.v1beta1/experiment/experiment_controller_suite_test.go index 4055744fe06..1121d79744a 100644 --- a/pkg/controller.v1beta1/experiment/experiment_controller_suite_test.go +++ b/pkg/controller.v1beta1/experiment/experiment_controller_suite_test.go @@ -43,7 +43,7 @@ func TestMain(m *testing.M) { ControlPlaneStartTimeout: controlPlaneStartTimeout, ControlPlaneStopTimeout: controlPlaneStopTimeout, CRDDirectoryPaths: []string{ - filepath.Join("..", "..", "..", "manifests", "v1beta1", "katib-controller"), + filepath.Join("..", "..", "..", "manifests", "v1beta1", "components", "crd"), filepath.Join("..", "..", "..", "test", "unit", "v1beta1", "crds"), }, } diff --git a/pkg/controller.v1beta1/suggestion/composer/composer_test.go b/pkg/controller.v1beta1/suggestion/composer/composer_test.go index 87420f7ca02..1763de4b182 100644 --- a/pkg/controller.v1beta1/suggestion/composer/composer_test.go +++ b/pkg/controller.v1beta1/suggestion/composer/composer_test.go @@ -83,7 +83,7 @@ func TestMain(m *testing.M) { // Start test k8s server t := &envtest.Environment{ CRDDirectoryPaths: []string{ - filepath.Join("..", "..", "..", "..", "manifests", "v1beta1", "katib-controller"), + filepath.Join("..", "..", "..", "..", "manifests", "v1beta1", "components", "crd"), }, } apis.AddToScheme(scheme.Scheme) diff --git a/pkg/controller.v1beta1/suggestion/suggestion_controller_suite_test.go b/pkg/controller.v1beta1/suggestion/suggestion_controller_suite_test.go index 49251c668eb..bf7a20baf69 100644 --- a/pkg/controller.v1beta1/suggestion/suggestion_controller_suite_test.go +++ b/pkg/controller.v1beta1/suggestion/suggestion_controller_suite_test.go @@ -36,7 +36,7 @@ var cfg *rest.Config func TestMain(m *testing.M) { t := &envtest.Environment{ CRDDirectoryPaths: []string{ - filepath.Join("..", "..", "..", "manifests", "v1beta1", "katib-controller"), + filepath.Join("..", "..", "..", "manifests", "v1beta1", "components", "crd"), filepath.Join("..", "..", "..", "test", "unit", "v1beta1", "crds"), }, } diff --git a/pkg/controller.v1beta1/trial/trial_controller_suite_test.go b/pkg/controller.v1beta1/trial/trial_controller_suite_test.go index b3bc48b31bc..5e55e6c96b7 100644 --- a/pkg/controller.v1beta1/trial/trial_controller_suite_test.go +++ b/pkg/controller.v1beta1/trial/trial_controller_suite_test.go @@ -43,7 +43,7 @@ func TestMain(m *testing.M) { ControlPlaneStartTimeout: controlPlaneStartTimeout, ControlPlaneStopTimeout: controlPlaneStopTimeout, CRDDirectoryPaths: []string{ - filepath.Join("..", "..", "..", "manifests", "v1beta1", "katib-controller"), + filepath.Join("..", "..", "..", "manifests", "v1beta1", "components", "crd"), filepath.Join("..", "..", "..", "test", "unit", "v1beta1", "crds"), }, } diff --git a/pkg/new-ui/v1beta1/README.md b/pkg/new-ui/v1beta1/README.md index 09979b17e7f..f029f3c7527 100755 --- a/pkg/new-ui/v1beta1/README.md +++ b/pkg/new-ui/v1beta1/README.md @@ -24,6 +24,7 @@ To make changes to the UI you need to install: ## Development While development you have different ways to run Katib UI. + 1. Build and serve only the frontend. The dev server will also be proxying requests to the backend 2. Build the frontend and serve it via the backend locally @@ -32,12 +33,12 @@ While development you have different ways to run Katib UI. You can run a webpack dev server that only exposes the frontend files, which can be useful for testing only the UI of the app. There's also a `proxy.conf.json` file which configures the dev server to send the backend requests to port `8000`. In order to build the UI locally, and expose it with a webpack dev server you will need to: + 1. Create a module from the [common library](https://github.com/kubeflow/kubeflow/tree/master/components/crud-web-apps/common/frontend/kubeflow-common-lib) 2. Install the node modules of the app and also link the common-library module - - You can build the common library with: + ```bash cd /tmp && git clone https://github.com/kubeflow/kubeflow.git \ && cd kubeflow \ @@ -55,6 +56,7 @@ npm link dist/kubeflow ``` And then build and run the UI locally, on `localhost:4200`, with: + ```bash # If you've already cloned the repo then skip this step and just # navigate to the pkg/new-ui/v1beta1/frontend dir @@ -66,15 +68,16 @@ npm link kubeflow npm run start ``` -### Serve the UI from the backend +### Serve the UI from the backend This is the recommended way to test the web app e2e. In order to build the UI and serve it via the backend, locally, you will need to: 1. Build the UI locally. You have to follow the steps from the previous section, but instead of running `npm run start` you need to run `npm run build:prod`. It builds the frontend artifacts under `frontend/dist/static` folder. - - Moreover, you are able to run `npm run build:watch` instead of `npm run build:prod`. In that case, it starts a process which is watching the source code changes and building the frontend artifacts under `frontend/dist/static` folder. - Learn more about Angular scripts in the [official guide](https://angular.io/cli/build). + Moreover, you are able to run `npm run build:watch` instead of `npm run build:prod`. In that case, it starts a process which is watching the source code changes and building the frontend artifacts under `frontend/dist/static` folder. + + Learn more about Angular scripts in the [official guide](https://angular.io/cli/build). + 1. Run `kubectl port-forward svc/katib-db-manager 6789 -n kubeflow` to expose `katib-db-manager` service for external access. You can use [different ways](https://kubernetes.io/docs/tasks/access-application-cluster/) to get external address for Kubernetes service. After exposing service, you should be able to receive information by running `wget :`. In case of port-forwarding above, you have to run `wget localhost:6789`. 1. Go to `cmd/new-ui/v1beta1`. @@ -97,7 +100,7 @@ After that, you can access the UI using this URL: `http://localhost:8080/katib/` To run Katib UI in Production, after all changes in frontend and backend, you need to create an image for the UI. Under `/katib` directory run this: `docker build . -f cmd/new-ui/v1beta1/Dockerfile -t ` to build the image. -After that, you can modify UI [deployment](https://github.com/kubeflow/katib/blob/master/manifests/v1beta1/ui/deployment.yaml#L24) with your new image. Then, follow [these steps](https://www.kubeflow.org/docs/components/katib/hyperparameter/#accessing-the-katib-ui) to access Katib UI. +After that, you can modify UI [deployment](https://github.com/kubeflow/katib/blob/master/manifests/v1beta1/components/ui/ui.yaml#L21) with your new image. Then, follow [these steps](https://www.kubeflow.org/docs/components/katib/hyperparameter/#accessing-the-katib-ui) to access Katib UI. ## Code style diff --git a/pkg/ui/v1beta1/README.md b/pkg/ui/v1beta1/README.md index ddea7b6777e..e1be851d2cf 100755 --- a/pkg/ui/v1beta1/README.md +++ b/pkg/ui/v1beta1/README.md @@ -69,7 +69,7 @@ After that, you can access the UI using this URL: `http://localhost:8080/katib/` To run Katib UI in Production, after all changes in frontend and backend, you need to create an image for the UI. Under `/katib` directory run this: `docker build . -f cmd/ui/v1beta1/Dockerfile -t ` to build the image. If Docker resources are not enough to build the frontend, you get `node` out of memory error. You can try to increase Docker resources or modify `package.json` as detailed [above](https://github.com/kubeflow/katib/tree/master/pkg/ui/v1beta1#serve-ui-frontend-and-backend) at step 1. -After that, you can modify UI [deployment](https://github.com/kubeflow/katib/blob/master/manifests/v1beta1/ui/deployment.yaml#L24) with your new image. Then, follow [these steps](https://www.kubeflow.org/docs/components/hyperparameter-tuning/hyperparameter/#accessing-the-katib-ui) to access Katib UI. +After that, you can modify UI [deployment](https://github.com/kubeflow/katib/blob/master/manifests/v1beta1/components/ui/ui.yaml#L21) with your new image. Then, follow [these steps](https://www.kubeflow.org/docs/components/hyperparameter-tuning/hyperparameter/#accessing-the-katib-ui) to access Katib UI. ## Code style diff --git a/pkg/webhook/v1beta1/pod/inject_webhook_test.go b/pkg/webhook/v1beta1/pod/inject_webhook_test.go index e6bec6f3833..0823dc84083 100644 --- a/pkg/webhook/v1beta1/pod/inject_webhook_test.go +++ b/pkg/webhook/v1beta1/pod/inject_webhook_test.go @@ -222,7 +222,7 @@ func TestGetMetricsCollectorArgs(t *testing.T) { // Start test k8s server envTest := &envtest.Environment{ CRDDirectoryPaths: []string{ - filepath.Join("..", "..", "..", "..", "manifests", "v1beta1", "katib-controller"), + filepath.Join("..", "..", "..", "..", "manifests", "v1beta1", "components", "crd"), filepath.Join("..", "..", "..", "..", "test", "unit", "v1beta1", "crds"), }, } @@ -639,7 +639,7 @@ func TestGetKatibJob(t *testing.T) { // Start test k8s server envTest := &envtest.Environment{ CRDDirectoryPaths: []string{ - filepath.Join("..", "..", "..", "..", "manifests", "v1beta1", "katib-controller"), + filepath.Join("..", "..", "..", "..", "manifests", "v1beta1", "components", "crd"), filepath.Join("..", "..", "..", "..", "test", "unit", "v1beta1", "crds"), }, } diff --git a/scripts/v1beta1/deploy.sh b/scripts/v1beta1/deploy.sh index de013dfe985..3782347a467 100755 --- a/scripts/v1beta1/deploy.sh +++ b/scripts/v1beta1/deploy.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2020 The Kubeflow Authors. +# Copyright 2021 The Kubeflow Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,19 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -o errexit -set -o nounset -set -o pipefail set -o xtrace SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/../.. cd ${SCRIPT_ROOT} -kubectl apply -f manifests/v1beta1 -kubectl apply -f manifests/v1beta1/katib-controller -kubectl apply -f manifests/v1beta1/db-manager -kubectl apply -f manifests/v1beta1/pv -kubectl apply -f manifests/v1beta1/mysql-db -kubectl apply -f manifests/v1beta1/ui -kubectl apply -f manifests/v1beta1/webhooks -cd - >/dev/null +kustomize build manifests/v1beta1/installs/katib-standalone --load_restrictor none | kubectl apply -f - diff --git a/scripts/v1beta1/undeploy.sh b/scripts/v1beta1/undeploy.sh index 0d89ac11862..1202c582632 100755 --- a/scripts/v1beta1/undeploy.sh +++ b/scripts/v1beta1/undeploy.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2019 The Kubeflow Authors. +# Copyright 2021 The Kubeflow Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,26 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -o nounset -set -o pipefail set -o xtrace -# Delete CR first -experiments=$(kubectl get experiments --all-namespaces | awk '{if (NR>1) {print $1"/"$2}}') -for s in $experiments; do - ns=$(echo $s | cut -d "/" -f 1) - exp=$(echo $s | cut -d "/" -f 2) - kubectl delete experiments $exp -n $ns -done +# Delete all Katib Experiment in all namespaces. +kubectl delete experiment --all --all-namespaces +sleep 10 SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/../.. cd ${SCRIPT_ROOT} -kubectl delete -f manifests/v1beta1/katib-controller -kubectl delete -f manifests/v1beta1/db-manager -kubectl delete -f manifests/v1beta1/mysql-db -kubectl delete -f manifests/v1beta1/ui -kubectl delete -f manifests/v1beta1/pv -kubectl delete -f manifests/v1beta1/webhooks -kubectl delete -f manifests/v1beta1 -cd - >/dev/null +kustomize build manifests/v1beta1/installs/katib-standalone --load_restrictor none | kubectl delete -f - diff --git a/scripts/v1beta1/update-trial-images.sh b/scripts/v1beta1/update-trial-images.sh index b66fc823c0c..1fdbbfeb66b 100755 --- a/scripts/v1beta1/update-trial-images.sh +++ b/scripts/v1beta1/update-trial-images.sh @@ -74,4 +74,4 @@ else find ./ -regex ".*\.yaml" -exec sed -i -e "s@${BASE_IMAGE_PREFIX}${DARTS}:.*@${IMAGE_PREFIX}${DARTS}:${TAG}@" {} \; fi -echo "Trial template images has been updated" +echo "Trial template images have been updated" diff --git a/test/e2e/v1beta1/invalid-experiment.yaml b/test/e2e/v1beta1/invalid-experiment.yaml index 34bdacf5a34..d945bba5d96 100644 --- a/test/e2e/v1beta1/invalid-experiment.yaml +++ b/test/e2e/v1beta1/invalid-experiment.yaml @@ -52,7 +52,7 @@ spec: spec: containers: - name: training-container - image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-e294a90 + image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-c6c9172 command: - "python3" - "/opt/mxnet-mnist/mnist.py" diff --git a/test/e2e/v1beta1/valid-experiment.yaml b/test/e2e/v1beta1/valid-experiment.yaml index 71e297e93b3..0793f095247 100644 --- a/test/e2e/v1beta1/valid-experiment.yaml +++ b/test/e2e/v1beta1/valid-experiment.yaml @@ -52,7 +52,7 @@ spec: spec: containers: - name: training-container - image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-e294a90 + image: docker.io/kubeflowkatib/mxnet-mnist:v1beta1-c6c9172 command: - "python3" - "/opt/mxnet-mnist/mnist.py" diff --git a/test/scripts/v1beta1/setup-katib.sh b/test/scripts/v1beta1/setup-katib.sh index e293f9c616f..94877f6e615 100755 --- a/test/scripts/v1beta1/setup-katib.sh +++ b/test/scripts/v1beta1/setup-katib.sh @@ -37,36 +37,45 @@ kubectl version kubectl cluster-info # Update images with current pull base sha. -echo "Updating Katib images with current PR SHA: ${VERSION}" -# Katib controller -sed -i -e "s@image: docker.io/kubeflowkatib\/katib-controller@image: ${ECR_REGISTRY}\/${REPO_NAME}\/v1beta1\/katib-controller:${VERSION}@" manifests/v1beta1/katib-controller/katib-controller.yaml +echo "Updating Katib images with the current PR SHA: ${VERSION}" +KUSTOMIZE_PATH="manifests/v1beta1/installs/katib-standalone/kustomization.yaml" +CONFIG_PATCH="manifests/v1beta1/installs/katib-standalone/katib-config-patch.yaml" -# Metrics collector -sed -i -e "s@docker.io/kubeflowkatib\/file-metrics-collector@${ECR_REGISTRY}\/${REPO_NAME}\/v1beta1\/file-metrics-collector:${VERSION}@" manifests/v1beta1/katib-controller/katib-config.yaml -sed -i -e "s@docker.io/kubeflowkatib\/tfevent-metrics-collector@${ECR_REGISTRY}\/${REPO_NAME}\/v1beta1\/tfevent-metrics-collector:${VERSION}@" manifests/v1beta1/katib-controller/katib-config.yaml +# Change tag to all images in kustomization and katib-config patch files. +sed -i -e "s@latest@${VERSION}@" ${KUSTOMIZE_PATH} +sed -i -e "s@latest@${VERSION}@" ${CONFIG_PATCH} -# Katib DB manager -sed -i -e "s@image: docker.io/kubeflowkatib\/katib-db-manager@image: ${ECR_REGISTRY}\/${REPO_NAME}\/v1beta1\/katib-db-manager:${VERSION}@" manifests/v1beta1/db-manager/deployment.yaml +# Change Katib controller image. +sed -i -e "s@newName: docker.io/kubeflowkatib/katib-controller@newName: ${ECR_REGISTRY}/${REPO_NAME}/v1beta1/katib-controller@" ${KUSTOMIZE_PATH} -# UI -sed -i -e "s@image: docker.io/kubeflowkatib\/katib-ui@image: ${ECR_REGISTRY}\/${REPO_NAME}\/v1beta1\/katib-ui:${VERSION}@" manifests/v1beta1/ui/deployment.yaml +# Change Katib DB manager image. +sed -i -e "s@newName: docker.io/kubeflowkatib/katib-db-manager@newName: ${ECR_REGISTRY}/${REPO_NAME}/v1beta1/katib-db-manager@" ${KUSTOMIZE_PATH} -# Cert generator -sed -i -e "s@image: docker.io/kubeflowkatib\/cert-generator@image: ${ECR_REGISTRY}\/${REPO_NAME}\/v1beta1\/cert-generator:${VERSION}@" manifests/v1beta1/webhooks/cert-generator-job.yaml +# Change Katib UI image. +sed -i -e "s@newName: docker.io/kubeflowkatib/katib-ui@newName: ${ECR_REGISTRY}/${REPO_NAME}/v1beta1/katib-ui@" ${KUSTOMIZE_PATH} -# Suggestion algorithms -sed -i -e "s@docker.io/kubeflowkatib\/suggestion-enas@${ECR_REGISTRY}\/${REPO_NAME}\/v1beta1\/suggestion-enas:${VERSION}@" manifests/v1beta1/katib-controller/katib-config.yaml -sed -i -e "s@docker.io/kubeflowkatib\/suggestion-hyperband@${ECR_REGISTRY}\/${REPO_NAME}\/v1beta1\/suggestion-hyperband:${VERSION}@" manifests/v1beta1/katib-controller/katib-config.yaml -sed -i -e "s@docker.io/kubeflowkatib\/suggestion-chocolate@${ECR_REGISTRY}\/${REPO_NAME}\/v1beta1\/suggestion-chocolate:${VERSION}@" manifests/v1beta1/katib-controller/katib-config.yaml -sed -i -e "s@docker.io/kubeflowkatib\/suggestion-hyperopt@${ECR_REGISTRY}\/${REPO_NAME}\/v1beta1\/suggestion-hyperopt:${VERSION}@" manifests/v1beta1/katib-controller/katib-config.yaml -sed -i -e "s@docker.io/kubeflowkatib\/suggestion-skopt@${ECR_REGISTRY}\/${REPO_NAME}\/v1beta1\/suggestion-skopt:${VERSION}@" manifests/v1beta1/katib-controller/katib-config.yaml -sed -i -e "s@docker.io/kubeflowkatib\/suggestion-goptuna@${ECR_REGISTRY}\/${REPO_NAME}\/v1beta1\/suggestion-goptuna:${VERSION}@" manifests/v1beta1/katib-controller/katib-config.yaml -sed -i -e "s@docker.io/kubeflowkatib\/suggestion-darts@${ECR_REGISTRY}\/${REPO_NAME}\/v1beta1\/suggestion-darts:${VERSION}@" manifests/v1beta1/katib-controller/katib-config.yaml +# Change Katib cert generator image. +sed -i -e "s@newName: docker.io/kubeflowkatib/cert-generator@newName: ${ECR_REGISTRY}/${REPO_NAME}/v1beta1/cert-generator@" ${KUSTOMIZE_PATH} -# Early stopping -sed -i -e "s@docker.io/kubeflowkatib\/earlystopping-medianstop@${ECR_REGISTRY}\/${REPO_NAME}\/v1beta1\/earlystopping-medianstop:${VERSION}@" manifests/v1beta1/katib-controller/katib-config.yaml +# Change Katib metrics collector images. +sed -i -e "s@docker.io/kubeflowkatib/file-metrics-collector@${ECR_REGISTRY}/${REPO_NAME}/v1beta1/file-metrics-collector@" ${CONFIG_PATCH} +sed -i -e "s@docker.io/kubeflowkatib/tfevent-metrics-collector@${ECR_REGISTRY}/${REPO_NAME}/v1beta1/tfevent-metrics-collector@" ${CONFIG_PATCH} -cat manifests/v1beta1/katib-controller/katib-config.yaml +# Change Katib Suggestion images. +sed -i -e "s@docker.io/kubeflowkatib/suggestion-hyperopt@${ECR_REGISTRY}/${REPO_NAME}/v1beta1/suggestion-hyperopt@" ${CONFIG_PATCH} +sed -i -e "s@docker.io/kubeflowkatib/suggestion-chocolate@${ECR_REGISTRY}/${REPO_NAME}/v1beta1/suggestion-chocolate@" ${CONFIG_PATCH} +sed -i -e "s@docker.io/kubeflowkatib/suggestion-hyperband@${ECR_REGISTRY}/${REPO_NAME}/v1beta1/suggestion-hyperband@" ${CONFIG_PATCH} +sed -i -e "s@docker.io/kubeflowkatib/suggestion-skopt@${ECR_REGISTRY}/${REPO_NAME}/v1beta1/suggestion-skopt@" ${CONFIG_PATCH} +sed -i -e "s@docker.io/kubeflowkatib/suggestion-goptuna@${ECR_REGISTRY}/${REPO_NAME}/v1beta1/suggestion-goptuna@" ${CONFIG_PATCH} +sed -i -e "s@docker.io/kubeflowkatib/suggestion-enas@${ECR_REGISTRY}/${REPO_NAME}/v1beta1/suggestion-enas@" ${CONFIG_PATCH} +sed -i -e "s@docker.io/kubeflowkatib/suggestion-darts@${ECR_REGISTRY}/${REPO_NAME}/v1beta1/suggestion-darts@" ${CONFIG_PATCH} + +# Change Katib Early Stopping images. +sed -i -e "s@docker.io/kubeflowkatib/earlystopping-medianstop@${ECR_REGISTRY}/${REPO_NAME}/v1beta1/earlystopping-medianstop@" ${CONFIG_PATCH} + +echo "Katib images have been updated" +cat ${KUSTOMIZE_PATH} +cat ${CONFIG_PATCH} # Update Trial template images in the examples. ./scripts/v1beta1/update-trial-images.sh -p "${ECR_REGISTRY}/${REPO_NAME}/v1beta1/trial-" -t ${VERSION}