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

accelerate loading by clean init scripts #426

Open
unkcpz opened this issue Jan 10, 2024 · 0 comments
Open

accelerate loading by clean init scripts #426

unkcpz opened this issue Jan 10, 2024 · 0 comments
Assignees

Comments

@unkcpz
Copy link
Member

unkcpz commented Jan 10, 2024

Background

When the first time start the container, it takes at least 1 minute to prepare everything needed to start the platform.
Those consist of:

  • (✅) Initialize the psql database into user home.
  • (✅) Initialize AiiDA profile in the user home.
  • (✅) create localhost as a default computer.
  • (✅) Reset the RMQ configure path and config for infinite consumer timeout.
  • Reset (if triggered) the user's home folder.
  • (✅) Install aiidalab-home
  • pre-install the apps if set.
  • start the AiiDA daemon.

Items tagged with in the list are things that need to be done for every user. Thus they can be hardcoded in the Dockerfile and run in the image build phase. The reason that we can not put them in Dockerfile is that the consequence of these procedures are modifying user's home folder which potentially will be mapped to the persistent volume for long term data storage.
For the docker, it has the mechanism that if the volume is empty the data will be copied from image to the volume the first time container start. But for the jupyterhub it is not the case. That is to say Docker image’s $HOME directory will be hidden from the user. To make these contents visible to the user, we must pre-populate the user’s filesystem. The method is provided with new JupyterHub and can be found at https://z2jh.jupyter.org/en/3.2.1/jupyterhub/customizing/user-environment.html#about-user-storage-and-adding-files-to-it (but be careful that poststart hook will not work since it will happen after the start of container, instead need to archive the home folder and populate it as the first "before-notebook" task after the container start).

Impact

This will greatly reduce the first-start time of the container from minutes to seconds.

@unkcpz unkcpz self-assigned this Jan 10, 2024
@unkcpz unkcpz converted this from a draft issue Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants