Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 32 additions & 98 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions cmd/suggestion/v1alpha3/darts/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM python:3

ADD . /usr/src/app/github.com/kubeflow/katib
WORKDIR /usr/src/app/github.com/kubeflow/katib/cmd/suggestion/v1alpha3/darts
RUN pip install --no-cache-dir -r ./requirements.txt \
&& curl -O https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh \
&& sh Anaconda3-5.2.0-Linux-x86_64.sh -b \
&& . ~/.bashrc \
&& conda install -y pytorch-cpu torchvision-cpu -c pytorch
ENV PYTHONPATH /usr/src/app/github.com/kubeflow/katib:/usr/src/app/github.com/kubeflow/katib/pkg/api/suggestion/v1alpha3/python:/usr/src/app/github.com/kubeflow/katib/cmd/suggestion/v1alpha3/darts/cnn

ENTRYPOINT ["python", "service.py"]
23 changes: 23 additions & 0 deletions cmd/suggestion/v1alpha3/darts/client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# sample client for GRPC getSuggestions
import grpc
import time
from concurrent import futures

from pkg.api.suggestion.v1alpha3.python import oneshot_pb2_grpc
from pkg.api.suggestion.v1alpha3.python import oneshot_pb2

ADDRESS = '127.0.0.1:6789'

def main():
channel = grpc.insecure_channel(ADDRESS)
stub = oneshot_pb2_grpc.OneshotSuggestionStub(channel)
request = oneshot_pb2.GetOneshotSuggestionRequest()
reply = stub.GetSuggestions(request)
cnt = 0
for reply_item in reply:
cnt += 1
print(reply_item)
print(cnt) # how many chunks are received

if __name__ == "__main__":
main()
Loading