Skip to content

Commit a86a720

Browse files
authored
Merge pull request #92 from vsoch/vsoch-v2.5
Updates for 2.5 (with merge conflicts resolved)
2 parents a609aa1 + 38ff491 commit a86a720

File tree

274 files changed

+308
-6217
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

274 files changed

+308
-6217
lines changed

.travis/before_install

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ sudo apt-get update && sudo apt-get install -y wget git build-essential squashfs
66
automake \
77
autoconf \
88
uuid-dev \
9-
libssl-dev
9+
libssl-dev \
10+
libarchive-dev
1011

1112

1213
sudo sed -i -e 's/^Defaults\tsecure_path.*$//' /etc/sudoers
@@ -31,9 +32,7 @@ which python
3132

3233
conda install -y pandas scikit-learn pygments
3334
cd $TRAVIS_BUILD_DIR && sudo python -m pip install -r requirements.txt
34-
python setup.py sdist && python setup.py install
35-
pylint --version
35+
python python setup.py install
3636

3737
# Install Singularity (development)
38-
cd /tmp && git clone -b development https://github.com/singularityware/singularity.git && cd singularity && ./autogen.sh && ./configure --prefix=/usr/local && make && sudo make install
39-
38+
cd /tmp && git clone https://github.com/singularityware/singularity.git && cd singularity && ./autogen.sh && ./configure --prefix=/usr/local && make && sudo make install

.travis/script

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
#!/bin/bash
2-
sudo apt-get install -y squashfs-tools
32
python -m unittest discover -s $TRAVIS_BUILD_DIR/singularity/tests/ -p '[t|T]est*.py'

CHANGELOG.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ and changes prior to that are (unfortunately) done retrospectively. Critical ite
1313
- migration guidance (how to convert images?)
1414
- changed behaviour (recipe sections work differently)
1515

16-
## [vxx](https://github.com/singularityware/singularity-python/tree/development) (development)
1716

