Skip to content

Commit c6aa834

Browse files
authored
Merge pull request #82 from vsoch/v2.4.1
V2.4.1
2 parents 1b38684 + 2eaca0d commit c6aa834

File tree

8 files changed

+45
-17
lines changed

8 files changed

+45
-17
lines changed

.travis/before_install

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
#!/bin/bash
22

3-
apt-get update && apt-get install -y wget git build-essential squashfs-tools \
4-
libtool \
5-
autotools-dev \
6-
automake \
7-
autoconf
3+
sudo apt-get update && sudo apt-get install -y wget git build-essential squashfs-tools \
4+
libtool \
5+
autotools-dev \
6+
automake \
7+
autoconf \
8+
uuid-dev \
9+
libssl-dev
10+
811

912
sudo sed -i -e 's/^Defaults\tsecure_path.*$//' /etc/sudoers
1013

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,16 @@ 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-
1716
## [vxx](https://github.com/singularityware/singularity-python/tree/development) (development)
1817

18+
19+
## [v2.4.1](https://github.com/singularityware/singularity-python/releases/tag/v2.4.1) (v2.4.1)
20+
21+
**changed behavior**
22+
- *apps extraction* files limited to those in bin and lib, as the response to the server was too large.
23+
- **updated tests** to handle secure build
24+
25+
## [v2.4](https://github.com/singularityware/singularity-python/releases/tag/v2.4) (v2.4)
26+
1927
**changed defaults**
2028
- *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.

singularity/analysis/apps.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ def extract_apps(image_path, app_names, S=None, verbose=True):
7979
except:
8080
pass
8181
base = '/scif/apps/%s' %app_name
82-
metadata['files'] = [x.path for x in members if base in x.path]
82+
libs = [x.path for x in members if "%s/lib" %base in x.path]
83+
bins = [x.path for x in members if "%s/bin" %base in x.path]
84+
metadata['files'] = libs + bins
8385
apps[app_name] = metadata
8486

8587
return apps

singularity/analysis/classify.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,12 @@ def estimate_os(container=None,image_package=None,return_top=True):
128128
comparison = compare_packages(packages_set1=[image_package])['files.txt'].transpose()
129129

130130
comparison.columns = ['SCORE']
131-
most_similar = comparison['SCORE'].idxmax()
131+
try:
132+
most_similar = comparison['SCORE'].idxmax()
133+
except:
134+
most_similar = comparison['SCORE'].values.argmax()
135+
most_similar = comparison.index.tolist()[most_similar]
136+
132137
print("Most similar OS found to be ", most_similar)
133138
if return_top == True:
134139
return most_similar

singularity/build/main.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ def run_build(build_dir,params,verbose=True, compress_image=False):
162162
diff = get_diff(image_package=image_package)
163163

164164
# Inspect to get labels and other metadata
165+
165166
cli = Singularity(debug=params['debug'])
166167
inspect = cli.inspect(image_path=image)
167168

@@ -179,7 +180,8 @@ def run_build(build_dir,params,verbose=True, compress_image=False):
179180
extensions = extension_counts(diff=diff)
180181

181182
os_sims = estimate_os(image_package=image_package,return_top=False)
182-
most_similar = os_sims['SCORE'].idxmax()
183+
most_similar = os_sims['SCORE'].values.argmax()
184+
most_similar = os_sims['SCORE'].index.tolist()[most_similar]
183185

184186
metrics = {'build_time_seconds':final_time,
185187
'singularity_version':singularity_version,
@@ -238,6 +240,9 @@ def send_build_data(build_dir, data, secret,
238240

239241
if response_url is not None:
240242
finish = requests.post(response_url,data=data, headers=headers)
243+
bot.debug("RECEIVE POST TO SINGULARITY HUB ---------------------")
244+
bot.debug(finish.status_code)
245+
bot.debug(finish.reason)
241246
else:
242247
bot.warning("response_url set to None, skipping sending of build.")
243248

@@ -275,5 +280,8 @@ def send_build_close(params,response_url):
275280

276281
headers = {'Authorization': signature }
277282

278-
# Send it back!
279-
return requests.post(response_url,data=response, headers=headers)
283+
finish = requests.post(response_url,data=response, headers=headers)
284+
bot.debug("FINISH POST TO SINGULARITY HUB ---------------------")
285+
bot.debug(finish.status_code)
286+
bot.debug(finish.reason)
287+
return finish

singularity/build/scripts/singularity-prepare-instance.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ sudo apt-get -y install git \
1818
autoconf \
1919
debootstrap \
2020
yum \
21+
uuid-dev \
22+
libssl-dev \
2123
python3-pip
2224

2325

@@ -29,9 +31,9 @@ sudo pip3 install --upgrade google &&
2931
sudo pip3 install oauth2client==3.0.0
3032

3133
# Install Singularity from Github
32-
cd /tmp && git clone -b feature-squashbuild-secbuild https://github.com/cclerget/singularity.git &&
34+
cd /tmp && git clone -b feature-squashbuild-secbuild-2.4.1 https://github.com/cclerget/singularity.git &&
3335
cd /tmp/singularity && ./autogen.sh && ./configure --prefix=/usr/local && make && sudo make install && sudo make secbuildimg
3436

3537
# Singularity python development
36-
cd /tmp && git clone -b development https://www.github.com/vsoch/singularity-python.git &&
38+
cd /tmp && git clone -b v2.4.1 https://www.github.com/vsoch/singularity-python.git &&
3739
cd /tmp/singularity-python && sudo python3 setup.py install

singularity/cli/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,9 @@ def pull(self,image_path,pull_folder='',
319319
if size is not None:
320320
cmd = cmd + ["--size",size]
321321
if image_name is None:
322-
image_name = "%s" %image_path.replace("docker://","").replace("/","-")
323-
final_image = "%s%s.img" %(pull_folder,image_name)
324-
cmd = cmd + ["--name", image_name]
322+
image_name = image_path.replace("docker://","").replace("/","-")
323+
final_image = "%s%s.simg" %(pull_folder,image_name)
324+
cmd = cmd + ["--name", final_image]
325325

326326
cmd.append(image_path)
327327
bot.debug(' '.join(cmd))

singularity/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
SOFTWARE.
2323
'''
2424

25-
__version__ = "1.2.1"
25+
__version__ = "2.4.1"
2626
AUTHOR = 'Vanessa Sochat'
2727
AUTHOR_EMAIL = 'vsochat@stanford.edu'
2828
NAME = 'singularity'

0 commit comments

Comments
 (0)