Skip to content
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

Base AiiDAlab image on jupyter/base-notebook image and support AiiDA 2.0 #254

Merged
merged 16 commits into from
Aug 25, 2022

Conversation

yakutovicha
Copy link
Member

@yakutovicha yakutovicha commented Jun 8, 2022

Edited by @csadorf

@csadorf
Copy link
Member

csadorf commented Jun 21, 2022

Open questions:

  • Previously, we were populating the user's folder at the startup time. If we want to base the image on official Jupyter ones, we might rely on the existing user (jovyan). The question is: what to do with the user's data (.ssh, .local, apps, etc). A possible solution would be to create volumes for all of them.

  • If mounting volumes to store all the persistent user's information is the way to go, which one should mount:

    • .ssh
    • .local
    • apps

@yakutovicha In aiidalab-launch we already have a dedicated volume for the conda environment, because some of the conda libraries cannot be installed in all host file systems, but what would be the motivation to having dedicated volumes for each of the other directories?

@csadorf csadorf linked an issue Jun 21, 2022 that may be closed by this pull request
@csadorf csadorf changed the title Prepare AiiDAlab image to be used with docker-compose Base AiiDAlab image on jupyter/base-notebook image Jul 19, 2022
@csadorf csadorf self-assigned this Jul 19, 2022
@csadorf csadorf force-pushed the feature/minimal-image-for-docker-compose branch from c98ea05 to 457f31b Compare July 27, 2022 14:17
@csadorf csadorf linked an issue Jul 27, 2022 that may be closed by this pull request
8 tasks
@csadorf
Copy link
Member

csadorf commented Jul 27, 2022

This PR is almost ready to go, we have the following outstanding issues:

Dockerfile Outdated Show resolved Hide resolved
@csadorf csadorf changed the title Base AiiDAlab image on jupyter/base-notebook image Base AiiDAlab image on jupyter/base-notebook image and support AiiDA 2.0 Jul 27, 2022
@csadorf csadorf force-pushed the feature/minimal-image-for-docker-compose branch 2 times, most recently from 74ae759 to 6894d22 Compare August 5, 2022 14:45
@csadorf
Copy link
Member

csadorf commented Aug 5, 2022

Blocked by: conda-forge/staged-recipes#19940

@csadorf csadorf added the blocked This issue/PR is blocked by another issue/PR. label Aug 5, 2022
@csadorf csadorf force-pushed the feature/minimal-image-for-docker-compose branch 2 times, most recently from 29a6647 to 3012766 Compare August 5, 2022 15:01
csadorf and others added 3 commits August 8, 2022 10:30
- The PGSQL and RabbitMQ services are expected to started in separate
containers.
- Do not separate the Jupyter and AiiDA Python kernels; use shared
requirements file.
- Use requirements file for environment-wide pinning (conda and pip).
- Supports AiiDA 2.0.

Co-authored-by: Aliaksandr Yakutovich <yakutovicha@gmail.com>
@csadorf csadorf force-pushed the feature/minimal-image-for-docker-compose branch from 3012766 to 667fda5 Compare August 8, 2022 08:30
@ltalirz
Copy link
Member

ltalirz commented Aug 15, 2022

@csadorf I guess this is no longer blocked?

@csadorf
Copy link
Member

csadorf commented Aug 16, 2022

@csadorf I guess this is no longer blocked?

Kind of. We'll have to make a release of https://github.com/aiidalab/aiidalab and then we can switch to installing from conda. I'm also trying to merge #276, but I'm having some trouble getting GitHub actions to actually build the aiidalab image. Feel free to have a look, maybe you can spot the problem?

The refactoring into an actual hierarchical stack will enable me to implement the one-off migration image needed for the switch to AiiDA 2.0 and the slightly changed user environment which is the last task on #240.

@ltalirz
Copy link
Member

ltalirz commented Aug 16, 2022

I'm also trying to merge #276, but I'm having some trouble getting GitHub actions to actually build the aiidalab image. Feel free to have a look, maybe you can spot the problem?

The Dockerfile is starting from an aiidalab/aiida image. I don't see this on https://hub.docker.com/u/aiidalab

@csadorf
Copy link
Member

csadorf commented Aug 16, 2022

The Dockerfile is starting from an aiidalab/aiida image. I don't see this on https://hub.docker.com/u/aiidalab

