-
Notifications
You must be signed in to change notification settings - Fork 87
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
[APP-3453] Add python unbuffered environment variable #1156
Conversation
The Needs Review labels were added based on the following file changes. Team @datarobot/applications (#applications) was assigned because of changes in files:public_dropin_environments/python312/Dockerfile public_dropin_environments/python39_streamlit/Dockerfile Team @datarobot/buzok (#buzok) was assigned because of changes in files:public_dropin_environments/python311_genai/Dockerfile Team @datarobot/codegen (#scoring-code) was assigned because of changes in files:public_dropin_environments/python311_genai/Dockerfile Team @datarobot/custom-models (#custom-models) was assigned because of changes in files:public_dropin_environments/python312/Dockerfile public_dropin_environments/python39_streamlit/Dockerfile If you think that there are some issues with ownership, please discuss with C&A domain at #core-backend-domain slack channel and create PR to update DRCODEOWNERS\CODEOWNERS file. |
Label Needs Review: Scoring Code was removed because @shopin32 is part of Scoring Code domain. |
@@ -2,6 +2,9 @@ | |||
# It contains a variety of common useful data-science packages and tools. | |||
FROM datarobot/dropin-env-base-jdk:ubi8.8-py3.11-jdk11.0.22-drum1.11.5-mlops9.2.8 | |||
|
|||
# This makes print statements show up in the logs API | |||
ENV PYTHONUNBUFFERED=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 was right about to do this for all environments. Can I ask you to add this to others 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.
I agree, it seems like there is no reason to not set this in Dockerfile
where isatty()
is not reliable (https://bugs.python.org/issue41449).
However, we may get more bang for our buck if we update the envs in https://github.com/datarobot/datarobot-user-models/tree/master/docker and then update any envs that don't extend those base images.
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.
Makes sense to update the base image and also exceptions if they dont inherit from the base.
@ben-cutler-datarobot thank you for the PR, would you be up for this job?
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.
Sure thing
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.
Thanks a lot!
I think we can introduce to the listed python-aware base dropins. @yakov-g can you please assist with publishing new versions of the base image to our dockerhub?
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.
There are several base images, at least dropin-env-base and dropin-env-base-jdk are used in several of our environments.
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.
Ah, I didn't realize the jdk one had python. Got it 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.
PLease don't merge, I'll add into one more base image.
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.
Added, can merge
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.
Hold on again.
I'll update drum and image tag in the base envs
Done. |
This repository is public. Do not put here any private DataRobot or customer's data: code, datasets, model artifacts, .etc.
The way docker containers run python makes
Causes the print statements to not show up in the DataRobot logging APIs (eg
/api/v2/customApplications/<id>/logs/
)docker-library/python#604
We could make customers run:
but that would be a clunky solution.
We can add the environment variable
PYTHONUNBUFFERED
to the containers.Summary
Rationale