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

Installing neurodeskapp in an azure enclave #212

Closed
marcelzwiers opened this issue Mar 25, 2024 · 24 comments
Closed

Installing neurodeskapp in an azure enclave #212

marcelzwiers opened this issue Mar 25, 2024 · 24 comments

Comments

@marcelzwiers
Copy link

marcelzwiers commented Mar 25, 2024

Hi there,

I'm not sure if it is possible what I'm trying to accomplish, but here is the situation. I recently got involved in setting up some applications in a secure computing environment (https://andrea-cloud.com/). I set up a Ubuntu22 client that I can connect to with my web-browser (using Bastion -> rdp). The default XFCE environment is very basic and I have to whitelist all connectivity. I managed to install docker and the neurodeskapp, but when I try to launch the app I get:

image

image

(sorry for the png, I couldn't get clipboard transfer to work)

Any suggestions? Do you think it should be doable what I'm trying to do?

@stebo85
Copy link
Contributor

stebo85 commented Mar 25, 2024

In an Ubuntu 22 environment, I would suggest not using docker to run Neurodesktop but rather using the Neurocommand Linux install method (https://www.neurodesk.org/docs/getting-started/neurocommand/linux/) or CVMFS if that's possible in your secure environment (https://www.neurodesk.org/docs/getting-started/neurocontainers/cvmfs/)

The error in the neurodeskapp you see most likely comes from Docker not working correctly. If you want to continue following this path, then the first step would be testing, if you can actually run the plain docker command:

docker volume create neurodesk-home &&
sudo docker run \
  --shm-size=1gb -it --privileged --user=root --name neurodesktop \
  -v ~/neurodesktop-storage:/neurodesktop-storage \
  --mount source=neurodesk-home,target=/home/jovyan \
  -e NB_UID="$(id -u)" -e NB_GID="$(id -g)" \
  -p 8888:8888 \
  -e NEURODESKTOP_VERSION=2024-01-12 vnmd/neurodesktop:2024-01-12

Alternatively, you could try podman

@marcelzwiers
Copy link
Author

Indeed, I cannot run that command:

image

I really don't like this enclave tech :-(

I will go the neurocommand route (whenever I manage to get apptainer installed). Thanks for the help

@stebo85
Copy link
Contributor

stebo85 commented Mar 26, 2024

It looks like you don't have sudo privileges in this machine? Can you install anything via apt? If yes, apptainer should be easy to install:

sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:apptainer/ppa
sudo apt-get update
sudo apt-get install -y apptainer 

Neurodesk should work in such enclave environments - we just need to figure out what's possible and what's not.

@marcelzwiers
Copy link
Author

Wait, I added a sudo and fixed some typos, now I got a bit further:

image

@stebo85
Copy link
Contributor

stebo85 commented Mar 26, 2024

It seems to have trouble with

-e NB_UID="$(id -u)" -e NB_GID="$(id -g)" \

you can remove that for now. Later it would be good to figure out why there is no gid

@marcelzwiers
Copy link
Author

I removed -e NB_GID="$(id -g)" and got:

image

@stebo85
Copy link
Contributor

stebo85 commented Mar 26, 2024

Yes, this now is CVMFS which probably doesn't have fuse mounting privileges. So, I think your best bet is to install apptainer and go the HPC route.

@stebo85
Copy link
Contributor

stebo85 commented Mar 26, 2024

Can you try if this works? https://www.neurodesk.org/docs/getting-started/neurocontainers/cvmfs/ - maybe they didn't completely restrict fuse mounting. Otherwise, try a plain apptainer and download a container from here (https://www.neurodesk.org/docs/getting-started/neurocontainers/singularity/) to see if that route works

@marcelzwiers
Copy link
Author

Yes, this now is CVMFS which probably doesn't have fuse mounting privileges. So, I think your best bet is to install apptainer and go the HPC route.

Could it be that I need to whitelist a domain first?

@stebo85
Copy link
Contributor

stebo85 commented Mar 26, 2024 via email

@marcelzwiers
Copy link
Author

Installing cvmfs fails, so I think I will try the neurocontainers (if I can get apptainer to install)
image

@stebo85
Copy link
Contributor

stebo85 commented Apr 2, 2024

you can't whitelist that IP 11.5.0.4 so it could pull the CVMFS repo package?

Is there a way we could get access to this environment so we can try a few things on our side?

@marcelzwiers
Copy link
Author

marcelzwiers commented Apr 8, 2024

Here's an update on things. I gave up on neurodesktop on Ubuntu and tried to get the environment modules system installed. It failed to work normally (I had to manually source /etc/profile to get it to work, but it seemed unavailable in subshell, or at least neurocommand was giving errors about module commands not found). In our enclave, there was also an old CentOS 7.9 system available, which I tried next. I started off with neurocommands and the good news is that I now got it to work, just like that. I don't understand why people are so fond of Ubuntu

@marcelzwiers
Copy link
Author

The neurodesktop gives users a nice menu structure to startup a terminal with pre-loaded module, are there other benefits about using this desktop instead of the default XFCE that comes with the CentOS VM?

@marcelzwiers
Copy link
Author

marcelzwiers commented Apr 8, 2024

I tested a few neurocommands that worked fine, but when I tried RStudio I got this error:

image

@marcelzwiers marcelzwiers changed the title Installing neurodeskapp in an azzure enclave Installing neurodeskapp in an azure enclave Apr 8, 2024
@marcelzwiers
Copy link
Author

FYI, if I re-install RStudio I get:

image

@marcelzwiers
Copy link
Author

marcelzwiers commented Apr 8, 2024

Btw, I've seen this module: command not found also in Ubuntu. I think it's because I need to run the install script using sudo, which starts it's own (non-profile) shell. I even use sudo -E env PATH=$PATH (also to get the conda python environment working), which is the only way for me to get to python 3.6 (I have sudo permission, but I am not allowed to become root)

@marcelzwiers
Copy link
Author

marcelzwiers commented Apr 8, 2024

Ok, it gets even more weird. I went back to Ubuntu and manually sourced the module profile (somehow this seems the only way) and set the modulepath (using module use, somehow this also seems the only way), and then I managed to install the RStudio neurocontainer. And guess what, the rstudio neurocommand just works

@stebo85
Copy link
Contributor

stebo85 commented Apr 9, 2024

interesting problem indeed. I unfortunately can't replicate these issues, so it's difficult to troubleshoot on my side. Can you describe in more detail what you did? Maybe the only way to replicate these issues is running it in the secure enclave you are in? Is there a way to get access to this environment?

@marcelzwiers
Copy link
Author

Yes, I'll send you a message on Mattermost@brainhack with details

@marcelzwiers
Copy link
Author

In the meantime I made some more progress on Ubuntu, because I found out (somewhere in a Stackoverflow comment) that there is a /usr/bin/add.modules file that I could run. Now I finally got the module system to work and this in turn makes the rest a lot easier... :-)

@marcelzwiers
Copy link
Author

Ok, I learned another important thing. I believe the module system under Ubuntu is not initializing properly because in Ubuntu \bin\sh is a dash shell, whereas in other distros it is bash

@stebo85
Copy link
Contributor

stebo85 commented Apr 9, 2024

@github-project-automation github-project-automation bot moved this from New to Completed in NeuroDesk Apr 10, 2024
@stebo85
Copy link
Contributor

stebo85 commented Apr 10, 2024

Another problem was that apptainer wasn’t running with user namespaces and the setuid was interfering with rrstudio

@marcelzwiers marcelzwiers reopened this Apr 10, 2024
@github-project-automation github-project-automation bot moved this from Completed to New in NeuroDesk Apr 10, 2024
@github-project-automation github-project-automation bot moved this from New to Completed in NeuroDesk Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Completed
Development

No branches or pull requests

2 participants