ratt-ru / Stimela-classic

Containerized radio interferometry scripting framework -- NB: Classic version is no longer in active development, use stimela 2! See README for details.
GNU General Public License v2.0
28 stars 16 forks source link

Does stimela really need the USER variable? #784

Open o-smirnov opened 1 year ago

o-smirnov commented 1 year ago

See https://github.com/caracal-pipeline/stimela/issues/156

SpheMakh commented 1 year ago

It does when using docker (at least docker that requires root). I'm pushing a commit that uses os.getlogin() per your suggestion. If that doesn't work, then we can just add a conditional before getting the USER.

SpheMakh commented 1 year ago

Here is the branch apptainer. @NicolaMalavasi, please try it

NicolaMalavasi commented 1 year ago

Dear all, thanks for taking the time to review this. A few considerations here below.

1) I was unfortunately unable to use the new stimela branch. In fact I do not install stimela directly, but I pip install -U caracal==1.0.6 which then installs stimela, per my understanding. I can see if I can modify the commit of stimela used by this installation. For the moment I had to rely on manually changing the line USER = os.environ["USER"] to USER = os.getlogin() in __init__.py of stimela after installation.

2) This solution does not work either. The error I get is

USER = os.getlogin()
OSError: [Errno 6] No such device or address

and I think I understood that this is because os.getlogin() requires a user to be logged in an active terminal which is not my case (I run caracal from an HTcondor job and my user is nobody during the run.

Thanks for the help

SpheMakh commented 1 year ago

Hi @NicolaMalavasi, I've updated the branch again. Please re-install the branch and try again.

Install the branch by running this where you have CARACal installed

pip install -U --force-reinstall git+https://github.com/ratt-ru/Stimela@apptainer
SpheMakh commented 1 year ago

The changes are now in the master branch, the apptainer branch is gone. Install using the below instead

pip install -U --force-reinstall git+https://github.com/ratt-ru/Stimela.git