-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
backend: Pin python dependencies #3161
backend: Pin python dependencies #3161
Conversation
084a8e9
to
7ed33a9
Compare
/retest |
Thanks! looks like a first step of #3078. |
backend/requirements.txt
Outdated
@@ -0,0 +1,124 @@ | |||
absl-py==0.8.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better if
The requirements.txt was created by running python3 -m pip install tfx==0.21.0 && python3 -m pip freeze in the current python:3.5 image
is clearly documented inside code instead of in the PR.
Did you ever try pip-tools? Would a separate requirements.in
file for direct deps and a compiled requirements.txt
suit this model better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just ran into the problem with unpinned dependencies, so fixed it in the most obvious way. I did't add the comment because it didn't seem to matter to me outside the context of the commit, because well, given subsequent runs of that command will yield a different requirements.txt.
Re/ pip-tools, not familiar with it. I don't do much python. Feel free to replace this PR with something better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that comment is useful because we will probably install more dependencies/uninstall some dependencies from time to time. It will be a disaster to not know which ones are the actual direct dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/assign @Ark-kun
/assign @numerology
I'm not familiar with python env too. They will be able to help.
Since I again ran into a failed test due to changed, unpinned dependencies, I'm looking into pip-tools for both. Stay tuned. |
/retest |
18b42eb
to
661c770
Compare
Looks like the dependencies as resolved on my local machine somehow don't work in CI.. So I guess we need to run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Thanks! This looks great to me.
Only one comment left.
@numerology @Ark-kun for more review.
backend/Dockerfile
Outdated
RUN wget https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py | ||
RUN python3 -m pip install tfx==0.21.0 | ||
apt-get install --no-install-recommends -y -q default-jdk python3-setuptools python3-dev && \ | ||
pip install pip-tools==4.5.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pip-tools is redundant here, right?
I think you can document this command, run it in the path with
and copy the generated content to requirements.txt (because if we generates requirements.txt in docker, it will be owned by root). |
Yeah haven't push my latest revision. Should be there in a bit. |
661c770
to
894cba4
Compare
Ok this should be it. I've moved the command to a script and added a README to sample-test as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Thank you for your contribution! This is great.
One last comment
backend/update_requirements.sh
Outdated
#!/bin/bash | ||
set -euo pipefail | ||
|
||
exec docker run -v "$PWD:/src" -w /src --rm python:3.5 bash \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Can you duplicate this script in sample-test
folder too?
Very useful!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hrm it can be invoked from sample-test
, which is mentioned in the README I've created there. Maybe we should move it to the root of the repo? Or in /bin
or /hack
or something?
RUN pip3 install tfx==0.21.0 | ||
|
||
COPY ./test/sample-test/requirements.txt /python/src/github.com/kubeflow/pipelines/test/sample-test/requirements.txt | ||
RUN pip3 install -r /python/src/github.com/kubeflow/pipelines/test/sample-test/requirements.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@discordianfish actually, this uses a google/cloud-sdk:279.0.0
image, can you try pinning dependency in this image.
894cba4
to
08aea77
Compare
0ab6975
to
f879307
Compare
Builds/tests failed due to broken transident dependencies. This pins the python dependencies to prevent this in the future.
f879307
to
56c2c0d
Compare
Ok tests pass now! @Ark-kun @Bobgy @numerology can you approve (again)? |
Awesome, great thanks! @jingzhang36 for backend approval Didn't realize I have permission too for test folder |
/assign @rmgogogo Let's get this merged before it outdates again :) |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Bobgy, jingzhang36 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
* backend: Pin python dependencies Builds/tests failed due to broken transident dependencies. This pins the python dependencies to prevent this in the future. * Add README to test/sample-test
Builds/tests failed due to broken transident dependencies. This pins the
python dependencies to prevent this in the future.
The requirements.txt was created by running
python3 -m pip install tfx==0.21.0 && python3 -m pip freeze
in the current python:3.5 imageThis change is