Activate base conda env in entrypoint.sh#860
Conversation
Signed-off-by: Jaya Venkatesh <jjayabaskar@nvidia.com>
Signed-off-by: Jaya Venkatesh <jjayabaskar@nvidia.com>
Co-authored-by: James Lamb <jaylamb20@gmail.com>
Co-authored-by: James Lamb <jaylamb20@gmail.com>
Signed-off-by: Jaya Venkatesh <jjayabaskar@nvidia.com>
Co-authored-by: James Lamb <jaylamb20@gmail.com>
tests/container-canary/base.yml
Outdated
| command: | ||
| - /bin/bash | ||
| - -c | ||
| - 'test -d "$CONDA_PREFIX" && conda config --show-sources' |
There was a problem hiding this comment.
| - 'test -d "$CONDA_PREFIX" && conda config --show-sources' | |
| - '[[ "${CONDA_PREFIX}" == "/opt/conda" ]];' |
conda config --show-sources will always be successful as long as conda is installed and on PATH, won't it? I'm confused about why that's included here. If it's just left over from debugging, please remove it.
Here we should also test for the exact value of CONDA_PREFIX, not only that it's set... these tests are expected to describe the things that should always be true of these images, to help us avoid breaking changes. e.g. if we change CONDA_PREFIX to /opt/rapids/conda or something in the future, we should be alerted to that potentially being a user-facing breaking change by a test failing.
And we should test that env base is activated here, too. This image still runs the entrypoint and therefore activates the environment, doesn't it?
Line 185 in ae4d636
There was a problem hiding this comment.
Oops that did slip through from debugging.
Following the code in run-validation-checks.sh, I put both the tests in base.yml as neither of them are notebook-specific and will need to be run on both the rapidsai images.
There was a problem hiding this comment.
Looking at the CI failures, I realized that testing for CONDA_DEFAULT_ENV would need us to actually run the container, whereas using exec through container-canary bypasses the entrypoint.sh and does not activate the base environment. container-canary also does not support adding -i flag for an interactive shell to test out environment activation in .bashrc
As a result, I am leaving the test out.
It is possible to use a login shell with the exec probe from container-canary and that should cause the environment to be active and it looks like #859 is testing that, so happy to leave this for that PR.
There was a problem hiding this comment.
Ah ok, then yeah this is fine. Thanks for working through that.
Signed-off-by: Jaya Venkatesh <jjayabaskar@nvidia.com>
Signed-off-by: Jaya Venkatesh <jjayabaskar@nvidia.com>
Signed-off-by: Jaya Venkatesh <jjayabaskar@nvidia.com>
jakirkham
left a comment
There was a problem hiding this comment.
Thanks Jaya! 🙏
Agree with James this would be good to include. However have left a couple comments that we should follow up on first
context/entrypoint.sh
Outdated
| # Activate the base environment | ||
| . /opt/conda/etc/profile.d/conda.sh | ||
| conda activate base |
There was a problem hiding this comment.
Sourcing the profile.d script is handled by a login shell along with any other configurations included there. So think we should do this step by configuring a login shell. Otherwise we risk missing other relevant scripts and recreating the logic already included in top-level profile configuration
Running conda activate is also good to include in the entrypoint. Would drop base as that is implied by conda activate. Also over time the main environment has been renamed from root to base. So not specifying it would save us future potential churn
Lastly would do this before the install steps above so that the active environment can be used effectively
There was a problem hiding this comment.
Love all of these suggestions, and they do make this more streamlined!
Thanks @jakirkham, I made these changes.
Signed-off-by: Jaya Venkatesh <jjayabaskar@nvidia.com>
Co-authored-by: James Lamb <jaylamb20@gmail.com>
jameslamb
left a comment
There was a problem hiding this comment.
I'll merge this once CI passes. I can admin-merge past the failing check-nightly-ci job, and happy to do that because this will fix the nightlies.
Thanks for working through this!
|
I think this is in a good state and it looks to me like all reviewers' comments have been addressed, merging this to get CI going again. Once it builds, @jayavenkatesh19 or @ncclementi could you trigger a new nightly run with tests at https://github.com/rapidsai/docker/actions/workflows/publish.yml? |
|
There is something off on the versioning, but I can't find where the issue is. After @jayavenkatesh19 re-triggered the publish, the images where publish but they show as cc: @jameslamb in case you've seen this before. |
|
😫 I suspect something's wrong with the repo's tags. The version is computed here: docker/.github/workflows/build-test-publish-images.yml Lines 113 to 126 in d9ca067 $ git checkout main
$ git pull upstream main
$ git fetch upstream --tags
$ git describe --tags --abbrev=0
v26.02.00aThat's a problem, we want to see Probably some mistake with #851. Since we haven't published ANY |
|
I think I've fixed this, see https://github.com/rapidsai/github-infrastructure/issues/52#issuecomment-4034306294 @jayavenkatesh19 @ncclementi can you please try another build and let me know how it goes? |
|
@jameslamb Great work, that fixed it. The job is still in progress, but some of the images are published already with the right tag.
|
|
Ok great! Thank you for helping to get builds going here again! |

Towards #857
Activates the base environment before Jupyterlab is launched by adding the conda activation script to
entrypoint.sh.Me and @ncclementi built the container and tested out
cupy=14.0.1on this container and everything runs smoothlyCC: @taureandyernv