Skip to content

Commit b176b04

Browse files
authored
Update Algorithm Service Doc for new CI script (#1724)
* Update Algorithm Service Doc for new CI script * Fix experiments * Remove spaces
1 parent 5353cb5 commit b176b04

File tree

1 file changed

+21
-65
lines changed

1 file changed

+21
-65
lines changed

docs/new-algorithm-service.md

Lines changed: 21 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ e2e test for it in the CI and submit a PR.
119119

120120
#### Unit Test
121121

122-
Here is an example [test_hyperopt_service.py](../test/suggestion/v1beta1/test_hyperopt_service.py):
122+
Here is an example [test_hyperopt_service.py](../test/unit/v1beta1/suggestion/test_hyperopt_service.py):
123123

124124
```python
125125
import grpc
@@ -149,7 +149,7 @@ You can setup the GRPC server using `grpc_testing`, then define your own test ca
149149

150150
#### E2E Test (Optional)
151151

152-
E2e tests help Katib verify that the algorithm works well.
152+
E2E tests help Katib verify that the algorithm works well.
153153
Follow below steps to add your algorithm (Suggestion) to the Katib CI
154154
(replace `<name>` with your Suggestion name):
155155

@@ -160,76 +160,32 @@ Follow below steps to add your algorithm (Suggestion) to the Katib CI
160160
1. Create a new Experiment YAML in the [examples/v1beta1](../examples/v1beta1)
161161
with the new algorithm.
162162

163-
1. Update [`setup-katib.sh`](../test/scripts/v1beta1/setup-katib.sh)
163+
1. Update [`setup-katib.sh`](../test/e2e/v1beta1/scripts/setup-katib.sh)
164164
script to modify `katib-config.yaml` with the new test Suggestion image name.
165165
For example:
166166

167167
```sh
168168
sed -i -e "[email protected]/kubeflowkatib/suggestion-<name>@${ECR_REGISTRY}/${REPO_NAME}/v1beta1/suggestion-<name>@" ${CONFIG_PATCH}
169169
```
170170

171-
1. Add a new two steps in the CI workflow
172-
([test/workflows/components/workflows-v1beta1.libsonnet](../test/workflows/components/workflows-v1beta1.libsonnet))
173-
to build and run the new Suggestion:
171+
1. Update the following variables in [`argo_workflow.py`](../test/e2e/v1beta1/argo_workflow.py):
172+
173+
- [`KATIB_IMAGES`](../test/e2e/v1beta1/argo_workflow.py#L43) with your Suggestion Dockerfile location:
174+
175+
```diff
176+
. . .
177+
"suggestion-goptuna": "cmd/suggestion/goptuna/v1beta1/Dockerfile",
178+
"suggestion-optuna": "cmd/suggestion/optuna/v1beta1/Dockerfile",
179+
+ "suggestion-<name>": "cmd/suggestion/<name>/v1beta1/Dockerfile",
180+
. . .
181+
```
182+
183+
- [`KATIB_EXPERIMENTS`](../test/e2e/v1beta1/argo_workflow.py#L69) with your Experiment YAML location:
174184

175185
```diff
176-
. . .
177-
{
178-
name: "build-suggestion-hyperopt",
179-
template: "build-suggestion-hyperopt",
180-
},
181-
{
182-
name: "build-suggestion-chocolate",
183-
template: "build-suggestion-chocolate",
184-
},
185-
+ {
186-
+ name: "build-suggestion-<name>",
187-
+ template: "build-suggestion-<name>",
188-
+ },
189-
. . .
190-
{
191-
name: "run-tpe-e2e-tests",
192-
template: "run-tpe-e2e-tests",
193-
},
194-
{
195-
name: "run-grid-e2e-tests",
196-
template: "run-grid-e2e-tests",
197-
},
198-
+ {
199-
+ name: "run-<name>-e2e-tests",
200-
+ template: "run-<name>-e2e-tests",
201-
+ },
202-
. . .
203-
$.parts(namespace, name, overrides).e2e(prow_env, bucket).buildTemplate("build-suggestion-hyperopt", kanikoExecutorImage, [
204-
"/kaniko/executor",
205-
"--dockerfile=" + katibDir + "/cmd/suggestion/hyperopt/v1beta1/Dockerfile",
206-
"--context=dir://" + katibDir,
207-
"--destination=" + registry + "/katib/v1beta1/suggestion-hyperopt:$(PULL_BASE_SHA)",
208-
]), // build suggestion hyperopt
209-
$.parts(namespace, name, overrides).e2e(prow_env, bucket).buildTemplate("build-suggestion-chocolate", kanikoExecutorImage, [
210-
"/kaniko/executor",
211-
"--dockerfile=" + katibDir + "/cmd/suggestion/chocolate/v1beta1/Dockerfile",
212-
"--context=dir://" + katibDir,
213-
"--destination=" + registry + "/katib/v1beta1/suggestion-chocolate:$(PULL_BASE_SHA)",
214-
]), // build suggestion chocolate
215-
+ $.parts(namespace, name, overrides).e2e(prow_env, bucket).buildTemplate("build-suggestion-<name>", kanikoExecutorImage, [
216-
+ "/kaniko/executor",
217-
+ "--dockerfile=" + katibDir + "/cmd/suggestion/<name>/v1beta1/Dockerfile",
218-
+ "--context=dir://" + katibDir,
219-
+ "--destination=" + registry + "/katib/v1beta1/suggestion-<name>:$(PULL_BASE_SHA)",
220-
+ ]), // build suggestion <name>
221-
. . .
222-
$.parts(namespace, name, overrides).e2e(prow_env, bucket).buildTemplate("run-tpe-e2e-tests", testWorkerImage, [
223-
"test/scripts/v1beta1/run-e2e-experiment.sh",
224-
"examples/v1beta1/tpe-example.yaml",
225-
]), // run TPE algorithm
226-
$.parts(namespace, name, overrides).e2e(prow_env, bucket).buildTemplate("run-grid-e2e-tests", testWorkerImage, [
227-
"test/scripts/v1beta1/run-e2e-experiment.sh",
228-
"examples/v1beta1/grid-example.yaml",
229-
]), // run grid algorithm
230-
+ $.parts(namespace, name, overrides).e2e(prow_env, bucket).buildTemplate("run-<name>-e2e-tests", testWorkerImage, [
231-
+ "test/scripts/v1beta1/run-e2e-experiment.sh",
232-
+ "examples/v1beta1/<name>-example.yaml",
233-
+ ]), // run <name> algorithm
234-
. . .
186+
. . .
187+
"multivariate-tpe": "examples/v1beta1/hp-tuning/multivariate-tpe.yaml",
188+
"cmaes": "examples/v1beta1/hp-tuning/cma-es.yaml",
189+
+ "<algorithm-name>: "examples/v1beta1/hp-tuning/<algorithm-name>.yaml",
190+
. . .
235191
```

0 commit comments

Comments
 (0)