Skip to content

Use tty for running docker commands by default #2260

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

Merged
merged 3 commits into from
Mar 22, 2025

Conversation

mathbunnyru
Copy link
Member

Describe your changes

Issue ticket if applicable

Checklist (especially for first-time contributors)

  • I have performed a self-review of my code
  • If it is a core feature, I have added thorough tests
  • I will try not to use force-push to make the review process easier for reviewers
  • I have updated the documentation for significant changes

@mathbunnyru
Copy link
Member Author

I first made our tests work fine without tty (and fixed a bug in our start script) and unified tests, but now I want to have tty by default:

  • sometimes we have different results with tty and without it, so it's nice to have the tests which work fine in both cases and to control from one place if tty is enabled (unfortunately, before, TTY flag was quite random)
  • by default I want to have tty enabled: the output is coloured, which makes debugging much easier when something fails

no_warnings=False,
user="1010",
command=["id"],
timeout=5, no_warnings=False, user="1010", command=["id"], tty=False
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only test which fails with tty enabled (I tested base-notebook locally).
It also fails when running manually:
docker run -it --user 1010 quay.io/jupyter/base-notebook:latest id
If I remove -t, then it gives expected output.

The source of /usr/local/bin/before-notebook.d/10activate-conda-env.sh unfortunately doesn't work

Copy link
Member Author

@mathbunnyru mathbunnyru Mar 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, I removed the script in the image, and then ran it's content manually (eval "$(conda shell.bash hook)") and in the end it gives:

Would you like conda to send this report to the core maintainers? [y/N]:

So in a non-interactive mode it just finishes, but in interactive it fails after timeout.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And it fails after 40 seconds which is more than our timeout, that's why test reports as failed

https://github.com/conda/conda/blob/4691c2826d5282637674de754b504c2f045e23d5/conda/exception_handler.py#L285

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting report_errors in config won't work here, because in this test the /home/jovyan is not accessible.

So the best we can do is to put a link why we need to disable tty there, at least now I know the reason.

@mathbunnyru mathbunnyru merged commit f47292e into jupyter:main Mar 22, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant