Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop->master #89

Merged
merged 3 commits into from
Oct 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ develop: [![Build Status](https://travis-ci.org/kbase/catalog.svg?branch=develop
Code coverage: (develop branch)
[![Coverage Status](https://coveralls.io/repos/github/kbase/catalog/badge.svg?branch=develop)](https://coveralls.io/github/kbase/catalog?branch=develop)


#### v2.1.1 - 6/26/17
- Bugfix for change in docker build log

#### v2.1.0 - 4/13/17
- No change from 2.0.7, but upgraded minor version number because many new features
now exist since the initial 2.0.x release.
Expand Down
32 changes: 14 additions & 18 deletions lib/biokbase/catalog/registrar.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,35 +542,31 @@ def cleanup(self):
shutil.rmtree(os.path.join(self.temp_dir,self.registration_id))

def build_docker_image(self, docker_client, image_name, basedir):
self.log('\nBuilding the docker image for ' + image_name);
self.log('\nBuilding the docker image for ' + image_name)

# examine stream to determine success/failure of build
imageId=None
last={}
for lines in docker_client.build(path=basedir,rm=True,tag=image_name, pull=False):
imageId = None
for lines in docker_client.build(path=basedir, rm=True, tag=image_name, pull=False):
for line in lines.strip().splitlines():
line_parse = json.loads(line.strip())
log_line = ''
if 'stream' in line_parse:
self.log(line_parse['stream'],no_end_line=True)
self.log(line_parse['stream'], no_end_line=True)
if 'errorDetail' in line_parse:
self.log(str(line_parse),no_end_line=True)
raise ValueError('Docker build failed: '+str(line_parse['errorDetail']))
last=line_parse

if 'stream' in last and last['stream'][:19]=='Successfully built ':
imageId = docker_client.inspect_image(image_name)['Id']
self.log(str(line_parse), no_end_line=True)
raise ValueError('Docker build failed: ' + str(line_parse['errorDetail']))

imageId = docker_client.inspect_image(image_name)['Id']

self.log('Docker build successful.')
self.log(' Image Id: ' + imageId)
self.log(' Image Name: ' + image_name+'\n\n')
self.log(' Image Id: ' + str(imageId))
self.log(' Image Name: ' + str(image_name) + '\n\n')
return imageId

def push_docker_image(self, docker_client, image_name):
self.log('\nPushing docker image to registry for ' + image_name);
colon_pos = image_name.rfind(':') # This logic supports images with "host:port/" prefix for private registry
image=image_name[:colon_pos]
tag=image_name[colon_pos+1:]
self.log('\nPushing docker image to registry for ' + image_name)
colon_pos = image_name.rfind(':') # This logic supports images with "host:port/" prefix for private registry
image = image_name[:colon_pos]
tag = image_name[colon_pos + 1:]
#response = [ line for line in docker_client.push(image, tag=tag, stream=True) ]
#response_stream = response
#self.log(str(response_stream))
Expand Down