Skip to content

Commit 38c9f3d

Browse files
committed
wip: add DeploymentSpec to AlgorithmSpec. Clones k8s 1.22.17 proto repo to enable protoc compilation. Go outputs look to correctly use upstream package.
1 parent ac321db commit 38c9f3d

File tree

6 files changed

+267
-229
lines changed

6 files changed

+267
-229
lines changed

pkg/apis/manager/v1beta1/api.pb.go

Lines changed: 137 additions & 125 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/manager/v1beta1/api.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ syntax = "proto3";
55

66
package api.v1.beta1;
77

8+
import "k8s.io/api/apps/v1/generated.proto";
9+
810
/**
911
* DBManager service defines APIs to manage Katib database.
1012
*/
@@ -134,6 +136,7 @@ enum ObjectiveType {
134136
message AlgorithmSpec {
135137
string algorithm_name = 1;
136138
repeated AlgorithmSetting algorithm_settings = 2;
139+
k8s.io.api.apps.v1.DeploymentSpec suggestion_spec = 3;
137140
}
138141

139142
/**

pkg/apis/manager/v1beta1/build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,14 @@ cd "$(dirname "$0")"
2121

2222
proto="api.proto"
2323

24+
git clone --depth 1 --branch kubernetes-1.22.17 https://github.com/kubernetes/api.git k8s.io/api
25+
git clone --depth 1 --branch kubernetes-1.22.17 https://github.com/kubernetes/apimachinery.git k8s.io/apimachinery
26+
2427
docker run -i --rm -v "$PWD:$PWD" -w "$PWD" znly/protoc --python_out=plugins=grpc:./python --go_out=plugins=grpc:. -I. $proto
2528
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
2629

30+
rm -rf k8s.io
31+
2732
docker build -t protoc-gen-doc gen-doc/
2833
docker run --rm -v "$PWD/gen-doc:/out" -v "$PWD:/apiprotos" protoc-gen-doc --doc_opt=markdown,api.md -I /protobuf -I /apiprotos $proto
2934
docker run --rm -v "$PWD/gen-doc:/out" -v "$PWD:/apiprotos" protoc-gen-doc --doc_opt=html,index.html -I /protobuf -I /apiprotos $proto

pkg/apis/manager/v1beta1/gen-doc/api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ HP or NAS algorithm specification.
9595
| ----- | ---- | ----- | ----------- |
9696
| algorithm_name | [string](#string) | | |
9797
| algorithm_settings | [AlgorithmSetting](#api-v1-beta1-AlgorithmSetting) | repeated | |
98+
| suggestion_spec | [k8s.io.api.apps.v1.DeploymentSpec](#k8s-io-api-apps-v1-DeploymentSpec) | | |
9899

99100

100101

pkg/apis/manager/v1beta1/gen-doc/index.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,13 @@ <h3 id="api.v1.beta1.AlgorithmSpec">AlgorithmSpec</h3>
455455
<td><p> </p></td>
456456
</tr>
457457

458+
<tr>
459+
<td>suggestion_spec</td>
460+
<td><a href="#k8s.io.api.apps.v1.DeploymentSpec">k8s.io.api.apps.v1.DeploymentSpec</a></td>
461+
<td></td>
462+
<td><p> </p></td>
463+
</tr>
464+
458465
</tbody>
459466
</table>
460467

0 commit comments

Comments
 (0)