Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull client should honor quiet #137

Merged
merged 4 commits into from
Jun 26, 2019
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.
Jump to
Jump to file
Failed to load files.
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)
- client is not honoring quiet for pull (0.0.71)
- removing debugging line in pull (0.0.70)
- adding quiet argument to build to override client (0.0.69)
- adding additional options to build to support singularity-compose (0.0.68)
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Singularity Python

[![Build Status](https://travis-ci.org/singularityhub/singularity-cli.svg?branch=master)](https://travis-ci.org/singularityhub/singularity-cli)

Singularity Python (spython) is the Python API for working with <a href="https://singularityware.github.io/" target="_blank">Singularity</a> containers. See
the [documentation](https://singularityhub.github.io/singularity-cli) for installation and usage.

Expand Down
1 change: 0 additions & 1 deletion spython/main/base/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def init_level(self, quiet=False):
self.quiet = quiet



def println(self, output, quiet=False):
'''print will print the output, given that quiet is not True. This
function also serves to convert output in bytes to utf-8
Expand Down
16 changes: 12 additions & 4 deletions spython/main/pull.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def pull(self,
ext=None,
force=False,
capture=False,
stream=False):
stream=False,
quiet=False):

'''pull will pull a singularity hub or Docker image

Expand All @@ -39,6 +40,9 @@ def pull(self,

cmd = self._init_command('pull')

# Quiet is honored if set by the client, or user
quiet = quiet or self.quiet

if not ext:
ext = 'sif' if 'version 3' in self.version() else 'simg'

Expand Down Expand Up @@ -75,17 +79,21 @@ def pull(self,
cmd = cmd + ["--force"]

cmd.append(image)
bot.info(' '.join(cmd))

if not quiet:
bot.info(' '.join(cmd))

with ScopedEnvVar('SINGULARITY_PULLFOLDER', pull_folder):
# Option 1: Streaming we just run to show user
if not stream:
self._run_command(cmd, capture=capture)
self._run_command(cmd,
capture=capture,
quiet=quiet)

# Option 3: A custom name we can predict (not commit/hash) and can also show
else:
return final_image, stream_command(cmd, sudo=False)

if os.path.exists(final_image):
if os.path.exists(final_image) and not quiet:
bot.info(final_image)
return final_image
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.70"
__version__ = "0.0.71"
AUTHOR = 'Vanessa Sochat'
AUTHOR_EMAIL = 'vsochat@stanford.edu'
NAME = 'spython'
Expand Down