Skip to content

Commit

Permalink
Simplifying using volume mount instead of GCSBucket in singlehost cas…
Browse files Browse the repository at this point in the history
…e. Changed SAX_CELL default to /sax/cell

PiperOrigin-RevId: 620978624
Change-Id: I445693188c391d6de70c5d916c2cb00c850e1394
  • Loading branch information
Sax Authors authored and copybara-github committed Apr 1, 2024
1 parent d290a4c commit 99181d4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
11 changes: 8 additions & 3 deletions saxml/tools/docker/Dockerfile.admin
Original file line number Diff line number Diff line change
Expand Up @@ -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\
Expand All @@ -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"]
8 changes: 6 additions & 2 deletions saxml/tools/docker/Dockerfile.model
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

0 comments on commit 99181d4

Please sign in to comment.