From e8f5ebb8bb26ccc7c77b7ccd8a457e1502eedcfd Mon Sep 17 00:00:00 2001 From: Arief Rahmansyah Date: Thu, 14 Dec 2023 14:30:29 +0700 Subject: [PATCH] Uninstall merlin-sdk before installing pyfunc/batch dependencies (#507) **What this PR does / why we need it**: If user has a direct or indirect dependency on merlin-sdk on their pyfunc or batch job's conda.yaml, that merlin-sdk version is the one that will be used to run the pyfunc or batch job, ignoring the local merlin-sdk. By uninstalling it before installing the pyfunc or batch job dependencies, we make sure to always use the local merlin-sdk version. **Which issue(s) this PR fixes**: Fixes pyfunc/batch job running old version of merlin **Does this PR introduce a user-facing change?**: ```release-note NONE ``` **Checklist** - [ ] Added unit test, integration, and/or e2e tests - [x] Tested locally - [ ] Updated documentation - [ ] Update Swagger spec if the PR introduce API changes - [ ] Regenerated Golang and Python client if the PR introduce API changes --- python/batch-predictor/docker/app.Dockerfile | 2 +- python/pyfunc-server/docker/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/batch-predictor/docker/app.Dockerfile b/python/batch-predictor/docker/app.Dockerfile index a23205ff8..80f95eee2 100644 --- a/python/batch-predictor/docker/app.Dockerfile +++ b/python/batch-predictor/docker/app.Dockerfile @@ -31,7 +31,7 @@ COPY --chown=${UID}:${GID} batch-predictor ${HOME}/merlin-spark-app COPY --chown=${UID}:${GID} sdk ${HOME}/sdk ENV SDK_PATH=${HOME}/sdk -RUN /bin/bash -c ". activate merlin-model && pip install -r ${HOME}/merlin-spark-app/requirements.txt" +RUN /bin/bash -c ". activate merlin-model && pip uninstall -y merlin-sdk && pip install -r ${HOME}/merlin-spark-app/requirements.txt" # Download and dry-run user model artifacts and code ARG MODEL_ARTIFACTS_URL diff --git a/python/pyfunc-server/docker/Dockerfile b/python/pyfunc-server/docker/Dockerfile index 8671797ac..71c5fbcc4 100644 --- a/python/pyfunc-server/docker/Dockerfile +++ b/python/pyfunc-server/docker/Dockerfile @@ -32,7 +32,7 @@ COPY sdk /sdk ENV SDK_PATH=/sdk WORKDIR /pyfunc-server -RUN /bin/bash -c ". activate merlin-model && pip install -r /pyfunc-server/requirements.txt" +RUN /bin/bash -c ". activate merlin-model && pip uninstall -y merlin-sdk && pip install -r /pyfunc-server/requirements.txt" # Download and dry-run user model artifacts and code ARG MODEL_ARTIFACTS_URL