Skip to content

Commit 8bb32da

Browse files
committed
changing generation of timestamp and defaults
1 parent 4e77340 commit 8bb32da

7 files changed

Lines changed: 29 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# CHANGELOG
2+
3+
This is a manually generated log to track changes to the repository for each release.
4+
Each section should include general headers such as **Implemented enhancements**
5+
and **Merged pull requests**. All closed issued and bug fixes should be
6+
represented by the pull requests that fixed them. This log originated with Singularity 2.4
7+
and changes prior to that are (unfortunately) done retrospectively. Critical items to know are:
8+
9+
- renamed commands
10+
- deprecated / removed commands
11+
- changed defaults
12+
- backward incompatible changes (recipe file format? image file format?)
13+
- migration guidance (how to convert images?)
14+
- changed behaviour (recipe sections work differently)
15+
16+
17+
## [vxx](https://github.com/singularityware/singularity-python/tree/development) (development)
18+
19+
**changed defaults**
20+
- *sregistry client*: to support use of squashfs images and singularity 2.4, the default upload is not compressed, assuming squashfs, and the default download is not decompressed. To still compress an image add the `--compress` flag on push, and the `--decompress` flag on pull.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Singularity Python is a python module and command line tool for working with <a href="https://singularityware.github.io" target="_blank">Singularity</a> containers, specifically providing functions to visualize, package, and compare containers. Currently, most functions use Singularity on the command line, and some require sudo.
66

7-
We currently require Python > version 3 to use various timezone functions. If you are unable to install version 3.0, we provide a [Singularity.container](Singularity.container) for you to use instead. See the [installation docs](https://github.com/singularityware/singularity-python/wiki/Installation) for your different options.
7+
We currently require Python > version 3 to use various timezone functions. If you are unable to install version 3.0, we provide a [Singularity.container](Singularity.container) for you to use instead. This is the recommended approach as some older versions of Python do not support generation of the timestamp. See the [installation docs](https://github.com/singularityware/singularity-python/wiki/Installation) for your different options.
88

99
The Singularity-Python code is licensed under the MIT open source license, which is a highly permissive license that places few limits upon reuse. This ensures that the code will be usable by the greatest number of researchers, in both academia and industry. The following examples are provided:
1010

singularity/registry/auth.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ def generate_signature(payload, secret):
6161

6262

6363
def generate_timestamp():
64-
ts = datetime.now()
65-
ts = ts.replace(tzinfo=timezone.utc)
64+
ts = datetime.now(timezone.utc)
6665
return ts.strftime('%Y%m%dT%HZ')
6766

6867

singularity/registry/client/push.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
)
5151

5252

53-
def push(self, path, name, tag=None, compress=True):
53+
def push(self, path, name, tag=None, compress=False):
5454
'''push an image to Singularity Registry'''
5555

5656
path = os.path.abspath(path)

singularity/registry/main/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ def get_parser():
9797
help='name of image, in format "library/image"',
9898
type=str, required=True)
9999

100-
push.add_argument('--no-compress', dest="nocompress",
101-
help="show the test for each container.",
100+
push.add_argument('--compress', dest="compress",
101+
help="compress the container on upload (for legacy containers prior to 2.4)",
102102
default=False, action='store_true')
103103

104104

@@ -114,8 +114,8 @@ def get_parser():
114114
help='custom name for image',
115115
type=str, default=None)
116116

117-
pull.add_argument('--no-decompress', dest="nodecompress",
118-
help="extract a gzip compressed image",
117+
pull.add_argument('--decompress', dest="decompress",
118+
help="extract a gzip compressed image for legacy (prior to 2.4) containers",
119119
default=False, action='store_true')
120120

121121
# List or search labels

singularity/registry/main/pull.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ def main(args,parser,subparser):
3535
sreg = Client(secrets=args.secrets)
3636
response = sreg.pull(images=args.image,
3737
file_name=args.name,
38-
decompress=not args.nodecompress)
38+
decompress=args.decompress)

singularity/registry/main/push.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,4 @@ def main(args,parser,subparser):
4444
response = sreg.push(path=image,
4545
name=args.name,
4646
tag=args.tag,
47-
compress=not args.nocompress)
48-
49-
47+
compress=args.compress)

0 commit comments

Comments
 (0)