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
6 changes: 3 additions & 3 deletions .github/workflows/run-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.9]
python-version: ["3.10", "3.14"]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,6 @@ bulker.egg-info/

docs_jupyter/biobase_example
docs_jupyter/templates/
docs_jupyter/fasterq*
docs_jupyter/fasterq*

build
1 change: 1 addition & 0 deletions build/lib/bulker/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.7.3"
2 changes: 1 addition & 1 deletion bulker/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.7.3"
__version__ = "0.8.0"
380 changes: 205 additions & 175 deletions bulker/bulker.py

Large diffs are not rendered by default.

24 changes: 13 additions & 11 deletions bulker/templates/bulker_config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
bulker:
volumes: ['$HOME']
envvars: ['DISPLAY']
build_template: templates/docker_build.jinja2
container_engine: docker
crates: null
default_crate_folder: ${HOME}/bulker_crates
default_namespace: bulker
envvars:
- DISPLAY
executable_template: templates/docker_executable.jinja2
rcfile: templates/start.sh
rcfile_strict: templates/start_strict.sh
registry_url: http://hub.bulker.io/
shell_path: ${SHELL}
shell_rc: $HOME/.bashrc
rcfile: start.sh
rcfile_strict: start_strict.sh
default_crate_folder: ${HOME}/bulker_crates
shell_template: templates/docker_shell.jinja2
singularity_image_folder: ${HOME}/simages
container_engine: docker
default_namespace: bulker
executable_template: docker_executable.jinja2
shell_template: docker_shell.jinja2
build_template: docker_build.jinja2
crates: null
volumes:
- $HOME
9 changes: 8 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# Changelog

## [0.8.0] -- 2026-02-25
- Migrated to yacman v1 API (`YAMLConfigManager.from_yaml_file()`, `write_lock` context managers)
- Dropped attmap dependency
- Bumped ubiquerg requirement to >=0.9.0
- Added support for Python 3.12
- Fixed compatibility with distutils removal in Python 3.12

## [0.7.3] -- 2021-12-08
- Fixed a bug that prevented use when installed in non-writable directory
- Added ability to use bash autocompletion

## [0.7.2] -- 2021-06-24
- Update to yacman 0.8.0, fixing references to internal config attributes.
- Add documentation and clarity for the `shell_prompt` option
- Added documentation and clarity for the `shell_prompt` option
- Fixed bug with relative crate root folders

## [0.7.1] -- 2021-03-03
Expand Down
4 changes: 2 additions & 2 deletions docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ bulker:
default:
docker_args: -v /project/shefflab/database/redis:/data
bioconductor:
bioconductor_full:
bioconductor_docker:
default:
docker_args: --volume=${HOME}/.local/lib/R:/usr/local/lib/R/host-site-library
devel:
Expand All @@ -25,4 +25,4 @@ bulker:

For the `redis` example, we're mounting a custom folder to `/data`, but only on `docker:redis` containers.

For the bioconductor example, we're showing how you can mount different host folders to the same container spot, depending on the *tag* (version) of the image being used. This is useful for separating your development vs. stable R packages, for example.
For the bioconductor example, we're showing how you can mount different host folders to the same container spot, depending on the *tag* (version) of the image being used. This is useful for separating your development vs. stable R packages, for example.
4 changes: 2 additions & 2 deletions requirements/requirements-all.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
yacman>=0.8.4
yacman>=0.9.5
pyyaml>=5.1
logmuse>=0.2.0
jinja2
ubiquerg>=0.5.1
ubiquerg>=0.9.0
psutil
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@
description="Manager of portable multi-container computing environments",
long_description=long_description,
long_description_content_type='text/markdown',
python_requires=">=3.10",
classifiers=[
"Development Status :: 4 - Beta",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Bio-Informatics"
],
keywords="docker, containers, reproducibility, bioinformatics, workflow",
Expand Down
27 changes: 12 additions & 15 deletions tests/test_bulker.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

def test_yacman():

bc = yacman.YacAttMap(filepath=DEFAULT_CONFIG_FILEPATH)
bc = yacman.YAMLConfigManager.from_yaml_file(DEFAULT_CONFIG_FILEPATH)
bc
bc.bulker.default_crate_folder
bc["bulker"]["default_crate_folder"]

