Skip to content

Switch to nbclassic and Python 3.12.11#479

Open
danielhollas wants to merge 42 commits intomainfrom
nbclassic
Open

Switch to nbclassic and Python 3.12.11#479
danielhollas wants to merge 42 commits intomainfrom
nbclassic

Conversation

@danielhollas
Copy link
Copy Markdown
Contributor

@danielhollas danielhollas commented Jul 14, 2024

fixes #552

This is just a test if we can switch to nbclassic interface, which is now supported in appmode.

Notebook v7 is currently not supported in Appmode.

@yakutovicha yakutovicha changed the title WIP: Switch to nbclassic Switch to nbclassic and Python 3.11.10 Nov 11, 2025
@yakutovicha yakutovicha changed the title Switch to nbclassic and Python 3.11.10 Switch to nbclassic and Python 3.12.11 Mar 10, 2026
@yakutovicha yakutovicha marked this pull request as ready for review March 16, 2026 11:05
@yakutovicha
Copy link
Copy Markdown
Member

@edan-bainglass, @danielhollas - this one is ready, please test 🙏

Copy link
Copy Markdown
Member

@edan-bainglass edan-bainglass left a comment

Choose a reason for hiding this comment

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

Left comments

PSQL_START_CMD="pg_ctl --timeout=180 -w -l ${PSQL_LOGFILE} start"

MAMBA_RUN="mamba run -n aiida-core-services"
CONDA_RUN="conda run -n aiida-core-services"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The time I tried, Mamba was just hanging and not moving forward, so I switched to conda to make it work.

I can try to revert it and see how it goes this time.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please try. If it fails, good to understand why.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Here it is: #479 (comment)

Comment thread stack/base/Dockerfile Outdated
Comment thread stack/lab/Dockerfile Outdated
Comment thread stack/lab/Dockerfile Outdated
Comment thread stack/lab/Dockerfile
Comment thread build.json Outdated
@danielhollas
Copy link
Copy Markdown
Contributor Author

I've merged in main to get aiida-core 2.8.0

danielhollas and others added 2 commits March 27, 2026 13:04
For some reason, mamba now lists this package
in canonicalize form as `aiidalab_home`
@yakutovicha
Copy link
Copy Markdown
Member

For the record, the failing tests are because we are constraining ipywidgets~=8.0, which means we won't be able to make the tests run before apps (QE app in this case) migrate to ipywidgets 8.x.

@yakutovicha
Copy link
Copy Markdown
Member

yakutovicha commented Apr 8, 2026

@edan-bainglass, @danielhollas: Here is the result of the investigation regarding mamba run vs conda activate.

By default, conda run sets up pipes for stdout/stderr to capture the subprocess output. The flow is:

  1. mamba run -n aiida-core-services pg_ctl start spawns pg_ctl as a child process
  2. pg_ctl's stdout/stderr are connected to pipes back to mamba run
  3. mamba run reads from those pipes until EOF, then exits

What happens when starting the deamons

When pg_ctl starts or rabbitmq-server -detached runs:

  1. The command forks a long-running daemon process.
  2. The daemon inherits the pipe file descriptors from its parent (stdout/stderr).
  3. The parent process exits normally.
  4. mamba run sees the parent exit, but it's still waiting for EOF on the pipe.
  5. EOF on a pipe only occurs when every process holding the write end closes it.
  6. The daemon still holds the pipe's write end open (inherited at fork).
  7. The daemon never exits -> pipe never gets EOF -> mamba run hangs forever

An alternative solution is suggested here is to use --no-capture-output

Here is the summary of all tries:

Approach Result Notes
mamba run (original) HANGS Pipe inheritance by forked daemons
mamba run --no-capture-output BROKEN Generates exec (in wrapper script -> exec): invalid option (mamba bug)
conda run --no-capture-output WORKS Avoids pipe capture without the exec bug
conda activate + direct commands WORKS To me, this is the cleanest way.

@yakutovicha
Copy link
Copy Markdown
Member

@danielhollas, @edan-bainglass - to me, the PR is ready to go, please re-review.

@danielhollas
Copy link
Copy Markdown
Contributor Author

danielhollas commented Apr 8, 2026

@yakutovicha thanks so much, I'll have a look (but will not have time today). Note that this is still blocked on the RabbitMQ upgrade, we need to resolve #510 first. But I agree that otherwise this looks ready.

Can you please merge main? That should remove some of the changes to the docker compose files.

@danielhollas
Copy link
Copy Markdown
Contributor Author

@yakutovicha I just launched the latest image from this PR and I am seeing a Notebook v7 warning banner:

image

I believe it was hidden in the earlier versions of this PR, perhaps that change got lost?

Copy link
Copy Markdown
Member

@edan-bainglass edan-bainglass left a comment

Choose a reason for hiding this comment

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

LGTM. Just a few comments, but good to go.

Comment thread build.json
},
"AIIDALAB_HOME_TAG": {
"default": "v25.02.0"
"default": "main"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why unpin?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We should make a new release of aiidalab-home

Comment thread docker-bake.hcl

variable "JUPYTER_BASE_IMAGE" {
default = "jupyter/minimal-notebook:python-${PYTHON_VERSION}"
default = "quay.io/jupyter/minimal-notebook:python-${PYTHON_VERSION}"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why?

Comment thread tests/test_lab.py

def test_correct_aiidalab_home_version_installed(package_info, aiidalab_home_tag):
info = package_info("aiidalab-home")
info = package_info("aiidalab_home")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Was this a typo before?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Newer mamba version in this image uses this canonicalized package name in its mamba list output

We've been manually updating traitlets to 5.9 for
performance reasons, but the new python3.12 base
image contains newer traitlets version already.
@danielhollas
Copy link
Copy Markdown
Contributor Author

Pushed some small changes, hope that's okay. Disabled QeApp integration tests for now, but before this is merged it would be good to have at least a rough idea what it would take to upgrade QeApp for this image.

May I ask, what kind of testing has been done on this image so far? I think at the very least we should test individual AWB widgets.

Marking this as blocked until #510 is merged (hope to make some progress on that over weekend) and we need to first release the 2.8 based image anyway.

@danielhollas danielhollas added blocked This issue/PR is blocked by another issue/PR. labels Apr 10, 2026
@danielhollas
Copy link
Copy Markdown
Contributor Author

This is very minor, but I am seeing this warning when using pip in this image

image

We can add ENV PIP_USE_FEATURE="build-constraint" in the base image to get rid of it (where we set PIP_CONSTRAINT).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked This issue/PR is blocked by another issue/PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support nbclassic and Python 3.12

3 participants