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

Set up environment on remote host (module load) #2982

Closed
Flamefire opened this issue May 12, 2020 · 6 comments
Closed

Set up environment on remote host (module load) #2982

Flamefire opened this issue May 12, 2020 · 6 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) ssh Issue in vscode-remote SSH

Comments

@Flamefire
Copy link

I'd like to use VS Code to develop on our HPC cluster via the remote-SSH extension.

In short: The environment after SSH is minimal. Almost no software is available. To get that you need to issue 1 or more module load <software> commands which set up PATH/LD_LIBRARY_PATH and more. This module is a bash (or other shell) function.

So what I'd like to do: Specify commands to run before starting the remote VSC instance so it picks up the changed environment or alternatively modify the environment via a shell and reload the remote VSC in that environment.

Another solution would be to specify a (remote) file to be sourced before loading the remote VSC instance. This could then contain e.g. module load <foo> and export FOO=bar statements which the remote VSC will pick up.

@psakievich
Copy link

I would also add that I'd like to see an ability to load modules when running the debugger. Something in the launch.json like:

"moduleList": ["package1", "package2"]

@fteufel
Copy link

fteufel commented Aug 7, 2020

Hi,
I'm facing the same problem on my HPC cluster. Specifically, I need to load python3 with module load python3. Because python3 is not available at the start of vs code, the python extension cannot recognize python3 and all the virtual environments, effectively making it impossible to use most functionalities of the extension.
See
microsoft/vscode-python#13313

@Zho-o-o-u
Copy link

Hi, I'm facing the same problem when using ssh remote host. Because python3 and virtual environments(conda) can't be recognized, I can't use python to deal with snakefile.

@Chuxel Chuxel added the ssh Issue in vscode-remote SSH label Aug 19, 2020
@Chuxel
Copy link
Member

Chuxel commented Aug 19, 2020

@roblourens This is sort of in the same class as #690

@roblourens
Copy link
Member

You can also set this stuff up in a bashrc, does that help?

Also #1722

@roblourens roblourens added the *duplicate Issue identified as a duplicate of another issue(s) label Nov 7, 2020
@chrisb2244
Copy link

@roblourens That's true (at least from my experience), but only helps if you're willing to semi-unconditionally (because you can still draw some distinction between login and non-login shells) run the command.
What if you want VSCode to always run the code, but when you SSH to the remote from a terminal you don't want the module loaded/command executed?

In the case of modules, you could just unload it interactively... but that's a workaround to a workaround.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) ssh Issue in vscode-remote SSH
Projects
None yet
Development

No branches or pull requests

7 participants