Skip to content

Commit

Permalink
Merge pull request #60 from singularityhub/al3x609-master
Browse files Browse the repository at this point in the history
Adding Al3x609 master for nv flag
  • Loading branch information
vsoch authored Sep 7, 2018
2 parents f285629 + 72d50cb commit 62e2388
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The client here will eventually be released as "spython" (and eventually to
singularity on pypi), and the versions here will coincide with these releases.

## [master](https://github.com/singularityhub/singularity-cli/tree/master)
- adding nvidia flag as nv argument (with default False) to run/exec (0.0.41)
- fixing bug in shell.py, cli should be client (0.0.40)
- remove uri function should only right strip to support relative paths (0.0.39)
- adjusting container build to use correct Github branch (vault/release-2.5)
Expand Down
9 changes: 7 additions & 2 deletions spython/main/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def execute(self,
writable = False,
contain = False,
bind = None,
stream = False):
stream = False,
nv = False):

''' execute: send a command to a container
Expand All @@ -46,13 +47,17 @@ def execute(self,
bind: list or single string of bind paths.
This option allows you to map directories on your host system to
directories within your container using bind mounts
nv: if True, load Nvidia Drivers in runtime (default False)
'''
from spython.utils import check_install
check_install()

cmd = self._init_command('exec')

# nv option leverages any GPU cards
if nv is True:
cmd += ['--nv']

# If the image is given as a list, it's probably the command
if isinstance(image, list):
command = image
Expand Down
9 changes: 7 additions & 2 deletions spython/main/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def run(self,
writable = False,
contain = False,
bind = None,
stream = False):
stream = False,
nv = False):

'''
run will run the container, with or withour arguments (which
Expand All @@ -47,12 +48,16 @@ def run(self,
This option allows you to map directories on your host system to
directories within your container using bind mounts
stream: if True, return <generator> for the user to run
nv: if True, load Nvidia Drivers in runtime (default False)
'''
from spython.utils import check_install
check_install()

cmd = self._init_command('run')

# nv option leverages any GPU cards
if nv is True:
cmd += ['--nv']

# No image provided, default to use the client's loaded image
if image is None:
Expand Down
2 changes: 1 addition & 1 deletion spython/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@



__version__ = "0.0.40"
__version__ = "0.0.41"
AUTHOR = 'Vanessa Sochat'
AUTHOR_EMAIL = '[email protected]'
NAME = 'spython'
Expand Down

0 comments on commit 62e2388

Please sign in to comment.