Skip to content

Commit 6fb2c47

Browse files
[EAGLE-7160]: Use tini as entrypoint (#922)
* use tini as default entrypoint
1 parent 521126f commit 6fb2c47

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

clarifai/runners/dockerfile_template/Dockerfile.node.template

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
FROM --platform=$TARGETPLATFORM python:${PYTHON_VERSION}-slim
44
# Install Node.js & npm (npx is included with npm)
55
# This is required to run the Node.js MCP server via npx
6-
RUN apt-get update && apt-get install -y curl xz-utils \
6+
RUN apt-get update && apt-get install -y curl xz-utils tini \
77
&& curl -fsSL https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz -o node.tar.xz \
88
&& tar -xJf node.tar.xz -C /usr/local --strip-components=1 \
99
&& rm node.tar.xz \
@@ -55,8 +55,7 @@ ENV PYTHONPATH=${PYTHONPATH}:/home/nonroot/main \
5555

5656
WORKDIR /home/nonroot/main
5757

58-
# Finally run the clarifai entrypoint to start the runner loop and local runner server.
59-
# Note(zeiler): we may want to make this a clarifai CLI call.
60-
ENTRYPOINT ["python", "-m", "clarifai.runners.server"]
61-
CMD ["--model_path", "/home/nonroot/main"]
58+
# Finally run tini which acts as the init process to reap zombies and wraps the clarifai cmd that starts the runner loop and local runner server.
59+
ENTRYPOINT ["/usr/bin/tini-static", "--"]
60+
CMD ["python", "-m", "clarifai.runners.server", "--model_path", "/home/nonroot/main"]
6261
#############################

clarifai/runners/dockerfile_template/Dockerfile.template

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ COPY --link --chown=65532:65532 requirements.txt /home/nonroot/requirements.txt
4343
ENV VIRTUAL_ENV=/venv
4444
ENV PATH="/home/nonroot/.local/bin:$VIRTUAL_ENV/bin:$PATH"
4545

46-
4746
# Update clarifai package so we always have latest protocol to the API. Everything should land in /venv
4847
RUN ["uv", "pip", "install", "--no-cache-dir", "-r", "/home/nonroot/requirements.txt"]
4948
RUN ["uv", "pip", "show", "--no-cache-dir", "clarifai"]
@@ -68,8 +67,7 @@ ENV PYTHONPATH=${PYTHONPATH}:/home/nonroot/main \
6867
CLARIFAI_COMPUTE_CLUSTER_ID=${CLARIFAI_COMPUTE_CLUSTER_ID} \
6968
CLARIFAI_API_BASE=${CLARIFAI_API_BASE:-https://api.clarifai.com}
7069

71-
# Finally run the clarifai entrypoint to start the runner loop and local runner server.
72-
# Note(zeiler): we may want to make this a clarifai CLI call.
73-
ENTRYPOINT ["python", "-m", "clarifai.runners.server"]
74-
CMD ["--model_path", "/home/nonroot/main"]
70+
# Finally run tini which acts as the init process to reap zombies and wraps the clarifai cmd that starts the runner loop and local runner server.
71+
ENTRYPOINT ["/usr/bin/tini", "--"]
72+
CMD ["python", "-m", "clarifai.runners.server", "--model_path", "/home/nonroot/main"]
7573
#############################

clarifai/runners/utils/const.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
registry = os.environ.get('CLARIFAI_BASE_IMAGE_REGISTRY', 'public.ecr.aws/clarifai-models')
44

5-
GIT_SHA = "a008c5fdd0690ce7ac44d04ec54f02722837dfc5"
5+
GIT_SHA = "77e4ad7daeb7a3b175702a1dc5778f22f35ff7a8"
66

7-
AMD_GIT_SHA = "81e942130173f54927e7c9a65aabc7e32780616d"
7+
AMD_GIT_SHA = "451f564c3f688e9c0d5c43ad737581e5424b04f1"
88

99
PYTHON_BASE_IMAGE = registry + '/python-base:{python_version}-' + GIT_SHA
1010
TORCH_BASE_IMAGE = registry + '/torch:{torch_version}-py{python_version}-{gpu_version}-' + GIT_SHA

0 commit comments

Comments
 (0)