Skip to content

Commit

Permalink
Merge pull request #193 from singularityhub/fix/docker-auth-undefined
Browse files Browse the repository at this point in the history
fixing undefined variable auth in docker
  • Loading branch information
vsoch committed Apr 23, 2019
2 parents 7f2dede + e454418 commit abc9614
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
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.com/singularityhub/sregistry-cli/tree/master) (0.0.x)
- docker auth is undefined, and storage attribute needs to be checked for naming (0.01.40)
- fixing bug with tag specification for registry pull (0.01.39)
- registry client should honor base, if provided with uri (0.01.38)
- added google-build client, building with google build and sending to google storage (0.01.37)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -6,7 +6,7 @@ Hi Friends! Are your containers lonely? Singularity containers thrive in happine

Singularity Global Client is an interface to interact with Singularity containers in many different storage locations. We are able to use modern APIs by way of providing and using the software within a Singularity container! For older architectures, we provide a [Singularity container](Singularity) for you to use instead. You can build it from this repository, or use the provided container on [Singularity Hub](https://www.singularity-hub.org/collections/379).

See our [installation guide](https://singularityhub.github.io/sregistry-cli/install) to get started. For more details, please refer to our [documentation](docs)
If used for the Singularity Registry client, Python 3 is required. See our [installation guide](https://singularityhub.github.io/sregistry-cli/install) to get started. For more details, please refer to our [documentation](docs).

## Building the RPM

Expand Down
1 change: 1 addition & 0 deletions docs/clients/registry.md
Expand Up @@ -18,6 +18,7 @@ The following commands are not yet developed or implemented, but can be (please

- *delete*: `[remote]`: delete an image from a remote endpoint if you have the correct credential (note this isn't implemented yet for the registry, but is noted here as a todo).

If you are using `sregistry` for a Singularity Registry, Python 3.3+ is required.

## Install
The Singularity Registry client for sregistry is recommended for use with Python 3, since it uses the datetime package to help with the credential header (if you have a workaround for this, please contribute since it causes issues for many). To install the dependencies:
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Expand Up @@ -143,7 +143,6 @@ def get_reqs(lookup=None, key='INSTALL_REQUIRES'):
'Topic :: Software Development',
'Topic :: Scientific/Engineering',
'Operating System :: Unix',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
],
entry_points = {'console_scripts': [ 'sregistry=sregistry.client:main' ] })
5 changes: 5 additions & 0 deletions sregistry/main/base/settings.py
Expand Up @@ -118,6 +118,11 @@ def get_storage_name(self, names, remove_dir=False):
names: the output from parse_image_name
'''
storage_folder = os.path.dirname(names['storage'])

# If the client doesn't have a database, default to PWD
if not hasattr(self, 'storage'):
return os.path.basename(names['storage'])

storage_folder = "%s/%s" %(self.storage, storage_folder)
mkdir_p(storage_folder)
file_name = names['storage'].replace('/','-')
Expand Down
1 change: 1 addition & 0 deletions sregistry/main/docker/__init__.py
Expand Up @@ -135,6 +135,7 @@ def _update_secrets(self):
password = self._get_setting('SREGISTRY_DOCKERHUB_PASSWORD', password)

# Option 1: the user exports username and password
auth = None
if username is not None and password is not None:
auth = basic_auth_header(username, password)
self.headers.update(auth)
Expand Down
2 changes: 1 addition & 1 deletion sregistry/version.py
Expand Up @@ -8,7 +8,7 @@
'''

__version__ = "0.1.39"
__version__ = "0.1.40"
AUTHOR = 'Vanessa Sochat'
AUTHOR_EMAIL = 'vsochat@stanford.edu'
NAME = 'sregistry'
Expand Down

0 comments on commit abc9614

Please sign in to comment.