Skip to content

Commit

Permalink
Fix SERVER_START_CMD environment variable (#320)
Browse files Browse the repository at this point in the history
* Fix entrypoint for published servers

* iterate

* use subshell in entrypoint for env var resolution

* fix dead doc link

* Revert "fix dead doc link"

This reverts commit 6475f3c.

* fix entrypoint

* fix test

* add SERVER_START_CMD to dockerfile

* fix diff test

* bump dev12

* bump to 0.4.6

* fix dockerfile

---------

Co-authored-by: Bola Malek <bola@baseten.co>
  • Loading branch information
joostinyi and bolasim committed Jun 2, 2023
1 parent b85d253 commit 9af2917
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "truss"
version = "0.4.6dev10"
version = "0.4.6"
description = "A seamless bridge from model development to model delivery"
license = "MIT"
readme = "README.md"
Expand Down
4 changes: 3 additions & 1 deletion truss/templates/server.Dockerfile.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ COPY ./{{config.data_dir}} /app/data
ENV HASH_TRUSS {{truss_hash}}
ENV CONTROL_SERVER_PORT 8080
ENV INFERENCE_SERVER_PORT 8090
ENV SERVER_START_CMD="/control/.env/bin/python3 /control/control/server.py"
ENTRYPOINT ["/control/.env/bin/python3", "/control/control/server.py"]
{%- else %}
ENV INFERENCE_SERVER_PORT 8080
ENTRYPOINT $PYTHON_EXECUTABLE /app/inference_server.py
ENV SERVER_START_CMD="{{(config.base_image.python_executable_path or "python3") ~ " /app/inference_server.py"}}"
ENTRYPOINT ["{{config.base_image.python_executable_path or "python3"}}", "/app/inference_server.py"]
{%- endif %}
{% endblock %}
3 changes: 2 additions & 1 deletion truss/test_data/server.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ COPY ./data /app/data
COPY ./packages /packages

ENV INFERENCE_SERVER_PORT 8080
ENTRYPOINT $PYTHON_EXECUTABLE /app/inference_server.py
ENV SERVER_START_CMD="/usr/local/bin/python3 /app/inference_server.py"
ENTRYPOINT ["/usr/local/bin/python3", "/app/inference_server.py"]

0 comments on commit 9af2917

Please sign in to comment.