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 @@ -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)
- additional of args to instance start commands (0.0.50)
- continued lines should not be split in docker.py recipe parser (_setup) (0.0.49)
- COPY command should honor src src dest (and not reverse) (0.0.48)
- adding support for instance list (0.0.47)
Expand Down
10 changes: 9 additions & 1 deletion spython/instance/cmd/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from spython.logger import bot
import sys

def start(self, image=None, name=None, sudo=False, options=[], capture=False):
def start(self, image=None, name=None, args=None, sudo=False, options=[], capture=False):
'''start an instance. This is done by default when an instance is created.

Parameters
Expand All @@ -18,6 +18,7 @@ def start(self, image=None, name=None, sudo=False, options=[], capture=False):
name: a name for the instance
sudo: if the user wants to run the command with sudo
capture: capture output, default is False. With True likely to hang.
args: arguments to provide to the instance (supported Singularity 3.1+)
options: a list of tuples, each an option to give to the start command
[("--bind", "/tmp"),...]

Expand Down Expand Up @@ -59,8 +60,15 @@ def start(self, image=None, name=None, sudo=False, options=[], capture=False):
# Assemble the command!
cmd = cmd + options + [image, self.name]

# If arguments are provided
if args != None:
if not isinstance(args, list):
args = [args]
cmd = cmd + args

# Save the options and cmd, if the user wants to see them later
self.options = options
self.args = args
self.cmd = cmd

output = run_command(cmd, sudo=sudo, quiet=True, capture=capture)
Expand Down
2 changes: 1 addition & 1 deletion spython/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.


__version__ = "0.0.49"
__version__ = "0.0.50"
AUTHOR = 'Vanessa Sochat'
AUTHOR_EMAIL = 'vsochat@stanford.edu'
NAME = 'spython'
Expand Down