From fd914967698671cea1f60099851a0bea59916b66 Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Wed, 27 Apr 2022 11:55:32 +0530 Subject: [PATCH] Included gRPC dependency modules and exposed the gRPC service port --- Dockerfile.hpo | 5 +++-- scripts/cluster-helpers.sh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile.hpo b/Dockerfile.hpo index e6bcdc9..acdae10 100644 --- a/Dockerfile.hpo +++ b/Dockerfile.hpo @@ -25,7 +25,7 @@ WORKDIR /opt/app # Install packages needed for python to function correctly # Create the non root user, same as the one used in the build phase. -RUN microdnf install -y python3 \ +RUN microdnf install -y python3 gcc-c++ python3-devel \ && microdnf update -y \ && microdnf -y install shadow-utils \ && adduser -u 1001 -G root -s /usr/sbin/nologin default \ @@ -38,7 +38,7 @@ RUN microdnf install -y python3 \ USER 1001 # Install optuna to the default user -RUN python3 -m pip install --user optuna requests scikit-optimize jsonschema +RUN python3 -m pip install --user optuna requests scikit-optimize jsonschema click grpcio google-api-core LABEL name="Kruize HPO" \ vendor="Red Hat" \ @@ -54,5 +54,6 @@ COPY --chown=1001:0 index.html /opt/app/ EXPOSE 8085 +EXPOSE 50051 ENTRYPOINT python3 -u src/service.py diff --git a/scripts/cluster-helpers.sh b/scripts/cluster-helpers.sh index b72764d..a060e01 100644 --- a/scripts/cluster-helpers.sh +++ b/scripts/cluster-helpers.sh @@ -69,7 +69,7 @@ function docker_start() { check_prereq running ${SERVICE_STATUS_DOCKER} - ${CONTAINER_RUNTIME} run -d --name hpo_docker_container -p 8085:8085 ${HPO_CONTAINER_IMAGE} >/dev/null 2>&1 + ${CONTAINER_RUNTIME} run -d --name hpo_docker_container -p 8085:8085 -p 50051:50051 ${HPO_CONTAINER_IMAGE} >/dev/null 2>&1 check_err "Unexpected error occured. Service Stopped!" echo