Skip to content

Commit

Permalink
fix(image-builder): Use SDK version that matches PyFunc servers (#499)
Browse files Browse the repository at this point in the history
<!--  Thanks for sending a pull request!  Here are some tips for you:

1. Run unit tests and ensure that they are passing
2. If your change introduces any API changes, make sure to update the
e2e tests
3. Make sure documentation is updated for your PR!

-->

**What this PR does / why we need it**:
<!-- Explain here the context and why you're making the change. What is
the problem you're trying to solve. --->

Users may sometimes add an explicit dependency on `merlin-sdk` whose
version may not be compatible with the Pyfunc Real-time / Batch server.
This PR adds a step to the image building such that, the local copy of
the SDK in the model server will be re-installed into the model
environment, in the final step - this way, the server and SDK will
always be in sync.

**Which issue(s) this PR fixes**:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->

Handles cases where a user specified dependency on `merlin-sdk` in their
model could lead to a mismatch on the Pyfunc server.

**Does this PR introduce a user-facing change?**:
<!--
If no, just write "NONE" in the release-note block below.
If yes, a release note is required. Enter your extended release note in
the block below.
If the PR requires additional action from users switching to the new
release, include the string "action required".

For more information about release notes, see kubernetes' guide here:
http://git.k8s.io/community/contributors/guide/release-notes.md
-->

```release-note
Force an SDK version that matches PyFunc servers during image building
```

**Checklist**

- [ ] Added unit test, integration, and/or e2e tests
- [ ] Tested locally
- [ ] Updated documentation
- [ ] Update Swagger spec if the PR introduce API changes
- [ ] Regenerated Golang and Python client if the PR introduce API
changes
  • Loading branch information
krithika369 authored Nov 30, 2023
1 parent 78dd351 commit 670ac14
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions python/batch-predictor/docker/app.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ RUN /bin/bash -c ". activate ${CONDA_ENVIRONMENT} && \
sed -i 's/mlflow[><=]\{0,1\}.*$/mlflow==1.26.1/g' ${HOME}/model/conda.yaml && \
sed -i '/merlin-sdk/d' ${HOME}/model/conda.yaml && \
conda env update --name ${CONDA_ENVIRONMENT} --file ${HOME}/model/conda.yaml && \
pip install ${SDK_PATH} && \
python ${HOME}/merlin-spark-app/main.py --dry-run-model ${HOME}/model"
1 change: 1 addition & 0 deletions python/pyfunc-server/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ RUN /bin/bash -c ". activate merlin-model && \
sed -i 's/mlflow[><=]\{0,1\}.*$/mlflow==1.26.1/g' model/conda.yaml && \
sed -i '/merlin-sdk/d' model/conda.yaml && \
conda env update --name merlin-model --file model/conda.yaml && \
pip install ${SDK_PATH} && \
python -m pyfuncserver --model_dir model --dry_run"

CMD ["/bin/bash", "./run.sh"]

0 comments on commit 670ac14

Please sign in to comment.