yaml_str = """\
---
Expand All @@ -28,7 +28,7 @@ def test_yacman():

def test_float_idx():

data = yacman.YacAttMap(yamldata=yaml_str)
data = yacman.YAMLConfigManager.from_yaml_data(yaml_str)
# We should be able to access this by string, not by int index.
assert(data['2'] == "two")
with pytest.raises(KeyError):
Expand All @@ -51,7 +51,7 @@ def test_bulker_init():
pass

bulker_init(DUMMY_CFG_FILEPATH, DEFAULT_CONFIG_FILEPATH, "docker")
bulker_config = yacman.YacAttMap(filepath=DEFAULT_CONFIG_FILEPATH)
bulker_config = yacman.YAMLConfigManager.from_yaml_file(DEFAULT_CONFIG_FILEPATH)

manifest, cratevars = load_remote_registry_path(bulker_config,
"demo",
Expand All @@ -66,7 +66,7 @@ def test_bulker_init():

def test_bulker_activate():

bulker_config = yacman.YacAttMap(filepath=DEFAULT_CONFIG_FILEPATH)
bulker_config = yacman.YAMLConfigManager.from_yaml_file(DEFAULT_CONFIG_FILEPATH)


def test_nonconfig_load():
Expand All @@ -85,23 +85,22 @@ def test_nonconfig_load():
pass

bulker_init(DUMMY_CFG_FILEPATH, DEFAULT_CONFIG_FILEPATH, "docker")
bulker_config = yacman.YacAttMap(filepath=DUMMY_CFG_FILEPATH)
bulker_config = yacman.YAMLConfigManager.from_yaml_file(DUMMY_CFG_FILEPATH)

# The 'load' command will write the new crate to the config file;
# we don't want it to update the template config file, so make a dummy
# filepath that we'll delete later.
bulker_config.make_writable()
# for testing, use a local crate folder
bulker_config.bulker.default_crate_folder = DUMMY_CFG_CRATE_SUBDIR
bulker_config["bulker"]["default_crate_folder"] = DUMMY_CFG_CRATE_SUBDIR

print("Bulker config: {}".format(bulker_config))
manifest, cratevars = load_remote_registry_path(bulker_config,
"demo",
None)
manifest, cratevars = load_remote_registry_path(bulker_config, "demo", None)
exe_template = mkabs(bulker_config.bulker.executable_template, os.path.dirname(bulker_config.__internal.file_path))
shell_template = mkabs(bulker_config.bulker.shell_template,
os.path.dirname(bulker_config.__internal.file_path))
exe_template = mkabs(bulker_config["bulker"]["executable_template"], os.path.dirname(bulker_config.filepath))
shell_template = mkabs(bulker_config["bulker"]["shell_template"],
os.path.dirname(bulker_config.filepath))
import jinja2
with open(exe_template, 'r') as f:
contents = f.read()
Expand All @@ -111,8 +110,6 @@ def test_nonconfig_load():
contents = f.read()
shell_template_jinja = jinja2.Template(contents)



bulker_load(manifest, cratevars, bulker_config, exe_template_jinja,
shell_template_jinja, force=True)
# bulker_config.make_readonly() # deprecated this line with yacman improvements?
Expand All @@ -124,7 +121,7 @@ def test_nonconfig_load():
print(cratelist)

# Test a reload with already-removed crate
crate_folder = os.path.join(bulker_config.bulker.default_crate_folder, "bulker/demo/default")
crate_folder = os.path.join(bulker_config["bulker"]["default_crate_folder"], "bulker/demo/default")
print("removing {}".format(crate_folder))
# shutil.rmtree(crate_folder)
bulker_load(manifest, cratevars, bulker_config, exe_template_jinja,
Expand Down Expand Up @@ -163,5 +160,5 @@ def test_nonconfig_load():
# out, err, exitcode = capture([os.path.expandvars("$HOME/.local/bin/bulker"), "load", "bogusbogus"])
# assert exitcode == 1

# manifest = yacman.YacAttMap(filepath="/home/ns5bc/code/bulker/demo/demo_manifest.yaml")
# manifest = yacman.YAMLConfigManager(filepath="/home/ns5bc/code/bulker/demo/demo_manifest.yaml")
# bc