Some packages contain binary code that requires sourcing activation script, that are normally sourced upon environment activation. But these scripts are not sourced in the renku session automatically.
Is there a way to deal with this without manually building a container? Do I miss something?
It should be possible to handle this once the next update to RenkuLab occurs (scheduled for today, Dec. 17).
The changes that were made here support startup scripts for environments.
To take advantage, your project needs a folder that is named either .init or init.d. If this folder is found, all scripts in the folder will be run when the environment is started.
Conda itself is not available in the images built as code-based environments, but if you can identify what scripts are run when the conda environment is activated, you can add them to the init folder.
This is for sure a useful functionality, but unfortunately it doesn’t help in this case, as scripts are run, not sourced. What I’m looking for is more of extending an entrypoint with additional initialisations.
A workaround would be to manually set it like described in Create an environment with custom packages installed | Renku , but this requires digging into what is the original entrypoint (we want to start the standard jupyter lab session finally), and keep this up-to-date with buildpack changes. Maybe there is a better way?
If not, then, I think you will need to build your own image. You can use an officially provided image as a base image and install conda into it. See this project for an example:
(That one uses micromamba, which might work for you, but changing it to use conda should not be difficult.)
To create a session environment in RenkuLab, use the following settings:
Container image: ghcr.io/[github project]/[path to image]
Default URL path: /lab
Port: 8888
Working directory: /home/renku/work
Mount directory: /home/renku/work
UID: 1000
GID: 1000
Command: ["tini","-g","--"]
Args: ["bash","/home/renku/work/renkulab-conda-r/jupyterlab-entrypoint.sh","/home/renku/.local/share/mamba"]
Strip session URL path prefix: No