Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and **Merged pull requests**. Critical items to know are:
The versions coincide with releases on pip. Only major versions will be released as tags on Github.

## [0.0.x](https://github.scom/singularityhub/singularity-hpc/tree/master) (0.0.x)
- `.version` file should be written in top level of module folders [#450](https://github.com/singularityhub/singularity-hpc/issues/450) (0.0.35)
- Tcl modules use shell functions for bash, to export to child shells (0.0.34)
- fixed missing singularity -B flag for custom home feature
- fixed singularity.tcl to always replace $ with \$ for custom home feature
Expand Down
8 changes: 7 additions & 1 deletion docs/getting_started/user-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ variable replacement. A summary table of variables is included below, and then f
* - updated_at
- a timestamp to keep track of when you last saved
- never
* - default_version
- A boolean to indicate generating a .version file (LMOD or lua modules only)
- true
* - singularity_module
- if defined, add to module script to load this Singularity module first
- null
Expand Down Expand Up @@ -327,8 +330,11 @@ you can add or remove entries via the config variable ``registry``
.. code-block:: console

# change to your own registry of container yaml configs
$ shpc config set registry:/opt/lmod/registry
$ shpc config add registry:/opt/lmod/registry


# Note that "add" is used for lists of things (e.g., the registry config variable is a list)
and "set" is used to set a key value pair.


Module Names
Expand Down
8 changes: 8 additions & 0 deletions shpc/main/modules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from datetime import datetime
import os
from pathlib import Path
import shutil
import subprocess
import sys
Expand Down Expand Up @@ -304,6 +305,13 @@ def install(self, name, tag=None, **kwargs):
container_dir = self.container.container_dir(subfolder)
shpc.utils.mkdirp([module_dir, container_dir])

# Add a .version file to indicate the level of versioning (not for tcl)
if self.module_extension != "tcl" and self.settings.default_version == True:
version_dir = os.path.join(self.settings.module_base, uri)
version_file = os.path.join(version_dir, ".version")
if not os.path.exists(version_file):
Path(version_file).touch()

# For Singularity this is a path, podman is a uri. If None is returned
# there was an error and we cleanup
container_path = self.container.registry_pull(
Expand Down
1 change: 1 addition & 0 deletions shpc/main/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
"module_name": {"type": "string"},
"config_editor": {"type": "string"},
"environment_file": {"type": "string"},
"default_version": {"type": "boolean"},
"enable_tty": {"type": "boolean"},
"container_tech": {"type": "string", "enum": ["singularity", "podman", "docker"]},
"singularity_shell": {"type": "string", "enum": shells},
Expand Down
3 changes: 3 additions & 0 deletions shpc/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ module_base: $root_dir/modules
# This is where you might add a prefix to your module names, if desired.
module_name: '{{ tool }}'

# Create a .version file for LMOD in the module folder
default_version: true

# store containers separately from module files
container_base:

Expand Down
2 changes: 1 addition & 1 deletion shpc/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
__copyright__ = "Copyright 2021, Vanessa Sochat"
__license__ = "MPL 2.0"

__version__ = "0.0.34"
__version__ = "0.0.35"
AUTHOR = "Vanessa Sochat"
NAME = "singularity-hpc"
PACKAGE_URL = "https://github.com/singularityhub/singularity-hpc"
Expand Down