18-
**changed user experience**
19-
- to address this [sregisty issue](https://github.com/singularityhub/sregistry/issues/56) the push client does not always state that the upload is finished. In the case that an image is frozen (and 403 status) this message is misleading.
20-
**pull bug**
21-
- changing function to rename image after download to `shutil.move` to allow for cross device downloads.
17+
## [master](https://github.com/singularityware/singularity-python/tree/master)
18+
- removed all client functionality in favor of using spython (2.5)
19+
- build on Google will not extract file counts, etc.
2220

2321
## [v2.4.1](https://github.com/singularityware/singularity-python/releases/tag/v2.4.1) (v2.4.1)
2422

25-
**changed behavior**
23+
- changing function to rename image after download to `shutil.move` to allow for cross device downloads.
2624
- *apps extraction* files limited to those in bin and lib, as the response to the server was too large.
2725
- **updated tests** to handle secure build
26+
- to address this [sregisty issue](https://github.com/singularityhub/sregistry/issues/56) the push client does not always state that the upload is finished. In the case that an image is frozen (and 403 status) this message is misleading.
27+
2828

2929
## [v2.4](https://github.com/singularityware/singularity-python/releases/tag/v2.4) (v2.4)
3030

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,25 @@
22

33
[![Build Status](https://travis-ci.org/singularityware/singularity-python.svg?branch=master)](https://travis-ci.org/singularityware/singularity-python)
44

5-
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.
5+
Singularity Python is a python module and command line tool to provide helpers for working with <a href="https://singularityware.github.io" target="_blank">Singularity</a> containers, specifically providing functions to visualize, package, and compare containers.
6+
7+
- If you are looking for the Singularity Python client to pull, build, and otherwise wrap Singularity functions, then please see the repository [singularity-cli](https://singularityhub.github.io/singularity-cli) for the [spython](https://pypi.org/project/spython/) module.
8+
- If you are looking for local management and interaction with various storage locations (e.g., to pull and inspect containers in Singularity Hub, Registry, or other cloud resource) then please see the [Global Client](https://singularityhub.github.io/sregistry-cli) for the `sregistry` module.
9+
10+
## Install
11+
You have the option to install only the dependencies that are needed for your functionality of interest.
12+
13+
```bash
14+
# All
15+
pip install singularity
16+
17+
# Metrics and analysis dependencies
18+
pip install singularity[metrics]
19+
20+
# Building on Google Cloud
21+
pip install singularity[google[
22+
```
23+
624
725
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.
826

Singularity.container

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@ Bootstrap: docker
22
From: continuumio/miniconda3
33

44
%runscript
5-
exec /opt/conda/bin/sregistry "$@"
6-
7-
%apprun shub
8-
exec /opt/conda/bin/shub "$@"
9-
10-
%apprun sregistry
11-
exec /opt/conda/bin/sregistry "$@"
5+
exec /opt/conda/bin/python "$@"
126

137
%labels
148
@@ -21,10 +15,8 @@ apt-get update && apt-get install -y git
2115

2216
# Install Singularity Python
2317
cd /opt
24-
git clone -b development https://www.github.com/vsoch/singularity-python
18+
git clone https://www.github.com/singularityware/singularity-python
2519
cd singularity-python
2620
/opt/conda/bin/pip install setuptools
2721
/opt/conda/bin/pip install -r requirements.txt
28-
/opt/conda/bin/pip install pyasn1==0.4.1
29-
/opt/conda/bin/python setup.py sdist
3022
/opt/conda/bin/python setup.py install

examples/classify/classify_image/count_files.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,20 @@
33
# This is an example of counting files using an image diff
44

55
from singularity.analysis.classify import (
6-
get_diff,
76
file_counts,
87
extension_counts
98
)
109

11-
image_package = "python:3.6.0.img.zip"
12-
13-
# The diff is a dict of folders --> files that differ between
14-
# image and it's closest OS
15-
diff = get_diff(image_package=image_package)
10+
container = "ubuntu.simg"
1611

1712
# Now we might be interested in counting different things
18-
readme_count = file_counts(diff=diff)
19-
copyright_count = file_counts(diff=diff,patterns=['copyright'])
20-
authors_count = file_counts(diff=diff,patterns=['authors','thanks','credit'])
21-
todo_count = file_counts(diff=diff,patterns=['todo'])
13+
readme_count = file_counts(container)
14+
copyright_count = file_counts(container, patterns=['copyright'])
15+
authors_count = file_counts(container, patterns=['authors','thanks','credit'])
16+
todo_count = file_counts(container, patterns=['todo'])
2217

2318
# Or getting a complete dict of extensions
24-
extensions = extension_counts(diff=diff)
19+
extensions = extension_counts(container)
2520

2621
# Return files instead of counts
27-
extensions = extension_counts(diff=diff,return_counts=False)
22+
extensions = extension_counts(container, return_counts=False)

examples/classify/classify_image/derive_tags.py

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,19 @@
55
import os
66
os.environ['MESSAGELEVEL'] = 'CRITICAL'
77

8-
from singularity.analysis.classify import (
9-
get_tags,
10-
get_diff
11-
)
12-
13-
image_package = "python:3.6.0.img.zip"
8+
from singularity.analysis.classify import get_tags
9+
from singularity.package import get_container_contents
1410

1511
# The algorithm works as follows:
16-
# 1) first compare package to set of base OS (provided with shub)
17-
# 2) subtract the most similar os from image, leaving "custom" files
18-
# 3) organize custom files into dict based on folder name
19-
# 4) return search_folders as tags
12+
# 1) organize custom files into dict based on folder name
13+
# 2) return search_folders as tags
2014

2115
# Default tags will be returned as software in "bin"
22-
tags = get_tags(image_package=image_package)
16+
tags = get_tags(container)
2317

24-
# We can also get the raw "diff" between the image and it's base
25-
# which is usable in other functions (and we don't have to calc
26-
# it again)
27-
diff = get_diff(image_package=image_package)
18+
# We can also get the raw list of flies
19+
file_list = get_container_contents(container)['all']
2820

2921
# We can specify other folders of interest
3022
folders = ['init','init.d','bin','systemd']
31-
tags = get_tags(search_folders=folders,diff=diff)
32-
# Most similar OS found to be %s debian:7.11
23+
tags = get_tags(container, search_folders=folders)

examples/classify/classify_image/estimate_os.py

Lines changed: 0 additions & 17 deletions
This file was deleted.
-134 KB
Binary file not shown.

examples/cli/run_singularity/singularity_client.py

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)