Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • master
  • singularity
  • conda
  • singularity-no-venv
4 results

Target

Select target project
No results found
Select Git revision
  • master
  • singularity
  • conda
  • singularity-no-venv
4 results
Show changes

Commits on Source 2

2 files
+ 24
0
Compare changes
  • Side-by-side
  • Inline

Files

create_interpreter.sh

0 → 100755
+21 −0
Original line number Diff line number Diff line
#!/bin/bash

SOURCE_PATH="${BASH_SOURCE[0]:-${(%):-%x}}"

RELATIVE_PATH="$(dirname "$SOURCE_PATH")"
ABSOLUTE_PATH="$(realpath "${RELATIVE_PATH}")"
source "${ABSOLUTE_PATH}"/config.sh

echo the name is "$ENV_NAME"

echo "Setting up the python interpreter script in the following dir: " "~/.local/share/python/interpreter/${ENV_NAME}"

mkdir -p ~/.local/share/python/interpreter/"${ENV_NAME}"

echo '
#!/bin/bash
source "'"${ABSOLUTE_PATH}"'"/activate.sh  2> /dev/null > /dev/null
python "$@"
' > ~/.local/share/python/interpreter/"${ENV_NAME}"/python

chmod a+x ~/.local/share/python/interpreter/"${ENV_NAME}"/python
+3 −0
Original line number Diff line number Diff line
@@ -43,6 +43,8 @@ source <path_to_venv>/activate.sh
The script `create_kernel.sh` will create a kernel json file in the user's home directory that can be found
by Jupyter and a helper script in the virtual environment folder.

The script `create_interpreter.sh` creates a python interpreter wrapper script in the user's home directory (`~/.local/share/python/interpreter/<venv_name>/python`).
You can set this newly created wrapper script as python interpreter in your favorite IDE for remote development and debugging. See further instructions [here](https://gitlab.jsc.fz-juelich.de/niesel1/howtos-ai/-/blob/main/RemoteDebuggingWithVSCode.ipynb).


# Intended Workflow
@@ -52,3 +54,4 @@ by Jupyter and a helper script in the virtual environment folder.
4. Edit `setup.sh` and `activate.sh` to add extra steps for custom modules.
5. Create the environment with `bash setup.sh`.
6. Create a kernel with `bash create_kernel.sh`.
7. Create a python interpreter wrapper with `create_interpreter.sh`.