SwissDataScienceCenter/renku

post-init issue

Closed this issue · 2 comments

erbou commented

Describe the bug
I believe that the project ./post-init.sh script is not always invoked on start up as it should be.

And I suspect that this is because the /entrypoint.sh attempts to execute the script before the git clone completes.

To Reproduce
Steps to reproduce the behavior:

  1. Create a post-init.sh in the project that writes to a log file when it is executed, e.g. echo 'started' >> /tmp/post-init.log
  2. Commit and push the changes
  3. Start the project
  4. Check the log file
  5. Repeat if necessary

Since this could be is a race condition, you may need to artificially make the git clone slower, e.g. by adding files to emulate larger projects.

Expected behavior
A log file should be there.

Screenshots and/or execution output
If applicable, add screenshots and/or execution output to help explain your problem.

Run environment (please complete the following information):

  • renkulab browser
  • Jupyterlab: renku/renkulab-py:3.10-0.18.1
  • renku-python version: RENKU_VERSION=2.7.0
  • browser: firefox, but shouldn't matter

Additional context

  • This issue happened during a class, when tens of students started their renkulab sessions simultaneously. The way around is to add a /post-init.sh that spawns a background process that waits up to a reasonable amount of time for the presence of the post-init.sh script, which is expected to be present in this project.
  • The part that copies the authorized ssh keys could also be affected

@erbou I don't think it's possible for the script to run before git clone because that runs in an init container, which must complete before the main container starts. I use the post-init.sh here and it works as advertised. Could you post a link to a project where it isn't working as expected?

@erbou I'm closing this for now - not sure if the problem is still there, feel free to reopen if that is the case.