Skip to content

Commit 141499f

Browse files
authored
removing lmod_base and other unused defaults (#422)
Signed-off-by: vsoch <[email protected]> Co-authored-by: vsoch <[email protected]>
1 parent da2d72a commit 141499f

File tree

8 files changed

+59
-39
lines changed

8 files changed

+59
-39
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and **Merged pull requests**. Critical items to know are:
1414
The versions coincide with releases on pip. Only major versions will be released as tags on Github.
1515

1616
## [0.0.x](https://github.scom/singularityhub/singularity-hpc/tree/master) (0.0.x)
17+
- Removing un-used defaults and lmod_base (0.0.30)
1718
- Allow environment variables in settings (0.0.29)
1819
- User settings file creation and use with shpc config inituser
1920
- registry is now a list to support multiple registry locations

docs/getting_started/installation.rst

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ if you install to a system python, meaning either of these commands:
4343
4444
You will need to put the registry files elsewhere (update the ``registry`` config argument to the path), as they will not be installed
4545
alongside the package. The same is the case for modules - if you install to system
46-
python it's recommended to define ``lmod_base`` as something else, unless you
46+
python it's recommended to define ``module_base`` as something else, unless you
4747
can write to your install location. Installing locally ensures that you
4848
can easily store your module files along with the install (the default until you
4949
change it). Installation of singularity-hpc adds an executable, `shpc` to your path.
@@ -80,13 +80,20 @@ You'll next want to configure and create your registry, discussed next in
8080
8181
8282
$ shpc config set registry:/<DIR>
83-
$ shpc config set lmod_base:/<DIR>
83+
$ shpc config set module_base:/<DIR>
8484
$ shpc config set container_base:/<DIR>
8585
8686
87+
Also importantly, if you are using environment modules (Tcl) and not LMOD, you need
88+
to tell shpc about this (as it defaults to LMOD):
89+
90+
.. code-block:: console
91+
92+
$ shpc config set module_sys:tcl
93+
8794
You can also easily (manually) update any settings in the ``shpc/settings.yaml`` file.
88-
Again, see the :ref:`getting-started` pages for next steps for setup and configuration,
89-
and interacting with your modules.
95+
Take a look at this file for other configuration settings, and see the :ref:`getting-started`
96+
pages for next steps for setup and configuration, and interacting with your modules.
9097

9198
.. warning::
9299

docs/getting_started/use-cases.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ If you are a linux administrator, you likely want to clone the repository
1111
directly (or use a release when they are available). Then you can install modules
1212
for your users from the local ``registry`` folder, create your own module files
1313
(and contribute them to the repository if they are useful!) and update the
14-
``lmod_base`` to be where you install modules.
14+
``module_base`` to be where you install modules.
1515

1616
.. code-block:: console
1717
1818
# an absolute path
19-
$ shpc config lmod_base:/opt/lmod/shpc
19+
$ shpc config module_base:/opt/lmod/shpc
2020
2121
2222
If you pull or otherwise update the install of shpc, the module files will update

docs/getting_started/user-guide.rst

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,17 @@ for more information about contributing containers to this registry.
3434
Really Quick Start
3535
==================
3636

37-
Once you have shpc installed, you can easily install, load, and use modules:
37+
Once you have shpc installed, make sure you tell shpc what your module software is
38+
(note that you only need to run this command if you aren't using Lmod, which is the
39+
default).
40+
41+
.. code-block:: console
42+
43+
$ shpc config set module_sys:tcl
44+
$ shpc config set module_sys:lmod # default
45+
46+
47+
You can then easily install, load, and use modules:
3848

3949
.. code-block:: console
4050
@@ -44,25 +54,41 @@ Once you have shpc installed, you can easily install, load, and use modules:
4454
4555
4656
The above assumes that you've installed the software, and have already
47-
added the modules folder to be seen by your module software. This step is shown in detail
48-
in the next section.
57+
added the modules folder to be seen by your module software. If your module
58+
software doesn't see the module, remember that you need to have done:
59+
60+
.. code-block:: console
61+
62+
$ module use ./modules
63+
64+
65+
We walk through these steps in more detail in the next section.
4966

5067

5168
Quick Start
5269
===========
5370

5471
After :ref:`getting_started-installation`, and let's say shpc is installed
55-
at ``~/singularity-hpc`` you can edit your settings in ``settings.yaml`` and
56-
then install a container:
72+
at ``~/singularity-hpc`` you can edit your settings in ``settings.yaml``.
73+
Importantly, make sure your shpc install is configured to use the right module
74+
software, which is typicall lmod or tcl. Here is how to change from the default
75+
"lmod" to "tcl" and then back:
76+
77+
.. code-block:: console
78+
79+
$ shpc config set module_sys:tcl
80+
$ shpc config set module_sys:lmod # this is the default, which we change back to!
81+
82+
83+
Once you have the correct module software indicated, try installing a container:
5784

5885
.. code-block:: console
5986
6087
$ shpc install python
6188
62-
Add the modules folder to your lmod (you can run this in a bash profile or
63-
manually, and note that if you want to use Environment Modules, you need to add
64-
``--module-sys tcl``).
65-
89+
Make sure that the local ./modules folder can be seen by your module software
90+
(you can run this in a bash profile or manually, and note that if you want to
91+
use Environment Modules, you need to add ``--module-sys tcl``).
6692

6793
.. code-block:: console
6894

paper/paper.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ the software automatically generates alias to inspect, run, shell, or inspect
8989
container metadata. E.g., here is the shell command:
9090

9191
```bash
92-
$ biocontainer-samtools-shell
92+
$ samtools-shell
9393
```
9494

9595
Another compelling example is using a notebook provided by Jupyter Stacks [@cook2017opinionated].

shpc/defaults.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import os
66
import shpc.utils as utils
77

8-
# Replacements can currently be made for the database_file and lmod_base
98
install_dir = utils.get_installdir()
109
reps = {"$install_dir": install_dir, "$root_dir": os.path.dirname(install_dir)}
1110

@@ -22,24 +21,3 @@
2221

2322
# The GitHub repository with recipes
2423
github_url = "https://github.com/singularityhub/singularity-hpc"
25-
26-
# Defaults should correspond to fields in settings.yml
27-
# Testing checks that we have a 1:1 match
28-
29-
# Currently only lmod is supported. To request an additional system,
30-
# please open an issue https://github.com/singularityhub/singularity-hpc
31-
plugins_enabled = ["lmod"]
32-
33-
# Registry folder with subfolders of recipes
34-
recipes = os.path.join(reps["$root_dir"], "registry")
35-
36-
# Lmod settings
37-
38-
# The install directory for modules. Defaults to the install directory/modules
39-
lmod_base = os.path.join(reps["$root_dir"], "modules")
40-
41-
# disable keeping a sqlite database with metadata
42-
database_disable = False
43-
44-
# default database file
45-
database_file = os.path.join(reps["$root_dir"], "shpc.db")

shpc/main/settings.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ def edit(self):
6969
"""
7070
if not self.settings_file or not os.path.exists(self.settings_file):
7171
logger.exit("Settings file not found.")
72+
73+
# Make sure editor exists first!
74+
editor = shpc.utils.which(self.config_editor)
75+
if editor["return_code"] != 0:
76+
logger.exit(
77+
"Editor '%s' not found! Update with shpc config set config_editor:<name>"
78+
% self.config_editor
79+
)
7280
shpc.utils.run_command([self.config_editor, self.settings_file], stream=True)
7381

7482
def get_settings_file(self, settings_file=None):

shpc/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
__copyright__ = "Copyright 2021, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

5-
__version__ = "0.0.29"
5+
__version__ = "0.0.30"
66
AUTHOR = "Vanessa Sochat"
77
NAME = "singularity-hpc"
88
PACKAGE_URL = "https://github.com/singularityhub/singularity-hpc"

0 commit comments

Comments
 (0)