Skip to content

Commit

Permalink
Remove python checks and deps from custom server
Browse files Browse the repository at this point in the history
  • Loading branch information
bolasim committed Dec 10, 2024
1 parent e98f143 commit c43017d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 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.9.56rc0"
version = "0.9.56.dev1"
description = "A seamless bridge from model development to model delivery"
license = "MIT"
readme = "README.md"
Expand Down
6 changes: 0 additions & 6 deletions truss/templates/base.Dockerfile.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ FROM {{base_image_name_and_tag}} AS truss_server

ENV PYTHON_EXECUTABLE="{{ config.base_image.python_executable_path or 'python3' }}"

{% block fail_fast %}
RUN grep -w 'ID=debian\|ID_LIKE=debian' /etc/os-release || { echo "ERROR: Supplied base image is not a debian image"; exit 1; }
RUN $PYTHON_EXECUTABLE -c "import sys; sys.exit(0) if sys.version_info.major == {{supported_python_major_version_in_custom_base_image}} and sys.version_info.minor >={{min_supported_python_minor_version_in_custom_base_image}} and sys.version_info.minor <={{max_supported_python_minor_version_in_custom_base_image}} else sys.exit(1)" \
|| { echo "ERROR: Supplied base image does not have {{min_supported_python_version_in_custom_base_image}} <= python <= {{max_supported_python_version_in_custom_base_image}}"; exit 1; }
{% endblock %}

RUN pip install --upgrade pip --no-cache-dir \
&& rm -rf /root/.cache/pip

Expand Down
1 change: 0 additions & 1 deletion truss/templates/docker_server_requirements.txt

This file was deleted.

12 changes: 9 additions & 3 deletions truss/templates/server.Dockerfile.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
# If user base image is supplied in config, apply build commands from truss base image
{% if config.base_image %}
{%- if not config.docker_server %}

{% block fail_fast %}
RUN grep -w 'ID=debian\|ID_LIKE=debian' /etc/os-release || { echo "ERROR: Supplied base image is not a debian image"; exit 1; }
RUN $PYTHON_EXECUTABLE -c "import sys; sys.exit(0) if sys.version_info.major == {{supported_python_major_version_in_custom_base_image}} and sys.version_info.minor >={{min_supported_python_minor_version_in_custom_base_image}} and sys.version_info.minor <={{max_supported_python_minor_version_in_custom_base_image}} else sys.exit(1)" \
|| { echo "ERROR: Supplied base image does not have {{min_supported_python_version_in_custom_base_image}} <= python <= {{max_supported_python_version_in_custom_base_image}}"; exit 1; }
{% endblock %}


ENV PYTHONUNBUFFERED="True"
ENV DEBIAN_FRONTEND="noninteractive"

Expand Down Expand Up @@ -100,10 +108,8 @@ COPY ./{{ config.model_module_dir }} /app/model
{% block run %}
{%- if config.docker_server %}
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
curl nginx python3-pip && \
curl nginx supervisor && \
rm -rf /var/lib/apt/lists/*
COPY ./docker_server_requirements.txt /app/docker_server_requirements.txt
RUN pip install -r /app/docker_server_requirements.txt --no-cache-dir && rm -rf /root/.cache/pip
{% set proxy_config_path = "/etc/nginx/conf.d/proxy.conf" %}
{% set supervisor_config_path = "/etc/supervisor/supervisord.conf" %}
{% set supervisor_log_dir = "/var/log/supervisor" %}
Expand Down

0 comments on commit c43017d

Please sign in to comment.