)]}'
{"zun/api/controllers/experimental/capsules.py":[{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"b6b84356e237f3d81a2766ca4fd12d23dbb6f313","unresolved":false,"context_lines":[{"line_number":159,"context_line":"                    new_capsule.cpu +\u003d container_dict[\u0027cpu\u0027]"},{"line_number":160,"context_line":"                if allocation.get(\u0027memory\u0027):"},{"line_number":161,"context_line":"                    container_dict[\u0027memory\u0027] \u003d str(allocation[\u0027memory\u0027]) + \u0027M\u0027"},{"line_number":162,"context_line":"                    new_capsule.memory +\u003d container_dict[\u0027memory\u0027]"},{"line_number":163,"context_line":"                container_dict.pop(\u0027resources\u0027)"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"            if capsule_restart_policy:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f515b1d_c3bc0cde","line":162,"range":{"start_line":162,"start_character":20,"end_line":162,"end_character":66},"updated":"2017-09-25 15:33:20.000000000","message":"This doesn\u0027t look correct. If there are two containers. Both have \u00271024M\u0027 of memory. The new_capsule.memory will be set as \u002701024M1024M\u0027 (the first \u00270\u0027 is due to allocation has \u00270\u0027 of memory), which is incorrect.","commit_id":"a65dcf5c0f1da94fd56c4de4d23b76b13d7d9195"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"531bb5e9c3bba74f0ba30fe977c54082ddbb7ce6","unresolved":false,"context_lines":[{"line_number":174,"context_line":"            new_container.create(context)"},{"line_number":175,"context_line":"            new_capsule.containers.append(new_container)"},{"line_number":176,"context_line":"            new_capsule.containers_uuids.append(new_container.uuid)"},{"line_number":177,"context_line":"            new_capsule.memory \u003d str(capsule_need_memory) + \u0027M\u0027"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"        new_capsule.save(context)"},{"line_number":180,"context_line":"        compute_api.capsule_create(context, new_capsule, requested_networks)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f515b1d_c80e443a","line":177,"range":{"start_line":177,"start_character":24,"end_line":177,"end_character":30},"updated":"2017-09-26 14:51:28.000000000","message":"Shengqin,\n\nMind adding unit tests to verify cpu and memory is correctly calculated?","commit_id":"024c51dcb6ff147c97ef75de9fb7340255124bc4"},{"author":{"_account_id":10206,"name":"Madhuri Kumari","email":"madhuri.kumari@intel.com","username":"Madhuri"},"change_message_id":"d94ccdb1ce19979e62e7b6aab69ea65328e9fe74","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        new_capsule.containers \u003d []"},{"line_number":154,"context_line":"        new_capsule.containers_uuids \u003d []"},{"line_number":155,"context_line":"        new_capsule.volumes \u003d []"},{"line_number":156,"context_line":"        capsule_need_cpu \u003d 0"},{"line_number":157,"context_line":"        capsule_need_memory \u003d 0"},{"line_number":158,"context_line":"        count \u003d len(containers_spec)"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"        capsule_restart_policy \u003d capsules_spec.get(\u0027restart_policy\u0027, \u0027always\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f515b1d_0bf2fd70","line":157,"range":{"start_line":156,"start_character":8,"end_line":157,"end_character":31},"updated":"2017-09-27 08:01:46.000000000","message":"Why do we need to initialize these variables? We can directly fetch from the request.","commit_id":"385af79f1cca1f6dd68347b95cfd8e11179e3f28"},{"author":{"_account_id":23365,"name":"feng.shengqin","email":"feng.shengqin@zte.com.cn","username":"FengShengqin"},"change_message_id":"67f95c62903582e079b4b30a4cedb6486e0ba359","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        new_capsule.containers \u003d []"},{"line_number":154,"context_line":"        new_capsule.containers_uuids \u003d []"},{"line_number":155,"context_line":"        new_capsule.volumes \u003d []"},{"line_number":156,"context_line":"        capsule_need_cpu \u003d 0"},{"line_number":157,"context_line":"        capsule_need_memory \u003d 0"},{"line_number":158,"context_line":"        count \u003d len(containers_spec)"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"        capsule_restart_policy \u003d capsules_spec.get(\u0027restart_policy\u0027, \u0027always\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f515b1d_665dd845","line":157,"range":{"start_line":156,"start_character":8,"end_line":157,"end_character":31},"in_reply_to":"7f515b1d_0bf2fd70","updated":"2017-09-30 00:53:11.000000000","message":"Thanks for your comment.\nIn fact,all containers in a capsule will be scheduled to the same host. Currently, we choose a host by filtering capsule.cpu and capsule.memory. So I add these two variables to store the sum of all containers\u0027 cpu and memory in a capsule for filtering.","commit_id":"385af79f1cca1f6dd68347b95cfd8e11179e3f28"},{"author":{"_account_id":22076,"name":"Kevin Zhao","email":"kevin.zhao@linaro.org","username":"KevinZhao"},"change_message_id":"06870c543fd0bdf5302aa677f1164aa366bd1ce5","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        new_capsule.containers \u003d []"},{"line_number":154,"context_line":"        new_capsule.containers_uuids \u003d []"},{"line_number":155,"context_line":"        new_capsule.volumes \u003d []"},{"line_number":156,"context_line":"        capsule_need_cpu \u003d 0"},{"line_number":157,"context_line":"        capsule_need_memory \u003d 0"},{"line_number":158,"context_line":"        count \u003d len(containers_spec)"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"        capsule_restart_policy \u003d capsules_spec.get(\u0027restart_policy\u0027, \u0027always\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ff82abbf_1e52a914","line":157,"range":{"start_line":156,"start_character":8,"end_line":157,"end_character":31},"in_reply_to":"7f515b1d_0bf2fd70","updated":"2017-11-21 03:36:59.000000000","message":"The cpu and memory resource allocation is pulled from capsule-container field.\n  - image: ubuntu\n    command:\n      - \"/bin/bash\"\n    image_pull_policy: ifnotpresent\n    workdir: /root\n    labels:\n      app: web\n    ports:\n      - name: nginx-port\n        containerPort: 80\n        hostPort: 80\n        protocol: TCP\n    resources:\n      allocation:\n        cpu: 1\n        memory: 1024\nSo we need to calculated them here.","commit_id":"385af79f1cca1f6dd68347b95cfd8e11179e3f28"},{"author":{"_account_id":10206,"name":"Madhuri Kumari","email":"madhuri.kumari@intel.com","username":"Madhuri"},"change_message_id":"d94ccdb1ce19979e62e7b6aab69ea65328e9fe74","unresolved":false,"context_lines":[{"line_number":230,"context_line":"            new_capsule.containers.append(new_container)"},{"line_number":231,"context_line":"            new_capsule.containers_uuids.append(new_container.uuid)"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"        new_capsule.cpu \u003d capsule_need_cpu"},{"line_number":234,"context_line":"        new_capsule.memory \u003d str(capsule_need_memory) + \u0027M\u0027"},{"line_number":235,"context_line":"        new_capsule.save(context)"},{"line_number":236,"context_line":"        compute_api.capsule_create(context, new_capsule, requested_networks)"},{"line_number":237,"context_line":"        # Set the HTTP Location Header"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f515b1d_0b979dee","line":234,"range":{"start_line":233,"start_character":8,"end_line":234,"end_character":58},"updated":"2017-09-27 08:01:46.000000000","message":"these two assignments are redundant.","commit_id":"385af79f1cca1f6dd68347b95cfd8e11179e3f28"}]}
