Compare commits

...

6 Commits

Author SHA1 Message Date
Andrey Velichkevich 5723604d41 Katib official release v0.17.0 2024-07-12 21:08:19 +01:00
Andrey Velichkevich 1f70d0daff Katib official release v0.17.0-rc.1 2024-06-20 17:23:16 +01:00
Andrey Velichkevich 343b94137a
Cherry pick: Remove code generation from release script (#2363) (#2364)
Signed-off-by: Andrey Velichkevich <andrey.velichkevich@gmail.com>
2024-06-20 16:12:00 +00:00
Andrey Velichkevich 1c45521fb8
Cherry pick of #2350 #2355 #2357 #2344 #2358 #2360 into release-0.17 branch (#2362)
* Fix TestReconcileBatchJob (#2350)

* update

Signed-off-by: forsaken628 <forsaken628@gmail.com>

* fix

Signed-off-by: forsaken628 <forsaken628@gmail.com>

* update

Signed-off-by: forsaken628 <forsaken628@gmail.com>

* update

Signed-off-by: forsaken628 <forsaken628@gmail.com>

* update

Signed-off-by: forsaken628 <forsaken628@gmail.com>

* fix

Signed-off-by: forsaken628 <forsaken628@gmail.com>

* cleanup

Signed-off-by: forsaken628 <forsaken628@gmail.com>

* fix

Signed-off-by: forsaken628 <forsaken628@gmail.com>

* update

Signed-off-by: forsaken628 <forsaken628@gmail.com>

* use gomock

Signed-off-by: forsaken628 <forsaken628@gmail.com>

---------

Signed-off-by: forsaken628 <forsaken628@gmail.com>
Signed-off-by: Andrey Velichkevich <andrey.velichkevich@gmail.com>

* Use cache-dependency-path in actions/setup-go for CI workflow (#2355)

Signed-off-by: forsaken628 <forsaken628@gmail.com>
Signed-off-by: Andrey Velichkevich <andrey.velichkevich@gmail.com>

* Replace already closed github.com/golang/mock with go.uber.org/mock (#2357)

* replace gomock

Signed-off-by: forsaken628 <forsaken628@gmail.com>

* fix

Signed-off-by: forsaken628 <forsaken628@gmail.com>

* revert

Signed-off-by: forsaken628 <forsaken628@gmail.com>

* fix

Signed-off-by: forsaken628 <forsaken628@gmail.com>

* fix

Signed-off-by: forsaken628 <forsaken628@gmail.com>

---------

Signed-off-by: forsaken628 <forsaken628@gmail.com>
Signed-off-by: Andrey Velichkevich <andrey.velichkevich@gmail.com>

* Replace gRPC code generation tool from Znly/protoc to Buf  (#2344)

* Replace gRPC code generation tool from Znly/protoc to Buf

Signed-off-by: forsaken628 <forsaken628@gmail.com>

* fix

Signed-off-by: forsaken628 <forsaken628@gmail.com>

* del build.sh

Signed-off-by: forsaken628 <forsaken628@gmail.com>

* cleanup

Signed-off-by: forsaken628 <forsaken628@gmail.com>

* fix test

Signed-off-by: forsaken628 <forsaken628@gmail.com>

* fix

Signed-off-by: forsaken628 <forsaken628@gmail.com>

* fix

Signed-off-by: forsaken628 <forsaken628@gmail.com>

* refine

Signed-off-by: forsaken628 <forsaken628@gmail.com>

* fix

Signed-off-by: forsaken628 <forsaken628@gmail.com>

* rm outter yaml

Signed-off-by: forsaken628 <forsaken628@gmail.com>

* fix

Signed-off-by: forsaken628 <forsaken628@gmail.com>

---------

Signed-off-by: forsaken628 <forsaken628@gmail.com>
Signed-off-by: Andrey Velichkevich <andrey.velichkevich@gmail.com>

* Upgrade the protobuf version to >=4.21.12,<5 (#2358)

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
Signed-off-by: Andrey Velichkevich <andrey.velichkevich@gmail.com>

* [SDK] Fix empty list for env variables and numpy version (#2360)

* [SDK] Fix empty list for env variables

Signed-off-by: Andrey Velichkevich <andrey.velichkevich@gmail.com>

* Fix numpy version in tests

Signed-off-by: Andrey Velichkevich <andrey.velichkevich@gmail.com>

---------

Signed-off-by: Andrey Velichkevich <andrey.velichkevich@gmail.com>

---------

Signed-off-by: forsaken628 <forsaken628@gmail.com>
Signed-off-by: Andrey Velichkevich <andrey.velichkevich@gmail.com>
Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
Co-authored-by: coldWater <forsaken628@gmail.com>
Co-authored-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
2024-06-18 20:19:58 +00:00
Andrey Velichkevich 6cac704dda
Cherry pick of #2324 #2336 #2337 into release-0.17 branch (#2351)
* Update outdated actions (#2324)
2024-06-11 22:09:23 +05:30
Andrey Velichkevich f0acce70fc Katib official release v0.17.0-rc.0 2024-04-29 17:03:11 +01:00
111 changed files with 5569 additions and 5246 deletions

View File

@ -25,14 +25,14 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Docker Login
# Trigger workflow only for kubeflow/katib repository with specific branch (master, release-.*) or tag (v.*).
if: >-
github.repository == 'kubeflow/katib' &&
(github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-') || startsWith(github.ref, 'refs/tags/v'))
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

View File

@ -15,13 +15,13 @@ jobs:
timeout-minutes: 120
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Test Env
uses: ./.github/workflows/template-setup-e2e-test
with:
kubernetes-version: ${{ matrix.kubernetes-version }}
python-version: "3.7"
python-version: "3.11"
- name: Run e2e test with ${{ matrix.experiments }} experiments
uses: ./.github/workflows/template-e2e-test

View File

@ -15,7 +15,7 @@ jobs:
timeout-minutes: 120
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Test Env
uses: ./.github/workflows/template-setup-e2e-test

View File

@ -15,7 +15,7 @@ jobs:
timeout-minutes: 120
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Test Env
uses: ./.github/workflows/template-setup-e2e-test

View File

@ -15,7 +15,7 @@ jobs:
timeout-minutes: 120
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Test Env
uses: ./.github/workflows/template-setup-e2e-test

View File

@ -15,7 +15,7 @@ jobs:
timeout-minutes: 120
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Test Env
uses: ./.github/workflows/template-setup-e2e-test

View File

@ -13,7 +13,7 @@ jobs:
timeout-minutes: 120
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Test Env
uses: ./.github/workflows/template-setup-e2e-test

View File

@ -36,14 +36,14 @@ runs:
df -h
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
- name: Set Up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Add Docker Tags
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ inputs.image }}
tags: |
@ -51,7 +51,7 @@ runs:
type=sha,prefix=v1beta1-
- name: Build and Push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
file: ${{ inputs.dockerfile }}

View File

@ -32,12 +32,12 @@ runs:
df -h
- name: Setup kubectl
uses: azure/setup-kubectl@v3
uses: azure/setup-kubectl@v4
with:
version: ${{ inputs.kubernetes-version }}
- name: Setup Minikube Cluster
uses: medyagh/setup-minikube@v0.0.14
uses: medyagh/setup-minikube@v0.0.16
with:
network-plugin: cni
cni: flannel
@ -47,10 +47,10 @@ runs:
start-args: --wait-timeout=120s
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}

View File

@ -20,14 +20,15 @@ jobs:
working-directory: ${{ env.GOPATH }}/src/github.com/kubeflow/katib
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ${{ env.GOPATH }}/src/github.com/kubeflow/katib
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version-file: ${{ env.GOPATH }}/src/github.com/kubeflow/katib/go.mod
cache-dependency-path: ${{ env.GOPATH }}/src/github.com/kubeflow/katib/go.sum
- name: Check Go Modules, Generated Go/Python codes, and Format
run: make check
@ -42,14 +43,15 @@ jobs:
working-directory: ${{ env.GOPATH }}/src/github.com/kubeflow/katib
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ${{ env.GOPATH }}/src/github.com/kubeflow/katib
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version-file: ${{ env.GOPATH }}/src/github.com/kubeflow/katib/go.mod
cache-dependency-path: ${{ env.GOPATH }}/src/github.com/kubeflow/katib/go.sum
- name: Run Go test
run: go mod download && make test ENVTEST_K8S_VERSION=${{ matrix.kubernetes-version }}

View File

@ -16,10 +16,10 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.9

View File

@ -16,10 +16,10 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 12.18.1
@ -39,10 +39,10 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 12.18.1
@ -73,9 +73,9 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup node version to 12
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 12

View File

@ -16,10 +16,10 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11
@ -36,10 +36,10 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.9

View File

@ -8,12 +8,10 @@ COMMIT := v1beta1-$(shell git rev-parse --short=7 HEAD)
KATIB_REGISTRY := docker.io/kubeflowkatib
CPU_ARCH ?= linux/amd64,linux/arm64
ENVTEST_K8S_VERSION ?= 1.29
MOCKGEN_VERSION ?= $(shell grep 'github.com/golang/mock' go.mod | cut -d ' ' -f 2)
MOCKGEN_VERSION ?= $(shell grep 'go.uber.org/mock' go.mod | cut -d ' ' -f 2)
GO_VERSION=$(shell grep '^go' go.mod | cut -d ' ' -f 2)
GOPATH ?= $(shell go env GOPATH)
# for pytest
PYTHONPATH := $(PYTHONPATH):$(CURDIR)/pkg/apis/manager/v1beta1/python:$(CURDIR)/pkg/apis/manager/health/python
PYTHONPATH := $(PYTHONPATH):$(CURDIR)/pkg/metricscollector/v1beta1/common:$(CURDIR)/pkg/metricscollector/v1beta1/tfevent-metricscollector
TEST_TENSORFLOW_EVENT_FILE_PATH ?= $(CURDIR)/test/unit/v1beta1/metricscollector/testdata/tfevent-metricscollector/logs
# Run tests
@ -93,17 +91,13 @@ controller-gen:
# 4. Generate gRPC manager APIs (pkg/apis/manager/v1beta1/build.sh and pkg/apis/manager/health/build.sh)
# 5. Generate Go mock codes
generate: controller-gen
ifndef GOPATH
$(error GOPATH not defined, please define GOPATH. Run "go help gopath" to learn more about GOPATH)
endif
ifndef HAS_MOCKGEN
go install github.com/golang/mock/mockgen@$(MOCKGEN_VERSION)
go install go.uber.org/mock/mockgen@$(MOCKGEN_VERSION)
$(info "mockgen has been installed")
endif
go generate ./pkg/... ./cmd/...
hack/gen-python-sdk/gen-sdk.sh
pkg/apis/manager/v1beta1/build.sh
pkg/apis/manager/health/build.sh
hack/update-proto.sh
hack/update-mockgen.sh
# Build images for the Katib v1beta1 components.
@ -121,14 +115,12 @@ push-latest: generate
bash scripts/v1beta1/push.sh $(KATIB_REGISTRY) $(COMMIT)
# Build and push Katib images for the given tag.
push-tag: generate
push-tag:
ifeq ($(TAG),)
$(error TAG must be set. Usage: make push-tag TAG=<release-tag>)
endif
bash scripts/v1beta1/build.sh $(KATIB_REGISTRY) $(TAG) $(CPU_ARCH)
bash scripts/v1beta1/build.sh $(KATIB_REGISTRY) $(COMMIT) $(CPU_ARCH)
bash scripts/v1beta1/push.sh $(KATIB_REGISTRY) $(TAG)
bash scripts/v1beta1/push.sh $(KATIB_REGISTRY) $(COMMIT)
# Release a new version of Katib.
release:
@ -175,9 +167,9 @@ ifeq ("$(wildcard $(TEST_TENSORFLOW_EVENT_FILE_PATH))", "")
endif
pytest: prepare-pytest prepare-pytest-testdata
PYTHONPATH=$(PYTHONPATH) pytest ./test/unit/v1beta1/suggestion --ignore=./test/unit/v1beta1/suggestion/test_skopt_service.py
PYTHONPATH=$(PYTHONPATH) pytest ./test/unit/v1beta1/earlystopping
PYTHONPATH=$(PYTHONPATH) pytest ./test/unit/v1beta1/metricscollector
pytest ./test/unit/v1beta1/suggestion --ignore=./test/unit/v1beta1/suggestion/test_skopt_service.py
pytest ./test/unit/v1beta1/earlystopping
pytest ./test/unit/v1beta1/metricscollector
# The skopt service doesn't work appropriately with Python 3.11.
# So, we need to run the test with Python 3.9.
@ -187,4 +179,4 @@ pytest-skopt:
pip install six
pip install --prefer-binary -r test/unit/v1beta1/requirements.txt
pip install --prefer-binary -r cmd/suggestion/skopt/v1beta1/requirements.txt
PYTHONPATH=$(PYTHONPATH) pytest ./test/unit/v1beta1/suggestion/test_skopt_service.py
pytest ./test/unit/v1beta1/suggestion/test_skopt_service.py

View File

@ -20,7 +20,7 @@ import (
"context"
"testing"
"github.com/golang/mock/gomock"
"go.uber.org/mock/gomock"
health_pb "github.com/kubeflow/katib/pkg/apis/manager/health"
api_pb "github.com/kubeflow/katib/pkg/apis/manager/v1beta1"

View File

@ -1,5 +1,5 @@
grpcio>=1.41.1
protobuf>=3.19.5, <=3.20.3
protobuf>=4.21.12,<5
googleapis-common-protos==1.6.0
kubernetes==22.6.0
cython>=0.29.24

View File

@ -15,6 +15,7 @@
import grpc
import argparse
import api_pb2
import api_pb2_grpc
from pns import WaitMainProcesses
import const
from tfevent_loader import MetricsCollector
@ -55,25 +56,28 @@ if __name__ == '__main__':
wait_all_processes = opt.wait_all_processes.lower() == "true"
db_manager_server = opt.db_manager_server_addr.split(':')
if len(db_manager_server) != 2:
raise Exception("Invalid Katib DB manager service address: %s" %
opt.db_manager_server_addr)
raise Exception(
f"Invalid Katib DB manager service address: {opt.db_manager_server_addr}"
)
WaitMainProcesses(
pool_interval=opt.poll_interval,
timout=opt.timeout,
wait_all=wait_all_processes,
completed_marked_dir=opt.metrics_file_dir)
completed_marked_dir=opt.metrics_file_dir,
)
mc = MetricsCollector(opt.metric_names.split(';'))
mc = MetricsCollector(opt.metric_names.split(";"))
observation_log = mc.parse_file(opt.metrics_file_dir)
channel = grpc.beta.implementations.insecure_channel(
db_manager_server[0], int(db_manager_server[1]))
with api_pb2.beta_create_DBManager_stub(channel) as client:
logger.info("In " + opt.trial_name + " " +
str(len(observation_log.metric_logs)) + " metrics will be reported.")
client.ReportObservationLog(api_pb2.ReportObservationLogRequest(
trial_name=opt.trial_name,
observation_log=observation_log
), timeout=timeout_in_seconds)
with grpc.insecure_channel(opt.db_manager_server_addr) as channel:
stub = api_pb2_grpc.DBManagerStub(channel)
logger.info(
f"In {opt.trial_name} {str(len(observation_log.metric_logs))} metrics will be reported."
)
stub.ReportObservationLog(
api_pb2.ReportObservationLogRequest(
trial_name=opt.trial_name, observation_log=observation_log
),
timeout=timeout_in_seconds,
)

View File

@ -3,4 +3,4 @@ rfc3339>=6.2
grpcio>=1.41.1
googleapis-common-protos==1.6.0
tensorflow==2.16.1
protobuf<=3.20.3
protobuf>=4.21.12,<5

View File

@ -4,6 +4,6 @@ numpy>=1.25.2
scikit-learn>=0.24.0
scipy>=1.5.4
forestci==0.3
protobuf>=3.19.5, <=3.20.3
protobuf>=4.21.12,<5
googleapis-common-protos==1.6.0
cython>=0.29.24

View File

@ -4,7 +4,7 @@ numpy>=1.25.2
scikit-learn>=0.24.0
scipy>=1.5.4
forestci==0.3
protobuf>=3.19.5, <=3.20.3
protobuf>=4.21.12,<5
googleapis-common-protos==1.6.0
hyperopt==0.2.5
cython>=0.29.24

View File

@ -1,4 +1,4 @@
grpcio>=1.41.1
protobuf>=3.19.5, <=3.20.3
protobuf>=4.21.12,<5
googleapis-common-protos==1.6.0
cython>=0.29.24

View File

@ -2,4 +2,4 @@ grpcio>=1.41.1
googleapis-common-protos==1.6.0
cython>=0.29.24
tensorflow==2.16.1
protobuf<=3.20.3
protobuf>=4.21.12,<5

View File

@ -1,4 +1,4 @@
grpcio>=1.41.1
protobuf>=3.19.5, <=3.20.3
protobuf>=4.21.12,<5
googleapis-common-protos==1.53.0
optuna==3.3.0

View File

@ -1,4 +1,4 @@
grpcio>=1.41.1
protobuf>=3.19.5, <=3.20.3
protobuf>=4.21.12,<5
googleapis-common-protos==1.53.0
numpy==1.25.2

View File

@ -4,10 +4,10 @@ cloudpickle==0.5.6
# AttributeError: module 'numpy' has no attribute 'int'
# See more: https://github.com/numpy/numpy/pull/22607
numpy==1.23.5
scikit-learn>=0.24.0
scikit-learn>=0.24.0, <=1.3.0
scipy>=1.5.4
forestci==0.3
protobuf>=3.19.5, <=3.20.3
protobuf>=4.21.12,<5
googleapis-common-protos==1.6.0
scikit-optimize>=0.9.0
cython>=0.29.24

View File

@ -74,7 +74,7 @@ spec:
- name: epochs
container:
name: model-training
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.17.0
command:
- "python3"
- "/opt/pytorch-mnist/mnist.py"

View File

@ -62,7 +62,7 @@ spec:
spec:
containers:
- name: training-container
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.17.0
command:
- "python3"
- "/opt/pytorch-mnist/mnist.py"

View File

@ -52,7 +52,7 @@ spec:
spec:
containers:
- name: training-container
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.17.0
command:
- "python3"
- "/opt/pytorch-mnist/mnist.py"

View File

@ -45,7 +45,7 @@ spec:
spec:
containers:
- name: training-container
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.17.0
command:
- "python3"
- "/opt/pytorch-mnist/mnist.py"

View File

@ -45,7 +45,7 @@ spec:
spec:
containers:
- name: training-container
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.17.0
command:
- "python3"
- "/opt/pytorch-mnist/mnist.py"

View File

@ -44,7 +44,7 @@ spec:
spec:
containers:
- name: training-container
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.17.0
command:
- "python3"
- "/opt/pytorch-mnist/mnist.py"

View File

@ -57,7 +57,7 @@ spec:
spec:
containers:
- name: training-container
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.17.0
command:
- "python3"
- "/opt/pytorch-mnist/mnist.py"

View File

@ -42,7 +42,7 @@ spec:
spec:
containers:
- name: training-container
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.17.0
command:
- "python3"
- "/opt/pytorch-mnist/mnist.py"

View File

@ -42,7 +42,7 @@ spec:
spec:
containers:
- name: training-container
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.17.0
command:
- "python3"
- "/opt/pytorch-mnist/mnist.py"

View File

@ -43,7 +43,7 @@ spec:
spec:
containers:
- name: training-container
image: docker.io/kubeflowkatib/simple-pbt:latest
image: docker.io/kubeflowkatib/simple-pbt:v0.17.0
command:
- "python3"
- "/opt/pbt/pbt_test.py"

View File

@ -42,7 +42,7 @@ spec:
spec:
containers:
- name: training-container
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.17.0
command:
- "python3"
- "/opt/pytorch-mnist/mnist.py"

View File

@ -42,7 +42,7 @@ spec:
spec:
containers:
- name: training-container
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.17.0
command:
- "python3"
- "/opt/pytorch-mnist/mnist.py"

View File

@ -46,7 +46,7 @@ spec:
spec:
containers:
- name: pytorch
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.17.0
command:
- "python3"
- "/opt/pytorch-mnist/mnist.py"
@ -61,7 +61,7 @@ spec:
spec:
containers:
- name: pytorch
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.17.0
command:
- "python3"
- "/opt/pytorch-mnist/mnist.py"

View File

@ -56,7 +56,7 @@ spec:
spec:
containers:
- name: tensorflow
image: docker.io/kubeflowkatib/tf-mnist-with-summaries:latest
image: docker.io/kubeflowkatib/tf-mnist-with-summaries:v0.17.0
command:
- "python"
- "/opt/tf-mnist-with-summaries/mnist.py"

View File

@ -67,7 +67,7 @@ spec:
spec:
containers:
- name: training-container
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.17.0
command:
- "python3"
- "/opt/pytorch-mnist/mnist.py"

View File

@ -52,7 +52,7 @@ spec:
spec:
containers:
- name: training-container
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.17.0
command:
- "python3"
- "/opt/pytorch-mnist/mnist.py"

View File

@ -54,7 +54,7 @@ spec:
spec:
containers:
- name: training-container
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.17.0
command:
- "python3"
- "/opt/pytorch-mnist/mnist.py"

View File

@ -49,7 +49,7 @@ spec:
spec:
containers:
- name: training-container
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.17.0
command:
- "python3"
- "/opt/pytorch-mnist/mnist.py"

View File

@ -60,7 +60,7 @@ spec:
spec:
containers:
- name: training-container
image: docker.io/kubeflowkatib/darts-cnn-cifar10-cpu:latest
image: docker.io/kubeflowkatib/darts-cnn-cifar10-cpu:v0.17.0
command:
- python3
- run_trial.py

View File

@ -77,7 +77,7 @@ spec:
spec:
containers:
- name: training-container
image: docker.io/kubeflowkatib/darts-cnn-cifar10-gpu:latest
image: docker.io/kubeflowkatib/darts-cnn-cifar10-gpu:v0.17.0
command:
- python3
- run_trial.py

View File

@ -139,7 +139,7 @@ spec:
spec:
containers:
- name: training-container
image: docker.io/kubeflowkatib/enas-cnn-cifar10-cpu:latest
image: docker.io/kubeflowkatib/enas-cnn-cifar10-cpu:v0.17.0
command:
- python3
- -u

View File

@ -136,7 +136,7 @@ spec:
spec:
containers:
- name: training-container
image: docker.io/kubeflowkatib/enas-cnn-cifar10-gpu:latest
image: docker.io/kubeflowkatib/enas-cnn-cifar10-gpu:v0.17.0
command:
- python3
- -u

View File

@ -43,7 +43,7 @@ spec:
spec:
containers:
- name: training-container
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.17.0
command:
- "python3"
- "/opt/pytorch-mnist/mnist.py"

View File

@ -43,7 +43,7 @@ spec:
spec:
containers:
- name: training-container
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.17.0
command:
- "python3"
- "/opt/pytorch-mnist/mnist.py"

View File

@ -88,7 +88,7 @@ spec:
description: Number of epochs
steps:
- name: model-training
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.17.0
command:
- "python3"
- "/opt/pytorch-mnist/mnist.py"

View File

@ -6,8 +6,10 @@ ADD examples/v1beta1/trial-images/darts-cnn-cifar10 ${TARGET_DIR}
WORKDIR ${TARGET_DIR}
# TODO (andreyvelich): This is required since torchvision==0.17.1 is incompatible with numpy 2.0
RUN pip install numpy==1.26.0
RUN pip install --prefer-binary --no-cache-dir torch==2.2.1 torchvision==0.17.1
RUN pip install --prefer-binary --no-cache-dir -r requirements.txt
RUN chgrp -R 0 ${TARGET_DIR} \
&& chmod -R g+rwX ${TARGET_DIR}

View File

@ -6,6 +6,9 @@ WORKDIR /opt/pytorch-mnist
# Add folder for the logs.
RUN mkdir /katib
# TODO (andreyvelich): This is required since torchvision==0.17.1 is incompatible with numpy 2.0
RUN pip install numpy==1.26.0
RUN pip install --prefer-binary --no-cache-dir torch==2.2.1 torchvision==0.17.1
RUN pip install --prefer-binary --no-cache-dir -r requirements.txt

View File

@ -1,2 +1 @@
cloudml-hypertune==0.1.0.dev6
Pillow>=9.1.1

View File

@ -66,7 +66,7 @@ spec:
spec:
containers:
- name: training-container
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.17.0
command:
- "python3"
- "/opt/pytorch-mnist/mnist.py"

8
go.mod
View File

@ -7,8 +7,6 @@ require (
github.com/awalterschulze/gographviz v2.0.3+incompatible
github.com/c-bata/goptuna v0.8.0
github.com/go-sql-driver/mysql v1.5.0
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.4
github.com/google/go-cmp v0.6.0
github.com/google/go-containerregistry v0.15.2
github.com/google/go-containerregistry/pkg/authn/k8schain v0.0.0-20230517160804-b7ad3f13a62c
@ -21,8 +19,9 @@ require (
github.com/shirou/gopsutil/v3 v3.22.5
github.com/spf13/viper v1.9.0
github.com/tidwall/gjson v1.14.1
golang.org/x/net v0.23.0
go.uber.org/mock v0.4.0
google.golang.org/grpc v1.58.3
google.golang.org/protobuf v1.33.0
k8s.io/api v0.29.3
k8s.io/apimachinery v0.29.3
k8s.io/client-go v0.29.3
@ -84,6 +83,7 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-containerregistry/pkg/authn/kubernetes v0.0.0-20230516205744-dbecb1de8cfa // indirect
github.com/google/gofuzz v1.2.0 // indirect
@ -128,6 +128,7 @@ require (
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/oauth2 v0.12.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.18.0 // indirect
@ -139,7 +140,6 @@ require (
gonum.org/v1/gonum v0.8.2 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/fsnotify/fsnotify.v1 v1.4.7 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.63.2 // indirect

3
go.sum
View File

@ -263,7 +263,6 @@ github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8=
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0=
@ -689,6 +688,8 @@ go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=

View File

@ -26,11 +26,11 @@ SCRIPT_ROOT="$(dirname "${BASH_SOURCE[0]}")/.."
cd "${SCRIPT_ROOT}"
# Grab mockgen version from go.mod
MOCKGEN_VERSION=$(grep 'github.com/golang/mock' go.mod | awk '{print $2}')
MOCKGEN_VERSION=$(grep 'go.uber.org/mock' go.mod | awk '{print $2}')
if [[ ! $(mockgen -version) == "${MOCKGEN_VERSION}" ]]; then
echo "You must use ${MOCKGEN_VERSION} mockgen version to run this script"
echo "To install mockgen follow this doc: https://github.com/golang/mock/tree/main#installation"
echo "To install mockgen follow this doc: https://github.com/uber-go/mock#installation"
echo "Run 'mockgen -version' to check the installed version"
exit 1
fi

40
hack/update-proto.sh Executable file
View File

@ -0,0 +1,40 @@
#!/usr/bin/env bash
# Copyright 2024 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
ROOT_DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )"
mkdir -p "${ROOT_DIR}/bin"
export GOBIN=$ROOT_DIR/bin
if [ ! -f "${GOBIN}/buf" ]; then
go install github.com/bufbuild/buf/cmd/buf@v1.32.2
fi
pushd "${ROOT_DIR}/pkg/apis/manager/health"
"${GOBIN}/buf" generate
popd
pushd "${ROOT_DIR}/pkg/apis/manager/v1beta1"
"${GOBIN}/buf" generate
popd

View File

@ -15,7 +15,7 @@ data:
spec:
containers:
- name: training-container
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.17.0
command:
- "python3"
- "/opt/pytorch-mnist/mnist.py"
@ -33,7 +33,7 @@ data:
spec:
containers:
- name: training-container
image: docker.io/kubeflowkatib/enas-cnn-cifar10-cpu:latest
image: docker.io/kubeflowkatib/enas-cnn-cifar10-cpu:v0.17.0
command:
- python3
- -u
@ -54,7 +54,7 @@ data:
spec:
containers:
- name: pytorch
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.17.0
command:
- "python3"
- "/opt/pytorch-mnist/mnist.py"
@ -68,7 +68,7 @@ data:
spec:
containers:
- name: pytorch
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.17.0
command:
- "python3"
- "/opt/pytorch-mnist/mnist.py"

View File

@ -14,40 +14,40 @@ init:
runtime:
metricsCollectors:
- kind: StdOut
image: docker.io/kubeflowkatib/file-metrics-collector:latest
image: docker.io/kubeflowkatib/file-metrics-collector:v0.17.0
- kind: File
image: docker.io/kubeflowkatib/file-metrics-collector:latest
image: docker.io/kubeflowkatib/file-metrics-collector:v0.17.0
- kind: TensorFlowEvent
image: docker.io/kubeflowkatib/tfevent-metrics-collector:latest
image: docker.io/kubeflowkatib/tfevent-metrics-collector:v0.17.0
resources:
limits:
memory: 1Gi
suggestions:
- algorithmName: random
image: docker.io/kubeflowkatib/suggestion-hyperopt:latest
image: docker.io/kubeflowkatib/suggestion-hyperopt:v0.17.0
- algorithmName: tpe
image: docker.io/kubeflowkatib/suggestion-hyperopt:latest
image: docker.io/kubeflowkatib/suggestion-hyperopt:v0.17.0
- algorithmName: grid
image: docker.io/kubeflowkatib/suggestion-optuna:latest
image: docker.io/kubeflowkatib/suggestion-optuna:v0.17.0
- algorithmName: hyperband
image: docker.io/kubeflowkatib/suggestion-hyperband:latest
image: docker.io/kubeflowkatib/suggestion-hyperband:v0.17.0
- algorithmName: bayesianoptimization
image: docker.io/kubeflowkatib/suggestion-skopt:latest
image: docker.io/kubeflowkatib/suggestion-skopt:v0.17.0
- algorithmName: cmaes
image: docker.io/kubeflowkatib/suggestion-goptuna:latest
image: docker.io/kubeflowkatib/suggestion-goptuna:v0.17.0
- algorithmName: sobol
image: docker.io/kubeflowkatib/suggestion-goptuna:latest
image: docker.io/kubeflowkatib/suggestion-goptuna:v0.17.0
- algorithmName: multivariate-tpe
image: docker.io/kubeflowkatib/suggestion-optuna:latest
image: docker.io/kubeflowkatib/suggestion-optuna:v0.17.0
- algorithmName: enas
image: docker.io/kubeflowkatib/suggestion-enas:latest
image: docker.io/kubeflowkatib/suggestion-enas:v0.17.0
resources:
limits:
memory: 400Mi
- algorithmName: darts
image: docker.io/kubeflowkatib/suggestion-darts:latest
image: docker.io/kubeflowkatib/suggestion-darts:v0.17.0
- algorithmName: pbt
image: docker.io/kubeflowkatib/suggestion-pbt:latest
image: docker.io/kubeflowkatib/suggestion-pbt:v0.17.0
persistentVolumeClaimSpec:
accessModes:
- ReadWriteMany
@ -56,4 +56,4 @@ runtime:
storage: 5Gi
earlyStoppings:
- algorithmName: medianstop
image: docker.io/kubeflowkatib/earlystopping-medianstop:latest
image: docker.io/kubeflowkatib/earlystopping-medianstop:v0.17.0

View File

@ -22,13 +22,13 @@ resources:
images:
- name: docker.io/kubeflowkatib/katib-controller
newName: docker.io/kubeflowkatib/katib-controller
newTag: latest
newTag: v0.17.0
- name: docker.io/kubeflowkatib/katib-db-manager
newName: docker.io/kubeflowkatib/katib-db-manager
newTag: latest
newTag: v0.17.0
- name: docker.io/kubeflowkatib/katib-ui
newName: docker.io/kubeflowkatib/katib-ui
newTag: latest
newTag: v0.17.0
patchesStrategicMerge:
- patches/katib-cert-injection.yaml

View File

@ -16,40 +16,40 @@ init:
runtime:
metricsCollectors:
- kind: StdOut
image: docker.io/kubeflowkatib/file-metrics-collector:latest
image: docker.io/kubeflowkatib/file-metrics-collector:v0.17.0
- kind: File
image: docker.io/kubeflowkatib/file-metrics-collector:latest
image: docker.io/kubeflowkatib/file-metrics-collector:v0.17.0
- kind: TensorFlowEvent
image: docker.io/kubeflowkatib/tfevent-metrics-collector:latest
image: docker.io/kubeflowkatib/tfevent-metrics-collector:v0.17.0
resources:
limits:
memory: 1Gi
suggestions:
- algorithmName: random
image: docker.io/kubeflowkatib/suggestion-hyperopt:latest
image: docker.io/kubeflowkatib/suggestion-hyperopt:v0.17.0
- algorithmName: tpe
image: docker.io/kubeflowkatib/suggestion-hyperopt:latest
image: docker.io/kubeflowkatib/suggestion-hyperopt:v0.17.0
- algorithmName: grid
image: docker.io/kubeflowkatib/suggestion-optuna:latest
image: docker.io/kubeflowkatib/suggestion-optuna:v0.17.0
- algorithmName: hyperband
image: docker.io/kubeflowkatib/suggestion-hyperband:latest
image: docker.io/kubeflowkatib/suggestion-hyperband:v0.17.0
- algorithmName: bayesianoptimization
image: docker.io/kubeflowkatib/suggestion-skopt:latest
image: docker.io/kubeflowkatib/suggestion-skopt:v0.17.0
- algorithmName: cmaes
image: docker.io/kubeflowkatib/suggestion-goptuna:latest
image: docker.io/kubeflowkatib/suggestion-goptuna:v0.17.0
- algorithmName: sobol
image: docker.io/kubeflowkatib/suggestion-goptuna:latest
image: docker.io/kubeflowkatib/suggestion-goptuna:v0.17.0
- algorithmName: multivariate-tpe
image: docker.io/kubeflowkatib/suggestion-optuna:latest
image: docker.io/kubeflowkatib/suggestion-optuna:v0.17.0
- algorithmName: enas
image: docker.io/kubeflowkatib/suggestion-enas:latest
image: docker.io/kubeflowkatib/suggestion-enas:v0.17.0
resources:
limits:
memory: 400Mi
- algorithmName: darts
image: docker.io/kubeflowkatib/suggestion-darts:latest
image: docker.io/kubeflowkatib/suggestion-darts:v0.17.0
- algorithmName: pbt
image: docker.io/kubeflowkatib/suggestion-pbt:latest
image: docker.io/kubeflowkatib/suggestion-pbt:v0.17.0
persistentVolumeClaimSpec:
accessModes:
- ReadWriteMany
@ -58,4 +58,4 @@ runtime:
storage: 5Gi
earlyStoppings:
- algorithmName: medianstop
image: docker.io/kubeflowkatib/earlystopping-medianstop:latest
image: docker.io/kubeflowkatib/earlystopping-medianstop:v0.17.0

View File

@ -18,13 +18,13 @@ resources:
images:
- name: docker.io/kubeflowkatib/katib-controller
newName: docker.io/kubeflowkatib/katib-controller
newTag: latest
newTag: v0.17.0
- name: docker.io/kubeflowkatib/katib-db-manager
newName: docker.io/kubeflowkatib/katib-db-manager
newTag: latest
newTag: v0.17.0
- name: docker.io/kubeflowkatib/katib-ui
newName: docker.io/kubeflowkatib/katib-ui
newTag: latest
newTag: v0.17.0
patchesStrategicMerge:
- patches/db-manager.yaml
# Modify katib-mysql-secrets with parameters for the DB.

View File

@ -17,40 +17,40 @@ init:
runtime:
metricsCollectors:
- kind: StdOut
image: docker.io/kubeflowkatib/file-metrics-collector:latest
image: docker.io/kubeflowkatib/file-metrics-collector:v0.17.0
- kind: File
image: docker.io/kubeflowkatib/file-metrics-collector:latest
image: docker.io/kubeflowkatib/file-metrics-collector:v0.17.0
- kind: TensorFlowEvent
image: docker.io/kubeflowkatib/tfevent-metrics-collector:latest
image: docker.io/kubeflowkatib/tfevent-metrics-collector:v0.17.0
resources:
limits:
memory: 1Gi
suggestions:
- algorithmName: random
image: docker.io/kubeflowkatib/suggestion-hyperopt:latest
image: docker.io/kubeflowkatib/suggestion-hyperopt:v0.17.0
- algorithmName: tpe
image: docker.io/kubeflowkatib/suggestion-hyperopt:latest
image: docker.io/kubeflowkatib/suggestion-hyperopt:v0.17.0
- algorithmName: grid
image: docker.io/kubeflowkatib/suggestion-optuna:latest
image: docker.io/kubeflowkatib/suggestion-optuna:v0.17.0
- algorithmName: hyperband
image: docker.io/kubeflowkatib/suggestion-hyperband:latest
image: docker.io/kubeflowkatib/suggestion-hyperband:v0.17.0
- algorithmName: bayesianoptimization
image: docker.io/kubeflowkatib/suggestion-skopt:latest
image: docker.io/kubeflowkatib/suggestion-skopt:v0.17.0
- algorithmName: cmaes
image: docker.io/kubeflowkatib/suggestion-goptuna:latest
image: docker.io/kubeflowkatib/suggestion-goptuna:v0.17.0
- algorithmName: sobol
image: docker.io/kubeflowkatib/suggestion-goptuna:latest
image: docker.io/kubeflowkatib/suggestion-goptuna:v0.17.0
- algorithmName: multivariate-tpe
image: docker.io/kubeflowkatib/suggestion-optuna:latest
image: docker.io/kubeflowkatib/suggestion-optuna:v0.17.0
- algorithmName: enas
image: docker.io/kubeflowkatib/suggestion-enas:latest
image: docker.io/kubeflowkatib/suggestion-enas:v0.17.0
resources:
limits:
memory: 400Mi
- algorithmName: darts
image: docker.io/kubeflowkatib/suggestion-darts:latest
image: docker.io/kubeflowkatib/suggestion-darts:v0.17.0
- algorithmName: pbt
image: docker.io/kubeflowkatib/suggestion-pbt:latest
image: docker.io/kubeflowkatib/suggestion-pbt:v0.17.0
persistentVolumeClaimSpec:
accessModes:
- ReadWriteMany
@ -59,4 +59,4 @@ runtime:
storage: 5Gi
earlyStoppings:
- algorithmName: medianstop
image: docker.io/kubeflowkatib/earlystopping-medianstop:latest
image: docker.io/kubeflowkatib/earlystopping-medianstop:v0.17.0

View File

@ -14,40 +14,40 @@ init:
runtime:
metricsCollectors:
- kind: StdOut
image: docker.io/kubeflowkatib/file-metrics-collector:latest
image: docker.io/kubeflowkatib/file-metrics-collector:v0.17.0
- kind: File
image: docker.io/kubeflowkatib/file-metrics-collector:latest
image: docker.io/kubeflowkatib/file-metrics-collector:v0.17.0
- kind: TensorFlowEvent
image: docker.io/kubeflowkatib/tfevent-metrics-collector:latest
image: docker.io/kubeflowkatib/tfevent-metrics-collector:v0.17.0
resources:
limits:
memory: 1Gi
suggestions:
- algorithmName: random
image: docker.io/kubeflowkatib/suggestion-hyperopt:latest
image: docker.io/kubeflowkatib/suggestion-hyperopt:v0.17.0
- algorithmName: tpe
image: docker.io/kubeflowkatib/suggestion-hyperopt:latest
image: docker.io/kubeflowkatib/suggestion-hyperopt:v0.17.0
- algorithmName: grid
image: docker.io/kubeflowkatib/suggestion-optuna:latest
image: docker.io/kubeflowkatib/suggestion-optuna:v0.17.0
- algorithmName: hyperband
image: docker.io/kubeflowkatib/suggestion-hyperband:latest
image: docker.io/kubeflowkatib/suggestion-hyperband:v0.17.0
- algorithmName: bayesianoptimization
image: docker.io/kubeflowkatib/suggestion-skopt:latest
image: docker.io/kubeflowkatib/suggestion-skopt:v0.17.0
- algorithmName: cmaes
image: docker.io/kubeflowkatib/suggestion-goptuna:latest
image: docker.io/kubeflowkatib/suggestion-goptuna:v0.17.0
- algorithmName: sobol
image: docker.io/kubeflowkatib/suggestion-goptuna:latest
image: docker.io/kubeflowkatib/suggestion-goptuna:v0.17.0
- algorithmName: multivariate-tpe
image: docker.io/kubeflowkatib/suggestion-optuna:latest
image: docker.io/kubeflowkatib/suggestion-optuna:v0.17.0
- algorithmName: enas
image: docker.io/kubeflowkatib/suggestion-enas:latest
image: docker.io/kubeflowkatib/suggestion-enas:v0.17.0
resources:
limits:
memory: 400Mi
- algorithmName: darts
image: docker.io/kubeflowkatib/suggestion-darts:latest
image: docker.io/kubeflowkatib/suggestion-darts:v0.17.0
- algorithmName: pbt
image: docker.io/kubeflowkatib/suggestion-pbt:latest
image: docker.io/kubeflowkatib/suggestion-pbt:v0.17.0
persistentVolumeClaimSpec:
accessModes:
- ReadWriteMany
@ -56,4 +56,4 @@ runtime:
storage: 5Gi
earlyStoppings:
- algorithmName: medianstop
image: docker.io/kubeflowkatib/earlystopping-medianstop:latest
image: docker.io/kubeflowkatib/earlystopping-medianstop:v0.17.0

View File

@ -30,13 +30,13 @@ resources:
images:
- name: docker.io/kubeflowkatib/katib-controller
newName: docker.io/kubeflowkatib/katib-controller
newTag: latest
newTag: v0.17.0
- name: docker.io/kubeflowkatib/katib-db-manager
newName: docker.io/kubeflowkatib/katib-db-manager
newTag: latest
newTag: v0.17.0
- name: docker.io/kubeflowkatib/katib-ui
newName: docker.io/kubeflowkatib/katib-ui
newTag: latest
newTag: v0.17.0
patchesJson6902:
# Annotate Service to delegate TLS-secret generation to OpenShift service controller

View File

@ -16,40 +16,40 @@ init:
runtime:
metricsCollectors:
- kind: StdOut
image: docker.io/kubeflowkatib/file-metrics-collector:latest
image: docker.io/kubeflowkatib/file-metrics-collector:v0.17.0
- kind: File
image: docker.io/kubeflowkatib/file-metrics-collector:latest
image: docker.io/kubeflowkatib/file-metrics-collector:v0.17.0
- kind: TensorFlowEvent
image: docker.io/kubeflowkatib/tfevent-metrics-collector:latest
image: docker.io/kubeflowkatib/tfevent-metrics-collector:v0.17.0
resources:
limits:
memory: 1Gi
suggestions:
- algorithmName: random
image: docker.io/kubeflowkatib/suggestion-hyperopt:latest
image: docker.io/kubeflowkatib/suggestion-hyperopt:v0.17.0
- algorithmName: tpe
image: docker.io/kubeflowkatib/suggestion-hyperopt:latest
image: docker.io/kubeflowkatib/suggestion-hyperopt:v0.17.0
- algorithmName: grid
image: docker.io/kubeflowkatib/suggestion-optuna:latest
image: docker.io/kubeflowkatib/suggestion-optuna:v0.17.0
- algorithmName: hyperband
image: docker.io/kubeflowkatib/suggestion-hyperband:latest
image: docker.io/kubeflowkatib/suggestion-hyperband:v0.17.0
- algorithmName: bayesianoptimization
image: docker.io/kubeflowkatib/suggestion-skopt:latest
image: docker.io/kubeflowkatib/suggestion-skopt:v0.17.0
- algorithmName: cmaes
image: docker.io/kubeflowkatib/suggestion-goptuna:latest
image: docker.io/kubeflowkatib/suggestion-goptuna:v0.17.0
- algorithmName: sobol
image: docker.io/kubeflowkatib/suggestion-goptuna:latest
image: docker.io/kubeflowkatib/suggestion-goptuna:v0.17.0
- algorithmName: multivariate-tpe
image: docker.io/kubeflowkatib/suggestion-optuna:latest
image: docker.io/kubeflowkatib/suggestion-optuna:v0.17.0
- algorithmName: enas
image: docker.io/kubeflowkatib/suggestion-enas:latest
image: docker.io/kubeflowkatib/suggestion-enas:v0.17.0
resources:
limits:
memory: 400Mi
- algorithmName: darts
image: docker.io/kubeflowkatib/suggestion-darts:latest
image: docker.io/kubeflowkatib/suggestion-darts:v0.17.0
- algorithmName: pbt
image: docker.io/kubeflowkatib/suggestion-pbt:latest
image: docker.io/kubeflowkatib/suggestion-pbt:v0.17.0
persistentVolumeClaimSpec:
accessModes:
- ReadWriteMany
@ -58,4 +58,4 @@ runtime:
storage: 5Gi
earlyStoppings:
- algorithmName: medianstop
image: docker.io/kubeflowkatib/earlystopping-medianstop:latest
image: docker.io/kubeflowkatib/earlystopping-medianstop:v0.17.0

View File

@ -20,13 +20,13 @@ resources:
images:
- name: docker.io/kubeflowkatib/katib-controller
newName: docker.io/kubeflowkatib/katib-controller
newTag: latest
newTag: v0.17.0
- name: docker.io/kubeflowkatib/katib-db-manager
newName: docker.io/kubeflowkatib/katib-db-manager
newTag: latest
newTag: v0.17.0
- name: docker.io/kubeflowkatib/katib-ui
newName: docker.io/kubeflowkatib/katib-ui
newTag: latest
newTag: v0.17.0
patchesJson6902:
- target:
group: apps

View File

@ -16,40 +16,40 @@ init:
runtime:
metricsCollectors:
- kind: StdOut
image: docker.io/kubeflowkatib/file-metrics-collector:latest
image: docker.io/kubeflowkatib/file-metrics-collector:v0.17.0
- kind: File
image: docker.io/kubeflowkatib/file-metrics-collector:latest
image: docker.io/kubeflowkatib/file-metrics-collector:v0.17.0
- kind: TensorFlowEvent
image: docker.io/kubeflowkatib/tfevent-metrics-collector:latest
image: docker.io/kubeflowkatib/tfevent-metrics-collector:v0.17.0
resources:
limits:
memory: 1Gi
suggestions:
- algorithmName: random
image: docker.io/kubeflowkatib/suggestion-hyperopt:latest
image: docker.io/kubeflowkatib/suggestion-hyperopt:v0.17.0
- algorithmName: tpe
image: docker.io/kubeflowkatib/suggestion-hyperopt:latest
image: docker.io/kubeflowkatib/suggestion-hyperopt:v0.17.0
- algorithmName: grid
image: docker.io/kubeflowkatib/suggestion-optuna:latest
image: docker.io/kubeflowkatib/suggestion-optuna:v0.17.0
- algorithmName: hyperband
image: docker.io/kubeflowkatib/suggestion-hyperband:latest
image: docker.io/kubeflowkatib/suggestion-hyperband:v0.17.0
- algorithmName: bayesianoptimization
image: docker.io/kubeflowkatib/suggestion-skopt:latest
image: docker.io/kubeflowkatib/suggestion-skopt:v0.17.0
- algorithmName: cmaes
image: docker.io/kubeflowkatib/suggestion-goptuna:latest
image: docker.io/kubeflowkatib/suggestion-goptuna:v0.17.0
- algorithmName: sobol
image: docker.io/kubeflowkatib/suggestion-goptuna:latest
image: docker.io/kubeflowkatib/suggestion-goptuna:v0.17.0
- algorithmName: multivariate-tpe
image: docker.io/kubeflowkatib/suggestion-optuna:latest
image: docker.io/kubeflowkatib/suggestion-optuna:v0.17.0
- algorithmName: enas
image: docker.io/kubeflowkatib/suggestion-enas:latest
image: docker.io/kubeflowkatib/suggestion-enas:v0.17.0
resources:
limits:
memory: 400Mi
- algorithmName: darts
image: docker.io/kubeflowkatib/suggestion-darts:latest
image: docker.io/kubeflowkatib/suggestion-darts:v0.17.0
- algorithmName: pbt
image: docker.io/kubeflowkatib/suggestion-pbt:latest
image: docker.io/kubeflowkatib/suggestion-pbt:v0.17.0
persistentVolumeClaimSpec:
accessModes:
- ReadWriteMany
@ -58,4 +58,4 @@ runtime:
storage: 5Gi
earlyStoppings:
- algorithmName: medianstop
image: docker.io/kubeflowkatib/earlystopping-medianstop:latest
image: docker.io/kubeflowkatib/earlystopping-medianstop:v0.17.0

View File

@ -20,13 +20,13 @@ resources:
images:
- name: docker.io/kubeflowkatib/katib-controller
newName: docker.io/kubeflowkatib/katib-controller
newTag: latest
newTag: v0.17.0
- name: docker.io/kubeflowkatib/katib-db-manager
newName: docker.io/kubeflowkatib/katib-db-manager
newTag: latest
newTag: v0.17.0
- name: docker.io/kubeflowkatib/katib-ui
newName: docker.io/kubeflowkatib/katib-ui
newTag: latest
newTag: v0.17.0
configMapGenerator:
- name: katib-config
behavior: create

View File

@ -11,13 +11,13 @@ resources:
images:
- name: docker.io/kubeflowkatib/katib-controller
newName: docker.io/kubeflowkatib/katib-controller
newTag: latest
newTag: v0.17.0
- name: docker.io/kubeflowkatib/katib-db-manager
newName: docker.io/kubeflowkatib/katib-db-manager
newTag: latest
newTag: v0.17.0
- name: docker.io/kubeflowkatib/katib-ui
newName: docker.io/kubeflowkatib/katib-ui
newTag: latest
newTag: v0.17.0
patchesStrategicMerge:
- patches/remove-namespace.yaml

View File

@ -0,0 +1,21 @@
version: v2
plugins:
- remote: buf.build/protocolbuffers/go:v1.33.0
out: .
opt: module=github.com/kubeflow/katib/pkg/apis/manager/health
- remote: buf.build/grpc/go:v1.3.0
out: .
opt: module=github.com/kubeflow/katib/pkg/apis/manager/health,require_unimplemented_servers=false
- remote: buf.build/protocolbuffers/python:v26.1
out: python
- remote: buf.build/protocolbuffers/pyi:v26.1
out: python
- remote: buf.build/grpc/python:v1.64.1
out: python
inputs:
- directory: .

View File

@ -1,24 +0,0 @@
#!/usr/bin/env bash
# Copyright 2022 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -x
set -e
cd "$(dirname "$0")"
proto="health.proto"
docker run -i --rm -v "$PWD:$PWD" -w "$PWD" znly/protoc --python_out=plugins=grpc:./python --go_out=plugins=grpc:. -I. $proto
docker run -i --rm -v "$PWD:$PWD" -w "$PWD" znly/protoc --plugin=protoc-gen-grpc=/usr/bin/grpc_python_plugin --python_out=./python --grpc_out=./python -I. $proto

View File

@ -1,37 +1,24 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc (unknown)
// source: health.proto
/*
Package grpc_health_v1 is a generated protocol buffer package.
It is generated from these files:
health.proto
It has these top-level messages:
HealthCheckRequest
HealthCheckResponse
*/
package grpc_health_v1
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type HealthCheckResponse_ServingStatus int32
@ -41,149 +28,250 @@ const (
HealthCheckResponse_NOT_SERVING HealthCheckResponse_ServingStatus = 2
)
var HealthCheckResponse_ServingStatus_name = map[int32]string{
// Enum value maps for HealthCheckResponse_ServingStatus.
var (
HealthCheckResponse_ServingStatus_name = map[int32]string{
0: "UNKNOWN",
1: "SERVING",
2: "NOT_SERVING",
}
var HealthCheckResponse_ServingStatus_value = map[string]int32{
HealthCheckResponse_ServingStatus_value = map[string]int32{
"UNKNOWN": 0,
"SERVING": 1,
"NOT_SERVING": 2,
}
)
func (x HealthCheckResponse_ServingStatus) Enum() *HealthCheckResponse_ServingStatus {
p := new(HealthCheckResponse_ServingStatus)
*p = x
return p
}
func (x HealthCheckResponse_ServingStatus) String() string {
return proto.EnumName(HealthCheckResponse_ServingStatus_name, int32(x))
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (HealthCheckResponse_ServingStatus) Descriptor() protoreflect.EnumDescriptor {
return file_health_proto_enumTypes[0].Descriptor()
}
func (HealthCheckResponse_ServingStatus) Type() protoreflect.EnumType {
return &file_health_proto_enumTypes[0]
}
func (x HealthCheckResponse_ServingStatus) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use HealthCheckResponse_ServingStatus.Descriptor instead.
func (HealthCheckResponse_ServingStatus) EnumDescriptor() ([]byte, []int) {
return fileDescriptor0, []int{1, 0}
return file_health_proto_rawDescGZIP(), []int{1, 0}
}
type HealthCheckRequest struct {
Service string `protobuf:"bytes,1,opt,name=service" json:"service,omitempty"`
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
}
func (m *HealthCheckRequest) Reset() { *m = HealthCheckRequest{} }
func (m *HealthCheckRequest) String() string { return proto.CompactTextString(m) }
func (*HealthCheckRequest) ProtoMessage() {}
func (*HealthCheckRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (x *HealthCheckRequest) Reset() {
*x = HealthCheckRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_health_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (m *HealthCheckRequest) GetService() string {
if m != nil {
return m.Service
func (x *HealthCheckRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*HealthCheckRequest) ProtoMessage() {}
func (x *HealthCheckRequest) ProtoReflect() protoreflect.Message {
mi := &file_health_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use HealthCheckRequest.ProtoReflect.Descriptor instead.
func (*HealthCheckRequest) Descriptor() ([]byte, []int) {
return file_health_proto_rawDescGZIP(), []int{0}
}
func (x *HealthCheckRequest) GetService() string {
if x != nil {
return x.Service
}
return ""
}
type HealthCheckResponse struct {
Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,enum=grpc.health.v1.HealthCheckResponse_ServingStatus" json:"status,omitempty"`
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,proto3,enum=grpc.health.v1.HealthCheckResponse_ServingStatus" json:"status,omitempty"`
}
func (m *HealthCheckResponse) Reset() { *m = HealthCheckResponse{} }
func (m *HealthCheckResponse) String() string { return proto.CompactTextString(m) }
func (*HealthCheckResponse) ProtoMessage() {}
func (*HealthCheckResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
func (x *HealthCheckResponse) Reset() {
*x = HealthCheckResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_health_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (m *HealthCheckResponse) GetStatus() HealthCheckResponse_ServingStatus {
if m != nil {
return m.Status
func (x *HealthCheckResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*HealthCheckResponse) ProtoMessage() {}
func (x *HealthCheckResponse) ProtoReflect() protoreflect.Message {
mi := &file_health_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use HealthCheckResponse.ProtoReflect.Descriptor instead.
func (*HealthCheckResponse) Descriptor() ([]byte, []int) {
return file_health_proto_rawDescGZIP(), []int{1}
}
func (x *HealthCheckResponse) GetStatus() HealthCheckResponse_ServingStatus {
if x != nil {
return x.Status
}
return HealthCheckResponse_UNKNOWN
}
func init() {
proto.RegisterType((*HealthCheckRequest)(nil), "grpc.health.v1.HealthCheckRequest")
proto.RegisterType((*HealthCheckResponse)(nil), "grpc.health.v1.HealthCheckResponse")
proto.RegisterEnum("grpc.health.v1.HealthCheckResponse_ServingStatus", HealthCheckResponse_ServingStatus_name, HealthCheckResponse_ServingStatus_value)
var File_health_proto protoreflect.FileDescriptor
var file_health_proto_rawDesc = []byte{
0x0a, 0x0c, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e,
0x67, 0x72, 0x70, 0x63, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x22, 0x2e,
0x0a, 0x12, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x9c,
0x01, 0x0a, 0x13, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x68, 0x65,
0x61, 0x6c, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68,
0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76,
0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75,
0x73, 0x22, 0x3a, 0x0a, 0x0d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74,
0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12,
0x0b, 0x0a, 0x07, 0x53, 0x45, 0x52, 0x56, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b,
0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x32, 0x5a, 0x0a,
0x06, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x12, 0x50, 0x0a, 0x05, 0x43, 0x68, 0x65, 0x63, 0x6b,
0x12, 0x22, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x2e, 0x76,
0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x68, 0x65, 0x61, 0x6c,
0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63,
0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x42, 0x5a, 0x40, 0x67, 0x69, 0x74,
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x66, 0x6c, 0x6f, 0x77,
0x2f, 0x6b, 0x61, 0x74, 0x69, 0x62, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f,
0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x3b, 0x67,
0x72, 0x70, 0x63, 0x5f, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
var (
file_health_proto_rawDescOnce sync.Once
file_health_proto_rawDescData = file_health_proto_rawDesc
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// Client API for Health service
type HealthClient interface {
Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error)
func file_health_proto_rawDescGZIP() []byte {
file_health_proto_rawDescOnce.Do(func() {
file_health_proto_rawDescData = protoimpl.X.CompressGZIP(file_health_proto_rawDescData)
})
return file_health_proto_rawDescData
}
type healthClient struct {
cc *grpc.ClientConn
var file_health_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_health_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_health_proto_goTypes = []interface{}{
(HealthCheckResponse_ServingStatus)(0), // 0: grpc.health.v1.HealthCheckResponse.ServingStatus
(*HealthCheckRequest)(nil), // 1: grpc.health.v1.HealthCheckRequest
(*HealthCheckResponse)(nil), // 2: grpc.health.v1.HealthCheckResponse
}
var file_health_proto_depIdxs = []int32{
0, // 0: grpc.health.v1.HealthCheckResponse.status:type_name -> grpc.health.v1.HealthCheckResponse.ServingStatus
1, // 1: grpc.health.v1.Health.Check:input_type -> grpc.health.v1.HealthCheckRequest
2, // 2: grpc.health.v1.Health.Check:output_type -> grpc.health.v1.HealthCheckResponse
2, // [2:3] is the sub-list for method output_type
1, // [1:2] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func NewHealthClient(cc *grpc.ClientConn) HealthClient {
return &healthClient{cc}
func init() { file_health_proto_init() }
func file_health_proto_init() {
if File_health_proto != nil {
return
}
func (c *healthClient) Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) {
out := new(HealthCheckResponse)
err := grpc.Invoke(ctx, "/grpc.health.v1.Health/Check", in, out, c.cc, opts...)
if err != nil {
return nil, err
if !protoimpl.UnsafeEnabled {
file_health_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*HealthCheckRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
return out, nil
}
// Server API for Health service
type HealthServer interface {
Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)
file_health_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*HealthCheckResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
func RegisterHealthServer(s *grpc.Server, srv HealthServer) {
s.RegisterService(&_Health_serviceDesc, srv)
}
func _Health_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(HealthCheckRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(HealthServer).Check(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/grpc.health.v1.Health/Check",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(HealthServer).Check(ctx, req.(*HealthCheckRequest))
}
return interceptor(ctx, in, info, handler)
}
var _Health_serviceDesc = grpc.ServiceDesc{
ServiceName: "grpc.health.v1.Health",
HandlerType: (*HealthServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Check",
Handler: _Health_Check_Handler,
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_health_proto_rawDesc,
NumEnums: 1,
NumMessages: 2,
NumExtensions: 0,
NumServices: 1,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "health.proto",
}
func init() { proto.RegisterFile("health.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 204 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xc9, 0x48, 0x4d, 0xcc,
0x29, 0xc9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4b, 0x2f, 0x2a, 0x48, 0xd6, 0x83,
0x0a, 0x95, 0x19, 0x2a, 0xe9, 0x71, 0x09, 0x79, 0x80, 0x39, 0xce, 0x19, 0xa9, 0xc9, 0xd9, 0x41,
0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x42, 0x12, 0x5c, 0xec, 0xc5, 0xa9, 0x45, 0x65, 0x99, 0xc9,
0xa9, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x30, 0xae, 0xd2, 0x1c, 0x46, 0x2e, 0x61, 0x14,
0x0d, 0xc5, 0x05, 0xf9, 0x79, 0xc5, 0xa9, 0x42, 0x9e, 0x5c, 0x6c, 0xc5, 0x25, 0x89, 0x25, 0xa5,
0xc5, 0x60, 0x0d, 0x7c, 0x46, 0x86, 0x7a, 0xa8, 0x16, 0xe9, 0x61, 0xd1, 0xa4, 0x17, 0x0c, 0x32,
0x34, 0x2f, 0x3d, 0x18, 0xac, 0x31, 0x08, 0x6a, 0x80, 0x92, 0x15, 0x17, 0x2f, 0x8a, 0x84, 0x10,
0x37, 0x17, 0x7b, 0xa8, 0x9f, 0xb7, 0x9f, 0x7f, 0xb8, 0x9f, 0x00, 0x03, 0x88, 0x13, 0xec, 0x1a,
0x14, 0xe6, 0xe9, 0xe7, 0x2e, 0xc0, 0x28, 0xc4, 0xcf, 0xc5, 0xed, 0xe7, 0x1f, 0x12, 0x0f, 0x13,
0x60, 0x32, 0x8a, 0xe2, 0x62, 0x83, 0x58, 0x24, 0x14, 0xc0, 0xc5, 0x0a, 0xb6, 0x4c, 0x48, 0x09,
0xaf, 0x4b, 0xc0, 0xfe, 0x95, 0x52, 0x26, 0xc2, 0xb5, 0x49, 0x6c, 0xe0, 0x10, 0x34, 0x06, 0x04,
0x00, 0x00, 0xff, 0xff, 0xac, 0x56, 0x2a, 0xcb, 0x51, 0x01, 0x00, 0x00,
GoTypes: file_health_proto_goTypes,
DependencyIndexes: file_health_proto_depIdxs,
EnumInfos: file_health_proto_enumTypes,
MessageInfos: file_health_proto_msgTypes,
}.Build()
File_health_proto = out.File
file_health_proto_rawDesc = nil
file_health_proto_goTypes = nil
file_health_proto_depIdxs = nil
}

View File

@ -2,6 +2,8 @@ syntax = "proto3";
package grpc.health.v1;
option go_package = "github.com/kubeflow/katib/pkg/apis/manager/health;grpc_health_v1";
service Health {
rpc Check(HealthCheckRequest) returns (HealthCheckResponse);
}

View File

@ -0,0 +1,107 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: health.proto
package grpc_health_v1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
Health_Check_FullMethodName = "/grpc.health.v1.Health/Check"
)
// HealthClient is the client API for Health service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type HealthClient interface {
Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error)
}
type healthClient struct {
cc grpc.ClientConnInterface
}
func NewHealthClient(cc grpc.ClientConnInterface) HealthClient {
return &healthClient{cc}
}
func (c *healthClient) Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) {
out := new(HealthCheckResponse)
err := c.cc.Invoke(ctx, Health_Check_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// HealthServer is the server API for Health service.
// All implementations should embed UnimplementedHealthServer
// for forward compatibility
type HealthServer interface {
Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)
}
// UnimplementedHealthServer should be embedded to have forward compatible implementations.
type UnimplementedHealthServer struct {
}
func (UnimplementedHealthServer) Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Check not implemented")
}
// UnsafeHealthServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to HealthServer will
// result in compilation errors.
type UnsafeHealthServer interface {
mustEmbedUnimplementedHealthServer()
}
func RegisterHealthServer(s grpc.ServiceRegistrar, srv HealthServer) {
s.RegisterService(&Health_ServiceDesc, srv)
}
func _Health_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(HealthCheckRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(HealthServer).Check(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Health_Check_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(HealthServer).Check(ctx, req.(*HealthCheckRequest))
}
return interceptor(ctx, in, info, handler)
}
// Health_ServiceDesc is the grpc.ServiceDesc for Health service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Health_ServiceDesc = grpc.ServiceDesc{
ServiceName: "grpc.health.v1.Health",
HandlerType: (*HealthServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Check",
Handler: _Health_Check_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "health.proto",
}

View File

@ -1,13 +1,12 @@
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: health.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
# Protobuf Python Version: 5.26.1
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import descriptor_pb2
from google.protobuf.internal import builder as _builder
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
@ -15,266 +14,20 @@ _sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='health.proto',
package='grpc.health.v1',
syntax='proto3',
serialized_pb=_b('\n\x0chealth.proto\x12\x0egrpc.health.v1\"%\n\x12HealthCheckRequest\x12\x0f\n\x07service\x18\x01 \x01(\t\"\x94\x01\n\x13HealthCheckResponse\x12\x41\n\x06status\x18\x01 \x01(\x0e\x32\x31.grpc.health.v1.HealthCheckResponse.ServingStatus\":\n\rServingStatus\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07SERVING\x10\x01\x12\x0f\n\x0bNOT_SERVING\x10\x02\x32Z\n\x06Health\x12P\n\x05\x43heck\x12\".grpc.health.v1.HealthCheckRequest\x1a#.grpc.health.v1.HealthCheckResponseb\x06proto3')
)
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0chealth.proto\x12\x0egrpc.health.v1\".\n\x12HealthCheckRequest\x12\x18\n\x07service\x18\x01 \x01(\tR\x07service\"\x9c\x01\n\x13HealthCheckResponse\x12I\n\x06status\x18\x01 \x01(\x0e\x32\x31.grpc.health.v1.HealthCheckResponse.ServingStatusR\x06status\":\n\rServingStatus\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07SERVING\x10\x01\x12\x0f\n\x0bNOT_SERVING\x10\x02\x32Z\n\x06Health\x12P\n\x05\x43heck\x12\".grpc.health.v1.HealthCheckRequest\x1a#.grpc.health.v1.HealthCheckResponseBBZ@github.com/kubeflow/katib/pkg/apis/manager/health;grpc_health_v1b\x06proto3')
_HEALTHCHECKRESPONSE_SERVINGSTATUS = _descriptor.EnumDescriptor(
name='ServingStatus',
full_name='grpc.health.v1.HealthCheckResponse.ServingStatus',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='UNKNOWN', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SERVING', index=1, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='NOT_SERVING', index=2, number=2,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=162,
serialized_end=220,
)
_sym_db.RegisterEnumDescriptor(_HEALTHCHECKRESPONSE_SERVINGSTATUS)
_HEALTHCHECKREQUEST = _descriptor.Descriptor(
name='HealthCheckRequest',
full_name='grpc.health.v1.HealthCheckRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='service', full_name='grpc.health.v1.HealthCheckRequest.service', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=32,
serialized_end=69,
)
_HEALTHCHECKRESPONSE = _descriptor.Descriptor(
name='HealthCheckResponse',
full_name='grpc.health.v1.HealthCheckResponse',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='status', full_name='grpc.health.v1.HealthCheckResponse.status', index=0,
number=1, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
_HEALTHCHECKRESPONSE_SERVINGSTATUS,
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=72,
serialized_end=220,
)
_HEALTHCHECKRESPONSE.fields_by_name['status'].enum_type = _HEALTHCHECKRESPONSE_SERVINGSTATUS
_HEALTHCHECKRESPONSE_SERVINGSTATUS.containing_type = _HEALTHCHECKRESPONSE
DESCRIPTOR.message_types_by_name['HealthCheckRequest'] = _HEALTHCHECKREQUEST
DESCRIPTOR.message_types_by_name['HealthCheckResponse'] = _HEALTHCHECKRESPONSE
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
HealthCheckRequest = _reflection.GeneratedProtocolMessageType('HealthCheckRequest', (_message.Message,), dict(
DESCRIPTOR = _HEALTHCHECKREQUEST,
__module__ = 'health_pb2'
# @@protoc_insertion_point(class_scope:grpc.health.v1.HealthCheckRequest)
))
_sym_db.RegisterMessage(HealthCheckRequest)
HealthCheckResponse = _reflection.GeneratedProtocolMessageType('HealthCheckResponse', (_message.Message,), dict(
DESCRIPTOR = _HEALTHCHECKRESPONSE,
__module__ = 'health_pb2'
# @@protoc_insertion_point(class_scope:grpc.health.v1.HealthCheckResponse)
))
_sym_db.RegisterMessage(HealthCheckResponse)
_HEALTH = _descriptor.ServiceDescriptor(
name='Health',
full_name='grpc.health.v1.Health',
file=DESCRIPTOR,
index=0,
options=None,
serialized_start=222,
serialized_end=312,
methods=[
_descriptor.MethodDescriptor(
name='Check',
full_name='grpc.health.v1.Health.Check',
index=0,
containing_service=None,
input_type=_HEALTHCHECKREQUEST,
output_type=_HEALTHCHECKRESPONSE,
options=None,
),
])
_sym_db.RegisterServiceDescriptor(_HEALTH)
DESCRIPTOR.services_by_name['Health'] = _HEALTH
try:
# THESE ELEMENTS WILL BE DEPRECATED.
# Please use the generated *_pb2_grpc.py files instead.
import grpc
from grpc.beta import implementations as beta_implementations
from grpc.beta import interfaces as beta_interfaces
from grpc.framework.common import cardinality
from grpc.framework.interfaces.face import utilities as face_utilities
class HealthStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.Check = channel.unary_unary(
'/grpc.health.v1.Health/Check',
request_serializer=HealthCheckRequest.SerializeToString,
response_deserializer=HealthCheckResponse.FromString,
)
class HealthServicer(object):
# missing associated documentation comment in .proto file
pass
def Check(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_HealthServicer_to_server(servicer, server):
rpc_method_handlers = {
'Check': grpc.unary_unary_rpc_method_handler(
servicer.Check,
request_deserializer=HealthCheckRequest.FromString,
response_serializer=HealthCheckResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'grpc.health.v1.Health', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
class BetaHealthServicer(object):
"""The Beta API is deprecated for 0.15.0 and later.
It is recommended to use the GA API (classes and functions in this
file not marked beta) for all further purposes. This class was generated
only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0."""
# missing associated documentation comment in .proto file
pass
def Check(self, request, context):
# missing associated documentation comment in .proto file
pass
context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)
class BetaHealthStub(object):
"""The Beta API is deprecated for 0.15.0 and later.
It is recommended to use the GA API (classes and functions in this
file not marked beta) for all further purposes. This class was generated
only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0."""
# missing associated documentation comment in .proto file
pass
def Check(self, request, timeout, metadata=None, with_call=False, protocol_options=None):
# missing associated documentation comment in .proto file
pass
raise NotImplementedError()
Check.future = None
def beta_create_Health_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None):
"""The Beta API is deprecated for 0.15.0 and later.
It is recommended to use the GA API (classes and functions in this
file not marked beta) for all further purposes. This function was
generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
request_deserializers = {
('grpc.health.v1.Health', 'Check'): HealthCheckRequest.FromString,
}
response_serializers = {
('grpc.health.v1.Health', 'Check'): HealthCheckResponse.SerializeToString,
}
method_implementations = {
('grpc.health.v1.Health', 'Check'): face_utilities.unary_unary_inline(servicer.Check),
}
server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout)
return beta_implementations.server(method_implementations, options=server_options)
def beta_create_Health_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None):
"""The Beta API is deprecated for 0.15.0 and later.
It is recommended to use the GA API (classes and functions in this
file not marked beta) for all further purposes. This function was
generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"""
request_serializers = {
('grpc.health.v1.Health', 'Check'): HealthCheckRequest.SerializeToString,
}
response_deserializers = {
('grpc.health.v1.Health', 'Check'): HealthCheckResponse.FromString,
}
cardinalities = {
'Check': cardinality.Cardinality.UNARY_UNARY,
}
stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size)
return beta_implementations.dynamic_stub(channel, 'grpc.health.v1.Health', cardinalities, options=stub_options)
except ImportError:
pass
_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'health_pb2', _globals)
if not _descriptor._USE_C_DESCRIPTORS:
_globals['DESCRIPTOR']._loaded_options = None
_globals['DESCRIPTOR']._serialized_options = b'Z@github.com/kubeflow/katib/pkg/apis/manager/health;grpc_health_v1'
_globals['_HEALTHCHECKREQUEST']._serialized_start=32
_globals['_HEALTHCHECKREQUEST']._serialized_end=78
_globals['_HEALTHCHECKRESPONSE']._serialized_start=81
_globals['_HEALTHCHECKRESPONSE']._serialized_end=237
_globals['_HEALTHCHECKRESPONSE_SERVINGSTATUS']._serialized_start=179
_globals['_HEALTHCHECKRESPONSE_SERVINGSTATUS']._serialized_end=237
_globals['_HEALTH']._serialized_start=239
_globals['_HEALTH']._serialized_end=329
# @@protoc_insertion_point(module_scope)

View File

@ -0,0 +1,26 @@
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
DESCRIPTOR: _descriptor.FileDescriptor
class HealthCheckRequest(_message.Message):
__slots__ = ("service",)
SERVICE_FIELD_NUMBER: _ClassVar[int]
service: str
def __init__(self, service: _Optional[str] = ...) -> None: ...
class HealthCheckResponse(_message.Message):
__slots__ = ("status",)
class ServingStatus(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
__slots__ = ()
UNKNOWN: _ClassVar[HealthCheckResponse.ServingStatus]
SERVING: _ClassVar[HealthCheckResponse.ServingStatus]
NOT_SERVING: _ClassVar[HealthCheckResponse.ServingStatus]
UNKNOWN: HealthCheckResponse.ServingStatus
SERVING: HealthCheckResponse.ServingStatus
NOT_SERVING: HealthCheckResponse.ServingStatus
STATUS_FIELD_NUMBER: _ClassVar[int]
status: HealthCheckResponse.ServingStatus
def __init__(self, status: _Optional[_Union[HealthCheckResponse.ServingStatus, str]] = ...) -> None: ...

View File

@ -1,12 +1,12 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import health_pb2 as health__pb2
class HealthStub(object):
# missing associated documentation comment in .proto file
pass
"""Missing associated documentation comment in .proto file."""
def __init__(self, channel):
"""Constructor.
@ -18,16 +18,14 @@ class HealthStub(object):
'/grpc.health.v1.Health/Check',
request_serializer=health__pb2.HealthCheckRequest.SerializeToString,
response_deserializer=health__pb2.HealthCheckResponse.FromString,
)
_registered_method=True)
class HealthServicer(object):
# missing associated documentation comment in .proto file
pass
"""Missing associated documentation comment in .proto file."""
def Check(self, request, context):
# missing associated documentation comment in .proto file
pass
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
@ -44,3 +42,36 @@ def add_HealthServicer_to_server(servicer, server):
generic_handler = grpc.method_handlers_generic_handler(
'grpc.health.v1.Health', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
server.add_registered_method_handlers('grpc.health.v1.Health', rpc_method_handlers)
# This class is part of an EXPERIMENTAL API.
class Health(object):
"""Missing associated documentation comment in .proto file."""
@staticmethod
def Check(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/grpc.health.v1.Health/Check',
health__pb2.HealthCheckRequest.SerializeToString,
health__pb2.HealthCheckResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,8 @@ syntax = "proto3";
package api.v1.beta1;
option go_package = "github.com/kubeflow/katib/pkg/apis/manager/v1beta1;api_v1_beta1";
/**
* DBManager service defines APIs to manage Katib database.
*/

View File

@ -0,0 +1,489 @@
//*
// Katib GRPC API v1beta1
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: api.proto
package api_v1_beta1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
DBManager_ReportObservationLog_FullMethodName = "/api.v1.beta1.DBManager/ReportObservationLog"
DBManager_GetObservationLog_FullMethodName = "/api.v1.beta1.DBManager/GetObservationLog"
DBManager_DeleteObservationLog_FullMethodName = "/api.v1.beta1.DBManager/DeleteObservationLog"
)
// DBManagerClient is the client API for DBManager service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type DBManagerClient interface {
// *
// Report a log of Observations for a Trial.
// The log consists of timestamp and value of metric.
// Katib store every log of metrics.
// You can see accuracy curve or other metric logs on UI.
ReportObservationLog(ctx context.Context, in *ReportObservationLogRequest, opts ...grpc.CallOption) (*ReportObservationLogReply, error)
// *
// Get all log of Observations for a Trial.
GetObservationLog(ctx context.Context, in *GetObservationLogRequest, opts ...grpc.CallOption) (*GetObservationLogReply, error)
// *
// Delete all log of Observations for a Trial.
DeleteObservationLog(ctx context.Context, in *DeleteObservationLogRequest, opts ...grpc.CallOption) (*DeleteObservationLogReply, error)
}
type dBManagerClient struct {
cc grpc.ClientConnInterface
}
func NewDBManagerClient(cc grpc.ClientConnInterface) DBManagerClient {
return &dBManagerClient{cc}
}
func (c *dBManagerClient) ReportObservationLog(ctx context.Context, in *ReportObservationLogRequest, opts ...grpc.CallOption) (*ReportObservationLogReply, error) {
out := new(ReportObservationLogReply)
err := c.cc.Invoke(ctx, DBManager_ReportObservationLog_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *dBManagerClient) GetObservationLog(ctx context.Context, in *GetObservationLogRequest, opts ...grpc.CallOption) (*GetObservationLogReply, error) {
out := new(GetObservationLogReply)
err := c.cc.Invoke(ctx, DBManager_GetObservationLog_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *dBManagerClient) DeleteObservationLog(ctx context.Context, in *DeleteObservationLogRequest, opts ...grpc.CallOption) (*DeleteObservationLogReply, error) {
out := new(DeleteObservationLogReply)
err := c.cc.Invoke(ctx, DBManager_DeleteObservationLog_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// DBManagerServer is the server API for DBManager service.
// All implementations should embed UnimplementedDBManagerServer
// for forward compatibility
type DBManagerServer interface {
// *
// Report a log of Observations for a Trial.
// The log consists of timestamp and value of metric.
// Katib store every log of metrics.
// You can see accuracy curve or other metric logs on UI.
ReportObservationLog(context.Context, *ReportObservationLogRequest) (*ReportObservationLogReply, error)
// *
// Get all log of Observations for a Trial.
GetObservationLog(context.Context, *GetObservationLogRequest) (*GetObservationLogReply, error)
// *
// Delete all log of Observations for a Trial.
DeleteObservationLog(context.Context, *DeleteObservationLogRequest) (*DeleteObservationLogReply, error)
}
// UnimplementedDBManagerServer should be embedded to have forward compatible implementations.
type UnimplementedDBManagerServer struct {
}
func (UnimplementedDBManagerServer) ReportObservationLog(context.Context, *ReportObservationLogRequest) (*ReportObservationLogReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method ReportObservationLog not implemented")
}
func (UnimplementedDBManagerServer) GetObservationLog(context.Context, *GetObservationLogRequest) (*GetObservationLogReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetObservationLog not implemented")
}
func (UnimplementedDBManagerServer) DeleteObservationLog(context.Context, *DeleteObservationLogRequest) (*DeleteObservationLogReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteObservationLog not implemented")
}
// UnsafeDBManagerServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to DBManagerServer will
// result in compilation errors.
type UnsafeDBManagerServer interface {
mustEmbedUnimplementedDBManagerServer()
}
func RegisterDBManagerServer(s grpc.ServiceRegistrar, srv DBManagerServer) {
s.RegisterService(&DBManager_ServiceDesc, srv)
}
func _DBManager_ReportObservationLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReportObservationLogRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DBManagerServer).ReportObservationLog(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DBManager_ReportObservationLog_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DBManagerServer).ReportObservationLog(ctx, req.(*ReportObservationLogRequest))
}
return interceptor(ctx, in, info, handler)
}
func _DBManager_GetObservationLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetObservationLogRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DBManagerServer).GetObservationLog(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DBManager_GetObservationLog_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DBManagerServer).GetObservationLog(ctx, req.(*GetObservationLogRequest))
}
return interceptor(ctx, in, info, handler)
}
func _DBManager_DeleteObservationLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteObservationLogRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DBManagerServer).DeleteObservationLog(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DBManager_DeleteObservationLog_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DBManagerServer).DeleteObservationLog(ctx, req.(*DeleteObservationLogRequest))
}
return interceptor(ctx, in, info, handler)
}
// DBManager_ServiceDesc is the grpc.ServiceDesc for DBManager service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var DBManager_ServiceDesc = grpc.ServiceDesc{
ServiceName: "api.v1.beta1.DBManager",
HandlerType: (*DBManagerServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ReportObservationLog",
Handler: _DBManager_ReportObservationLog_Handler,
},
{
MethodName: "GetObservationLog",
Handler: _DBManager_GetObservationLog_Handler,
},
{
MethodName: "DeleteObservationLog",
Handler: _DBManager_DeleteObservationLog_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api.proto",
}
const (
Suggestion_GetSuggestions_FullMethodName = "/api.v1.beta1.Suggestion/GetSuggestions"
Suggestion_ValidateAlgorithmSettings_FullMethodName = "/api.v1.beta1.Suggestion/ValidateAlgorithmSettings"
)
// SuggestionClient is the client API for Suggestion service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type SuggestionClient interface {
GetSuggestions(ctx context.Context, in *GetSuggestionsRequest, opts ...grpc.CallOption) (*GetSuggestionsReply, error)
ValidateAlgorithmSettings(ctx context.Context, in *ValidateAlgorithmSettingsRequest, opts ...grpc.CallOption) (*ValidateAlgorithmSettingsReply, error)
}
type suggestionClient struct {
cc grpc.ClientConnInterface
}
func NewSuggestionClient(cc grpc.ClientConnInterface) SuggestionClient {
return &suggestionClient{cc}
}
func (c *suggestionClient) GetSuggestions(ctx context.Context, in *GetSuggestionsRequest, opts ...grpc.CallOption) (*GetSuggestionsReply, error) {
out := new(GetSuggestionsReply)
err := c.cc.Invoke(ctx, Suggestion_GetSuggestions_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *suggestionClient) ValidateAlgorithmSettings(ctx context.Context, in *ValidateAlgorithmSettingsRequest, opts ...grpc.CallOption) (*ValidateAlgorithmSettingsReply, error) {
out := new(ValidateAlgorithmSettingsReply)
err := c.cc.Invoke(ctx, Suggestion_ValidateAlgorithmSettings_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// SuggestionServer is the server API for Suggestion service.
// All implementations should embed UnimplementedSuggestionServer
// for forward compatibility
type SuggestionServer interface {
GetSuggestions(context.Context, *GetSuggestionsRequest) (*GetSuggestionsReply, error)
ValidateAlgorithmSettings(context.Context, *ValidateAlgorithmSettingsRequest) (*ValidateAlgorithmSettingsReply, error)
}
// UnimplementedSuggestionServer should be embedded to have forward compatible implementations.
type UnimplementedSuggestionServer struct {
}
func (UnimplementedSuggestionServer) GetSuggestions(context.Context, *GetSuggestionsRequest) (*GetSuggestionsReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetSuggestions not implemented")
}
func (UnimplementedSuggestionServer) ValidateAlgorithmSettings(context.Context, *ValidateAlgorithmSettingsRequest) (*ValidateAlgorithmSettingsReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method ValidateAlgorithmSettings not implemented")
}
// UnsafeSuggestionServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to SuggestionServer will
// result in compilation errors.
type UnsafeSuggestionServer interface {
mustEmbedUnimplementedSuggestionServer()
}
func RegisterSuggestionServer(s grpc.ServiceRegistrar, srv SuggestionServer) {
s.RegisterService(&Suggestion_ServiceDesc, srv)
}
func _Suggestion_GetSuggestions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetSuggestionsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SuggestionServer).GetSuggestions(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Suggestion_GetSuggestions_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SuggestionServer).GetSuggestions(ctx, req.(*GetSuggestionsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Suggestion_ValidateAlgorithmSettings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ValidateAlgorithmSettingsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SuggestionServer).ValidateAlgorithmSettings(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Suggestion_ValidateAlgorithmSettings_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SuggestionServer).ValidateAlgorithmSettings(ctx, req.(*ValidateAlgorithmSettingsRequest))
}
return interceptor(ctx, in, info, handler)
}
// Suggestion_ServiceDesc is the grpc.ServiceDesc for Suggestion service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Suggestion_ServiceDesc = grpc.ServiceDesc{
ServiceName: "api.v1.beta1.Suggestion",
HandlerType: (*SuggestionServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetSuggestions",
Handler: _Suggestion_GetSuggestions_Handler,
},
{
MethodName: "ValidateAlgorithmSettings",
Handler: _Suggestion_ValidateAlgorithmSettings_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api.proto",
}
const (
EarlyStopping_GetEarlyStoppingRules_FullMethodName = "/api.v1.beta1.EarlyStopping/GetEarlyStoppingRules"
EarlyStopping_SetTrialStatus_FullMethodName = "/api.v1.beta1.EarlyStopping/SetTrialStatus"
EarlyStopping_ValidateEarlyStoppingSettings_FullMethodName = "/api.v1.beta1.EarlyStopping/ValidateEarlyStoppingSettings"
)
// EarlyStoppingClient is the client API for EarlyStopping service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type EarlyStoppingClient interface {
GetEarlyStoppingRules(ctx context.Context, in *GetEarlyStoppingRulesRequest, opts ...grpc.CallOption) (*GetEarlyStoppingRulesReply, error)
SetTrialStatus(ctx context.Context, in *SetTrialStatusRequest, opts ...grpc.CallOption) (*SetTrialStatusReply, error)
ValidateEarlyStoppingSettings(ctx context.Context, in *ValidateEarlyStoppingSettingsRequest, opts ...grpc.CallOption) (*ValidateEarlyStoppingSettingsReply, error)
}
type earlyStoppingClient struct {
cc grpc.ClientConnInterface
}
func NewEarlyStoppingClient(cc grpc.ClientConnInterface) EarlyStoppingClient {
return &earlyStoppingClient{cc}
}
func (c *earlyStoppingClient) GetEarlyStoppingRules(ctx context.Context, in *GetEarlyStoppingRulesRequest, opts ...grpc.CallOption) (*GetEarlyStoppingRulesReply, error) {
out := new(GetEarlyStoppingRulesReply)
err := c.cc.Invoke(ctx, EarlyStopping_GetEarlyStoppingRules_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *earlyStoppingClient) SetTrialStatus(ctx context.Context, in *SetTrialStatusRequest, opts ...grpc.CallOption) (*SetTrialStatusReply, error) {
out := new(SetTrialStatusReply)
err := c.cc.Invoke(ctx, EarlyStopping_SetTrialStatus_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *earlyStoppingClient) ValidateEarlyStoppingSettings(ctx context.Context, in *ValidateEarlyStoppingSettingsRequest, opts ...grpc.CallOption) (*ValidateEarlyStoppingSettingsReply, error) {
out := new(ValidateEarlyStoppingSettingsReply)
err := c.cc.Invoke(ctx, EarlyStopping_ValidateEarlyStoppingSettings_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// EarlyStoppingServer is the server API for EarlyStopping service.
// All implementations should embed UnimplementedEarlyStoppingServer
// for forward compatibility
type EarlyStoppingServer interface {
GetEarlyStoppingRules(context.Context, *GetEarlyStoppingRulesRequest) (*GetEarlyStoppingRulesReply, error)
SetTrialStatus(context.Context, *SetTrialStatusRequest) (*SetTrialStatusReply, error)
ValidateEarlyStoppingSettings(context.Context, *ValidateEarlyStoppingSettingsRequest) (*ValidateEarlyStoppingSettingsReply, error)
}
// UnimplementedEarlyStoppingServer should be embedded to have forward compatible implementations.
type UnimplementedEarlyStoppingServer struct {
}
func (UnimplementedEarlyStoppingServer) GetEarlyStoppingRules(context.Context, *GetEarlyStoppingRulesRequest) (*GetEarlyStoppingRulesReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetEarlyStoppingRules not implemented")
}
func (UnimplementedEarlyStoppingServer) SetTrialStatus(context.Context, *SetTrialStatusRequest) (*SetTrialStatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetTrialStatus not implemented")
}
func (UnimplementedEarlyStoppingServer) ValidateEarlyStoppingSettings(context.Context, *ValidateEarlyStoppingSettingsRequest) (*ValidateEarlyStoppingSettingsReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method ValidateEarlyStoppingSettings not implemented")
}
// UnsafeEarlyStoppingServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to EarlyStoppingServer will
// result in compilation errors.
type UnsafeEarlyStoppingServer interface {
mustEmbedUnimplementedEarlyStoppingServer()
}
func RegisterEarlyStoppingServer(s grpc.ServiceRegistrar, srv EarlyStoppingServer) {
s.RegisterService(&EarlyStopping_ServiceDesc, srv)
}
func _EarlyStopping_GetEarlyStoppingRules_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetEarlyStoppingRulesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EarlyStoppingServer).GetEarlyStoppingRules(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: EarlyStopping_GetEarlyStoppingRules_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EarlyStoppingServer).GetEarlyStoppingRules(ctx, req.(*GetEarlyStoppingRulesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _EarlyStopping_SetTrialStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SetTrialStatusRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EarlyStoppingServer).SetTrialStatus(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: EarlyStopping_SetTrialStatus_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EarlyStoppingServer).SetTrialStatus(ctx, req.(*SetTrialStatusRequest))
}
return interceptor(ctx, in, info, handler)
}
func _EarlyStopping_ValidateEarlyStoppingSettings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ValidateEarlyStoppingSettingsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EarlyStoppingServer).ValidateEarlyStoppingSettings(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: EarlyStopping_ValidateEarlyStoppingSettings_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EarlyStoppingServer).ValidateEarlyStoppingSettings(ctx, req.(*ValidateEarlyStoppingSettingsRequest))
}
return interceptor(ctx, in, info, handler)
}
// EarlyStopping_ServiceDesc is the grpc.ServiceDesc for EarlyStopping service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var EarlyStopping_ServiceDesc = grpc.ServiceDesc{
ServiceName: "api.v1.beta1.EarlyStopping",
HandlerType: (*EarlyStoppingServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetEarlyStoppingRules",
Handler: _EarlyStopping_GetEarlyStoppingRules_Handler,
},
{
MethodName: "SetTrialStatus",
Handler: _EarlyStopping_SetTrialStatus_Handler,
},
{
MethodName: "ValidateEarlyStoppingSettings",
Handler: _EarlyStopping_ValidateEarlyStoppingSettings_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api.proto",
}

View File

@ -0,0 +1,21 @@
version: v2
plugins:
- remote: buf.build/protocolbuffers/go:v1.33.0
out: .
opt: module=github.com/kubeflow/katib/pkg/apis/manager/v1beta1
- remote: buf.build/grpc/go:v1.3.0
out: .
opt: module=github.com/kubeflow/katib/pkg/apis/manager/v1beta1,require_unimplemented_servers=false
- remote: buf.build/protocolbuffers/python:v26.1
out: python
- remote: buf.build/protocolbuffers/pyi:v26.1
out: python
- remote: buf.build/grpc/python:v1.64.1
out: python
inputs:
- directory: .

View File

@ -1,29 +0,0 @@
#!/usr/bin/env bash
# Copyright 2022 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -x
set -e
cd "$(dirname "$0")"
proto="api.proto"
docker run -i --rm -v "$PWD:$PWD" -w "$PWD" znly/protoc --python_out=plugins=grpc:./python --go_out=plugins=grpc:. -I. $proto
docker run -i --rm -v "$PWD:$PWD" -w "$PWD" znly/protoc --plugin=protoc-gen-grpc=/usr/bin/grpc_python_plugin --python_out=./python --grpc_out=./python -I. $proto
docker build -t protoc-gen-doc gen-doc/
docker run --rm -v "$PWD/gen-doc:/out" -v "$PWD:/apiprotos" protoc-gen-doc --doc_opt=markdown,api.md -I /protobuf -I /apiprotos $proto
docker run --rm -v "$PWD/gen-doc:/out" -v "$PWD:/apiprotos" protoc-gen-doc --doc_opt=html,index.html -I /protobuf -I /apiprotos $proto

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,407 @@
from google.protobuf.internal import containers as _containers
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
DESCRIPTOR: _descriptor.FileDescriptor
class ParameterType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
__slots__ = ()
UNKNOWN_TYPE: _ClassVar[ParameterType]
DOUBLE: _ClassVar[ParameterType]
INT: _ClassVar[ParameterType]
DISCRETE: _ClassVar[ParameterType]
CATEGORICAL: _ClassVar[ParameterType]
class ObjectiveType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
__slots__ = ()
UNKNOWN: _ClassVar[ObjectiveType]
MINIMIZE: _ClassVar[ObjectiveType]
MAXIMIZE: _ClassVar[ObjectiveType]
class ComparisonType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
__slots__ = ()
UNKNOWN_COMPARISON: _ClassVar[ComparisonType]
EQUAL: _ClassVar[ComparisonType]
LESS: _ClassVar[ComparisonType]
GREATER: _ClassVar[ComparisonType]
UNKNOWN_TYPE: ParameterType
DOUBLE: ParameterType
INT: ParameterType
DISCRETE: ParameterType
CATEGORICAL: ParameterType
UNKNOWN: ObjectiveType
MINIMIZE: ObjectiveType
MAXIMIZE: ObjectiveType
UNKNOWN_COMPARISON: ComparisonType
EQUAL: ComparisonType
LESS: ComparisonType
GREATER: ComparisonType
class Experiment(_message.Message):
__slots__ = ("name", "spec")
NAME_FIELD_NUMBER: _ClassVar[int]
SPEC_FIELD_NUMBER: _ClassVar[int]
name: str
spec: ExperimentSpec
def __init__(self, name: _Optional[str] = ..., spec: _Optional[_Union[ExperimentSpec, _Mapping]] = ...) -> None: ...
class ExperimentSpec(_message.Message):
__slots__ = ("parameter_specs", "objective", "algorithm", "early_stopping", "parallel_trial_count", "max_trial_count", "nas_config")
class ParameterSpecs(_message.Message):
__slots__ = ("parameters",)
PARAMETERS_FIELD_NUMBER: _ClassVar[int]
parameters: _containers.RepeatedCompositeFieldContainer[ParameterSpec]
def __init__(self, parameters: _Optional[_Iterable[_Union[ParameterSpec, _Mapping]]] = ...) -> None: ...
PARAMETER_SPECS_FIELD_NUMBER: _ClassVar[int]
OBJECTIVE_FIELD_NUMBER: _ClassVar[int]
ALGORITHM_FIELD_NUMBER: _ClassVar[int]
EARLY_STOPPING_FIELD_NUMBER: _ClassVar[int]
PARALLEL_TRIAL_COUNT_FIELD_NUMBER: _ClassVar[int]
MAX_TRIAL_COUNT_FIELD_NUMBER: _ClassVar[int]
NAS_CONFIG_FIELD_NUMBER: _ClassVar[int]
parameter_specs: ExperimentSpec.ParameterSpecs
objective: ObjectiveSpec
algorithm: AlgorithmSpec
early_stopping: EarlyStoppingSpec
parallel_trial_count: int
max_trial_count: int
nas_config: NasConfig
def __init__(self, parameter_specs: _Optional[_Union[ExperimentSpec.ParameterSpecs, _Mapping]] = ..., objective: _Optional[_Union[ObjectiveSpec, _Mapping]] = ..., algorithm: _Optional[_Union[AlgorithmSpec, _Mapping]] = ..., early_stopping: _Optional[_Union[EarlyStoppingSpec, _Mapping]] = ..., parallel_trial_count: _Optional[int] = ..., max_trial_count: _Optional[int] = ..., nas_config: _Optional[_Union[NasConfig, _Mapping]] = ...) -> None: ...
class ParameterSpec(_message.Message):
__slots__ = ("name", "parameter_type", "feasible_space")
NAME_FIELD_NUMBER: _ClassVar[int]
PARAMETER_TYPE_FIELD_NUMBER: _ClassVar[int]
FEASIBLE_SPACE_FIELD_NUMBER: _ClassVar[int]
name: str
parameter_type: ParameterType
feasible_space: FeasibleSpace
def __init__(self, name: _Optional[str] = ..., parameter_type: _Optional[_Union[ParameterType, str]] = ..., feasible_space: _Optional[_Union[FeasibleSpace, _Mapping]] = ...) -> None: ...
class FeasibleSpace(_message.Message):
__slots__ = ("max", "min", "list", "step")
MAX_FIELD_NUMBER: _ClassVar[int]
MIN_FIELD_NUMBER: _ClassVar[int]
LIST_FIELD_NUMBER: _ClassVar[int]
STEP_FIELD_NUMBER: _ClassVar[int]
max: str
min: str
list: _containers.RepeatedScalarFieldContainer[str]
step: str
def __init__(self, max: _Optional[str] = ..., min: _Optional[str] = ..., list: _Optional[_Iterable[str]] = ..., step: _Optional[str] = ...) -> None: ...
class ObjectiveSpec(_message.Message):
__slots__ = ("type", "goal", "objective_metric_name", "additional_metric_names")
TYPE_FIELD_NUMBER: _ClassVar[int]
GOAL_FIELD_NUMBER: _ClassVar[int]
OBJECTIVE_METRIC_NAME_FIELD_NUMBER: _ClassVar[int]
ADDITIONAL_METRIC_NAMES_FIELD_NUMBER: _ClassVar[int]
type: ObjectiveType
goal: float
objective_metric_name: str
additional_metric_names: _containers.RepeatedScalarFieldContainer[str]
def __init__(self, type: _Optional[_Union[ObjectiveType, str]] = ..., goal: _Optional[float] = ..., objective_metric_name: _Optional[str] = ..., additional_metric_names: _Optional[_Iterable[str]] = ...) -> None: ...
class AlgorithmSpec(_message.Message):
__slots__ = ("algorithm_name", "algorithm_settings")
ALGORITHM_NAME_FIELD_NUMBER: _ClassVar[int]
ALGORITHM_SETTINGS_FIELD_NUMBER: _ClassVar[int]
algorithm_name: str
algorithm_settings: _containers.RepeatedCompositeFieldContainer[AlgorithmSetting]
def __init__(self, algorithm_name: _Optional[str] = ..., algorithm_settings: _Optional[_Iterable[_Union[AlgorithmSetting, _Mapping]]] = ...) -> None: ...
class AlgorithmSetting(_message.Message):
__slots__ = ("name", "value")
NAME_FIELD_NUMBER: _ClassVar[int]
VALUE_FIELD_NUMBER: _ClassVar[int]
name: str
value: str
def __init__(self, name: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ...
class EarlyStoppingSpec(_message.Message):
__slots__ = ("algorithm_name", "algorithm_settings")
ALGORITHM_NAME_FIELD_NUMBER: _ClassVar[int]
ALGORITHM_SETTINGS_FIELD_NUMBER: _ClassVar[int]
algorithm_name: str
algorithm_settings: _containers.RepeatedCompositeFieldContainer[EarlyStoppingSetting]
def __init__(self, algorithm_name: _Optional[str] = ..., algorithm_settings: _Optional[_Iterable[_Union[EarlyStoppingSetting, _Mapping]]] = ...) -> None: ...
class EarlyStoppingSetting(_message.Message):
__slots__ = ("name", "value")
NAME_FIELD_NUMBER: _ClassVar[int]
VALUE_FIELD_NUMBER: _ClassVar[int]
name: str
value: str
def __init__(self, name: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ...
class NasConfig(_message.Message):
__slots__ = ("graph_config", "operations")
class Operations(_message.Message):
__slots__ = ("operation",)
OPERATION_FIELD_NUMBER: _ClassVar[int]
operation: _containers.RepeatedCompositeFieldContainer[Operation]
def __init__(self, operation: _Optional[_Iterable[_Union[Operation, _Mapping]]] = ...) -> None: ...
GRAPH_CONFIG_FIELD_NUMBER: _ClassVar[int]
OPERATIONS_FIELD_NUMBER: _ClassVar[int]
graph_config: GraphConfig
operations: NasConfig.Operations
def __init__(self, graph_config: _Optional[_Union[GraphConfig, _Mapping]] = ..., operations: _Optional[_Union[NasConfig.Operations, _Mapping]] = ...) -> None: ...
class GraphConfig(_message.Message):
__slots__ = ("num_layers", "input_sizes", "output_sizes")
NUM_LAYERS_FIELD_NUMBER: _ClassVar[int]
INPUT_SIZES_FIELD_NUMBER: _ClassVar[int]
OUTPUT_SIZES_FIELD_NUMBER: _ClassVar[int]
num_layers: int
input_sizes: _containers.RepeatedScalarFieldContainer[int]
output_sizes: _containers.RepeatedScalarFieldContainer[int]
def __init__(self, num_layers: _Optional[int] = ..., input_sizes: _Optional[_Iterable[int]] = ..., output_sizes: _Optional[_Iterable[int]] = ...) -> None: ...
class Operation(_message.Message):
__slots__ = ("operation_type", "parameter_specs")
class ParameterSpecs(_message.Message):
__slots__ = ("parameters",)
PARAMETERS_FIELD_NUMBER: _ClassVar[int]
parameters: _containers.RepeatedCompositeFieldContainer[ParameterSpec]
def __init__(self, parameters: _Optional[_Iterable[_Union[ParameterSpec, _Mapping]]] = ...) -> None: ...
OPERATION_TYPE_FIELD_NUMBER: _ClassVar[int]
PARAMETER_SPECS_FIELD_NUMBER: _ClassVar[int]
operation_type: str
parameter_specs: Operation.ParameterSpecs
def __init__(self, operation_type: _Optional[str] = ..., parameter_specs: _Optional[_Union[Operation.ParameterSpecs, _Mapping]] = ...) -> None: ...
class Trial(_message.Message):
__slots__ = ("name", "spec", "status")
NAME_FIELD_NUMBER: _ClassVar[int]
SPEC_FIELD_NUMBER: _ClassVar[int]
STATUS_FIELD_NUMBER: _ClassVar[int]
name: str
spec: TrialSpec
status: TrialStatus
def __init__(self, name: _Optional[str] = ..., spec: _Optional[_Union[TrialSpec, _Mapping]] = ..., status: _Optional[_Union[TrialStatus, _Mapping]] = ...) -> None: ...
class TrialSpec(_message.Message):
__slots__ = ("objective", "parameter_assignments", "labels")
class ParameterAssignments(_message.Message):
__slots__ = ("assignments",)
ASSIGNMENTS_FIELD_NUMBER: _ClassVar[int]
assignments: _containers.RepeatedCompositeFieldContainer[ParameterAssignment]
def __init__(self, assignments: _Optional[_Iterable[_Union[ParameterAssignment, _Mapping]]] = ...) -> None: ...
class LabelsEntry(_message.Message):
__slots__ = ("key", "value")
KEY_FIELD_NUMBER: _ClassVar[int]
VALUE_FIELD_NUMBER: _ClassVar[int]
key: str
value: str
def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ...
OBJECTIVE_FIELD_NUMBER: _ClassVar[int]
PARAMETER_ASSIGNMENTS_FIELD_NUMBER: _ClassVar[int]
LABELS_FIELD_NUMBER: _ClassVar[int]
objective: ObjectiveSpec
parameter_assignments: TrialSpec.ParameterAssignments
labels: _containers.ScalarMap[str, str]
def __init__(self, objective: _Optional[_Union[ObjectiveSpec, _Mapping]] = ..., parameter_assignments: _Optional[_Union[TrialSpec.ParameterAssignments, _Mapping]] = ..., labels: _Optional[_Mapping[str, str]] = ...) -> None: ...
class ParameterAssignment(_message.Message):
__slots__ = ("name", "value")
NAME_FIELD_NUMBER: _ClassVar[int]
VALUE_FIELD_NUMBER: _ClassVar[int]
name: str
value: str
def __init__(self, name: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ...
class TrialStatus(_message.Message):
__slots__ = ("start_time", "completion_time", "condition", "observation")
class TrialConditionType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
__slots__ = ()
CREATED: _ClassVar[TrialStatus.TrialConditionType]
RUNNING: _ClassVar[TrialStatus.TrialConditionType]
SUCCEEDED: _ClassVar[TrialStatus.TrialConditionType]
KILLED: _ClassVar[TrialStatus.TrialConditionType]
FAILED: _ClassVar[TrialStatus.TrialConditionType]
METRICSUNAVAILABLE: _ClassVar[TrialStatus.TrialConditionType]
EARLYSTOPPED: _ClassVar[TrialStatus.TrialConditionType]
UNKNOWN: _ClassVar[TrialStatus.TrialConditionType]
CREATED: TrialStatus.TrialConditionType
RUNNING: TrialStatus.TrialConditionType
SUCCEEDED: TrialStatus.TrialConditionType
KILLED: TrialStatus.TrialConditionType
FAILED: TrialStatus.TrialConditionType
METRICSUNAVAILABLE: TrialStatus.TrialConditionType
EARLYSTOPPED: TrialStatus.TrialConditionType
UNKNOWN: TrialStatus.TrialConditionType
START_TIME_FIELD_NUMBER: _ClassVar[int]
COMPLETION_TIME_FIELD_NUMBER: _ClassVar[int]
CONDITION_FIELD_NUMBER: _ClassVar[int]
OBSERVATION_FIELD_NUMBER: _ClassVar[int]
start_time: str
completion_time: str
condition: TrialStatus.TrialConditionType
observation: Observation
def __init__(self, start_time: _Optional[str] = ..., completion_time: _Optional[str] = ..., condition: _Optional[_Union[TrialStatus.TrialConditionType, str]] = ..., observation: _Optional[_Union[Observation, _Mapping]] = ...) -> None: ...
class Observation(_message.Message):
__slots__ = ("metrics",)
METRICS_FIELD_NUMBER: _ClassVar[int]
metrics: _containers.RepeatedCompositeFieldContainer[Metric]
def __init__(self, metrics: _Optional[_Iterable[_Union[Metric, _Mapping]]] = ...) -> None: ...
class Metric(_message.Message):
__slots__ = ("name", "value")
NAME_FIELD_NUMBER: _ClassVar[int]
VALUE_FIELD_NUMBER: _ClassVar[int]
name: str
value: str
def __init__(self, name: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ...
class ReportObservationLogRequest(_message.Message):
__slots__ = ("trial_name", "observation_log")
TRIAL_NAME_FIELD_NUMBER: _ClassVar[int]
OBSERVATION_LOG_FIELD_NUMBER: _ClassVar[int]
trial_name: str
observation_log: ObservationLog
def __init__(self, trial_name: _Optional[str] = ..., observation_log: _Optional[_Union[ObservationLog, _Mapping]] = ...) -> None: ...
class ReportObservationLogReply(_message.Message):
__slots__ = ()
def __init__(self) -> None: ...
class ObservationLog(_message.Message):
__slots__ = ("metric_logs",)
METRIC_LOGS_FIELD_NUMBER: _ClassVar[int]
metric_logs: _containers.RepeatedCompositeFieldContainer[MetricLog]
def __init__(self, metric_logs: _Optional[_Iterable[_Union[MetricLog, _Mapping]]] = ...) -> None: ...
class MetricLog(_message.Message):
__slots__ = ("time_stamp", "metric")
TIME_STAMP_FIELD_NUMBER: _ClassVar[int]
METRIC_FIELD_NUMBER: _ClassVar[int]
time_stamp: str
metric: Metric
def __init__(self, time_stamp: _Optional[str] = ..., metric: _Optional[_Union[Metric, _Mapping]] = ...) -> None: ...
class GetObservationLogRequest(_message.Message):
__slots__ = ("trial_name", "metric_name", "start_time", "end_time")
TRIAL_NAME_FIELD_NUMBER: _ClassVar[int]
METRIC_NAME_FIELD_NUMBER: _ClassVar[int]
START_TIME_FIELD_NUMBER: _ClassVar[int]
END_TIME_FIELD_NUMBER: _ClassVar[int]
trial_name: str
metric_name: str
start_time: str
end_time: str
def __init__(self, trial_name: _Optional[str] = ..., metric_name: _Optional[str] = ..., start_time: _Optional[str] = ..., end_time: _Optional[str] = ...) -> None: ...
class GetObservationLogReply(_message.Message):
__slots__ = ("observation_log",)
OBSERVATION_LOG_FIELD_NUMBER: _ClassVar[int]
observation_log: ObservationLog
def __init__(self, observation_log: _Optional[_Union[ObservationLog, _Mapping]] = ...) -> None: ...
class DeleteObservationLogRequest(_message.Message):
__slots__ = ("trial_name",)
TRIAL_NAME_FIELD_NUMBER: _ClassVar[int]
trial_name: str
def __init__(self, trial_name: _Optional[str] = ...) -> None: ...
class DeleteObservationLogReply(_message.Message):
__slots__ = ()
def __init__(self) -> None: ...
class GetSuggestionsRequest(_message.Message):
__slots__ = ("experiment", "trials", "current_request_number", "total_request_number")
EXPERIMENT_FIELD_NUMBER: _ClassVar[int]
TRIALS_FIELD_NUMBER: _ClassVar[int]
CURRENT_REQUEST_NUMBER_FIELD_NUMBER: _ClassVar[int]
TOTAL_REQUEST_NUMBER_FIELD_NUMBER: _ClassVar[int]
experiment: Experiment
trials: _containers.RepeatedCompositeFieldContainer[Trial]
current_request_number: int
total_request_number: int
def __init__(self, experiment: _Optional[_Union[Experiment, _Mapping]] = ..., trials: _Optional[_Iterable[_Union[Trial, _Mapping]]] = ..., current_request_number: _Optional[int] = ..., total_request_number: _Optional[int] = ...) -> None: ...
class GetSuggestionsReply(_message.Message):
__slots__ = ("parameter_assignments", "algorithm", "early_stopping_rules")
class ParameterAssignments(_message.Message):
__slots__ = ("assignments", "trial_name", "labels")
class LabelsEntry(_message.Message):
__slots__ = ("key", "value")
KEY_FIELD_NUMBER: _ClassVar[int]
VALUE_FIELD_NUMBER: _ClassVar[int]
key: str
value: str
def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ...
ASSIGNMENTS_FIELD_NUMBER: _ClassVar[int]
TRIAL_NAME_FIELD_NUMBER: _ClassVar[int]
LABELS_FIELD_NUMBER: _ClassVar[int]
assignments: _containers.RepeatedCompositeFieldContainer[ParameterAssignment]
trial_name: str
labels: _containers.ScalarMap[str, str]
def __init__(self, assignments: _Optional[_Iterable[_Union[ParameterAssignment, _Mapping]]] = ..., trial_name: _Optional[str] = ..., labels: _Optional[_Mapping[str, str]] = ...) -> None: ...
PARAMETER_ASSIGNMENTS_FIELD_NUMBER: _ClassVar[int]
ALGORITHM_FIELD_NUMBER: _ClassVar[int]
EARLY_STOPPING_RULES_FIELD_NUMBER: _ClassVar[int]
parameter_assignments: _containers.RepeatedCompositeFieldContainer[GetSuggestionsReply.ParameterAssignments]
algorithm: AlgorithmSpec
early_stopping_rules: _containers.RepeatedCompositeFieldContainer[EarlyStoppingRule]
def __init__(self, parameter_assignments: _Optional[_Iterable[_Union[GetSuggestionsReply.ParameterAssignments, _Mapping]]] = ..., algorithm: _Optional[_Union[AlgorithmSpec, _Mapping]] = ..., early_stopping_rules: _Optional[_Iterable[_Union[EarlyStoppingRule, _Mapping]]] = ...) -> None: ...
class ValidateAlgorithmSettingsRequest(_message.Message):
__slots__ = ("experiment",)
EXPERIMENT_FIELD_NUMBER: _ClassVar[int]
experiment: Experiment
def __init__(self, experiment: _Optional[_Union[Experiment, _Mapping]] = ...) -> None: ...
class ValidateAlgorithmSettingsReply(_message.Message):
__slots__ = ()
def __init__(self) -> None: ...
class GetEarlyStoppingRulesRequest(_message.Message):
__slots__ = ("experiment", "trials", "db_manager_address")
EXPERIMENT_FIELD_NUMBER: _ClassVar[int]
TRIALS_FIELD_NUMBER: _ClassVar[int]
DB_MANAGER_ADDRESS_FIELD_NUMBER: _ClassVar[int]
experiment: Experiment
trials: _containers.RepeatedCompositeFieldContainer[Trial]
db_manager_address: str
def __init__(self, experiment: _Optional[_Union[Experiment, _Mapping]] = ..., trials: _Optional[_Iterable[_Union[Trial, _Mapping]]] = ..., db_manager_address: _Optional[str] = ...) -> None: ...
class GetEarlyStoppingRulesReply(_message.Message):
__slots__ = ("early_stopping_rules",)
EARLY_STOPPING_RULES_FIELD_NUMBER: _ClassVar[int]
early_stopping_rules: _containers.RepeatedCompositeFieldContainer[EarlyStoppingRule]
def __init__(self, early_stopping_rules: _Optional[_Iterable[_Union[EarlyStoppingRule, _Mapping]]] = ...) -> None: ...
class EarlyStoppingRule(_message.Message):
__slots__ = ("name", "value", "comparison", "start_step")
NAME_FIELD_NUMBER: _ClassVar[int]
VALUE_FIELD_NUMBER: _ClassVar[int]
COMPARISON_FIELD_NUMBER: _ClassVar[int]
START_STEP_FIELD_NUMBER: _ClassVar[int]
name: str
value: str
comparison: ComparisonType
start_step: int
def __init__(self, name: _Optional[str] = ..., value: _Optional[str] = ..., comparison: _Optional[_Union[ComparisonType, str]] = ..., start_step: _Optional[int] = ...) -> None: ...
class ValidateEarlyStoppingSettingsRequest(_message.Message):
__slots__ = ("early_stopping",)
EARLY_STOPPING_FIELD_NUMBER: _ClassVar[int]
early_stopping: EarlyStoppingSpec
def __init__(self, early_stopping: _Optional[_Union[EarlyStoppingSpec, _Mapping]] = ...) -> None: ...
class ValidateEarlyStoppingSettingsReply(_message.Message):
__slots__ = ()
def __init__(self) -> None: ...
class SetTrialStatusRequest(_message.Message):
__slots__ = ("trial_name",)
TRIAL_NAME_FIELD_NUMBER: _ClassVar[int]
trial_name: str
def __init__(self, trial_name: _Optional[str] = ...) -> None: ...
class SetTrialStatusReply(_message.Message):
__slots__ = ()
def __init__(self) -> None: ...

View File

@ -1,4 +1,5 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import api_pb2 as api__pb2
@ -19,17 +20,17 @@ class DBManagerStub(object):
'/api.v1.beta1.DBManager/ReportObservationLog',
request_serializer=api__pb2.ReportObservationLogRequest.SerializeToString,
response_deserializer=api__pb2.ReportObservationLogReply.FromString,
)
_registered_method=True)
self.GetObservationLog = channel.unary_unary(
'/api.v1.beta1.DBManager/GetObservationLog',
request_serializer=api__pb2.GetObservationLogRequest.SerializeToString,
response_deserializer=api__pb2.GetObservationLogReply.FromString,
)
_registered_method=True)
self.DeleteObservationLog = channel.unary_unary(
'/api.v1.beta1.DBManager/DeleteObservationLog',
request_serializer=api__pb2.DeleteObservationLogRequest.SerializeToString,
response_deserializer=api__pb2.DeleteObservationLogReply.FromString,
)
_registered_method=True)
class DBManagerServicer(object):
@ -86,6 +87,95 @@ def add_DBManagerServicer_to_server(servicer, server):
generic_handler = grpc.method_handlers_generic_handler(
'api.v1.beta1.DBManager', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
server.add_registered_method_handlers('api.v1.beta1.DBManager', rpc_method_handlers)
# This class is part of an EXPERIMENTAL API.
class DBManager(object):
"""*
DBManager service defines APIs to manage Katib database.
"""
@staticmethod
def ReportObservationLog(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/api.v1.beta1.DBManager/ReportObservationLog',
api__pb2.ReportObservationLogRequest.SerializeToString,
api__pb2.ReportObservationLogReply.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def GetObservationLog(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/api.v1.beta1.DBManager/GetObservationLog',
api__pb2.GetObservationLogRequest.SerializeToString,
api__pb2.GetObservationLogReply.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def DeleteObservationLog(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/api.v1.beta1.DBManager/DeleteObservationLog',
api__pb2.DeleteObservationLogRequest.SerializeToString,
api__pb2.DeleteObservationLogReply.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
class SuggestionStub(object):
@ -103,12 +193,12 @@ class SuggestionStub(object):
'/api.v1.beta1.Suggestion/GetSuggestions',
request_serializer=api__pb2.GetSuggestionsRequest.SerializeToString,
response_deserializer=api__pb2.GetSuggestionsReply.FromString,
)
_registered_method=True)
self.ValidateAlgorithmSettings = channel.unary_unary(
'/api.v1.beta1.Suggestion/ValidateAlgorithmSettings',
request_serializer=api__pb2.ValidateAlgorithmSettingsRequest.SerializeToString,
response_deserializer=api__pb2.ValidateAlgorithmSettingsReply.FromString,
)
_registered_method=True)
class SuggestionServicer(object):
@ -117,15 +207,13 @@ class SuggestionServicer(object):
"""
def GetSuggestions(self, request, context):
# missing associated documentation comment in .proto file
pass
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ValidateAlgorithmSettings(self, request, context):
# missing associated documentation comment in .proto file
pass
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
@ -147,6 +235,68 @@ def add_SuggestionServicer_to_server(servicer, server):
generic_handler = grpc.method_handlers_generic_handler(
'api.v1.beta1.Suggestion', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
server.add_registered_method_handlers('api.v1.beta1.Suggestion', rpc_method_handlers)
# This class is part of an EXPERIMENTAL API.
class Suggestion(object):
"""*
Suggestion service defines APIs to manage Katib Suggestion from HP or NAS algorithms
"""
@staticmethod
def GetSuggestions(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/api.v1.beta1.Suggestion/GetSuggestions',
api__pb2.GetSuggestionsRequest.SerializeToString,
api__pb2.GetSuggestionsReply.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def ValidateAlgorithmSettings(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/api.v1.beta1.Suggestion/ValidateAlgorithmSettings',
api__pb2.ValidateAlgorithmSettingsRequest.SerializeToString,
api__pb2.ValidateAlgorithmSettingsReply.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
class EarlyStoppingStub(object):
@ -164,17 +314,17 @@ class EarlyStoppingStub(object):
'/api.v1.beta1.EarlyStopping/GetEarlyStoppingRules',
request_serializer=api__pb2.GetEarlyStoppingRulesRequest.SerializeToString,
response_deserializer=api__pb2.GetEarlyStoppingRulesReply.FromString,
)
_registered_method=True)
self.SetTrialStatus = channel.unary_unary(
'/api.v1.beta1.EarlyStopping/SetTrialStatus',
request_serializer=api__pb2.SetTrialStatusRequest.SerializeToString,
response_deserializer=api__pb2.SetTrialStatusReply.FromString,
)
_registered_method=True)
self.ValidateEarlyStoppingSettings = channel.unary_unary(
'/api.v1.beta1.EarlyStopping/ValidateEarlyStoppingSettings',
request_serializer=api__pb2.ValidateEarlyStoppingSettingsRequest.SerializeToString,
response_deserializer=api__pb2.ValidateEarlyStoppingSettingsReply.FromString,
)
_registered_method=True)
class EarlyStoppingServicer(object):
@ -183,22 +333,19 @@ class EarlyStoppingServicer(object):
"""
def GetEarlyStoppingRules(self, request, context):
# missing associated documentation comment in .proto file
pass
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def SetTrialStatus(self, request, context):
# missing associated documentation comment in .proto file
pass
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ValidateEarlyStoppingSettings(self, request, context):
# missing associated documentation comment in .proto file
pass
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
@ -225,3 +372,92 @@ def add_EarlyStoppingServicer_to_server(servicer, server):
generic_handler = grpc.method_handlers_generic_handler(
'api.v1.beta1.EarlyStopping', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
server.add_registered_method_handlers('api.v1.beta1.EarlyStopping', rpc_method_handlers)
# This class is part of an EXPERIMENTAL API.
class EarlyStopping(object):
"""*
EarlyStopping service defines APIs to manage Katib Early Stopping algorithms
"""
@staticmethod
def GetEarlyStoppingRules(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/api.v1.beta1.EarlyStopping/GetEarlyStoppingRules',
api__pb2.GetEarlyStoppingRulesRequest.SerializeToString,
api__pb2.GetEarlyStoppingRulesReply.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def SetTrialStatus(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/api.v1.beta1.EarlyStopping/SetTrialStatus',
api__pb2.SetTrialStatusRequest.SerializeToString,
api__pb2.SetTrialStatusReply.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def ValidateEarlyStoppingSettings(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/api.v1.beta1.EarlyStopping/ValidateEarlyStoppingSettings',
api__pb2.ValidateEarlyStoppingSettingsRequest.SerializeToString,
api__pb2.ValidateEarlyStoppingSettingsReply.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)

View File

@ -22,9 +22,9 @@ import (
"testing"
"time"
"github.com/golang/mock/gomock"
"github.com/onsi/gomega"
"github.com/prometheus/client_golang/prometheus"
"go.uber.org/mock/gomock"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"

View File

@ -22,7 +22,7 @@ import (
"reflect"
"testing"
"github.com/golang/mock/gomock"
"go.uber.org/mock/gomock"
batchv1 "k8s.io/api/batch/v1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

View File

@ -24,8 +24,8 @@ import (
"testing"
"time"
"github.com/golang/mock/gomock"
"github.com/onsi/gomega"
"go.uber.org/mock/gomock"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
rbacv1 "k8s.io/api/rbac/v1"

View File

@ -23,11 +23,12 @@ import (
"testing"
"time"
"github.com/golang/mock/gomock"
"github.com/onsi/gomega"
"go.uber.org/mock/gomock"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/equality"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -52,8 +53,13 @@ type k8sMatcher struct {
}
func (k8s k8sMatcher) Matches(x interface{}) bool {
switch ex := k8s.x.(type) {
case proto.Message:
return proto.Equal(ex, x.(proto.Message))
default:
return equality.Semantic.DeepEqual(k8s.x, x)
}
}
func (k8s k8sMatcher) String() string {
return fmt.Sprintf("is equal to %v", k8s.x)

View File

@ -21,10 +21,10 @@ import (
"testing"
"time"
"github.com/golang/mock/gomock"
"github.com/onsi/gomega"
"github.com/prometheus/client_golang/prometheus"
"github.com/spf13/viper"
"go.uber.org/mock/gomock"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
@ -58,7 +58,7 @@ var trialKey = types.NamespacedName{Name: trialName, Namespace: namespace}
var batchJobKey = types.NamespacedName{Name: batchJobName, Namespace: namespace}
func init() {
logf.SetLogger(zap.New())
logf.SetLogger(zap.New(zap.UseDevMode(true)))
}
func TestAdd(t *testing.T) {
@ -179,11 +179,10 @@ func TestReconcileBatchJob(t *testing.T) {
},
}
mockManagerClient.EXPECT().GetTrialObservationLog(gomock.Any()).Return(observationLogAvailable, nil).Times(1)
mockManagerClient.EXPECT().GetTrialObservationLog(gomock.Any()).Return(observationLogUnavailable, nil).MinTimes(1)
mockManagerClient.EXPECT().DeleteTrialObservationLog(gomock.Any()).Return(nil, nil).AnyTimes()
t.Run(`Trial run with "Failed" BatchJob.`, func(t *testing.T) {
g := gomega.NewGomegaWithT(t)
mockManagerClient.EXPECT().DeleteTrialObservationLog(gomock.Any()).Return(nil, nil)
// Test 1 - Trial run with "Failed" BatchJob.
trial := newFakeTrialBatchJob()
batchJob := &batchv1.Job{}
@ -238,8 +237,15 @@ func TestReconcileBatchJob(t *testing.T) {
g.Eventually(func() bool {
return errors.IsNotFound(c.Get(ctx, trialKey, &trialsv1beta1.Trial{}))
}, timeout).Should(gomega.BeTrue())
})
// Test 2 - Trail with "Complete" BatchJob and Available metrics.
t.Run(`Trail with "Complete" BatchJob and Available metrics.`, func(t *testing.T) {
g := gomega.NewGomegaWithT(t)
gomock.InOrder(
mockManagerClient.EXPECT().GetTrialObservationLog(gomock.Any()).Return(observationLogAvailable, nil).MinTimes(1),
mockManagerClient.EXPECT().DeleteTrialObservationLog(gomock.Any()).Return(nil, nil),
)
batchJob := &batchv1.Job{}
batchJobCompleteMessage := "BatchJob completed test message"
batchJobCompleteReason := "BatchJob completed test reason"
// Update BatchJob status to Complete.
@ -257,13 +263,15 @@ func TestReconcileBatchJob(t *testing.T) {
g.Expect(c.Status().Update(ctx, batchJob)).NotTo(gomega.HaveOccurred())
// Create the Trial
trial = newFakeTrialBatchJob()
trial := newFakeTrialBatchJob()
g.Expect(c.Create(ctx, trial)).NotTo(gomega.HaveOccurred())
// Expect that Trial status is succeeded and metrics are properly populated
// Metrics available because GetTrialObservationLog returns values
start := time.Now()
g.Eventually(func() bool {
if err = c.Get(ctx, trialKey, trial); err != nil {
t.Log(time.Since(start), err)
return false
}
return trial.IsSucceeded() &&
@ -280,10 +288,16 @@ func TestReconcileBatchJob(t *testing.T) {
g.Eventually(func() bool {
return errors.IsNotFound(c.Get(ctx, trialKey, &trialsv1beta1.Trial{}))
}, timeout).Should(gomega.BeTrue())
})
// Test 3 - Trail with "Complete" BatchJob and Unavailable metrics.
t.Run(`Trail with "Complete" BatchJob and Unavailable metrics.`, func(t *testing.T) {
g := gomega.NewGomegaWithT(t)
gomock.InOrder(
mockManagerClient.EXPECT().GetTrialObservationLog(gomock.Any()).Return(observationLogUnavailable, nil).MinTimes(1),
mockManagerClient.EXPECT().DeleteTrialObservationLog(gomock.Any()).Return(nil, nil),
)
// Create the Trial
trial = newFakeTrialBatchJob()
trial := newFakeTrialBatchJob()
g.Expect(c.Create(ctx, trial)).NotTo(gomega.HaveOccurred())
// Expect that Trial status is succeeded with "false" status and "metrics unavailable" reason.
@ -306,10 +320,12 @@ func TestReconcileBatchJob(t *testing.T) {
g.Eventually(func() bool {
return errors.IsNotFound(c.Get(ctx, trialKey, &trialsv1beta1.Trial{}))
}, timeout).Should(gomega.BeTrue())
})
// Test 4 - Update status for empty Trial
t.Run("Update status for empty Trial", func(t *testing.T) {
g := gomega.NewGomegaWithT(t)
g.Expect(r.updateStatus(&trialsv1beta1.Trial{})).To(gomega.HaveOccurred())
})
}
func TestGetObjectiveMetricValue(t *testing.T) {

View File

@ -13,6 +13,7 @@
# limitations under the License.
import logging
from typing import Iterable, Optional
from kubernetes import client, config
import multiprocessing
from datetime import datetime
@ -64,7 +65,7 @@ class MedianStopService(api_pb2_grpc.EarlyStoppingServicer):
self.api_instance = client.CustomObjectsApi()
def ValidateEarlyStoppingSettings(self, request, context):
def ValidateEarlyStoppingSettings(self, request: api_pb2.ValidateEarlyStoppingSettingsRequest, context: grpc.ServicerContext) -> api_pb2.ValidateEarlyStoppingSettingsReply:
is_valid, message = self.validate_early_stopping_spec(request.early_stopping)
if not is_valid:
context.set_code(grpc.StatusCode.INVALID_ARGUMENT)
@ -97,7 +98,7 @@ class MedianStopService(api_pb2_grpc.EarlyStoppingServicer):
return True, ""
def GetEarlyStoppingRules(self, request, context):
def GetEarlyStoppingRules(self, request: api_pb2.GetEarlyStoppingRulesRequest, context: grpc.ServicerContext) -> api_pb2.GetSuggestionsReply:
logger.info("Get new early stopping rules")
# Get required values for the first call.
@ -137,24 +138,32 @@ class MedianStopService(api_pb2_grpc.EarlyStoppingServicer):
early_stopping_rules=early_stopping_rules
)
def get_early_stopping_settings(self, early_stopping_settings):
def get_early_stopping_settings(self, early_stopping_settings: Iterable[api_pb2.EarlyStoppingSetting]):
for setting in early_stopping_settings:
if setting.name == "min_trials_required":
self.min_trials_required = int(setting.value)
elif setting.name == "start_step":
self.start_step = int(setting.value)
def get_median_value(self, trials):
def get_median_value(self, trials: Iterable[api_pb2.Trial]) -> Optional[float]:
for trial in trials:
# Get metrics only for the new succeeded Trials.
if trial.name not in self.trials_avg_history and trial.status.condition == SUCCEEDED_TRIAL:
channel = grpc.beta.implementations.insecure_channel(
self.db_manager_address[0], int(self.db_manager_address[1]))
with api_pb2.beta_create_DBManager_stub(channel) as client:
get_log_response = client.GetObservationLog(api_pb2.GetObservationLogRequest(
trial_name=trial.name,
metric_name=self.objective_metric
), timeout=APISERVER_TIMEOUT)
if (
trial.name not in self.trials_avg_history
and trial.status.condition == SUCCEEDED_TRIAL
):
with grpc.insecure_channel(
f"{self.db_manager_address[0]}:{self.db_manager_address[1]}"
) as channel:
stub = api_pb2_grpc.DBManagerStub(channel)
get_log_response: api_pb2.GetObservationLogReply = (
stub.GetObservationLog(
api_pb2.GetObservationLogRequest(
trial_name=trial.name, metric_name=self.objective_metric
),
timeout=APISERVER_TIMEOUT,
)
)
# Get only first start_step metrics.
# Since metrics are collected consistently and ordered by time, we slice top start_step metrics.
@ -181,7 +190,7 @@ class MedianStopService(api_pb2_grpc.EarlyStoppingServicer):
))
return None
def SetTrialStatus(self, request, context):
def SetTrialStatus(self, request: api_pb2.SetTrialStatusRequest, context: grpc.ServicerContext) -> api_pb2.SetTrialStatusReply:
trial_name = request.trial_name
logger.info("Update status for Trial: {}".format(trial_name))

View File

@ -27,6 +27,7 @@ import (
commonv1beta1 "github.com/kubeflow/katib/pkg/apis/controller/common/v1beta1"
v1beta1 "github.com/kubeflow/katib/pkg/apis/manager/v1beta1"
"github.com/kubeflow/katib/pkg/controller.v1beta1/consts"
"google.golang.org/protobuf/testing/protocmp"
)
func TestCollectObservationLog(t *testing.T) {
@ -320,7 +321,7 @@ invalid INFO {metricName: loss, metricValue: 0.3634}`,
if diff := cmp.Diff(test.wantError, err, cmpopts.EquateErrors()); len(diff) != 0 {
t.Errorf("Unexpected error (-want,+got):\n%s", diff)
}
if diff := cmp.Diff(test.expected, actual); len(diff) != 0 {
if diff := cmp.Diff(test.expected, actual, protocmp.Transform()); len(diff) != 0 {
t.Errorf("Unexpected parsed result (-want,+got):\n%s", diff)
}
})

View File

@ -1,5 +1,10 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/kubeflow/katib/pkg/apis/manager/v1beta1 (interfaces: EarlyStoppingClient)
//
// Generated by this command:
//
// mockgen -package mock -destination pkg/mock/v1beta1/api/earlystopping.go github.com/kubeflow/katib/pkg/apis/manager/v1beta1 EarlyStoppingClient
//
// Package mock is a generated GoMock package.
package mock
@ -8,8 +13,8 @@ import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
api_v1_beta1 "github.com/kubeflow/katib/pkg/apis/manager/v1beta1"
gomock "go.uber.org/mock/gomock"
grpc "google.golang.org/grpc"
)
@ -39,7 +44,7 @@ func (m *MockEarlyStoppingClient) EXPECT() *MockEarlyStoppingClientMockRecorder
// GetEarlyStoppingRules mocks base method.
func (m *MockEarlyStoppingClient) GetEarlyStoppingRules(arg0 context.Context, arg1 *api_v1_beta1.GetEarlyStoppingRulesRequest, arg2 ...grpc.CallOption) (*api_v1_beta1.GetEarlyStoppingRulesReply, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
varargs := []any{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
@ -50,16 +55,16 @@ func (m *MockEarlyStoppingClient) GetEarlyStoppingRules(arg0 context.Context, ar
}
// GetEarlyStoppingRules indicates an expected call of GetEarlyStoppingRules.
func (mr *MockEarlyStoppingClientMockRecorder) GetEarlyStoppingRules(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
func (mr *MockEarlyStoppingClientMockRecorder) GetEarlyStoppingRules(arg0, arg1 any, arg2 ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
varargs := append([]any{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEarlyStoppingRules", reflect.TypeOf((*MockEarlyStoppingClient)(nil).GetEarlyStoppingRules), varargs...)
}
// SetTrialStatus mocks base method.
func (m *MockEarlyStoppingClient) SetTrialStatus(arg0 context.Context, arg1 *api_v1_beta1.SetTrialStatusRequest, arg2 ...grpc.CallOption) (*api_v1_beta1.SetTrialStatusReply, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
varargs := []any{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
@ -70,16 +75,16 @@ func (m *MockEarlyStoppingClient) SetTrialStatus(arg0 context.Context, arg1 *api
}
// SetTrialStatus indicates an expected call of SetTrialStatus.
func (mr *MockEarlyStoppingClientMockRecorder) SetTrialStatus(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
func (mr *MockEarlyStoppingClientMockRecorder) SetTrialStatus(arg0, arg1 any, arg2 ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
varargs := append([]any{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrialStatus", reflect.TypeOf((*MockEarlyStoppingClient)(nil).SetTrialStatus), varargs...)
}
// ValidateEarlyStoppingSettings mocks base method.
func (m *MockEarlyStoppingClient) ValidateEarlyStoppingSettings(arg0 context.Context, arg1 *api_v1_beta1.ValidateEarlyStoppingSettingsRequest, arg2 ...grpc.CallOption) (*api_v1_beta1.ValidateEarlyStoppingSettingsReply, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
varargs := []any{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
@ -90,8 +95,8 @@ func (m *MockEarlyStoppingClient) ValidateEarlyStoppingSettings(arg0 context.Con
}
// ValidateEarlyStoppingSettings indicates an expected call of ValidateEarlyStoppingSettings.
func (mr *MockEarlyStoppingClientMockRecorder) ValidateEarlyStoppingSettings(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
func (mr *MockEarlyStoppingClientMockRecorder) ValidateEarlyStoppingSettings(arg0, arg1 any, arg2 ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
varargs := append([]any{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateEarlyStoppingSettings", reflect.TypeOf((*MockEarlyStoppingClient)(nil).ValidateEarlyStoppingSettings), varargs...)
}

View File

@ -1,5 +1,10 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/kubeflow/katib/pkg/apis/manager/v1beta1 (interfaces: SuggestionClient)
//
// Generated by this command:
//
// mockgen -package mock -destination pkg/mock/v1beta1/api/suggestion.go github.com/kubeflow/katib/pkg/apis/manager/v1beta1 SuggestionClient
//
// Package mock is a generated GoMock package.
package mock
@ -8,8 +13,8 @@ import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
api_v1_beta1 "github.com/kubeflow/katib/pkg/apis/manager/v1beta1"
gomock "go.uber.org/mock/gomock"
grpc "google.golang.org/grpc"
)
@ -39,7 +44,7 @@ func (m *MockSuggestionClient) EXPECT() *MockSuggestionClientMockRecorder {
// GetSuggestions mocks base method.
func (m *MockSuggestionClient) GetSuggestions(arg0 context.Context, arg1 *api_v1_beta1.GetSuggestionsRequest, arg2 ...grpc.CallOption) (*api_v1_beta1.GetSuggestionsReply, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
varargs := []any{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
@ -50,16 +55,16 @@ func (m *MockSuggestionClient) GetSuggestions(arg0 context.Context, arg1 *api_v1
}
// GetSuggestions indicates an expected call of GetSuggestions.
func (mr *MockSuggestionClientMockRecorder) GetSuggestions(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
func (mr *MockSuggestionClientMockRecorder) GetSuggestions(arg0, arg1 any, arg2 ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
varargs := append([]any{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSuggestions", reflect.TypeOf((*MockSuggestionClient)(nil).GetSuggestions), varargs...)
}
// ValidateAlgorithmSettings mocks base method.
func (m *MockSuggestionClient) ValidateAlgorithmSettings(arg0 context.Context, arg1 *api_v1_beta1.ValidateAlgorithmSettingsRequest, arg2 ...grpc.CallOption) (*api_v1_beta1.ValidateAlgorithmSettingsReply, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0, arg1}
varargs := []any{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
@ -70,8 +75,8 @@ func (m *MockSuggestionClient) ValidateAlgorithmSettings(arg0 context.Context, a
}
// ValidateAlgorithmSettings indicates an expected call of ValidateAlgorithmSettings.
func (mr *MockSuggestionClientMockRecorder) ValidateAlgorithmSettings(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
func (mr *MockSuggestionClientMockRecorder) ValidateAlgorithmSettings(arg0, arg1 any, arg2 ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0, arg1}, arg2...)
varargs := append([]any{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateAlgorithmSettings", reflect.TypeOf((*MockSuggestionClient)(nil).ValidateAlgorithmSettings), varargs...)
}

View File

@ -1,5 +1,10 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/kubeflow/katib/pkg/db/v1beta1/common (interfaces: KatibDBInterface)
//
// Generated by this command:
//
// mockgen -package mock -destination pkg/mock/v1beta1/db/db.go github.com/kubeflow/katib/pkg/db/v1beta1/common KatibDBInterface
//
// Package mock is a generated GoMock package.
package mock
@ -7,8 +12,8 @@ package mock
import (
reflect "reflect"
gomock "github.com/golang/mock/gomock"
api_v1_beta1 "github.com/kubeflow/katib/pkg/apis/manager/v1beta1"
gomock "go.uber.org/mock/gomock"
)
// MockKatibDBInterface is a mock of KatibDBInterface interface.
@ -55,7 +60,7 @@ func (m *MockKatibDBInterface) DeleteObservationLog(arg0 string) error {
}
// DeleteObservationLog indicates an expected call of DeleteObservationLog.
func (mr *MockKatibDBInterfaceMockRecorder) DeleteObservationLog(arg0 interface{}) *gomock.Call {
func (mr *MockKatibDBInterfaceMockRecorder) DeleteObservationLog(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteObservationLog", reflect.TypeOf((*MockKatibDBInterface)(nil).DeleteObservationLog), arg0)
}
@ -70,7 +75,7 @@ func (m *MockKatibDBInterface) GetObservationLog(arg0, arg1, arg2, arg3 string)
}
// GetObservationLog indicates an expected call of GetObservationLog.
func (mr *MockKatibDBInterfaceMockRecorder) GetObservationLog(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
func (mr *MockKatibDBInterfaceMockRecorder) GetObservationLog(arg0, arg1, arg2, arg3 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetObservationLog", reflect.TypeOf((*MockKatibDBInterface)(nil).GetObservationLog), arg0, arg1, arg2, arg3)
}
@ -84,7 +89,7 @@ func (m *MockKatibDBInterface) RegisterObservationLog(arg0 string, arg1 *api_v1_
}
// RegisterObservationLog indicates an expected call of RegisterObservationLog.
func (mr *MockKatibDBInterfaceMockRecorder) RegisterObservationLog(arg0, arg1 interface{}) *gomock.Call {
func (mr *MockKatibDBInterfaceMockRecorder) RegisterObservationLog(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterObservationLog", reflect.TypeOf((*MockKatibDBInterface)(nil).RegisterObservationLog), arg0, arg1)
}

View File

@ -1,5 +1,10 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/kubeflow/katib/pkg/controller.v1beta1/experiment/manifest (interfaces: Generator)
//
// Generated by this command:
//
// mockgen -package mock -destination pkg/mock/v1beta1/experiment/manifest/generator.go github.com/kubeflow/katib/pkg/controller.v1beta1/experiment/manifest Generator
//
// Package mock is a generated GoMock package.
package mock
@ -7,10 +12,10 @@ package mock
import (
reflect "reflect"
gomock "github.com/golang/mock/gomock"
v1beta1 "github.com/kubeflow/katib/pkg/apis/config/v1beta1"
v1beta10 "github.com/kubeflow/katib/pkg/apis/controller/common/v1beta1"
v1beta11 "github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1"
gomock "go.uber.org/mock/gomock"
unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
client "sigs.k8s.io/controller-runtime/pkg/client"
)
@ -48,7 +53,7 @@ func (m *MockGenerator) GetEarlyStoppingConfigData(arg0 string) (v1beta1.EarlySt
}
// GetEarlyStoppingConfigData indicates an expected call of GetEarlyStoppingConfigData.
func (mr *MockGeneratorMockRecorder) GetEarlyStoppingConfigData(arg0 interface{}) *gomock.Call {
func (mr *MockGeneratorMockRecorder) GetEarlyStoppingConfigData(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEarlyStoppingConfigData", reflect.TypeOf((*MockGenerator)(nil).GetEarlyStoppingConfigData), arg0)
}
@ -63,7 +68,7 @@ func (m *MockGenerator) GetMetricsCollectorConfigData(arg0 v1beta10.CollectorKin
}
// GetMetricsCollectorConfigData indicates an expected call of GetMetricsCollectorConfigData.
func (mr *MockGeneratorMockRecorder) GetMetricsCollectorConfigData(arg0 interface{}) *gomock.Call {
func (mr *MockGeneratorMockRecorder) GetMetricsCollectorConfigData(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMetricsCollectorConfigData", reflect.TypeOf((*MockGenerator)(nil).GetMetricsCollectorConfigData), arg0)
}
@ -78,7 +83,7 @@ func (m *MockGenerator) GetRunSpecWithHyperParameters(arg0 *v1beta11.Experiment,
}
// GetRunSpecWithHyperParameters indicates an expected call of GetRunSpecWithHyperParameters.
func (mr *MockGeneratorMockRecorder) GetRunSpecWithHyperParameters(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
func (mr *MockGeneratorMockRecorder) GetRunSpecWithHyperParameters(arg0, arg1, arg2, arg3 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRunSpecWithHyperParameters", reflect.TypeOf((*MockGenerator)(nil).GetRunSpecWithHyperParameters), arg0, arg1, arg2, arg3)
}
@ -93,7 +98,7 @@ func (m *MockGenerator) GetSuggestionConfigData(arg0 string) (v1beta1.Suggestion
}
// GetSuggestionConfigData indicates an expected call of GetSuggestionConfigData.
func (mr *MockGeneratorMockRecorder) GetSuggestionConfigData(arg0 interface{}) *gomock.Call {
func (mr *MockGeneratorMockRecorder) GetSuggestionConfigData(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSuggestionConfigData", reflect.TypeOf((*MockGenerator)(nil).GetSuggestionConfigData), arg0)
}
@ -108,7 +113,7 @@ func (m *MockGenerator) GetTrialTemplate(arg0 *v1beta11.Experiment) (string, err
}
// GetTrialTemplate indicates an expected call of GetTrialTemplate.
func (mr *MockGeneratorMockRecorder) GetTrialTemplate(arg0 interface{}) *gomock.Call {
func (mr *MockGeneratorMockRecorder) GetTrialTemplate(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTrialTemplate", reflect.TypeOf((*MockGenerator)(nil).GetTrialTemplate), arg0)
}
@ -120,7 +125,7 @@ func (m *MockGenerator) InjectClient(arg0 client.Client) {
}
// InjectClient indicates an expected call of InjectClient.
func (mr *MockGeneratorMockRecorder) InjectClient(arg0 interface{}) *gomock.Call {
func (mr *MockGeneratorMockRecorder) InjectClient(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InjectClient", reflect.TypeOf((*MockGenerator)(nil).InjectClient), arg0)
}

View File

@ -1,5 +1,10 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/kubeflow/katib/pkg/controller.v1beta1/experiment/suggestion (interfaces: Suggestion)
//
// Generated by this command:
//
// mockgen -package mock -destination pkg/mock/v1beta1/experiment/suggestion/suggestion.go github.com/kubeflow/katib/pkg/controller.v1beta1/experiment/suggestion Suggestion
//
// Package mock is a generated GoMock package.
package mock
@ -7,9 +12,9 @@ package mock
import (
reflect "reflect"
gomock "github.com/golang/mock/gomock"
v1beta1 "github.com/kubeflow/katib/pkg/apis/controller/experiments/v1beta1"
v1beta10 "github.com/kubeflow/katib/pkg/apis/controller/suggestions/v1beta1"
gomock "go.uber.org/mock/gomock"
)
// MockSuggestion is a mock of Suggestion interface.
@ -45,7 +50,7 @@ func (m *MockSuggestion) GetOrCreateSuggestion(arg0 *v1beta1.Experiment, arg1 in
}
// GetOrCreateSuggestion indicates an expected call of GetOrCreateSuggestion.
func (mr *MockSuggestionMockRecorder) GetOrCreateSuggestion(arg0, arg1 interface{}) *gomock.Call {
func (mr *MockSuggestionMockRecorder) GetOrCreateSuggestion(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOrCreateSuggestion", reflect.TypeOf((*MockSuggestion)(nil).GetOrCreateSuggestion), arg0, arg1)
}
@ -59,7 +64,7 @@ func (m *MockSuggestion) UpdateSuggestion(arg0 *v1beta10.Suggestion) error {
}
// UpdateSuggestion indicates an expected call of UpdateSuggestion.
func (mr *MockSuggestionMockRecorder) UpdateSuggestion(arg0 interface{}) *gomock.Call {
func (mr *MockSuggestionMockRecorder) UpdateSuggestion(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSuggestion", reflect.TypeOf((*MockSuggestion)(nil).UpdateSuggestion), arg0)
}
@ -73,7 +78,7 @@ func (m *MockSuggestion) UpdateSuggestionStatus(arg0 *v1beta10.Suggestion) error
}
// UpdateSuggestionStatus indicates an expected call of UpdateSuggestionStatus.
func (mr *MockSuggestionMockRecorder) UpdateSuggestionStatus(arg0 interface{}) *gomock.Call {
func (mr *MockSuggestionMockRecorder) UpdateSuggestionStatus(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSuggestionStatus", reflect.TypeOf((*MockSuggestion)(nil).UpdateSuggestionStatus), arg0)
}

Some files were not shown because too many files have changed in this diff Show More