Skip to content

Commit f3c8279

Browse files
committed
Add unit test
1 parent 7417e8c commit f3c8279

File tree

18 files changed

+720
-544
lines changed

18 files changed

+720
-544
lines changed

cmd/earlystopping/medianstop/v1beta1/Dockerfile

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,6 @@ RUN if [ "$(uname -m)" = "ppc64le" ] || [ "$(uname -m)" = "aarch64" ]; then \
99
pip install cython; \
1010
fi
1111

12-
RUN GRPC_HEALTH_PROBE_VERSION=v0.3.1 && \
13-
if [ "$(uname -m)" = "ppc64le" ]; then \
14-
wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-ppc64le; \
15-
elif [ "$(uname -m)" = "aarch64" ]; then \
16-
wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-arm64; \
17-
else \
18-
wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64; \
19-
fi && \
20-
chmod +x /bin/grpc_health_probe
21-
2212
ADD ./pkg/ ${TARGET_DIR}/pkg/
2313
ADD ./${EARLY_STOPPING_DIR}/ ${TARGET_DIR}/${EARLY_STOPPING_DIR}/
2414
WORKDIR ${TARGET_DIR}/${EARLY_STOPPING_DIR}
@@ -27,7 +17,7 @@ RUN pip install --no-cache-dir -r requirements.txt
2717
RUN chgrp -R 0 ${TARGET_DIR} \
2818
&& chmod -R g+rwX ${TARGET_DIR}
2919

30-
ENV PYTHONPATH ${TARGET_DIR}:${TARGET_DIR}/pkg/apis/manager/v1beta1/python:${TARGET_DIR}/pkg/apis/manager/health/python
20+
ENV PYTHONPATH ${TARGET_DIR}:${TARGET_DIR}/pkg/apis/manager/v1beta1/python
3121

3222
ENTRYPOINT ["python", "main.py"]
3323

cmd/earlystopping/medianstop/v1beta1/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
def serve():
1212
server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
1313
service = MedianStopService()
14-
api_pb2_grpc.add_EarlyStoppingServicer_to_server(service, server)
14+
api_pb2_grpc.add_SuggestionServicer_to_server(service, server)
1515

1616
server.add_insecure_port(DEFAULT_PORT)
1717
print("Listening...")

cmd/metricscollector/v1beta1/file-metricscollector/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ func watchMetricsFile(mFile string, stopRules stopRulesFlag, filters []string) {
259259
klog.Fatalf("Could not connect to Early Stopping service, error: %v", err)
260260
}
261261
defer conn.Close()
262-
c := api.NewEarlyStoppingClient(conn)
262+
c := api.NewSuggestionClient(conn)
263263

