diff --git a/saxml/tools/docker/Dockerfile.admin b/saxml/tools/docker/Dockerfile.admin index 14aaf04d..3ec350f9 100644 --- a/saxml/tools/docker/Dockerfile.admin +++ b/saxml/tools/docker/Dockerfile.admin @@ -37,15 +37,20 @@ COPY --from=build_image \ /saxml/bazel-bin/saxml/bin/saxutil_/saxutil \ /usr/bin/saxutil -# Use "/sax/test" as default sax cell. -ENV SAX_CELL=/sax/test +# Use "/sax/cell" as default sax cell. +ENV SAX_CELL=/sax/cell # Use "10000" as default port for admin server gRPC endpoint. ENV PORT=10000 ENV SAX_ROOT="" ENV FS_ROOT="" ENV SAX_GCS_BUCKET="" +ENV SAX_DIR="" # Create a script that configures and runs the admin server. RUN echo '#!/bin/bash\n\ +if [[ -n "$SAX_DIR" ]]; then\n\ + SAX_ROOT=${SAX_DIR}/sax-root \n\ + FS_ROOT=${SAX_DIR}/sax-fs-root \n\ +fi\n\ if [[ -n "$GSBUCKET" ]]; then\n\ SAX_GCS_BUCKET=${GSBUCKET}\n\ fi\n\ @@ -72,4 +77,4 @@ admin_server \ --alsologtostderr\n' \ > /usr/bin/admin_server_entrypoint.sh && chmod +x /usr/bin/admin_server_entrypoint.sh -ENTRYPOINT ["/usr/bin/admin_server_entrypoint.sh"] +ENTRYPOINT ["/usr/bin/admin_server_entrypoint.sh"] \ No newline at end of file diff --git a/saxml/tools/docker/Dockerfile.model b/saxml/tools/docker/Dockerfile.model index 76fbc3a5..5bba27da 100644 --- a/saxml/tools/docker/Dockerfile.model +++ b/saxml/tools/docker/Dockerfile.model @@ -58,14 +58,18 @@ COPY --from=build_image \ /usr/bin ENV SAX_ROOT="" +ENV SAX_DIR="" RUN echo '#!/bin/bash\n\ +if [[ -n "$SAX_DIR" ]];then \n\ + SAX_ROOT=${LOCAL_DIR}/sax-root \n\ +fi\n\ if [[ -z "$SAX_ROOT" ]]; then\n\ if [[ -n "$SAX_GCS_BUCKET" && -n "$SAX_REPLICA_NAME" ]]; then\n\ SAX_ROOT=gs://${SAX_GCS_BUCKET}/${SAX_REPLICA_NAME}/sax-root \n\ fi\n\ fi\n\ -server --alsologtostderr --sax_cell=/sax/test $@\n' \ +server --alsologtostderr --sax_cell=/sax/cell $@\n' \ > /usr/bin/model_server_entrypoint.sh && chmod +x /usr/bin/model_server_entrypoint.sh -ENTRYPOINT ["/usr/bin/model_server_entrypoint.sh"] +ENTRYPOINT ["/usr/bin/model_server_entrypoint.sh"] \ No newline at end of file