Thanks for checking! The image is built locally in the step prior ("Build aiida image"), however I think I finally identified the underlying problem: the buildx context is probably not using the docker driver (compare docker/buildx#301). I'd suggest to move any further discussion to #276 .

@csadorf
Copy link
Member

csadorf commented Aug 18, 2022

Mounting everything into the same volume is likely blocked by moby/moby#32582 . See also https://stackoverflow.com/questions/38164939/can-we-mount-sub-directories-of-a-named-volume-in-docker .

Port is configurable via a command line argument ('-p' / '--port).
Using an older jupyter stack version we cannot use the ENV_NOTEBOOK_ARGS
environment variable to configure the startup command.
@csadorf csadorf mentioned this pull request Aug 19, 2022
@csadorf csadorf marked this pull request as ready for review August 19, 2022 10:26
@csadorf
Copy link
Member

csadorf commented Aug 19, 2022

@yakutovicha This is ready to go, do you want to have another look at it before I merge?

Copy link
Member Author

@yakutovicha yakutovicha left a comment

Choose a reason for hiding this comment

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

Hi @csadorf, there are a couple of issues/questions. I would also like to carefully test this before merging it. IMO, we need to have at least one working Kubernetes instance using those images to confidently go ahead.

Another thing we should not forget is the ssh-agent to be able to connect to machines that require ssh keys with password

environment.yml Outdated Show resolved Hide resolved
stack/base/requirements.txt Outdated Show resolved Hide resolved
@csadorf csadorf changed the base branch from develop to stack August 19, 2022 14:01
csadorf and others added 2 commits August 19, 2022 16:02
@csadorf
Copy link
Member

csadorf commented Aug 19, 2022

@yakutovicha I'll merge this, ok?

@yakutovicha
Copy link
Member Author

yakutovicha commented Aug 19, 2022

@yakutovicha I'll merge this, ok?

sure, got ahead.

[EDIT] please either add the ssh-agent as I mentioned above or make an issue to not forget about this. People are actually using it.

Example: The lab image should be rebuilt when the base image is
changed. No need to further declare depencies since the process is
already optimized through docker layer caching.
And install the ssh-singleagent.sh script.
@csadorf
Copy link
Member

csadorf commented Aug 22, 2022

[EDIT] please either add the ssh-agent as I mentioned above or make an issue to not forget about this. People are actually using it.

@yakutovicha Implemented in 323bb51, I'm not sure how to test it.

@csadorf
Copy link
Member

csadorf commented Aug 24, 2022

@yakutovicha I'll merge this, ok?

@yakutovicha
Copy link
Member Author

@yakutovicha I'll merge this, ok?

yes, please go ahead

@csadorf csadorf merged commit 6a3c63e into stack Aug 25, 2022
@csadorf csadorf deleted the feature/minimal-image-for-docker-compose branch August 25, 2022 16:04
csadorf added a commit that referenced this pull request Aug 25, 2022
)

* Major revision that refactors the previous single image into a base and a lab
  image, where the former contains only AiiDA and the latter adds the AiiDAlab
  related software.
* The PGSQL and RabbitMQ services are expected to be started in separate
  containers, e.g., with docker-compose.
* There is only a single Python environment with shared dependencies, unlike
  the previous separation with one environment for the Jupyter server and the
  other one for the AiiDA Python kernels.
* Some requirements, e.g., the installed AiiDA version are pinned for both
  conda/mamba and pip to prevent the user from inadvertently breaking the
  environment; the user can override this or alternatively create a dedicated
  environment.
* Add tests that are implemented with pytest.
* Common repository tasks such as building the stack, running tests, and
  starting a lab server can be run with pydoit.
* Supports Python 3.9.2 and AiiDA 2.0.0.

Co-authored-by: Aliaksandr Yakutovich <yakutovicha@gmail.com>
csadorf added a commit that referenced this pull request Aug 25, 2022
* Major revision that refactors the previous single image into a base and a lab
  image, where the former contains only AiiDA and the latter adds the AiiDAlab
  related software.
* The PGSQL and RabbitMQ services are expected to be started in separate
  containers, e.g., with docker-compose.
* There is only a single Python environment with shared dependencies, unlike
  the previous separation with one environment for the Jupyter server and the
  other one for the AiiDA Python kernels.
* Some requirements, e.g., the installed AiiDA version are pinned for both
  conda/mamba and pip to prevent the user from inadvertently breaking the
  environment; the user can override this or alternatively create a dedicated
  environment.
* Add tests that are implemented with pytest.
* Common repository tasks such as building the stack, running tests, and
  starting a lab server can be run with pydoit.
* Supports Python 3.9.2 and AiiDA 2.0.0.

Co-authored-by: Aliaksandr Yakutovich <yakutovicha@gmail.com>
csadorf added a commit that referenced this pull request Sep 14, 2022
* Major revision that refactors the previous single image into a base and a lab
  image, where the former contains only AiiDA and the latter adds the AiiDAlab
  related software.
* The PGSQL and RabbitMQ services are expected to be started in separate
  containers, e.g., with docker-compose.
* There is only a single Python environment with shared dependencies, unlike
  the previous separation with one environment for the Jupyter server and the
  other one for the AiiDA Python kernels.
* Some requirements, e.g., the installed AiiDA version are pinned for both
  conda/mamba and pip to prevent the user from inadvertently breaking the
  environment; the user can override this or alternatively create a dedicated
  environment.
* Add tests that are implemented with pytest.
* Common repository tasks such as building the stack, running tests, and
  starting a lab server can be run with pydoit.
* Supports Python 3.9.2 and AiiDA 2.0.0.

Co-authored-by: Aliaksandr Yakutovich <yakutovicha@gmail.com>
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.

Implement AiiDAlab based on an official Jupyter image Support AiiDA core 2.0
3 participants