)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":10206,"name":"Madhuri Kumari","email":"madhuri.kumari@intel.com","username":"Madhuri"},"change_message_id":"41a322c509cd0a9833ba61bb34bf4785c5144748","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Bin Zhou \u003clakerzhou@gmail.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-03-16 15:35:01 -0400"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"This patch implements the creation of a docker container snapshot at local host."},{"line_number":8,"context_line":"example CLI: zun commit --repository myrepo --tag mytag"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"Change-Id: I377d1b84240d40fdae8c5bd02cb6ef12bc948271"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"1a1ced50_24f89ee5","line":7,"updated":"2017-03-17 04:38:28.000000000","message":"Add a title for this commit. It should not exceed 50 chars followed by this message.","commit_id":"c5e50473cc8bc42c627f5dc93b67ecbaf313d62c"},{"author":{"_account_id":25026,"name":"Bin Zhou","email":"lakerzhou@gmail.com","username":"lakerzhou"},"change_message_id":"692fbda931c301f4a58807c3c64ce41f9082c368","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Bin Zhou \u003clakerzhou@gmail.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-03-16 15:35:01 -0400"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"This patch implements the creation of a docker container snapshot at local host."},{"line_number":8,"context_line":"example CLI: zun commit --repository myrepo --tag mytag"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"Change-Id: I377d1b84240d40fdae8c5bd02cb6ef12bc948271"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"1a1ced50_5631bea1","line":7,"in_reply_to":"1a1ced50_24f89ee5","updated":"2017-03-17 14:55:46.000000000","message":"Madhuri, you are right. I was struggling with code the submition process and missed the correct title of code review.\nThis is the first patch, which support single host only. The second patch will support multi-hosts. \nMy plan is to break the snapshot process into several steps:\n1. create local image (docker commit)\n2. get the image file, save to /tmp or other place, TBD. We cannot directly use the local image file because its location varies with different distributions. The file name will be something like \u003crepo\u003e+\u003ctag\u003e+\u003cid\u003e.\n3. Call glance API to upload the image.\nThe 2nd patch will cover step 2 and 3.","commit_id":"c5e50473cc8bc42c627f5dc93b67ecbaf313d62c"}],"zun/api/controllers/v1/containers.py":[{"author":{"_account_id":16277,"name":"Pradeep Kumar Singh","email":"ps4openstack@gmail.com","username":"pradeep_singh"},"change_message_id":"e808cb13b7cced5b1a807c60f6ca3523ea1fc396","unresolved":false,"context_lines":[{"line_number":520,"context_line":"        compute_api.container_commit(context, container,"},{"line_number":521,"context_line":"                                     kw.get(\u0027repository\u0027, None),"},{"line_number":522,"context_line":"                                     kw.get(\u0027tag\u0027, None))"},{"line_number":523,"context_line":"        pecan.response.status \u003d 202"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_3030c556","line":523,"range":{"start_line":523,"start_character":8,"end_line":523,"end_character":35},"updated":"2017-03-17 15:03:57.000000000","message":"is it sync api or async api call? from code it seem its sync api, if yes then 200 would be better.","commit_id":"5f51346eaabb8b3fc155d76702a0c062c8a427ee"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"19e493e55a84445f1ffb69e0b9dbf27aacee856d","unresolved":false,"context_lines":[{"line_number":520,"context_line":"        compute_api.container_commit(context, container,"},{"line_number":521,"context_line":"                                     kw.get(\u0027repository\u0027, None),"},{"line_number":522,"context_line":"                                     kw.get(\u0027tag\u0027, None))"},{"line_number":523,"context_line":"        pecan.response.status \u003d 202"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_db03d240","line":523,"range":{"start_line":523,"start_character":8,"end_line":523,"end_character":35},"in_reply_to":"1a1ced50_3030c556","updated":"2017-03-20 17:43:32.000000000","message":"I think this API should be async, since it would take a while to commit a large container and upload it to remote image repository.","commit_id":"5f51346eaabb8b3fc155d76702a0c062c8a427ee"},{"author":{"_account_id":25026,"name":"Bin Zhou","email":"lakerzhou@gmail.com","username":"lakerzhou"},"change_message_id":"c8eb02defc31a59b0c5cf2569e61bf9a012a0120","unresolved":false,"context_lines":[{"line_number":520,"context_line":"        compute_api.container_commit(context, container,"},{"line_number":521,"context_line":"                                     kw.get(\u0027repository\u0027, None),"},{"line_number":522,"context_line":"                                     kw.get(\u0027tag\u0027, None))"},{"line_number":523,"context_line":"        pecan.response.status \u003d 202"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_c3783b2e","line":523,"range":{"start_line":523,"start_character":8,"end_line":523,"end_character":35},"in_reply_to":"1a1ced50_3030c556","updated":"2017-03-22 03:42:20.000000000","message":"It is async call. As noted by Hongbin, the work might take long time: save local copy and upload image to glance.","commit_id":"5f51346eaabb8b3fc155d76702a0c062c8a427ee"},{"author":{"_account_id":10206,"name":"Madhuri Kumari","email":"madhuri.kumari@intel.com","username":"Madhuri"},"change_message_id":"e2b979f635928b2519d293c0efa5b583a68538b5","unresolved":false,"context_lines":[{"line_number":520,"context_line":"        compute_api.container_commit(context, container,"},{"line_number":521,"context_line":"                                     kw.get(\u0027repository\u0027, None),"},{"line_number":522,"context_line":"                                     kw.get(\u0027tag\u0027, None))"},{"line_number":523,"context_line":"        pecan.response.status \u003d 202"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_d6f0f293","line":523,"range":{"start_line":523,"start_character":8,"end_line":523,"end_character":35},"in_reply_to":"1a1ced50_db03d240","updated":"2017-03-21 16:33:30.000000000","message":"+1 for async","commit_id":"5f51346eaabb8b3fc155d76702a0c062c8a427ee"}],"zun/compute/api.py":[{"author":{"_account_id":10206,"name":"Madhuri Kumari","email":"madhuri.kumari@intel.com","username":"Madhuri"},"change_message_id":"e2b979f635928b2519d293c0efa5b583a68538b5","unresolved":false,"context_lines":[{"line_number":104,"context_line":"    def container_put_archive(self, context, container, *args):"},{"line_number":105,"context_line":"        return self.rpcapi.container_put_archive(context, container, *args)"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def container_commit(self, context, container, *args):"},{"line_number":108,"context_line":"        return self.rpcapi.container_commit(context, container, *args)"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def image_pull(self, context, image, *args):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_62ff61aa","line":107,"range":{"start_line":107,"start_character":51,"end_line":107,"end_character":56},"updated":"2017-03-21 16:33:30.000000000","message":"I think the param repo and tag should be defined here.","commit_id":"5f51346eaabb8b3fc155d76702a0c062c8a427ee"},{"author":{"_account_id":10206,"name":"Madhuri Kumari","email":"madhuri.kumari@intel.com","username":"Madhuri"},"change_message_id":"e2b979f635928b2519d293c0efa5b583a68538b5","unresolved":false,"context_lines":[{"line_number":105,"context_line":"        return self.rpcapi.container_put_archive(context, container, *args)"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def container_commit(self, context, container, *args):"},{"line_number":108,"context_line":"        return self.rpcapi.container_commit(context, container, *args)"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def image_pull(self, context, image, *args):"},{"line_number":111,"context_line":"        return self.rpcapi.image_pull(context, image, *args)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_82d53d1d","line":108,"range":{"start_line":108,"start_character":64,"end_line":108,"end_character":69},"updated":"2017-03-21 16:33:30.000000000","message":"And pass repo and tag here. This call can fail otherwise due to parameters mismatch.","commit_id":"5f51346eaabb8b3fc155d76702a0c062c8a427ee"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"34bbaf921ebc5717187e332f4d3fc0860e34d4ef","unresolved":false,"context_lines":[{"line_number":105,"context_line":"        return self.rpcapi.container_put_archive(context, container, *args)"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def container_commit(self, context, container, *args):"},{"line_number":108,"context_line":"        return self.rpcapi.container_commit(context, container, *args)"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def image_pull(self, context, image, *args):"},{"line_number":111,"context_line":"        return self.rpcapi.image_pull(context, image, *args)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_ddf46f5c","line":108,"range":{"start_line":108,"start_character":64,"end_line":108,"end_character":69},"in_reply_to":"1a1ced50_82d53d1d","updated":"2017-03-21 19:04:26.000000000","message":"Madhuri,\n\nI believe this will work as well since I tested this patch in before.","commit_id":"5f51346eaabb8b3fc155d76702a0c062c8a427ee"},{"author":{"_account_id":25026,"name":"Bin Zhou","email":"lakerzhou@gmail.com","username":"lakerzhou"},"change_message_id":"c8eb02defc31a59b0c5cf2569e61bf9a012a0120","unresolved":false,"context_lines":[{"line_number":105,"context_line":"        return self.rpcapi.container_put_archive(context, container, *args)"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def container_commit(self, context, container, *args):"},{"line_number":108,"context_line":"        return self.rpcapi.container_commit(context, container, *args)"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def image_pull(self, context, image, *args):"},{"line_number":111,"context_line":"        return self.rpcapi.image_pull(context, image, *args)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_89d38f03","line":108,"range":{"start_line":108,"start_character":64,"end_line":108,"end_character":69},"in_reply_to":"1a1ced50_82d53d1d","updated":"2017-03-22 03:42:20.000000000","message":"The function is implemented the same way as others such as container_resize for example. I am thinking to make repo and tag as mandatory inputs. Otherwise there is no other way to tell the generated docker images. For example, the output of \"docker images\" looks like the following \n\u003cnone\u003e              \u003cnone\u003e              4050080df68b        2 weeks ago         7.74 MB\n\u003cnone\u003e              \u003cnone\u003e              8300259ce914        2 weeks ago         7.74 MB","commit_id":"5f51346eaabb8b3fc155d76702a0c062c8a427ee"}],"zun/compute/manager.py":[{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"cc4275fe260142dbf42d2048261a003e10bec078","unresolved":false,"context_lines":[{"line_number":482,"context_line":"    def _do_container_commit(self, context, container, repository, tag\u003dNone):"},{"line_number":483,"context_line":"        LOG.debug(\u0027Creating image...\u0027)"},{"line_number":484,"context_line":"        container_image \u003d None"},{"line_number":485,"context_line":"        container_imageID \u003d None"},{"line_number":486,"context_line":"        if tag is None:"},{"line_number":487,"context_line":"            tag \u003d \u0027latest\u0027"},{"line_number":488,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3f044301_1505b877","line":485,"range":{"start_line":485,"start_character":8,"end_line":485,"end_character":25},"updated":"2017-05-05 04:14:49.000000000","message":"nit: container_image_id","commit_id":"462059de070146e8e1f994316ff84ed43653a0ac"},{"author":{"_account_id":25026,"name":"Bin Zhou","email":"lakerzhou@gmail.com","username":"lakerzhou"},"change_message_id":"daed66f97ee20932829ba2b21137bd39844fb9a4","unresolved":false,"context_lines":[{"line_number":482,"context_line":"    def _do_container_commit(self, context, container, repository, tag\u003dNone):"},{"line_number":483,"context_line":"        LOG.debug(\u0027Creating image...\u0027)"},{"line_number":484,"context_line":"        container_image \u003d None"},{"line_number":485,"context_line":"        container_imageID \u003d None"},{"line_number":486,"context_line":"        if tag is None:"},{"line_number":487,"context_line":"            tag \u003d \u0027latest\u0027"},{"line_number":488,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1f013ff3_08f00a67","line":485,"range":{"start_line":485,"start_character":8,"end_line":485,"end_character":25},"in_reply_to":"3f044301_1505b877","updated":"2017-05-15 18:38:30.000000000","message":"Fixed in the new patch 4.","commit_id":"462059de070146e8e1f994316ff84ed43653a0ac"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"cc4275fe260142dbf42d2048261a003e10bec078","unresolved":false,"context_lines":[{"line_number":488,"context_line":""},{"line_number":489,"context_line":"        try:"},{"line_number":490,"context_line":"            container_imageID \u003d self.driver.commit(container, repository, tag)"},{"line_number":491,"context_line":"            container_image \u003d self.driver.get_image(repository+\u0027:\u0027+tag)"},{"line_number":492,"context_line":"        except exception.DockerError as e:"},{"line_number":493,"context_line":"            LOG.error(\"Error occurred while calling docker commit API: %s\","},{"line_number":494,"context_line":"                      six.text_type(e))"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f044301_954548b6","line":491,"range":{"start_line":491,"start_character":62,"end_line":491,"end_character":67},"updated":"2017-05-05 04:14:49.000000000","message":"nit: space between \"+\" and \"\u0027\"","commit_id":"462059de070146e8e1f994316ff84ed43653a0ac"},{"author":{"_account_id":25026,"name":"Bin Zhou","email":"lakerzhou@gmail.com","username":"lakerzhou"},"change_message_id":"daed66f97ee20932829ba2b21137bd39844fb9a4","unresolved":false,"context_lines":[{"line_number":488,"context_line":""},{"line_number":489,"context_line":"        try:"},{"line_number":490,"context_line":"            container_imageID \u003d self.driver.commit(container, repository, tag)"},{"line_number":491,"context_line":"            container_image \u003d self.driver.get_image(repository+\u0027:\u0027+tag)"},{"line_number":492,"context_line":"        except exception.DockerError as e:"},{"line_number":493,"context_line":"            LOG.error(\"Error occurred while calling docker commit API: %s\","},{"line_number":494,"context_line":"                      six.text_type(e))"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f013ff3_e8f4be5d","line":491,"range":{"start_line":491,"start_character":62,"end_line":491,"end_character":67},"in_reply_to":"3f044301_954548b6","updated":"2017-05-15 18:38:30.000000000","message":"Done","commit_id":"462059de070146e8e1f994316ff84ed43653a0ac"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"aee2f17f07bac7a6da80033d8427a8c8dd690fc0","unresolved":false,"context_lines":[{"line_number":495,"context_line":"                      six.text_type(e))"},{"line_number":496,"context_line":"            raise"},{"line_number":497,"context_line":"        LOG.debug(\u0027Upload image %s to glance\u0027 % container_image_id)"},{"line_number":498,"context_line":"        self._do_container_image_upload(context, container_image.data,"},{"line_number":499,"context_line":"                                        repository, tag)"},{"line_number":500,"context_line":""},{"line_number":501,"context_line":"    def image_pull(self, context, image):"}],"source_content_type":"text/x-python","patch_set":5,"id":"1f013ff3_dc98a06b","line":498,"range":{"start_line":498,"start_character":65,"end_line":498,"end_character":69},"updated":"2017-05-15 21:42:17.000000000","message":"Please avoid calling \"container_image.data\" because it will load the whole data raw data into memory, which is very slow. Simply pass \"container_image\" (without \".data\") will magically work.","commit_id":"ea554efac4d3d916f6b951b38a0d1be647eae295"}],"zun/compute/rpcapi.py":[{"author":{"_account_id":16277,"name":"Pradeep Kumar Singh","email":"ps4openstack@gmail.com","username":"pradeep_singh"},"change_message_id":"996c5ef855b8be4e4b0b7ed8dbba809037795577","unresolved":false,"context_lines":[{"line_number":106,"context_line":"                          container\u003dcontainer, path\u003dpath, data\u003ddata)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def container_commit(self, context, container, repository, tag):"},{"line_number":109,"context_line":"        return self._call(container.host, \u0027container_commit\u0027,"},{"line_number":110,"context_line":"                          container\u003dcontainer, repository\u003drepository, tag\u003dtag)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def image_pull(self, context, image):"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffe62b97_fef328e6","line":109,"range":{"start_line":109,"start_character":15,"end_line":109,"end_character":25},"updated":"2017-03-27 09:06:46.000000000","message":"You said it\u0027s async, but here it is call not cast.","commit_id":"5f51346eaabb8b3fc155d76702a0c062c8a427ee"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"380a84fe47e048eababa4fd39b5b6102dfebe467","unresolved":false,"context_lines":[{"line_number":106,"context_line":"                          container\u003dcontainer, path\u003dpath, data\u003ddata)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def container_commit(self, context, container, repository, tag):"},{"line_number":109,"context_line":"        return self._call(container.host, \u0027container_commit\u0027,"},{"line_number":110,"context_line":"                          container\u003dcontainer, repository\u003drepository, tag\u003dtag)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def image_pull(self, context, image):"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffe62b97_860f0a36","line":109,"range":{"start_line":109,"start_character":15,"end_line":109,"end_character":25},"in_reply_to":"ffe62b97_fef328e6","updated":"2017-03-27 21:39:20.000000000","message":"Good catch @Pradeep!","commit_id":"5f51346eaabb8b3fc155d76702a0c062c8a427ee"},{"author":{"_account_id":25026,"name":"Bin Zhou","email":"lakerzhou@gmail.com","username":"lakerzhou"},"change_message_id":"da24efd539007ab18013f62653cbd4fd242db4bd","unresolved":false,"context_lines":[{"line_number":106,"context_line":"                          container\u003dcontainer, path\u003dpath, data\u003ddata)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def container_commit(self, context, container, repository, tag):"},{"line_number":109,"context_line":"        return self._call(container.host, \u0027container_commit\u0027,"},{"line_number":110,"context_line":"                          container\u003dcontainer, repository\u003drepository, tag\u003dtag)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def image_pull(self, context, image):"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffe62b97_72b03d8b","line":109,"range":{"start_line":109,"start_character":15,"end_line":109,"end_character":25},"in_reply_to":"ffe62b97_fef328e6","updated":"2017-03-28 02:48:49.000000000","message":"Thanks the comments. Will address it in my next patch.","commit_id":"5f51346eaabb8b3fc155d76702a0c062c8a427ee"}],"zun/container/docker/driver.py":[{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"33ffc3c8c03f9da1c4a3d049d22cce775f84c90f","unresolved":false,"context_lines":[{"line_number":383,"context_line":"                raise"},{"line_number":384,"context_line":""},{"line_number":385,"context_line":"    @check_container_id"},{"line_number":386,"context_line":"    def commit(self, container, repository\u003dNone, tag\u003dNone):"},{"line_number":387,"context_line":"        with docker_utils.docker_client() as docker:"},{"line_number":388,"context_line":"            repository \u003d str(repository)"},{"line_number":389,"context_line":"            tag \u003d str(tag)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a1ced50_d076913d","line":386,"range":{"start_line":386,"start_character":8,"end_line":386,"end_character":14},"updated":"2017-03-17 15:01:21.000000000","message":"I think it is better to declare this in driver interface as well: https://github.com/openstack/zun/blob/master/zun/container/driver.py .","commit_id":"c5e50473cc8bc42c627f5dc93b67ecbaf313d62c"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"88c6061bea2afe81527ae1254aa6c977f1b4fe26","unresolved":false,"context_lines":[{"line_number":383,"context_line":"                raise"},{"line_number":384,"context_line":""},{"line_number":385,"context_line":"    @check_container_id"},{"line_number":386,"context_line":"    def commit(self, container, repository\u003dNone, tag\u003dNone):"},{"line_number":387,"context_line":"        with docker_utils.docker_client() as docker:"},{"line_number":388,"context_line":"            repository \u003d str(repository)"},{"line_number":389,"context_line":"            tag \u003d str(tag)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a1ced50_baea590d","line":386,"range":{"start_line":386,"start_character":8,"end_line":386,"end_character":14},"in_reply_to":"1a1ced50_2364af20","updated":"2017-03-21 19:02:11.000000000","message":"I see. Never mind.","commit_id":"c5e50473cc8bc42c627f5dc93b67ecbaf313d62c"},{"author":{"_account_id":25026,"name":"Bin Zhou","email":"lakerzhou@gmail.com","username":"lakerzhou"},"change_message_id":"3d93a6ee8fad4c8e7c537f6c40ddc8035a326f3f","unresolved":false,"context_lines":[{"line_number":383,"context_line":"                raise"},{"line_number":384,"context_line":""},{"line_number":385,"context_line":"    @check_container_id"},{"line_number":386,"context_line":"    def commit(self, container, repository\u003dNone, tag\u003dNone):"},{"line_number":387,"context_line":"        with docker_utils.docker_client() as docker:"},{"line_number":388,"context_line":"            repository \u003d str(repository)"},{"line_number":389,"context_line":"            tag \u003d str(tag)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a1ced50_2364af20","line":386,"range":{"start_line":386,"start_character":8,"end_line":386,"end_character":14},"in_reply_to":"1a1ced50_d076913d","updated":"2017-03-21 03:43:01.000000000","message":"Hongbin, I already declared the function at driver interface. Please let me know if I miss anything there.","commit_id":"c5e50473cc8bc42c627f5dc93b67ecbaf313d62c"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"33ffc3c8c03f9da1c4a3d049d22cce775f84c90f","unresolved":false,"context_lines":[{"line_number":385,"context_line":"    @check_container_id"},{"line_number":386,"context_line":"    def commit(self, container, repository\u003dNone, tag\u003dNone):"},{"line_number":387,"context_line":"        with docker_utils.docker_client() as docker:"},{"line_number":388,"context_line":"            repository \u003d str(repository)"},{"line_number":389,"context_line":"            tag \u003d str(tag)"},{"line_number":390,"context_line":"            docker.commit(container.container_id, repository, tag)"},{"line_number":391,"context_line":"            return container"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a1ced50_b0e4b50d","line":388,"range":{"start_line":388,"start_character":12,"end_line":388,"end_character":40},"updated":"2017-03-17 15:01:21.000000000","message":"I think we need to handle the case that repository is None. Simply checking None will work:\n\n  if repository:\n      repository \u003d str(repository)","commit_id":"c5e50473cc8bc42c627f5dc93b67ecbaf313d62c"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"88c6061bea2afe81527ae1254aa6c977f1b4fe26","unresolved":false,"context_lines":[{"line_number":385,"context_line":"    @check_container_id"},{"line_number":386,"context_line":"    def commit(self, container, repository\u003dNone, tag\u003dNone):"},{"line_number":387,"context_line":"        with docker_utils.docker_client() as docker:"},{"line_number":388,"context_line":"            repository \u003d str(repository)"},{"line_number":389,"context_line":"            tag \u003d str(tag)"},{"line_number":390,"context_line":"            docker.commit(container.container_id, repository, tag)"},{"line_number":391,"context_line":"            return container"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a1ced50_3d7e6319","line":388,"range":{"start_line":388,"start_character":12,"end_line":388,"end_character":40},"in_reply_to":"1a1ced50_23190f89","updated":"2017-03-21 19:02:11.000000000","message":"I see. Agree with you that a descriptive name is needed so make them mandatory might be a good idea. Perhaps make repo as mandatory and tag as optional will work?\n\nFor your proposal about repo+tag+ID, I think it will work and possibly can distinguish two images with the same name. The down side is that it might be a little harder to pull down the image. For example, this is how it works in before:\n\n  $ zun run busybox:latest\"\n\nIf this proposal is implemented, the command will change to something like:\n\n  $ zun run busybox:latest-4f9a2\n\nAn alternative is to allow pulling glance image by name or uuid. For example:\n\n  $ zun run busybox:latest\n\nor \n\n  $ zun run 08643d3f-cacf-4f3c-b9e3-e93808eee3ba\n\nThen, if a glance image don\u0027t have a name, users can still download it by uuid. Thoughts on this?\n\nBTW, you don\u0027t need to implement what I said above in this patch. I am OK to merge this patch with both repo and tag mandatory.","commit_id":"c5e50473cc8bc42c627f5dc93b67ecbaf313d62c"},{"author":{"_account_id":25026,"name":"Bin Zhou","email":"lakerzhou@gmail.com","username":"lakerzhou"},"change_message_id":"9c48cb774e9ec4557cdd82d4115d2bcb3644ac87","unresolved":false,"context_lines":[{"line_number":385,"context_line":"    @check_container_id"},{"line_number":386,"context_line":"    def commit(self, container, repository\u003dNone, tag\u003dNone):"},{"line_number":387,"context_line":"        with docker_utils.docker_client() as docker:"},{"line_number":388,"context_line":"            repository \u003d str(repository)"},{"line_number":389,"context_line":"            tag \u003d str(tag)"},{"line_number":390,"context_line":"            docker.commit(container.container_id, repository, tag)"},{"line_number":391,"context_line":"            return container"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a1ced50_4c7a8578","line":388,"range":{"start_line":388,"start_character":12,"end_line":388,"end_character":40},"in_reply_to":"1a1ced50_3d7e6319","updated":"2017-03-22 03:37:11.000000000","message":"Hongbin, thanks for the comments. In operation, I think user would like provide some information about a snapshot as the tag. For example, busybox:BeforeUpgrade-02-01-16 and busybox:UpgradeComplete-02-02-16 clearly tell user what changes made into the snapshot.\nThe main reason of adding docker image ID to the glance image name was to make the name unique. On the other thought, I believe we should allow images sharing the same name. In that case, if user pull an image with the name, the command will fail. User has to use UUID to pull the image, if the image name is not unique. By saying that, I am leaning to use \u003crepo\u003e-\u003ctag\u003e as the image name. More thoughts?","commit_id":"c5e50473cc8bc42c627f5dc93b67ecbaf313d62c"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"a72fec1bb93362a75284a308bd82d23e8b9f9754","unresolved":false,"context_lines":[{"line_number":385,"context_line":"    @check_container_id"},{"line_number":386,"context_line":"    def commit(self, container, repository\u003dNone, tag\u003dNone):"},{"line_number":387,"context_line":"        with docker_utils.docker_client() as docker:"},{"line_number":388,"context_line":"            repository \u003d str(repository)"},{"line_number":389,"context_line":"            tag \u003d str(tag)"},{"line_number":390,"context_line":"            docker.commit(container.container_id, repository, tag)"},{"line_number":391,"context_line":"            return container"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a1ced50_8fdf0f68","line":388,"range":{"start_line":388,"start_character":12,"end_line":388,"end_character":40},"in_reply_to":"1a1ced50_4c7a8578","updated":"2017-03-22 04:28:19.000000000","message":"Zhou Bin,\n\nI see. Based on your feedback, I have a specific proposal:\n* Make repository mandatory\n* Make tag optional. If user doesn\u0027t specify a tag, zun will generate it by using some information about a snapshot as the tag as you mentioned.\n\nFor the image name, either making it unique or allowing duplication would work for me at the first iteration. What is your preference?","commit_id":"c5e50473cc8bc42c627f5dc93b67ecbaf313d62c"},{"author":{"_account_id":25026,"name":"Bin Zhou","email":"lakerzhou@gmail.com","username":"lakerzhou"},"change_message_id":"3d93a6ee8fad4c8e7c537f6c40ddc8035a326f3f","unresolved":false,"context_lines":[{"line_number":385,"context_line":"    @check_container_id"},{"line_number":386,"context_line":"    def commit(self, container, repository\u003dNone, tag\u003dNone):"},{"line_number":387,"context_line":"        with docker_utils.docker_client() as docker:"},{"line_number":388,"context_line":"            repository \u003d str(repository)"},{"line_number":389,"context_line":"            tag \u003d str(tag)"},{"line_number":390,"context_line":"            docker.commit(container.container_id, repository, tag)"},{"line_number":391,"context_line":"            return container"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a1ced50_23190f89","line":388,"range":{"start_line":388,"start_character":12,"end_line":388,"end_character":40},"in_reply_to":"1a1ced50_b0e4b50d","updated":"2017-03-21 03:43:01.000000000","message":"Hongbin, I am thinking to make repo and tag mandatory, because otherwise both field will be none, then there is not way to tell what the new image from. Also when uploading the image to glance, a more descriptive name is desirable. I am proposing to use repo+tag+ID(first 5 digits) as the image name. Any more thoughts?\nRegarding the none parameter checking, I though it is not necessary, when both inputs are mandatory and verified at client side. But I can certainly do more checking here. Will provide update soon.","commit_id":"c5e50473cc8bc42c627f5dc93b67ecbaf313d62c"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"33ffc3c8c03f9da1c4a3d049d22cce775f84c90f","unresolved":false,"context_lines":[{"line_number":386,"context_line":"    def commit(self, container, repository\u003dNone, tag\u003dNone):"},{"line_number":387,"context_line":"        with docker_utils.docker_client() as docker:"},{"line_number":388,"context_line":"            repository \u003d str(repository)"},{"line_number":389,"context_line":"            tag \u003d str(tag)"},{"line_number":390,"context_line":"            docker.commit(container.container_id, repository, tag)"},{"line_number":391,"context_line":"            return container"},{"line_number":392,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a1ced50_50b461f1","line":389,"range":{"start_line":389,"start_character":18,"end_line":389,"end_character":21},"updated":"2017-03-17 15:01:21.000000000","message":"Ditto, need to handle the None case.","commit_id":"c5e50473cc8bc42c627f5dc93b67ecbaf313d62c"},{"author":{"_account_id":16277,"name":"Pradeep Kumar Singh","email":"ps4openstack@gmail.com","username":"pradeep_singh"},"change_message_id":"af3677c8e4a5b02f42e81f647c4b7c42a9e9a2f5","unresolved":false,"context_lines":[{"line_number":480,"context_line":"        with docker_utils.docker_client() as docker:"},{"line_number":481,"context_line":"            repository \u003d str(repository)"},{"line_number":482,"context_line":"            try:"},{"line_number":483,"context_line":"                if repository is None or repository \u003d\u003d \"None\":"},{"line_number":484,"context_line":"                    raise exception.ZunException(_(\"Cannot find repository\"))"},{"line_number":485,"context_line":"                elif tag is None or tag \u003d\u003d \"None\":"},{"line_number":486,"context_line":"                    return docker.commit(container.container_id, repository)"},{"line_number":487,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"ff0f0b1f_22040717","line":484,"range":{"start_line":483,"start_character":16,"end_line":484,"end_character":77},"updated":"2017-05-18 15:13:25.000000000","message":"if it is required property, can we specify it in schema, rather than checking here. That will validate it at API level. Thoughts?","commit_id":"175b5ad57c1b5cfde0767606513b4b4471b5916c"},{"author":{"_account_id":25026,"name":"Bin Zhou","email":"lakerzhou@gmail.com","username":"lakerzhou"},"change_message_id":"306d85d2bd6f3e82bd9ec452496e9fd1080b6fae","unresolved":false,"context_lines":[{"line_number":480,"context_line":"        with docker_utils.docker_client() as docker:"},{"line_number":481,"context_line":"            repository \u003d str(repository)"},{"line_number":482,"context_line":"            try:"},{"line_number":483,"context_line":"                if repository is None or repository \u003d\u003d \"None\":"},{"line_number":484,"context_line":"                    raise exception.ZunException(_(\"Cannot find repository\"))"},{"line_number":485,"context_line":"                elif tag is None or tag \u003d\u003d \"None\":"},{"line_number":486,"context_line":"                    return docker.commit(container.container_id, repository)"},{"line_number":487,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"ff0f0b1f_160ec63a","line":484,"range":{"start_line":483,"start_character":16,"end_line":484,"end_character":77},"in_reply_to":"ff0f0b1f_22040717","updated":"2017-05-19 13:48:56.000000000","message":"Hi Pradeep, \nit is specified in schema:\nquery_param_commit \u003d {\n    \u0027type\u0027: \u0027object\u0027,\n    \u0027properties\u0027: {\n        \u0027repository\u0027: parameter_types.string_ps_args,\n        \u0027tag\u0027: parameter_types.string_ps_args\n    },\n    \u0027additionalProperties\u0027: False\n}\nCan we specify if a properties is mandatory or not at schedma? Please kindly point me to an example if so. I did not know that. For this api, repository is mandatory, but tag is not.","commit_id":"175b5ad57c1b5cfde0767606513b4b4471b5916c"},{"author":{"_account_id":25026,"name":"Bin Zhou","email":"lakerzhou@gmail.com","username":"lakerzhou"},"change_message_id":"5ef368e2dbad2797c41cae9e565460ceb650ea9e","unresolved":false,"context_lines":[{"line_number":480,"context_line":"        with docker_utils.docker_client() as docker:"},{"line_number":481,"context_line":"            repository \u003d str(repository)"},{"line_number":482,"context_line":"            try:"},{"line_number":483,"context_line":"                if repository is None or repository \u003d\u003d \"None\":"},{"line_number":484,"context_line":"                    raise exception.ZunException(_(\"Cannot find repository\"))"},{"line_number":485,"context_line":"                elif tag is None or tag \u003d\u003d \"None\":"},{"line_number":486,"context_line":"                    return docker.commit(container.container_id, repository)"},{"line_number":487,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"ff0f0b1f_79ca951a","line":484,"range":{"start_line":483,"start_character":16,"end_line":484,"end_character":77},"in_reply_to":"ff0f0b1f_22040717","updated":"2017-05-19 14:08:53.000000000","message":"Thanks for the example, will send a new patch.","commit_id":"175b5ad57c1b5cfde0767606513b4b4471b5916c"}],"zun/image/driver.py":[{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"cc4275fe260142dbf42d2048261a003e10bec078","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        img \u003d image_driver.update_image(context,"},{"line_number":113,"context_line":"                                        img.id,"},{"line_number":114,"context_line":"                                        tag\u003dimage_tag)"},{"line_number":115,"context_line":"        \u0027\u0027\u0027image data has to match the image format."},{"line_number":116,"context_line":"           contain format defaults to \u0027docker\u0027;"},{"line_number":117,"context_line":"           disk format defaults to \u0027qcow2\u0027."},{"line_number":118,"context_line":"        \u0027\u0027\u0027"},{"line_number":119,"context_line":"        img \u003d image_driver.upload_image_data(context,"},{"line_number":120,"context_line":"                                             img.id,"},{"line_number":121,"context_line":"                                             image_data)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f044301_f555ac51","line":118,"range":{"start_line":115,"start_character":0,"end_line":118,"end_character":11},"updated":"2017-05-05 04:14:49.000000000","message":"nit: use \u0027#\u0027 for inline comments for consistency.","commit_id":"462059de070146e8e1f994316ff84ed43653a0ac"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"cc4275fe260142dbf42d2048261a003e10bec078","unresolved":false,"context_lines":[{"line_number":141,"context_line":"        \"\"\"Create an image.\"\"\""},{"line_number":142,"context_line":"        raise NotImplementedError()"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    def update_image(self, context, imgID, container_fmt\u003dNone,"},{"line_number":145,"context_line":"                     disk_fmt\u003dNone, tag\u003dNone):"},{"line_number":146,"context_line":"        \"\"\"Update an image.\"\"\""},{"line_number":147,"context_line":"        raise NotImplementedError()"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f044301_58d7f74c","line":144,"range":{"start_line":144,"start_character":36,"end_line":144,"end_character":41},"updated":"2017-05-05 04:14:49.000000000","message":"img_id","commit_id":"462059de070146e8e1f994316ff84ed43653a0ac"}],"zun/image/glance/utils.py":[{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"cc4275fe260142dbf42d2048261a003e10bec078","unresolved":false,"context_lines":[{"line_number":70,"context_line":"    return img"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"def update_image_format(context, imgID, disk_format,"},{"line_number":74,"context_line":"                        container_format):"},{"line_number":75,"context_line":"    \"\"\"Update container format of an image.\"\"\""},{"line_number":76,"context_line":"    glance \u003d create_glanceclient(context)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f044301_5865b7b4","line":73,"range":{"start_line":73,"start_character":33,"end_line":73,"end_character":38},"updated":"2017-05-05 04:14:49.000000000","message":"img_id. This applies to all below.","commit_id":"462059de070146e8e1f994316ff84ed43653a0ac"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"aee2f17f07bac7a6da80033d8427a8c8dd690fc0","unresolved":false,"context_lines":[{"line_number":89,"context_line":"def upload_image_data(context, img_id, data):"},{"line_number":90,"context_line":"    \"\"\"Upload an image.\"\"\""},{"line_number":91,"context_line":"    LOG.debug(\u0027Upload image %s \u0027 % img_id)"},{"line_number":92,"context_line":"    LOG.debug(\u0027Upload image data %s \u0027 % dir(data))"},{"line_number":93,"context_line":"    glance \u003d create_glanceclient(context)"},{"line_number":94,"context_line":"    img \u003d glance.images.upload(img_id, data)"},{"line_number":95,"context_line":"    return img"}],"source_content_type":"text/x-python","patch_set":5,"id":"1f013ff3_7cd74cc1","line":92,"range":{"start_line":92,"start_character":4,"end_line":92,"end_character":50},"updated":"2017-05-15 21:42:17.000000000","message":"nit: I don\u0027t think we need to log the image raw data.","commit_id":"ea554efac4d3d916f6b951b38a0d1be647eae295"}]}