264264
setTrialStatusReq := &api.SetTrialStatusRequest{
265265
TrialName: *trialName,

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

Lines changed: 161 additions & 193 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: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,11 @@ service DBManager {
3131
}
3232

3333
/**
34-
* Suggestion service defines APIs to manage Katib Suggestion algorithm.
34+
* Suggestion service defines APIs to manage Katib Suggestion AutoML algorithms and early stopping techniques
3535
*/
3636
service Suggestion {
3737
rpc GetSuggestions(GetSuggestionsRequest) returns (GetSuggestionsReply);
3838
rpc ValidateAlgorithmSettings(ValidateAlgorithmSettingsRequest) returns (ValidateAlgorithmSettingsReply);
39-
}
40-
41-
/**
42-
* EarlyStopping service defines APIs to manage Katib early stopping techniques
43-
*/
44-
service EarlyStopping {
4539
rpc GetEarlyStoppingRules(GetEarlyStoppingRulesRequest) returns (GetEarlyStoppingRulesReply);
4640
rpc SetTrialStatus(SetTrialStatusRequest) returns (SetTrialStatusReply);
4741
}

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

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
- [TrialStatus.TrialConditionType](#api.v1.beta1.TrialStatus.TrialConditionType)
5252

5353
- [DBManager](#api.v1.beta1.DBManager)
54-
- [EarlyStopping](#api.v1.beta1.EarlyStopping)
5554
- [Suggestion](#api.v1.beta1.Suggestion)
5655

5756
- [Scalar Value Types](#scalar-value-types)
@@ -775,26 +774,17 @@ DBManager service defines APIs to manage Katib database.
775774
| DeleteObservationLog | [DeleteObservationLogRequest](#api.v1.beta1.DeleteObservationLogRequest) | [DeleteObservationLogReply](#api.v1.beta1.DeleteObservationLogReply) | Delete all log of Observations for a Trial. |
776775

777776

778-
<a name="api.v1.beta1.EarlyStopping"></a>
779-
780-
### EarlyStopping
781-
EarlyStopping service defines APIs to manage Katib early stopping techniques
782-
783-
| Method Name | Request Type | Response Type | Description |
784-
| ----------- | ------------ | ------------- | ------------|
785-
| GetEarlyStoppingRules | [GetEarlyStoppingRulesRequest](#api.v1.beta1.GetEarlyStoppingRulesRequest) | [GetEarlyStoppingRulesReply](#api.v1.beta1.GetEarlyStoppingRulesReply) | |
786-
| SetTrialStatus | [SetTrialStatusRequest](#api.v1.beta1.SetTrialStatusRequest) | [SetTrialStatusReply](#api.v1.beta1.SetTrialStatusReply) | |
787-
788-
789777
<a name="api.v1.beta1.Suggestion"></a>
790778

791779
### Suggestion
792-
Suggestion service defines APIs to manage Katib Suggestion algorithm.
780+
Suggestion service defines APIs to manage Katib Suggestion AutoML algorithms and early stopping techniques
793781

794782
| Method Name | Request Type | Response Type | Description |
795783
| ----------- | ------------ | ------------- | ------------|
796784
| GetSuggestions | [GetSuggestionsRequest](#api.v1.beta1.GetSuggestionsRequest) | [GetSuggestionsReply](#api.v1.beta1.GetSuggestionsReply) | |
797785
| ValidateAlgorithmSettings | [ValidateAlgorithmSettingsRequest](#api.v1.beta1.ValidateAlgorithmSettingsRequest) | [ValidateAlgorithmSettingsReply](#api.v1.beta1.ValidateAlgorithmSettingsReply) | |
786+
| GetEarlyStoppingRules | [GetEarlyStoppingRulesRequest](#api.v1.beta1.GetEarlyStoppingRulesRequest) | [GetEarlyStoppingRulesReply](#api.v1.beta1.GetEarlyStoppingRulesReply) | |
787+
| SetTrialStatus | [SetTrialStatusRequest](#api.v1.beta1.SetTrialStatusRequest) | [SetTrialStatusReply](#api.v1.beta1.SetTrialStatusReply) | |
798788

799789

800790

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

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -361,10 +361,6 @@ <h2>Table of Contents</h2>
361361
<a href="#api.v1.beta1.DBManager"><span class="badge">S</span>DBManager</a>
362362
</li>
363363

364-
<li>
365-
<a href="#api.v1.beta1.EarlyStopping"><span class="badge">S</span>EarlyStopping</a>
366-
</li>
367-
368364
<li>
369365
<a href="#api.v1.beta1.Suggestion"><span class="badge">S</span>Suggestion</a>
370366
</li>
@@ -1812,51 +1808,39 @@ <h3 id="api.v1.beta1.DBManager">DBManager</h3>
18121808
</table>
18131809

18141810

1815-
<h3 id="api.v1.beta1.EarlyStopping">EarlyStopping</h3>
1816-
<p>EarlyStopping service defines APIs to manage Katib early stopping techniques</p>
1811+
<h3 id="api.v1.beta1.Suggestion">Suggestion</h3>
1812+
<p>Suggestion service defines APIs to manage Katib Suggestion AutoML algorithms and early stopping techniques</p>
18171813
<table class="enum-table">
18181814
<thead>
18191815
<tr><td>Method Name</td><td>Request Type</td><td>Response Type</td><td>Description</td></tr>
18201816
</thead>
18211817
<tbody>
18221818

18231819
<tr>
1824-
<td>GetEarlyStoppingRules</td>
1825-
<td><a href="#api.v1.beta1.GetEarlyStoppingRulesRequest">GetEarlyStoppingRulesRequest</a></td>
1826-
<td><a href="#api.v1.beta1.GetEarlyStoppingRulesReply">GetEarlyStoppingRulesReply</a></td>
1820+
<td>GetSuggestions</td>
1821+
<td><a href="#api.v1.beta1.GetSuggestionsRequest">GetSuggestionsRequest</a></td>
1822+
<td><a href="#api.v1.beta1.GetSuggestionsReply">GetSuggestionsReply</a></td>
18271823
<td><p></p></td>
18281824
</tr>
18291825

18301826
<tr>
1831-
<td>SetTrialStatus</td>
1832-
<td><a href="#api.v1.beta1.SetTrialStatusRequest">SetTrialStatusRequest</a></td>
1833-
<td><a href="#api.v1.beta1.SetTrialStatusReply">SetTrialStatusReply</a></td>
1827+
<td>ValidateAlgorithmSettings</td>
1828+
<td><a href="#api.v1.beta1.ValidateAlgorithmSettingsRequest">ValidateAlgorithmSettingsRequest</a></td>
1829+
<td><a href="#api.v1.beta1.ValidateAlgorithmSettingsReply">ValidateAlgorithmSettingsReply</a></td>
18341830
<td><p></p></td>
18351831
</tr>
18361832

1837-
</tbody>
1838-
</table>
1839-
1840-
1841-
<h3 id="api.v1.beta1.Suggestion">Suggestion</h3>
1842-
<p>Suggestion service defines APIs to manage Katib Suggestion algorithm.</p>
1843-
<table class="enum-table">
1844-
<thead>
1845-
<tr><td>Method Name</td><td>Request Type</td><td>Response Type</td><td>Description</td></tr>
1846-
</thead>
1847-
<tbody>
1848-
18491833
<tr>
1850-
<td>GetSuggestions</td>
1851-
<td><a href="#api.v1.beta1.GetSuggestionsRequest">GetSuggestionsRequest</a></td>
1852-
<td><a href="#api.v1.beta1.GetSuggestionsReply">GetSuggestionsReply</a></td>
1834+
<td>GetEarlyStoppingRules</td>
1835+
<td><a href="#api.v1.beta1.GetEarlyStoppingRulesRequest">GetEarlyStoppingRulesRequest</a></td>
1836+
<td><a href="#api.v1.beta1.GetEarlyStoppingRulesReply">GetEarlyStoppingRulesReply</a></td>
18531837
<td><p></p></td>
18541838
</tr>
18551839

18561840
<tr>
1857-
<td>ValidateAlgorithmSettings</td>
1858-
<td><a href="#api.v1.beta1.ValidateAlgorithmSettingsRequest">ValidateAlgorithmSettingsRequest</a></td>
1859-
<td><a href="#api.v1.beta1.ValidateAlgorithmSettingsReply">ValidateAlgorithmSettingsReply</a></td>
1841+
<td>SetTrialStatus</td>
1842+
<td><a href="#api.v1.beta1.SetTrialStatusRequest">SetTrialStatusRequest</a></td>
1843+
<td><a href="#api.v1.beta1.SetTrialStatusReply">SetTrialStatusReply</a></td>
18601844
<td><p></p></td>
18611845
</tr>
18621846

0 commit comments

Comments
 (0)