Skip to content

Commit 39c0c39

Browse files
committed
making updates to spec file
1 parent 2b00f86 commit 39c0c39

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
name="singularity",
88

99
# Version number:
10-
version="0.42",
10+
version="0.43",
1111

1212
# Application author details:
1313
author="Vanessa Sochat",

singularity/build/google.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -160,16 +160,16 @@ def run_build(build_dir=None,spec_file=None,repo_url=None,token=None,size=None,b
160160
{'key': 'branch', 'value': branch, 'return_text': True },
161161
{'key': 'spec_file', 'value': spec_file, 'return_text': True }]
162162

163-
# Default spec file is Singularity
164-
if spec_file == None:
165-
spec_file = "Singularity"
166-
167-
if bucket_name == None:
168-
bucket_name = "singularity-hub"
169-
170163
# Obtain values from build
171164
params = get_build_params(metadata)
172165

166+
# Default spec file is Singularity
167+
if params['spec_file'] == None:
168+
params['spec_file'] = "Singularity"
169+
170+
if params['bucket_name'] == None:
171+
params['bucket_name'] = "singularity-hub"
172+
173173
# Download the repo and image
174174
repo = download_repo(repo_url=params['repo_url'],
175175
destination=build_dir)
@@ -189,16 +189,16 @@ def run_build(build_dir=None,spec_file=None,repo_url=None,token=None,size=None,b
189189
bot.logger.warning("commit not specified, setting to current %s", params['commit'])
190190

191191

192-
if os.path.exists(spec_file):
193-
bot.logger.info("Found spec file %s in repository",spec_file)
192+
if os.path.exists(params['spec_file']):
193+
bot.logger.info("Found spec file %s in repository",params['spec_file'])
194194

195195
# If size is None, get from image + 50 padding
196196
if params['size'] == None:
197197
bot.logger.info("Size not detected for build. Will estimate with 200MB padding.")
198-
params['size'] = estimate_image_size(spec_file=spec_file,
198+
params['size'] = estimate_image_size(spec_file=os.path.abspath(params['spec_file']),
199199
sudopw='')
200200

201-
image = build_from_spec(spec_file=spec_file, # default will package the image
201+
image = build_from_spec(spec_file=params['spec_file'], # default will package the image
202202
size=params['size'],
203203
sudopw='', # with root should not need sudo
204204
output_folder=build_dir,
@@ -210,7 +210,7 @@ def run_build(build_dir=None,spec_file=None,repo_url=None,token=None,size=None,b
210210

211211
# Package the image metadata (files, folders, etc)
212212
image_package = package(image_path=image,
213-
spec_path=spec_file,
213+
spec_path=params['spec_file'],
214214
output_folder=build_dir,
215215
sudopw='',
216216
remove_image=True,
@@ -276,7 +276,7 @@ def run_build(build_dir=None,spec_file=None,repo_url=None,token=None,size=None,b
276276
else:
277277
# Tell the user what is actually there
278278
present_files = glob("*")
279-
bot.logger.error("Build file %s not found in repository",spec_file)
279+
bot.logger.error("Build file %s not found in repository",params['spec_file'])
280280
bot.logger.info("Found files are %s","\n".join(present_files))
281281

282282

singularity/package.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import os
2525

2626

27-
def estimate_image_size(spec_file=None,sudopw=None,padding=50):
27+
def estimate_image_size(spec_file,sudopw=None,padding=50):
2828
'''estimate_image_size will generate an image in a directory, and add
2929
some padding to it to estimate the size of the image file to generate
3030
:param sudopw: the sudopw for Singularity, root should provide ''

0 commit comments

Comments
 (0)