)]}'
{"cyborg/accelerator/drivers/fpga/intel/driver.py":[{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"9f8731107f1fc41e8bea79b01173a376c29049b3","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        p.wait()"},{"line_number":59,"context_line":"        return p.returncode"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def program_v2(self, controlpath_id, image_file_path):"},{"line_number":62,"context_line":"        \"\"\"Program the FPGA with the provided bitstream image."},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"           TODO(Sundar): Is it secure to store the image as a file?"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_43d1b022","line":61,"range":{"start_line":61,"start_character":8,"end_line":61,"end_character":18},"updated":"2019-05-14 10:44:52.000000000","message":"I\u0027m not sure it\u0027s a good name or not. :(, is there any reason to keep program_v2 and program?\n\nMaybe we could recognize the controlpath_id obj like:\n\nIf isInstance(controlpath_id, ControlPathID):\n    # do the logic on program_v2\n\nBut I still think we could replace the program with program v2 logic.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        p.wait()"},{"line_number":59,"context_line":"        return p.returncode"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def program_v2(self, controlpath_id, image_file_path):"},{"line_number":62,"context_line":"        \"\"\"Program the FPGA with the provided bitstream image."},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"           TODO(Sundar): Is it secure to store the image as a file?"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_e9a763bc","line":61,"range":{"start_line":61,"start_character":8,"end_line":61,"end_character":18},"in_reply_to":"dfbec78f_43d1b022","updated":"2019-06-19 04:42:42.000000000","message":"In Train, v1 API is deprecated but still has to work. In v1, there is no controlpath_id, driver_name in deployable, etc. So, the data being passed to the agent, and from the agent to the driver, are all different. I agree keeping v1 version is tough but hopefully we can deprecate in Train and remove it in U?","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"9f8731107f1fc41e8bea79b01173a376c29049b3","unresolved":false,"context_lines":[{"line_number":70,"context_line":"               String with the file path"},{"line_number":71,"context_line":"           :returns: True on success, False on failure"},{"line_number":72,"context_line":"        \"\"\""},{"line_number":73,"context_line":"        assert controlpath_id[\u0027cpid_type\u0027] \u003d\u003d \"PCI\""},{"line_number":74,"context_line":"        # TODO Do not hardcode fpgaconf. Use right tool based on"},{"line_number":75,"context_line":"        #    bitstream type."},{"line_number":76,"context_line":"        cmd \u003d [\"sudo\", \"/usr/bin/fpgaconf\"]"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_c38b601c","line":73,"range":{"start_line":73,"start_character":0,"end_line":73,"end_character":51},"updated":"2019-05-14 10:44:52.000000000","message":"better to write\nif controlpath_id[\u0027cpid_type\u0027] !\u003d \"PCI\":\n  raise someexception","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":70,"context_line":"               String with the file path"},{"line_number":71,"context_line":"           :returns: True on success, False on failure"},{"line_number":72,"context_line":"        \"\"\""},{"line_number":73,"context_line":"        assert controlpath_id[\u0027cpid_type\u0027] \u003d\u003d \"PCI\""},{"line_number":74,"context_line":"        # TODO Do not hardcode fpgaconf. Use right tool based on"},{"line_number":75,"context_line":"        #    bitstream type."},{"line_number":76,"context_line":"        cmd \u003d [\"sudo\", \"/usr/bin/fpgaconf\"]"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_80cba370","line":73,"range":{"start_line":73,"start_character":0,"end_line":73,"end_character":51},"in_reply_to":"dfbec78f_c38b601c","updated":"2019-06-19 04:42:42.000000000","message":"Done","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"9f8731107f1fc41e8bea79b01173a376c29049b3","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        #    bitstream type."},{"line_number":76,"context_line":"        cmd \u003d [\"sudo\", \"/usr/bin/fpgaconf\"]"},{"line_number":77,"context_line":"        # TODO Should driver do this or the agent?"},{"line_number":78,"context_line":"        controlpath_id[\u0027cpid_info\u0027] \u003d jsonutils.loads("},{"line_number":79,"context_line":"            controlpath_id[\u0027cpid_info\u0027])"},{"line_number":80,"context_line":"        bdf_dict \u003d controlpath_id[\u0027cpid_info\u0027]"},{"line_number":81,"context_line":"        bdf \u003d map(lambda x: bdf_dict[x], [\"bus\", \"device\", \"function\"])"},{"line_number":82,"context_line":"        for i in zip([\"--bus\", \"--device\", \"--function\"], bdf):"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_a3df4c38","line":79,"range":{"start_line":78,"start_character":0,"end_line":79,"end_character":40},"updated":"2019-05-14 10:44:52.000000000","message":"We could put this (de)serialize into ovo, like [1], to avoid the confusing on \"Is cpid_info a json string or obj?\"\n\n[1] https://review.opendev.org/#/c/659014/","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"35b4ef2ecfdfe830b8276633803b26e3b8a94407","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        #    bitstream type."},{"line_number":76,"context_line":"        cmd \u003d [\"sudo\", \"/usr/bin/fpgaconf\"]"},{"line_number":77,"context_line":"        # TODO Should driver do this or the agent?"},{"line_number":78,"context_line":"        controlpath_id[\u0027cpid_info\u0027] \u003d jsonutils.loads("},{"line_number":79,"context_line":"            controlpath_id[\u0027cpid_info\u0027])"},{"line_number":80,"context_line":"        bdf_dict \u003d controlpath_id[\u0027cpid_info\u0027]"},{"line_number":81,"context_line":"        bdf \u003d map(lambda x: bdf_dict[x], [\"bus\", \"device\", \"function\"])"},{"line_number":82,"context_line":"        for i in zip([\"--bus\", \"--device\", \"--function\"], bdf):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_a1008d03","line":79,"range":{"start_line":78,"start_character":0,"end_line":79,"end_character":40},"in_reply_to":"9fb8cfa7_209d1766","updated":"2019-06-28 03:30:21.000000000","message":"Have you tried this? I pulled it in local, it does not work with \"0000:18:00.0\". You can easily try by using ipython. Here is the output of \"jsonutils.loads(\"0000:18:0.0\")\" : ValueError: Extra data: line 1 column 2 - line 1 column 12 (char 1 - 11).","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        #    bitstream type."},{"line_number":76,"context_line":"        cmd \u003d [\"sudo\", \"/usr/bin/fpgaconf\"]"},{"line_number":77,"context_line":"        # TODO Should driver do this or the agent?"},{"line_number":78,"context_line":"        controlpath_id[\u0027cpid_info\u0027] \u003d jsonutils.loads("},{"line_number":79,"context_line":"            controlpath_id[\u0027cpid_info\u0027])"},{"line_number":80,"context_line":"        bdf_dict \u003d controlpath_id[\u0027cpid_info\u0027]"},{"line_number":81,"context_line":"        bdf \u003d map(lambda x: bdf_dict[x], [\"bus\", \"device\", \"function\"])"},{"line_number":82,"context_line":"        for i in zip([\"--bus\", \"--device\", \"--function\"], bdf):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_209d1766","line":79,"range":{"start_line":78,"start_character":0,"end_line":79,"end_character":40},"in_reply_to":"9fb8cfa7_35d013ca","updated":"2019-06-19 04:42:42.000000000","message":"That is not the intention: please see [1] for the usage. Also, for attach handles, we use the same format in Nova [2]. The reason is it is better to be explicit rather than use some syntax that may be system-specific. This was agreed upon in a Cyborg IRC meeting [3].\n\n[1] https://review.opendev.org/gitweb?p\u003dopenstack/cyborg.git;f\u003dnova-integ/initial_setup.sh;hb\u003drefs/changes/20/626420/22#l14\n[2] https://review.opendev.org/gitweb?p\u003dopenstack/nova.git;f\u003dnova/virt/libvirt/driver.py;hb\u003drefs/changes/45/631245/14#l5481\n[3] http://eavesdrop.openstack.org/irclogs/%23openstack-cyborg/%23openstack-cyborg.2019-06-19.log.html#t2019-06-19T03:32:49","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"d7a00350e07ebb5d97f9e79844c0359b0af7dc0f","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        #    bitstream type."},{"line_number":76,"context_line":"        cmd \u003d [\"sudo\", \"/usr/bin/fpgaconf\"]"},{"line_number":77,"context_line":"        # TODO Should driver do this or the agent?"},{"line_number":78,"context_line":"        controlpath_id[\u0027cpid_info\u0027] \u003d jsonutils.loads("},{"line_number":79,"context_line":"            controlpath_id[\u0027cpid_info\u0027])"},{"line_number":80,"context_line":"        bdf_dict \u003d controlpath_id[\u0027cpid_info\u0027]"},{"line_number":81,"context_line":"        bdf \u003d map(lambda x: bdf_dict[x], [\"bus\", \"device\", \"function\"])"},{"line_number":82,"context_line":"        for i in zip([\"--bus\", \"--device\", \"--function\"], bdf):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_0945c015","line":79,"range":{"start_line":78,"start_character":0,"end_line":79,"end_character":40},"in_reply_to":"9fb8cfa7_4a6bcfb5","updated":"2019-07-03 02:31:09.000000000","message":"We discussed this in IRC [1] and conluded that the string should be in JSON format. We need to patch the drivers.\n\n[1] http://eavesdrop.openstack.org/irclogs/%23openstack-cyborg/%23openstack-cyborg.2019-06-19.log.html#t2019-06-19T03:32:48","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"bc7f1c76339cdd0a3975bc15ef84080198e60a40","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        #    bitstream type."},{"line_number":76,"context_line":"        cmd \u003d [\"sudo\", \"/usr/bin/fpgaconf\"]"},{"line_number":77,"context_line":"        # TODO Should driver do this or the agent?"},{"line_number":78,"context_line":"        controlpath_id[\u0027cpid_info\u0027] \u003d jsonutils.loads("},{"line_number":79,"context_line":"            controlpath_id[\u0027cpid_info\u0027])"},{"line_number":80,"context_line":"        bdf_dict \u003d controlpath_id[\u0027cpid_info\u0027]"},{"line_number":81,"context_line":"        bdf \u003d map(lambda x: bdf_dict[x], [\"bus\", \"device\", \"function\"])"},{"line_number":82,"context_line":"        for i in zip([\"--bus\", \"--device\", \"--function\"], bdf):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_c1c80a23","line":79,"range":{"start_line":78,"start_character":0,"end_line":79,"end_character":40},"in_reply_to":"9fb8cfa7_a1008d03","updated":"2019-07-01 03:28:56.000000000","message":"Xinran: Yes, it works with the JSON format that I have mentioned a few times in the past: \nhttps://review.opendev.org/gitweb?p\u003dopenstack/cyborg.git;f\u003dnova-integ/demo_setup.sh;hb\u003drefs/changes/20/626420/24#l80","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"b07d65415fd850996fc8051e6c6f01561b604aeb","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        #    bitstream type."},{"line_number":76,"context_line":"        cmd \u003d [\"sudo\", \"/usr/bin/fpgaconf\"]"},{"line_number":77,"context_line":"        # TODO Should driver do this or the agent?"},{"line_number":78,"context_line":"        controlpath_id[\u0027cpid_info\u0027] \u003d jsonutils.loads("},{"line_number":79,"context_line":"            controlpath_id[\u0027cpid_info\u0027])"},{"line_number":80,"context_line":"        bdf_dict \u003d controlpath_id[\u0027cpid_info\u0027]"},{"line_number":81,"context_line":"        bdf \u003d map(lambda x: bdf_dict[x], [\"bus\", \"device\", \"function\"])"},{"line_number":82,"context_line":"        for i in zip([\"--bus\", \"--device\", \"--function\"], bdf):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_4a6bcfb5","line":79,"range":{"start_line":78,"start_character":0,"end_line":79,"end_character":40},"in_reply_to":"9fb8cfa7_c1c80a23","updated":"2019-07-01 05:34:54.000000000","message":"As I remembered, the demo_setup script directly write the cyborg DB. But in real env, drivers discover cpid_info as \"0000:18:00\" not \"domain:xxxx; slot:xx\". That is what FPGA, GPU driver has already done.  Btw, we need this addr format to name the depoyable in GPU device: https://github.com/openstack/cyborg/blob/master/cyborg/accelerator/drivers/gpu/utils.py#L105","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        #    bitstream type."},{"line_number":76,"context_line":"        cmd \u003d [\"sudo\", \"/usr/bin/fpgaconf\"]"},{"line_number":77,"context_line":"        # TODO Should driver do this or the agent?"},{"line_number":78,"context_line":"        controlpath_id[\u0027cpid_info\u0027] \u003d jsonutils.loads("},{"line_number":79,"context_line":"            controlpath_id[\u0027cpid_info\u0027])"},{"line_number":80,"context_line":"        bdf_dict \u003d controlpath_id[\u0027cpid_info\u0027]"},{"line_number":81,"context_line":"        bdf \u003d map(lambda x: bdf_dict[x], [\"bus\", \"device\", \"function\"])"},{"line_number":82,"context_line":"        for i in zip([\"--bus\", \"--device\", \"--function\"], bdf):"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_09751732","line":79,"range":{"start_line":78,"start_character":0,"end_line":79,"end_character":40},"in_reply_to":"dfbec78f_a3df4c38","updated":"2019-06-19 04:42:42.000000000","message":"Good idea. +1.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"bf3a68c47fcd96ad8073501e99951855243d7e81","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        #    bitstream type."},{"line_number":76,"context_line":"        cmd \u003d [\"sudo\", \"/usr/bin/fpgaconf\"]"},{"line_number":77,"context_line":"        # TODO Should driver do this or the agent?"},{"line_number":78,"context_line":"        controlpath_id[\u0027cpid_info\u0027] \u003d jsonutils.loads("},{"line_number":79,"context_line":"            controlpath_id[\u0027cpid_info\u0027])"},{"line_number":80,"context_line":"        bdf_dict \u003d controlpath_id[\u0027cpid_info\u0027]"},{"line_number":81,"context_line":"        bdf \u003d map(lambda x: bdf_dict[x], [\"bus\", \"device\", \"function\"])"},{"line_number":82,"context_line":"        for i in zip([\"--bus\", \"--device\", \"--function\"], bdf):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_35d013ca","line":79,"range":{"start_line":78,"start_character":0,"end_line":79,"end_character":40},"in_reply_to":"dfbec78f_a3df4c38","updated":"2019-06-03 07:21:59.000000000","message":"This will not work as expect. The reason is that in controlpath_id we stored pci address with domain, for example \"0000:18:00.0\".","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"9f8731107f1fc41e8bea79b01173a376c29049b3","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        for i in zip([\"--bus\", \"--device\", \"--function\"], bdf):"},{"line_number":83,"context_line":"            cmd.extend(i)"},{"line_number":84,"context_line":"        cmd.append(image_file_path)"},{"line_number":85,"context_line":"        # p \u003d subprocess.Popen(cmd, stdout\u003dsubprocess.PIPE)"},{"line_number":86,"context_line":"        # p.wait()"},{"line_number":87,"context_line":"        LOG.info(\u0027Running command: %s\u0027, cmd)"},{"line_number":88,"context_line":"        try:"},{"line_number":89,"context_line":"            # TODO Use oslo.privsep, not subprocess.Popen"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_437f7014","line":86,"range":{"start_line":85,"start_character":0,"end_line":86,"end_character":18},"updated":"2019-05-14 10:44:52.000000000","message":"remove unused code. :)","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        for i in zip([\"--bus\", \"--device\", \"--function\"], bdf):"},{"line_number":83,"context_line":"            cmd.extend(i)"},{"line_number":84,"context_line":"        cmd.append(image_file_path)"},{"line_number":85,"context_line":"        # p \u003d subprocess.Popen(cmd, stdout\u003dsubprocess.PIPE)"},{"line_number":86,"context_line":"        # p.wait()"},{"line_number":87,"context_line":"        LOG.info(\u0027Running command: %s\u0027, cmd)"},{"line_number":88,"context_line":"        try:"},{"line_number":89,"context_line":"            # TODO Use oslo.privsep, not subprocess.Popen"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_c0875b0f","line":86,"range":{"start_line":85,"start_character":0,"end_line":86,"end_character":18},"in_reply_to":"dfbec78f_437f7014","updated":"2019-06-19 04:42:42.000000000","message":"Done","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"}],"cyborg/agent/manager.py":[{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"9f8731107f1fc41e8bea79b01173a376c29049b3","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        \"\"\"List installed hardware.\"\"\""},{"line_number":49,"context_line":"        pass"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def fpga_program(self, context, deployable_uuid, image_uuid):"},{"line_number":52,"context_line":"        \"\"\" Program a FPGA regoin, image can be a url or local file\"\"\""},{"line_number":53,"context_line":"        # TODO (Shaohe Feng) Get image from glance."},{"line_number":54,"context_line":"        # And add claim and rollback logical."}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_23a7dca9","line":51,"range":{"start_line":51,"start_character":8,"end_line":51,"end_character":20},"updated":"2019-05-14 10:44:52.000000000","message":"ditto, we could replace it with v2 logic.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        \"\"\"List installed hardware.\"\"\""},{"line_number":49,"context_line":"        pass"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def fpga_program(self, context, deployable_uuid, image_uuid):"},{"line_number":52,"context_line":"        \"\"\" Program a FPGA regoin, image can be a url or local file\"\"\""},{"line_number":53,"context_line":"        # TODO (Shaohe Feng) Get image from glance."},{"line_number":54,"context_line":"        # And add claim and rollback logical."}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_49d22f02","line":51,"range":{"start_line":51,"start_character":8,"end_line":51,"end_character":20},"in_reply_to":"dfbec78f_23a7dca9","updated":"2019-06-19 04:42:42.000000000","message":"Please see response in [1].\n\n[1] https://review.opendev.org/#/c/626057/10/cyborg/accelerator/drivers/fpga/intel/driver.py@61","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"9f8731107f1fc41e8bea79b01173a376c29049b3","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    def fpga_program_v2(self, context, controlpath_id,"},{"line_number":61,"context_line":"                        bitstream_uuid, driver_name):"},{"line_number":62,"context_line":"        # TODO Use tempfile module?"},{"line_number":63,"context_line":"        download_path \u003d \"/tmp/\" + bitstream_uuid + \".gbs\""},{"line_number":64,"context_line":"        self.image_api.download(context,"},{"line_number":65,"context_line":"                                bitstream_uuid,"},{"line_number":66,"context_line":"                                dest_path\u003ddownload_path)"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_23dfdcd6","line":63,"range":{"start_line":63,"start_character":51,"end_line":63,"end_character":57},"updated":"2019-05-14 10:44:52.000000000","message":"I think \"*.gbs\" is not fit for every fpga device bitstream right?\n\nMaybe we could give some description on it.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    def fpga_program_v2(self, context, controlpath_id,"},{"line_number":61,"context_line":"                        bitstream_uuid, driver_name):"},{"line_number":62,"context_line":"        # TODO Use tempfile module?"},{"line_number":63,"context_line":"        download_path \u003d \"/tmp/\" + bitstream_uuid + \".gbs\""},{"line_number":64,"context_line":"        self.image_api.download(context,"},{"line_number":65,"context_line":"                                bitstream_uuid,"},{"line_number":66,"context_line":"                                dest_path\u003ddownload_path)"}],"source_content_type":"text/x-python","patch_set":10,"id":"bfb3d3c7_fc8a8a61","line":63,"range":{"start_line":63,"start_character":51,"end_line":63,"end_character":57},"in_reply_to":"bfb3d3c7_2491b69a","updated":"2019-06-19 04:42:42.000000000","message":"IMHO, it is cleaner for the function that defined download_path to remove that file.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":27458,"name":"Li Liu","email":"liliueecg@gmail.com","username":"liliu"},"change_message_id":"07c6d73fdccb0b7e02331e0534314805055064df","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    def fpga_program_v2(self, context, controlpath_id,"},{"line_number":61,"context_line":"                        bitstream_uuid, driver_name):"},{"line_number":62,"context_line":"        # TODO Use tempfile module?"},{"line_number":63,"context_line":"        download_path \u003d \"/tmp/\" + bitstream_uuid + \".gbs\""},{"line_number":64,"context_line":"        self.image_api.download(context,"},{"line_number":65,"context_line":"                                bitstream_uuid,"},{"line_number":66,"context_line":"                                dest_path\u003ddownload_path)"}],"source_content_type":"text/x-python","patch_set":10,"id":"bfb3d3c7_2491b69a","line":63,"range":{"start_line":63,"start_character":51,"end_line":63,"end_character":57},"in_reply_to":"dfbec78f_23dfdcd6","updated":"2019-05-20 11:35:31.000000000","message":"Consider using _download_bitstream as it already exists","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    def fpga_program_v2(self, context, controlpath_id,"},{"line_number":61,"context_line":"                        bitstream_uuid, driver_name):"},{"line_number":62,"context_line":"        # TODO Use tempfile module?"},{"line_number":63,"context_line":"        download_path \u003d \"/tmp/\" + bitstream_uuid + \".gbs\""},{"line_number":64,"context_line":"        self.image_api.download(context,"},{"line_number":65,"context_line":"                                bitstream_uuid,"},{"line_number":66,"context_line":"                                dest_path\u003ddownload_path)"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_e90c43a6","line":63,"range":{"start_line":63,"start_character":51,"end_line":63,"end_character":57},"in_reply_to":"dfbec78f_23dfdcd6","updated":"2019-06-19 04:42:42.000000000","message":"Yes! This should have been marked as TODO, because we have other bitstream types too, as was discussed in PTG [2].\n\n[2] Line 51 https://etherpad.openstack.org/p/cyborg-ptg-train","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":29845,"name":"Ikuo Otani","email":"ikuo.otani.rw@gmail.com","username":"ikuo_o"},"change_message_id":"754c1781369a407be856aac16208de0696d0dbc6","unresolved":false,"context_lines":[{"line_number":65,"context_line":"                                bitstream_uuid,"},{"line_number":66,"context_line":"                                dest_path\u003ddownload_path)"},{"line_number":67,"context_line":"        driver \u003d self.fpga_driver.create(driver_name)"},{"line_number":68,"context_line":"        driver.program_v2(controlpath_id, download_path)"},{"line_number":69,"context_line":"        os.remove(download_path)"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    def _download_bitstream(self, context, bitstream_uuid):"}],"source_content_type":"text/x-python","patch_set":10,"id":"bfb3d3c7_54908d43","line":68,"updated":"2019-05-28 11:38:03.000000000","message":"program() may fail according to the status of resource. It is preferable to get the result.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":65,"context_line":"                                bitstream_uuid,"},{"line_number":66,"context_line":"                                dest_path\u003ddownload_path)"},{"line_number":67,"context_line":"        driver \u003d self.fpga_driver.create(driver_name)"},{"line_number":68,"context_line":"        driver.program_v2(controlpath_id, download_path)"},{"line_number":69,"context_line":"        os.remove(download_path)"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    def _download_bitstream(self, context, bitstream_uuid):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_60ca2f50","line":68,"in_reply_to":"bfb3d3c7_54908d43","updated":"2019-06-19 04:42:42.000000000","message":"Done","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"}],"cyborg/api/controllers/v2/__init__.py":[{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"5d78daba0c5161df2345046a420bc96b4e381d55","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2017 Huawei Technologies Co.,LTD."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fce034c_d38dd1d3","line":1,"range":{"start_line":1,"start_character":15,"end_line":1,"end_character":37},"updated":"2019-04-16 09:52:20.000000000","message":"Should be Intel.","commit_id":"0de0fea5e24db5f098ca89aa8a574e53f2321bd3"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"d6a65d7bff65181d652287dfa8cb43edce48e3a1","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2017 Huawei Technologies Co.,LTD."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fce034c_83184975","line":1,"range":{"start_line":1,"start_character":15,"end_line":1,"end_character":37},"in_reply_to":"3fce034c_d38dd1d3","updated":"2019-04-17 01:15:19.000000000","message":"Done","commit_id":"0de0fea5e24db5f098ca89aa8a574e53f2321bd3"}],"cyborg/api/controllers/v2/arqs.py":[{"author":{"_account_id":17813,"name":"wangzhh","email":"wzh_1993@126.com","username":"wangzhh"},"change_message_id":"ff7ce58dac30cde964463eeef313f15c4f851686","unresolved":false,"context_lines":[{"line_number":111,"context_line":"            return None"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    # @policy.authorize_wsgi(\"cyborg:arq\", \"create\", False)"},{"line_number":114,"context_line":"    @expose.expose(ARQCollection, body\u003dtypes.jsontype,"},{"line_number":115,"context_line":"                   status_code\u003dhttp_client.CREATED)"},{"line_number":116,"context_line":"    def post(self, req):"},{"line_number":117,"context_line":"        \"\"\"Create a new arq."}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_d1a8fd20","line":114,"updated":"2019-05-15 02:34:27.000000000","message":"The body should be an object so that it can be validated every request.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":111,"context_line":"            return None"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    # @policy.authorize_wsgi(\"cyborg:arq\", \"create\", False)"},{"line_number":114,"context_line":"    @expose.expose(ARQCollection, body\u003dtypes.jsontype,"},{"line_number":115,"context_line":"                   status_code\u003dhttp_client.CREATED)"},{"line_number":116,"context_line":"    def post(self, req):"},{"line_number":117,"context_line":"        \"\"\"Create a new arq."}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_e0db7f1e","line":114,"in_reply_to":"dfbec78f_d1a8fd20","updated":"2019-06-19 04:42:42.000000000","message":"Can we keep such changes after I submit it?","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":29845,"name":"Ikuo Otani","email":"ikuo.otani.rw@gmail.com","username":"ikuo_o"},"change_message_id":"754c1781369a407be856aac16208de0696d0dbc6","unresolved":false,"context_lines":[{"line_number":122,"context_line":"              }"},{"line_number":123,"context_line":"           :param req: request body."},{"line_number":124,"context_line":"        \"\"\""},{"line_number":125,"context_line":"        # TODO assume only one ARQ per dev prof for now"},{"line_number":126,"context_line":"        # TODO ignore image_uuid for now"},{"line_number":127,"context_line":"        # Get devprof details and set devprof ID in arq."},{"line_number":128,"context_line":"        # This allows the conductor and db layer to skip the devprof query."}],"source_content_type":"text/x-python","patch_set":10,"id":"bfb3d3c7_74cd912f","line":125,"range":{"start_line":125,"start_character":8,"end_line":125,"end_character":55},"updated":"2019-05-28 11:38:03.000000000","message":"What makes this TODO and when does it solved, Train?","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":122,"context_line":"              }"},{"line_number":123,"context_line":"           :param req: request body."},{"line_number":124,"context_line":"        \"\"\""},{"line_number":125,"context_line":"        # TODO assume only one ARQ per dev prof for now"},{"line_number":126,"context_line":"        # TODO ignore image_uuid for now"},{"line_number":127,"context_line":"        # Get devprof details and set devprof ID in arq."},{"line_number":128,"context_line":"        # This allows the conductor and db layer to skip the devprof query."}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_77695789","line":125,"range":{"start_line":125,"start_character":8,"end_line":125,"end_character":55},"in_reply_to":"bfb3d3c7_74cd912f","updated":"2019-06-19 04:42:42.000000000","message":"One device profile may correspond to multiple ARQs. So, we should handle multiple ARQs in this API.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"}],"cyborg/api/controllers/v2/deployables.py":[{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"5d78daba0c5161df2345046a420bc96b4e381d55","unresolved":false,"context_lines":[{"line_number":35,"context_line":"MYLOG \u003d log.getLogger(__name__)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"class Deployable(base.APIBase):"},{"line_number":39,"context_line":"    \"\"\"API representation of a deployable."},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    This class enforces type checking and value constraints, and converts"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fce034c_3346957e","line":38,"range":{"start_line":38,"start_character":0,"end_line":38,"end_character":31},"updated":"2019-04-16 09:52:20.000000000","message":"this class defines a V1 controller, we should update it according to the v2 definition of deployable. some of the following fields is deprecated.","commit_id":"0de0fea5e24db5f098ca89aa8a574e53f2321bd3"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"d6a65d7bff65181d652287dfa8cb43edce48e3a1","unresolved":false,"context_lines":[{"line_number":35,"context_line":"MYLOG \u003d log.getLogger(__name__)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"class Deployable(base.APIBase):"},{"line_number":39,"context_line":"    \"\"\"API representation of a deployable."},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    This class enforces type checking and value constraints, and converts"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fce034c_432ca198","line":38,"range":{"start_line":38,"start_character":0,"end_line":38,"end_character":31},"in_reply_to":"3fce034c_3346957e","updated":"2019-04-17 01:15:19.000000000","message":"Done","commit_id":"0de0fea5e24db5f098ca89aa8a574e53f2321bd3"}],"cyborg/api/controllers/v2/device_profiles.py":[{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"bf3a68c47fcd96ad8073501e99951855243d7e81","unresolved":false,"context_lines":[{"line_number":118,"context_line":"    def _get_device_profile_list(self, names):"},{"line_number":119,"context_line":"        \"\"\"Get a list of API objects representing device profiles.\"\"\""},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        assert isinstance(names, list)"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        context \u003d pecan.request.context"},{"line_number":124,"context_line":"        obj_devprofs \u003d objects.DeviceProfile.list(context)"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_b5aac316","line":121,"range":{"start_line":121,"start_character":0,"end_line":121,"end_character":38},"updated":"2019-06-03 07:21:59.000000000","message":"Agreed, it\u0027s better to avoid using assertion. Same in https://review.opendev.org/#/c/626057/10/cyborg/accelerator/drivers/fpga/intel/driver.py L73","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":27458,"name":"Li Liu","email":"liliueecg@gmail.com","username":"liliu"},"change_message_id":"07c6d73fdccb0b7e02331e0534314805055064df","unresolved":false,"context_lines":[{"line_number":118,"context_line":"    def _get_device_profile_list(self, names):"},{"line_number":119,"context_line":"        \"\"\"Get a list of API objects representing device profiles.\"\"\""},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        assert isinstance(names, list)"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        context \u003d pecan.request.context"},{"line_number":124,"context_line":"        obj_devprofs \u003d objects.DeviceProfile.list(context)"}],"source_content_type":"text/x-python","patch_set":10,"id":"bfb3d3c7_04f59257","line":121,"range":{"start_line":121,"start_character":8,"end_line":121,"end_character":14},"updated":"2019-05-20 11:35:31.000000000","message":"better throw an exception instead of an assertion","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":118,"context_line":"    def _get_device_profile_list(self, names):"},{"line_number":119,"context_line":"        \"\"\"Get a list of API objects representing device profiles.\"\"\""},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        assert isinstance(names, list)"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        context \u003d pecan.request.context"},{"line_number":124,"context_line":"        obj_devprofs \u003d objects.DeviceProfile.list(context)"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_e004df80","line":121,"range":{"start_line":121,"start_character":0,"end_line":121,"end_character":38},"in_reply_to":"9fb8cfa7_b5aac316","updated":"2019-06-19 04:42:42.000000000","message":"Done","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":118,"context_line":"    def _get_device_profile_list(self, names):"},{"line_number":119,"context_line":"        \"\"\"Get a list of API objects representing device profiles.\"\"\""},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        assert isinstance(names, list)"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        context \u003d pecan.request.context"},{"line_number":124,"context_line":"        obj_devprofs \u003d objects.DeviceProfile.list(context)"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_60f8ef7b","line":121,"range":{"start_line":121,"start_character":8,"end_line":121,"end_character":14},"in_reply_to":"bfb3d3c7_04f59257","updated":"2019-06-19 04:42:42.000000000","message":"Removed the assert","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"35b4ef2ecfdfe830b8276633803b26e3b8a94407","unresolved":false,"context_lines":[{"line_number":172,"context_line":"        TODO Support more than one devprof per request"},{"line_number":173,"context_line":"        \"\"\""},{"line_number":174,"context_line":"        context \u003d pecan.request.context"},{"line_number":175,"context_line":"        obj_devprof \u003d objects.DeviceProfile.get(context, name)"},{"line_number":176,"context_line":"        # TODO Implement device profile delete via conductor"},{"line_number":177,"context_line":"        obj_devprof.destroy(context)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9fb8cfa7_013959f0","line":175,"range":{"start_line":175,"start_character":8,"end_line":175,"end_character":62},"updated":"2019-06-28 03:30:21.000000000","message":"Why not just call destroy() in device profile object, it better to not do any object operation in API layer.","commit_id":"2c839f65e2b1f83168dca4770fbc7474263261f3"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"bc7f1c76339cdd0a3975bc15ef84080198e60a40","unresolved":false,"context_lines":[{"line_number":172,"context_line":"        TODO Support more than one devprof per request"},{"line_number":173,"context_line":"        \"\"\""},{"line_number":174,"context_line":"        context \u003d pecan.request.context"},{"line_number":175,"context_line":"        obj_devprof \u003d objects.DeviceProfile.get(context, name)"},{"line_number":176,"context_line":"        # TODO Implement device profile delete via conductor"},{"line_number":177,"context_line":"        obj_devprof.destroy(context)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9fb8cfa7_6f7a6524","line":175,"range":{"start_line":175,"start_character":8,"end_line":175,"end_character":62},"in_reply_to":"9fb8cfa7_013959f0","updated":"2019-07-01 03:28:56.000000000","message":"The API gets a name but has to delete by uuid. But we can move this logic to objects layer. Will do.","commit_id":"2c839f65e2b1f83168dca4770fbc7474263261f3"}],"cyborg/api/controllers/v2/types.py":[{"author":{"_account_id":27458,"name":"Li Liu","email":"liliueecg@gmail.com","username":"liliu"},"change_message_id":"07c6d73fdccb0b7e02331e0534314805055064df","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2019 Intel, Inc."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":10,"id":"bfb3d3c7_049a7213","line":1,"updated":"2019-05-20 11:35:31.000000000","message":"Consider moving this file out of v2 folder, no need to maintain this for each individual versions.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"1dd53fc98c7536d795cefffa513f5902197ce11b","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2019 Intel, Inc."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_a4b7c0d8","line":1,"in_reply_to":"9fb8cfa7_80688321","updated":"2019-06-20 05:31:48.000000000","message":"Done.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2019 Intel, Inc."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_80688321","line":1,"in_reply_to":"bfb3d3c7_049a7213","updated":"2019-06-19 04:42:42.000000000","message":"Agreed. Can we do this after I commit the current patch?","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"}],"cyborg/api/controllers/v2/utils.py":[{"author":{"_account_id":27458,"name":"Li Liu","email":"liliueecg@gmail.com","username":"liliu"},"change_message_id":"07c6d73fdccb0b7e02331e0534314805055064df","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2019 Intel, Inc."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":10,"id":"bfb3d3c7_64880ec6","line":1,"updated":"2019-05-20 11:35:31.000000000","message":"Same here, no need to have utils version specific.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"1dd53fc98c7536d795cefffa513f5902197ce11b","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2019 Intel, Inc."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_c4baf4be","line":1,"in_reply_to":"bfb3d3c7_64880ec6","updated":"2019-06-20 05:31:48.000000000","message":"Done","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"}],"cyborg/common/placement_client.py":[{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"bf3a68c47fcd96ad8073501e99951855243d7e81","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"def _get_rp_traits(rp_uuid):"},{"line_number":31,"context_line":"    placement \u003d _get_placement()"},{"line_number":32,"context_line":"    resp \u003d placement.get(_RPT_TPL % rp_uuid, microversion\u003d\u00271.6\u0027)"},{"line_number":33,"context_line":"    if resp.status_code !\u003d 200:"},{"line_number":34,"context_line":"        raise Exception("}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_390fad2f","line":31,"range":{"start_line":31,"start_character":0,"end_line":31,"end_character":32},"updated":"2019-06-03 07:21:59.000000000","message":"We should define a class like PlacementClient here to avoid the duplicate assignment of \"placement\". And also, we should have a look at Nova code for reference and keep the code consistency. Do not be too much different from Nova code cause the placement is a dependent project now and this part of code (placement report) in different projects should always keep the consistency in case that Placement take over it.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"def _get_rp_traits(rp_uuid):"},{"line_number":31,"context_line":"    placement \u003d _get_placement()"},{"line_number":32,"context_line":"    resp \u003d placement.get(_RPT_TPL % rp_uuid, microversion\u003d\u00271.6\u0027)"},{"line_number":33,"context_line":"    if resp.status_code !\u003d 200:"},{"line_number":34,"context_line":"        raise Exception("}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_e077ff07","line":31,"range":{"start_line":31,"start_character":0,"end_line":31,"end_character":32},"in_reply_to":"9fb8cfa7_390fad2f","updated":"2019-06-19 04:42:42.000000000","message":"I agree we should make this a class. Can we do it after I commit the code?\n\nThis was patterned after Nova calling into Placement. Placement is an independent project now.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"}],"cyborg/db/sqlalchemy/alembic/versions/ede4e3f1a232_new_db_schema.py":[{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"9f8731107f1fc41e8bea79b01173a376c29049b3","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        sa.Column(\u0027device_id\u0027, sa.Integer(),"},{"line_number":63,"context_line":"                  sa.ForeignKey(\u0027devices.id\u0027, ondelete\u003d\"RESTRICT\"),"},{"line_number":64,"context_line":"                  nullable\u003dFalse),"},{"line_number":65,"context_line":"        sa.Column(\u0027rp_uuid\u0027, sa.String(length\u003d36), nullable\u003dTrue),"},{"line_number":66,"context_line":"        sa.Column(\u0027driver_name\u0027, sa.String(length\u003d100), nullable\u003dTrue),"},{"line_number":67,"context_line":"        sa.Column(\u0027num_accelerators_in_use\u0027, sa.Integer(), default\u003d0),"},{"line_number":68,"context_line":"        sa.PrimaryKeyConstraint(\u0027id\u0027),"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_e62eb290","line":65,"updated":"2019-05-14 10:44:52.000000000","message":"We should add new db migration file for any db schema change.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"bf3a68c47fcd96ad8073501e99951855243d7e81","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        sa.Column(\u0027device_id\u0027, sa.Integer(),"},{"line_number":63,"context_line":"                  sa.ForeignKey(\u0027devices.id\u0027, ondelete\u003d\"RESTRICT\"),"},{"line_number":64,"context_line":"                  nullable\u003dFalse),"},{"line_number":65,"context_line":"        sa.Column(\u0027rp_uuid\u0027, sa.String(length\u003d36), nullable\u003dTrue),"},{"line_number":66,"context_line":"        sa.Column(\u0027driver_name\u0027, sa.String(length\u003d100), nullable\u003dTrue),"},{"line_number":67,"context_line":"        sa.Column(\u0027num_accelerators_in_use\u0027, sa.Integer(), default\u003d0),"},{"line_number":68,"context_line":"        sa.PrimaryKeyConstraint(\u0027id\u0027),"},{"line_number":69,"context_line":"        sa.Index(\u0027deployables_parent_id_idx\u0027, \u0027parent_id\u0027),"},{"line_number":70,"context_line":"        sa.Index(\u0027deployables_root_id_idx\u0027, \u0027root_id\u0027),"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_39380dd2","line":67,"range":{"start_line":65,"start_character":0,"end_line":67,"end_character":70},"updated":"2019-06-03 07:21:59.000000000","message":"When you add a new column in DB, please consider where we should do the assignment, and please indicate it explicitly. Otherwise it will cause bugs, I have test this in local env, and have done some hard-code to avoid it. Could you please elaborate it in order that I can fix it. I have seen the comments in models.py, but my question is where these variable should be assigned/updated. For example, I didn\u0027t see any update of \"num_accelerator_in_use\" during binding process, did I miss something? Besides, why driver_name is in deployable level, not device level?","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        sa.Column(\u0027device_id\u0027, sa.Integer(),"},{"line_number":63,"context_line":"                  sa.ForeignKey(\u0027devices.id\u0027, ondelete\u003d\"RESTRICT\"),"},{"line_number":64,"context_line":"                  nullable\u003dFalse),"},{"line_number":65,"context_line":"        sa.Column(\u0027rp_uuid\u0027, sa.String(length\u003d36), nullable\u003dTrue),"},{"line_number":66,"context_line":"        sa.Column(\u0027driver_name\u0027, sa.String(length\u003d100), nullable\u003dTrue),"},{"line_number":67,"context_line":"        sa.Column(\u0027num_accelerators_in_use\u0027, sa.Integer(), default\u003d0),"},{"line_number":68,"context_line":"        sa.PrimaryKeyConstraint(\u0027id\u0027),"},{"line_number":69,"context_line":"        sa.Index(\u0027deployables_parent_id_idx\u0027, \u0027parent_id\u0027),"},{"line_number":70,"context_line":"        sa.Index(\u0027deployables_root_id_idx\u0027, \u0027root_id\u0027),"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_00cb331e","line":67,"range":{"start_line":65,"start_character":0,"end_line":67,"end_character":70},"in_reply_to":"9fb8cfa7_39380dd2","updated":"2019-06-19 04:42:42.000000000","message":"\"driver_name\" should be set by the conductor when a driver reports a deployable as part of the discovery. \n\n\"num_accelerators_in_use\" is relevant when there is more than one accelerator in a deployable. It is referenced in a comment [1] because I\u0027d like community input on whether to enable multi-accelerator devices now, as networked FPGAs will need it.\n\n[1] https://review.opendev.org/gitweb?p\u003dopenstack/cyborg.git;f\u003dcyborg/objects/ext_arq.py;hb\u003drefs/changes/57/626057/10#l145","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"}],"cyborg/db/sqlalchemy/api.py":[{"author":{"_account_id":29845,"name":"Ikuo Otani","email":"ikuo.otani.rw@gmail.com","username":"ikuo_o"},"change_message_id":"754c1781369a407be856aac16208de0696d0dbc6","unresolved":false,"context_lines":[{"line_number":161,"context_line":"        except NoResultFound:"},{"line_number":162,"context_line":"            raise exception.NotFound()"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def attach_handle_get_by_type(self, context, attach_type\u003d\u0027PCI\u0027):"},{"line_number":165,"context_line":"        query \u003d model_query(context, models.AttachHandle). \\"},{"line_number":166,"context_line":"            filter_by(attach_type\u003dattach_type)"},{"line_number":167,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"bfb3d3c7_542c0d01","line":164,"range":{"start_line":164,"start_character":48,"end_line":164,"end_character":66},"updated":"2019-05-28 11:38:03.000000000","message":"This takes out one attach_handle, but attach_handles exist as many as the number of cpid.\nCan we use only one attach_handle?","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":27458,"name":"Li Liu","email":"liliueecg@gmail.com","username":"liliu"},"change_message_id":"07c6d73fdccb0b7e02331e0534314805055064df","unresolved":false,"context_lines":[{"line_number":161,"context_line":"        except NoResultFound:"},{"line_number":162,"context_line":"            raise exception.NotFound()"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def attach_handle_get_by_type(self, context, attach_type\u003d\u0027PCI\u0027):"},{"line_number":165,"context_line":"        query \u003d model_query(context, models.AttachHandle). \\"},{"line_number":166,"context_line":"            filter_by(attach_type\u003dattach_type)"},{"line_number":167,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"bfb3d3c7_4d608dcf","line":164,"range":{"start_line":164,"start_character":8,"end_line":164,"end_character":33},"updated":"2019-05-20 11:35:31.000000000","message":"attach_handle_get_by_attach_type might be a better name","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":161,"context_line":"        except NoResultFound:"},{"line_number":162,"context_line":"            raise exception.NotFound()"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def attach_handle_get_by_type(self, context, attach_type\u003d\u0027PCI\u0027):"},{"line_number":165,"context_line":"        query \u003d model_query(context, models.AttachHandle). \\"},{"line_number":166,"context_line":"            filter_by(attach_type\u003dattach_type)"},{"line_number":167,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_c0d43bc0","line":164,"range":{"start_line":164,"start_character":8,"end_line":164,"end_character":33},"in_reply_to":"bfb3d3c7_4d608dcf","updated":"2019-06-19 04:42:42.000000000","message":"Done","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":161,"context_line":"        except NoResultFound:"},{"line_number":162,"context_line":"            raise exception.NotFound()"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def attach_handle_get_by_type(self, context, attach_type\u003d\u0027PCI\u0027):"},{"line_number":165,"context_line":"        query \u003d model_query(context, models.AttachHandle). \\"},{"line_number":166,"context_line":"            filter_by(attach_type\u003dattach_type)"},{"line_number":167,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_60d9cff2","line":164,"range":{"start_line":164,"start_character":48,"end_line":164,"end_character":66},"in_reply_to":"bfb3d3c7_542c0d01","updated":"2019-06-19 04:42:42.000000000","message":"Changed this to query.all().","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":17813,"name":"wangzhh","email":"wzh_1993@126.com","username":"wangzhh"},"change_message_id":"ff7ce58dac30cde964463eeef313f15c4f851686","unresolved":false,"context_lines":[{"line_number":463,"context_line":"        except NoResultFound:"},{"line_number":464,"context_line":"            raise exception.DeviceProfileNotFound(id\u003did)"},{"line_number":465,"context_line":""},{"line_number":466,"context_line":"    def device_profile_get(self, context, name):"},{"line_number":467,"context_line":"        query \u003d model_query("},{"line_number":468,"context_line":"            context, models.DeviceProfile).filter_by(name\u003dname)"},{"line_number":469,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_d1c23d34","line":466,"updated":"2019-05-15 02:34:27.000000000","message":"Device_profile is not unique in the database. So what if the name is duplicated?","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":463,"context_line":"        except NoResultFound:"},{"line_number":464,"context_line":"            raise exception.DeviceProfileNotFound(id\u003did)"},{"line_number":465,"context_line":""},{"line_number":466,"context_line":"    def device_profile_get(self, context, name):"},{"line_number":467,"context_line":"        query \u003d model_query("},{"line_number":468,"context_line":"            context, models.DeviceProfile).filter_by(name\u003dname)"},{"line_number":469,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_770ce040","line":466,"in_reply_to":"bfb3d3c7_ed838155","updated":"2019-06-19 04:42:42.000000000","message":"Device profile is a \u0027flavor for devices\u0027. When a flavor is created, a name is required but the id is optional [1]. Flavor id is really a string but could be used as integer or uuid. \n\n[1] https://developer.openstack.org/api-ref/compute/?expanded\u003dcreate-flavor-detail#create-flavor\n\nNova\u0027s flavor id is a legacy. For us, it is better to model the primary key field of a device profile as a name from Day 1. If there are additional device profile APIs that operate with UUIDs, that is ok too; we may need that for renaming device profiles in the future, for example.\n\nFrom the operators\u0027 point of view, a device profile represents a certain configuration (e.g. 2 GPUs) or a workload (e.g. ML offload with 1 FPGA and 1 GPU -- making stuff up here).That is best represented as a name. That is not only more usable than UUIDs but also more consistent than flavor id usage today.\n\nIn the end-to-end flow, operators set device profile names in flavors, and so Nova calls Cyborg with a dp name rather than UUID. So, we need APIs with names.\n\nGiven above background, device profile names must be unique just as flavor IDs are unique.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":27458,"name":"Li Liu","email":"liliueecg@gmail.com","username":"liliu"},"change_message_id":"07c6d73fdccb0b7e02331e0534314805055064df","unresolved":false,"context_lines":[{"line_number":463,"context_line":"        except NoResultFound:"},{"line_number":464,"context_line":"            raise exception.DeviceProfileNotFound(id\u003did)"},{"line_number":465,"context_line":""},{"line_number":466,"context_line":"    def device_profile_get(self, context, name):"},{"line_number":467,"context_line":"        query \u003d model_query("},{"line_number":468,"context_line":"            context, models.DeviceProfile).filter_by(name\u003dname)"},{"line_number":469,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"bfb3d3c7_ed838155","line":466,"in_reply_to":"dfbec78f_d1c23d34","updated":"2019-05-20 11:35:31.000000000","message":"I am having the same concern on using the name for distinguishing device profiles","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":463,"context_line":"        except NoResultFound:"},{"line_number":464,"context_line":"            raise exception.DeviceProfileNotFound(id\u003did)"},{"line_number":465,"context_line":""},{"line_number":466,"context_line":"    def device_profile_get(self, context, name):"},{"line_number":467,"context_line":"        query \u003d model_query("},{"line_number":468,"context_line":"            context, models.DeviceProfile).filter_by(name\u003dname)"},{"line_number":469,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_60878fb8","line":466,"in_reply_to":"dfbec78f_d1c23d34","updated":"2019-06-19 04:42:42.000000000","message":"Please see the reply below.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":27458,"name":"Li Liu","email":"liliueecg@gmail.com","username":"liliu"},"change_message_id":"07c6d73fdccb0b7e02331e0534314805055064df","unresolved":false,"context_lines":[{"line_number":527,"context_line":"            if count !\u003d 1:"},{"line_number":528,"context_line":"                raise exception.DeviceProfileNotFound(uuid\u003duuid)"},{"line_number":529,"context_line":""},{"line_number":530,"context_line":"    def deployable_create(self, context, values):"},{"line_number":531,"context_line":"        raise NotImplementedError()  # TODO"},{"line_number":532,"context_line":"        if not values.get(\u0027uuid\u0027):"},{"line_number":533,"context_line":"            values[\u0027uuid\u0027] \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":10,"id":"bfb3d3c7_5e2b5193","line":530,"range":{"start_line":530,"start_character":8,"end_line":530,"end_character":25},"updated":"2019-05-20 11:35:31.000000000","message":"Deployable is still one of DB objects, right? If we remove this api, how anyone is able to create deployable?","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":527,"context_line":"            if count !\u003d 1:"},{"line_number":528,"context_line":"                raise exception.DeviceProfileNotFound(uuid\u003duuid)"},{"line_number":529,"context_line":""},{"line_number":530,"context_line":"    def deployable_create(self, context, values):"},{"line_number":531,"context_line":"        raise NotImplementedError()  # TODO"},{"line_number":532,"context_line":"        if not values.get(\u0027uuid\u0027):"},{"line_number":533,"context_line":"            values[\u0027uuid\u0027] \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_3702e80c","line":530,"range":{"start_line":530,"start_character":8,"end_line":530,"end_character":25},"in_reply_to":"bfb3d3c7_5e2b5193","updated":"2019-06-19 04:42:42.000000000","message":"It is a valid object but I haven\u0027t changed the implementation for v2. That is the TODO.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":29845,"name":"Ikuo Otani","email":"ikuo.otani.rw@gmail.com","username":"ikuo_o"},"change_message_id":"754c1781369a407be856aac16208de0696d0dbc6","unresolved":false,"context_lines":[{"line_number":528,"context_line":"                raise exception.DeviceProfileNotFound(uuid\u003duuid)"},{"line_number":529,"context_line":""},{"line_number":530,"context_line":"    def deployable_create(self, context, values):"},{"line_number":531,"context_line":"        raise NotImplementedError()  # TODO"},{"line_number":532,"context_line":"        if not values.get(\u0027uuid\u0027):"},{"line_number":533,"context_line":"            values[\u0027uuid\u0027] \u003d uuidutils.generate_uuid()"},{"line_number":534,"context_line":"        if values.get(\u0027id\u0027):"}],"source_content_type":"text/x-python","patch_set":10,"id":"bfb3d3c7_d46d5d32","line":531,"range":{"start_line":531,"start_character":36,"end_line":531,"end_character":43},"updated":"2019-05-28 11:38:03.000000000","message":"Are functions with # TODO description like this used with API v2?","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":528,"context_line":"                raise exception.DeviceProfileNotFound(uuid\u003duuid)"},{"line_number":529,"context_line":""},{"line_number":530,"context_line":"    def deployable_create(self, context, values):"},{"line_number":531,"context_line":"        raise NotImplementedError()  # TODO"},{"line_number":532,"context_line":"        if not values.get(\u0027uuid\u0027):"},{"line_number":533,"context_line":"            values[\u0027uuid\u0027] \u003d uuidutils.generate_uuid()"},{"line_number":534,"context_line":"        if values.get(\u0027id\u0027):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_7a112552","line":531,"range":{"start_line":531,"start_character":36,"end_line":531,"end_character":43},"in_reply_to":"bfb3d3c7_d46d5d32","updated":"2019-06-19 04:42:42.000000000","message":"Yes, the implementation needs to be changed for v2 in Train.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":29845,"name":"Ikuo Otani","email":"ikuo.otani.rw@gmail.com","username":"ikuo_o"},"change_message_id":"754c1781369a407be856aac16208de0696d0dbc6","unresolved":false,"context_lines":[{"line_number":554,"context_line":"        except NoResultFound:"},{"line_number":555,"context_line":"            raise exception.DeployableNotFound(uuid\u003duuid)"},{"line_number":556,"context_line":""},{"line_number":557,"context_line":"    def deployable_get_by_host(self, context, host):"},{"line_number":558,"context_line":"        raise NotImplementedError()  # TODO"},{"line_number":559,"context_line":"        query \u003d model_query("},{"line_number":560,"context_line":"            context,"}],"source_content_type":"text/x-python","patch_set":10,"id":"bfb3d3c7_f425010a","line":557,"range":{"start_line":557,"start_character":46,"end_line":557,"end_character":50},"updated":"2019-05-28 11:38:03.000000000","message":"With v2 API, \"host\" doesn\u0027t exist as DB object of deployable, I think.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"1dd53fc98c7536d795cefffa513f5902197ce11b","unresolved":false,"context_lines":[{"line_number":554,"context_line":"        except NoResultFound:"},{"line_number":555,"context_line":"            raise exception.DeployableNotFound(uuid\u003duuid)"},{"line_number":556,"context_line":""},{"line_number":557,"context_line":"    def deployable_get_by_host(self, context, host):"},{"line_number":558,"context_line":"        raise NotImplementedError()  # TODO"},{"line_number":559,"context_line":"        query \u003d model_query("},{"line_number":560,"context_line":"            context,"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_e4c4d842","line":557,"range":{"start_line":557,"start_character":46,"end_line":557,"end_character":50},"in_reply_to":"9fb8cfa7_00f4935a","updated":"2019-06-20 05:31:48.000000000","message":"Done","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":554,"context_line":"        except NoResultFound:"},{"line_number":555,"context_line":"            raise exception.DeployableNotFound(uuid\u003duuid)"},{"line_number":556,"context_line":""},{"line_number":557,"context_line":"    def deployable_get_by_host(self, context, host):"},{"line_number":558,"context_line":"        raise NotImplementedError()  # TODO"},{"line_number":559,"context_line":"        query \u003d model_query("},{"line_number":560,"context_line":"            context,"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_00f4935a","line":557,"range":{"start_line":557,"start_character":46,"end_line":557,"end_character":50},"in_reply_to":"bfb3d3c7_f425010a","updated":"2019-06-19 04:42:42.000000000","message":"True. Will remove.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"}],"cyborg/image/glance.py":[{"author":{"_account_id":27458,"name":"Li Liu","email":"liliueecg@gmail.com","username":"liliu"},"change_message_id":"07c6d73fdccb0b7e02331e0534314805055064df","unresolved":false,"context_lines":[{"line_number":245,"context_line":"           E.g. {\"function_id\": \"3AFB\"}"},{"line_number":246,"context_line":"           :returns: List of images"},{"line_number":247,"context_line":"        \"\"\""},{"line_number":248,"context_line":"        assert isinstance(properties, dict)"},{"line_number":249,"context_line":"        image_generator \u003d self._client.call(context, 2, \u0027list\u0027, properties)"},{"line_number":250,"context_line":"        return list(image_generator)"},{"line_number":251,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"bfb3d3c7_79698fbc","line":248,"range":{"start_line":248,"start_character":8,"end_line":248,"end_character":14},"updated":"2019-05-20 11:35:31.000000000","message":"Consider raising an exception rather than doing assertion here.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":245,"context_line":"           E.g. {\"function_id\": \"3AFB\"}"},{"line_number":246,"context_line":"           :returns: List of images"},{"line_number":247,"context_line":"        \"\"\""},{"line_number":248,"context_line":"        assert isinstance(properties, dict)"},{"line_number":249,"context_line":"        image_generator \u003d self._client.call(context, 2, \u0027list\u0027, properties)"},{"line_number":250,"context_line":"        return list(image_generator)"},{"line_number":251,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_209197f2","line":248,"range":{"start_line":248,"start_character":8,"end_line":248,"end_character":14},"in_reply_to":"bfb3d3c7_79698fbc","updated":"2019-06-19 04:42:42.000000000","message":"Removed the assert.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"}],"cyborg/objects/arq.py":[{"author":{"_account_id":17813,"name":"wangzhh","email":"wzh_1993@126.com","username":"wangzhh"},"change_message_id":"ff7ce58dac30cde964463eeef313f15c4f851686","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        \u0027id\u0027: object_fields.IntegerField(nullable\u003dFalse),"},{"line_number":36,"context_line":"        \u0027uuid\u0027: object_fields.UUIDField(nullable\u003dFalse),"},{"line_number":37,"context_line":"        \u0027state\u0027: object_fields.ARQStateField(nullable\u003dFalse),"},{"line_number":38,"context_line":"        \u0027device_profile_name\u0027: object_fields.StringField(nullable\u003dFalse),"},{"line_number":39,"context_line":"        \u0027device_profile_group_id\u0027:"},{"line_number":40,"context_line":"            object_fields.IntegerField(nullable\u003dFalse),"},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_91bda5d9","line":38,"updated":"2019-05-15 02:34:27.000000000","message":"Why not use device_profile here?","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        \u0027id\u0027: object_fields.IntegerField(nullable\u003dFalse),"},{"line_number":36,"context_line":"        \u0027uuid\u0027: object_fields.UUIDField(nullable\u003dFalse),"},{"line_number":37,"context_line":"        \u0027state\u0027: object_fields.ARQStateField(nullable\u003dFalse),"},{"line_number":38,"context_line":"        \u0027device_profile_name\u0027: object_fields.StringField(nullable\u003dFalse),"},{"line_number":39,"context_line":"        \u0027device_profile_group_id\u0027:"},{"line_number":40,"context_line":"            object_fields.IntegerField(nullable\u003dFalse),"},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_fa7c3584","line":38,"in_reply_to":"dfbec78f_91bda5d9","updated":"2019-06-19 04:42:42.000000000","message":"Consider an example device profile:\n  { \"name\": \"mydp\",\n    \"groups\": [\n        { \"resources:FPGA\": \"2\",\n          \"trait:foo\": \"required\"\n        },\n        { \"resources:GPU\": \"3\",\n          \"trait:bar\": \"required\"\n        }\n    ]\n  }\nThe first request group will need 2 ARQs and 2nd one will need 3. So, ARQ : dp-group relation is N:1.\n\nSo, we should not copy the entire device profile object here. Instead, we only keep the name and request group id.\n\nAlso, since Nova queries Cyborg to get the device profile request groups and folds them into the request spec, carrying the request group(s) in the ARQ would be redundant.\n\nBut we do copy the request group for the ARQ into the ExtARQ, based on Nova developer feedback. This is similar to copying flavor into the request spec. This allows the device profile (or flavor) to be modified or deleted when running VMs are referencing them.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":17813,"name":"wangzhh","email":"wzh_1993@126.com","username":"wangzhh"},"change_message_id":"ff7ce58dac30cde964463eeef313f15c4f851686","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        \u0027instance_uuid\u0027: object_fields.StringField(nullable\u003dTrue),"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        # Fields populated by Cyborg after binding"},{"line_number":48,"context_line":"        \u0027attach_handle_type\u0027: object_fields.StringField(nullable\u003dTrue),"},{"line_number":49,"context_line":"        \u0027attach_handle_info\u0027: object_fields.StringField(nullable\u003dTrue),"},{"line_number":50,"context_line":"    }"},{"line_number":51,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_b1c22958","line":48,"updated":"2019-05-15 02:34:27.000000000","message":"Same problem as line 38.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        \u0027instance_uuid\u0027: object_fields.StringField(nullable\u003dTrue),"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        # Fields populated by Cyborg after binding"},{"line_number":48,"context_line":"        \u0027attach_handle_type\u0027: object_fields.StringField(nullable\u003dTrue),"},{"line_number":49,"context_line":"        \u0027attach_handle_info\u0027: object_fields.StringField(nullable\u003dTrue),"},{"line_number":50,"context_line":"    }"},{"line_number":51,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_9a6df9cd","line":48,"in_reply_to":"dfbec78f_b1c22958","updated":"2019-06-19 04:42:42.000000000","message":"The attacxh_handle object has many fields that are internal to Cyborg and need/should not be exposed to Nova.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"}],"cyborg/objects/device_profile.py":[{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"9f8731107f1fc41e8bea79b01173a376c29049b3","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    }"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def _to_profile_json(self, obj_changes):"},{"line_number":43,"context_line":"        assert \u0027groups\u0027 in obj_changes"},{"line_number":44,"context_line":"        if \u0027groups\u0027 in obj_changes:  # Convert to profile_json string"},{"line_number":45,"context_line":"            d \u003d {\"groups\": obj_changes[\u0027groups\u0027]}"},{"line_number":46,"context_line":"            profile_json \u003d jsonutils.dumps(d)"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_46421e40","line":43,"range":{"start_line":43,"start_character":8,"end_line":43,"end_character":38},"updated":"2019-05-14 10:44:52.000000000","message":"ditto","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    }"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def _to_profile_json(self, obj_changes):"},{"line_number":43,"context_line":"        assert \u0027groups\u0027 in obj_changes"},{"line_number":44,"context_line":"        if \u0027groups\u0027 in obj_changes:  # Convert to profile_json string"},{"line_number":45,"context_line":"            d \u003d {\"groups\": obj_changes[\u0027groups\u0027]}"},{"line_number":46,"context_line":"            profile_json \u003d jsonutils.dumps(d)"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_408e0bd1","line":43,"range":{"start_line":43,"start_character":8,"end_line":43,"end_character":38},"in_reply_to":"dfbec78f_46421e40","updated":"2019-06-19 04:42:42.000000000","message":"Done","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":17813,"name":"wangzhh","email":"wzh_1993@126.com","username":"wangzhh"},"change_message_id":"ff7ce58dac30cde964463eeef313f15c4f851686","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        return obj_devprof"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    @classmethod"},{"line_number":71,"context_line":"    def list(cls, context):"},{"line_number":72,"context_line":"        \"\"\"Return a list of Device Profile objects.\"\"\""},{"line_number":73,"context_line":"        db_devprofs \u003d cls.dbapi.device_profile_list(context)"},{"line_number":74,"context_line":"        obj_dp_list \u003d cls._from_db_object_list(db_devprofs, context)"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_51e40de0","line":71,"updated":"2019-05-15 02:34:27.000000000","message":"Why we remove the param: filter? I think it is essential.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        return obj_devprof"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    @classmethod"},{"line_number":71,"context_line":"    def list(cls, context):"},{"line_number":72,"context_line":"        \"\"\"Return a list of Device Profile objects.\"\"\""},{"line_number":73,"context_line":"        db_devprofs \u003d cls.dbapi.device_profile_list(context)"},{"line_number":74,"context_line":"        obj_dp_list \u003d cls._from_db_object_list(db_devprofs, context)"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_db266abb","line":71,"in_reply_to":"dfbec78f_51e40de0","updated":"2019-06-19 04:42:42.000000000","message":"Agreed. Marked it as TODO.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":17813,"name":"wangzhh","email":"wzh_1993@126.com","username":"wangzhh"},"change_message_id":"ff7ce58dac30cde964463eeef313f15c4f851686","unresolved":false,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def destroy(self, context):"},{"line_number":87,"context_line":"        \"\"\"Delete a Device Profile from the DB.\"\"\""},{"line_number":88,"context_line":"        self.dbapi.device_profile_delete(context, self.name)"},{"line_number":89,"context_line":"        self.obj_reset_changes()"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    @classmethod"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_51ce4d2d","line":88,"updated":"2019-05-15 02:34:27.000000000","message":"Name is not unique in the database. By the way, I\u0027m confused about why do we replace uuid with name?","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"4607762d09182c08248a35df9a2a6514eb67cffc","unresolved":false,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def destroy(self, context):"},{"line_number":87,"context_line":"        \"\"\"Delete a Device Profile from the DB.\"\"\""},{"line_number":88,"context_line":"        self.dbapi.device_profile_delete(context, self.name)"},{"line_number":89,"context_line":"        self.obj_reset_changes()"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    @classmethod"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_24059d46","line":88,"range":{"start_line":88,"start_character":55,"end_line":88,"end_character":59},"updated":"2019-06-12 08:30:35.000000000","message":"https://review.opendev.org/#/c/626057/10/cyborg/db/sqlalchemy/api.py L522 the inpute params is uuid, there is a conflict. It should be changed to uuid here and api layer also.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def destroy(self, context):"},{"line_number":87,"context_line":"        \"\"\"Delete a Device Profile from the DB.\"\"\""},{"line_number":88,"context_line":"        self.dbapi.device_profile_delete(context, self.name)"},{"line_number":89,"context_line":"        self.obj_reset_changes()"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    @classmethod"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_1b49625f","line":88,"range":{"start_line":88,"start_character":55,"end_line":88,"end_character":59},"in_reply_to":"9fb8cfa7_24059d46","updated":"2019-06-19 04:42:42.000000000","message":"It needs to be changed here. But API layer should continue to use the name.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def destroy(self, context):"},{"line_number":87,"context_line":"        \"\"\"Delete a Device Profile from the DB.\"\"\""},{"line_number":88,"context_line":"        self.dbapi.device_profile_delete(context, self.name)"},{"line_number":89,"context_line":"        self.obj_reset_changes()"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    @classmethod"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_9b6eb2c7","line":88,"in_reply_to":"dfbec78f_51ce4d2d","updated":"2019-06-19 04:42:42.000000000","message":"Please see response to comment in Line 466 of [1].\n\n[1] https://review.opendev.org/#/c/626057/10/cyborg/db/sqlalchemy/api.py","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"}],"cyborg/objects/ext_arq.py":[{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"51d64bc07eb7bbc1a01a39d6c03d34d69d6c2090","unresolved":false,"context_lines":[{"line_number":157,"context_line":"        LOG.info(\u0027Finished programming for hostname %s deployable %s\u0027,"},{"line_number":158,"context_line":"                 hostname, db_deployable.uuid)"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    def bind(self, context, hostname, devrp_uuid, instance_uuid):"},{"line_number":161,"context_line":"        \"\"\" Given a device rp UUID, get the deployable UUID and"},{"line_number":162,"context_line":"            an attach handle."},{"line_number":163,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"ffb9cba7_ddfdd6b1","line":160,"range":{"start_line":160,"start_character":38,"end_line":160,"end_character":48},"updated":"2019-04-25 02:55:35.000000000","message":"As your comment below, this devrp_uuid is already deployable level? I was thinking it is device level rp.","commit_id":"0de0fea5e24db5f098ca89aa8a574e53f2321bd3"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"35c4df9d842ebeffdd0bec4f94dbaa29cbd668a6","unresolved":false,"context_lines":[{"line_number":157,"context_line":"        LOG.info(\u0027Finished programming for hostname %s deployable %s\u0027,"},{"line_number":158,"context_line":"                 hostname, db_deployable.uuid)"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    def bind(self, context, hostname, devrp_uuid, instance_uuid):"},{"line_number":161,"context_line":"        \"\"\" Given a device rp UUID, get the deployable UUID and"},{"line_number":162,"context_line":"            an attach handle."},{"line_number":163,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"ffb9cba7_bcf32f0a","line":160,"range":{"start_line":160,"start_character":38,"end_line":160,"end_character":48},"in_reply_to":"ffb9cba7_5d031b0e","updated":"2019-04-26 02:45:01.000000000","message":"Maybe we can use rp_uuid directly. Also, there should be some comments below this line about the parameters which is passed in this funciton. we can add a comment to explain that this RP is deployable level RP in cyborg.\ne.g. https://github.com/openstack/cyborg/blob/master/cyborg/accelerator/configuration.py#L40","commit_id":"0de0fea5e24db5f098ca89aa8a574e53f2321bd3"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"033a520920546fa01a50d70889fec26761ce0df0","unresolved":false,"context_lines":[{"line_number":157,"context_line":"        LOG.info(\u0027Finished programming for hostname %s deployable %s\u0027,"},{"line_number":158,"context_line":"                 hostname, db_deployable.uuid)"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    def bind(self, context, hostname, devrp_uuid, instance_uuid):"},{"line_number":161,"context_line":"        \"\"\" Given a device rp UUID, get the deployable UUID and"},{"line_number":162,"context_line":"            an attach handle."},{"line_number":163,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"ffb9cba7_5d031b0e","line":160,"range":{"start_line":160,"start_character":38,"end_line":160,"end_character":48},"in_reply_to":"ffb9cba7_ddfdd6b1","updated":"2019-04-25 15:01:36.000000000","message":"I agree the name is confusing. We should call this a deployable_RP_uuid or similar, but that name has no meaning to Nova. I called it \u0027device_rp_uuid\u0027 to mean a RP inside a device. If you or others have better names, please propose.","commit_id":"0de0fea5e24db5f098ca89aa8a574e53f2321bd3"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"5d78daba0c5161df2345046a420bc96b4e381d55","unresolved":false,"context_lines":[{"line_number":168,"context_line":"        arq.device_rp_uuid \u003d devrp_uuid"},{"line_number":169,"context_line":"        arq.instance_uuid \u003d instance_uuid"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"        db_deployable \u003d self.dbapi.deployable_get_by_rp_uuid("},{"line_number":172,"context_line":"            context, devrp_uuid)"},{"line_number":173,"context_line":"        # TODO  Check that deployable.device.hostname matches param hostname"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"        bitstream_id \u003d self.device_profile_group.get(\u0027accel:bitstream_id\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fce034c_f33ecd27","line":172,"range":{"start_line":171,"start_character":8,"end_line":172,"end_character":32},"updated":"2019-04-16 09:52:20.000000000","message":"How we know this db_deployable has available accelerator to be assigned to a VM. I think deployable_get_by_rp_uuid is not enough for this logic.","commit_id":"0de0fea5e24db5f098ca89aa8a574e53f2321bd3"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"93c347c305bcaed3acaf62b3aef0683504f51f7a","unresolved":false,"context_lines":[{"line_number":168,"context_line":"        arq.device_rp_uuid \u003d devrp_uuid"},{"line_number":169,"context_line":"        arq.instance_uuid \u003d instance_uuid"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"        db_deployable \u003d self.dbapi.deployable_get_by_rp_uuid("},{"line_number":172,"context_line":"            context, devrp_uuid)"},{"line_number":173,"context_line":"        # TODO  Check that deployable.device.hostname matches param hostname"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"        bitstream_id \u003d self.device_profile_group.get(\u0027accel:bitstream_id\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"ffb9cba7_1b894fc9","line":172,"range":{"start_line":171,"start_character":8,"end_line":172,"end_character":32},"in_reply_to":"3fce034c_e357cd01","updated":"2019-04-24 08:05:22.000000000","message":"yes, my confusion is that, when there are multiple deployables in one dev_rp, why it returns the first one directly.","commit_id":"0de0fea5e24db5f098ca89aa8a574e53f2321bd3"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"d6a65d7bff65181d652287dfa8cb43edce48e3a1","unresolved":false,"context_lines":[{"line_number":168,"context_line":"        arq.device_rp_uuid \u003d devrp_uuid"},{"line_number":169,"context_line":"        arq.instance_uuid \u003d instance_uuid"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"        db_deployable \u003d self.dbapi.deployable_get_by_rp_uuid("},{"line_number":172,"context_line":"            context, devrp_uuid)"},{"line_number":173,"context_line":"        # TODO  Check that deployable.device.hostname matches param hostname"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"        bitstream_id \u003d self.device_profile_group.get(\u0027accel:bitstream_id\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fce034c_e357cd01","line":172,"range":{"start_line":171,"start_character":8,"end_line":172,"end_character":32},"in_reply_to":"3fce034c_f33ecd27","updated":"2019-04-17 01:15:19.000000000","message":"Placement counts the free resources (accelerators etc.). When Nova queries Placement, the only allocation candidates are those that have free resources of the right amount. Later, Nova picks one alloc cand, and claims those resources. So, that RP 9deployable) will have the accelerator(s) available.","commit_id":"0de0fea5e24db5f098ca89aa8a574e53f2321bd3"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"18e8ad3e9c8c04456dfd1b049cfe3206e00b5bb0","unresolved":false,"context_lines":[{"line_number":168,"context_line":"        arq.device_rp_uuid \u003d devrp_uuid"},{"line_number":169,"context_line":"        arq.instance_uuid \u003d instance_uuid"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"        db_deployable \u003d self.dbapi.deployable_get_by_rp_uuid("},{"line_number":172,"context_line":"            context, devrp_uuid)"},{"line_number":173,"context_line":"        # TODO  Check that deployable.device.hostname matches param hostname"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"        bitstream_id \u003d self.device_profile_group.get(\u0027accel:bitstream_id\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"ffb9cba7_c702e3b4","line":172,"range":{"start_line":171,"start_character":8,"end_line":172,"end_character":32},"in_reply_to":"ffb9cba7_1b894fc9","updated":"2019-04-24 23:46:15.000000000","message":"One deployable corresponds to one RP. Please see https://docs.google.com/presentation/d/1qUPtaw8YqCSZuEHlui0-GvEFEgkZcq080d1Odp7r_nU/edit#slide\u003did.p5 .","commit_id":"0de0fea5e24db5f098ca89aa8a574e53f2321bd3"},{"author":{"_account_id":29845,"name":"Ikuo Otani","email":"ikuo.otani.rw@gmail.com","username":"ikuo_o"},"change_message_id":"754c1781369a407be856aac16208de0696d0dbc6","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        # Left substate open now, fill them out during design/implementation"},{"line_number":54,"context_line":"        # later."},{"line_number":55,"context_line":"        \u0027substate\u0027: object_fields.StringField(),"},{"line_number":56,"context_line":"        \u0027deployable_uuid\u0027: object_fields.StringField(),"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        # The dp group is copied in to the extarq, so that any changes or"},{"line_number":59,"context_line":"        # deletions to the device profile do not affect running VMs."}],"source_content_type":"text/x-python","patch_set":10,"id":"bfb3d3c7_5463ad42","line":56,"range":{"start_line":56,"start_character":27,"end_line":56,"end_character":55},"updated":"2019-05-28 11:38:03.000000000","message":"object_fields.UUIDField(nullable\u003dTrue) looks better.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        # Left substate open now, fill them out during design/implementation"},{"line_number":54,"context_line":"        # later."},{"line_number":55,"context_line":"        \u0027substate\u0027: object_fields.StringField(),"},{"line_number":56,"context_line":"        \u0027deployable_uuid\u0027: object_fields.StringField(),"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        # The dp group is copied in to the extarq, so that any changes or"},{"line_number":59,"context_line":"        # deletions to the device profile do not affect running VMs."}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_80096332","line":56,"range":{"start_line":56,"start_character":27,"end_line":56,"end_character":55},"in_reply_to":"bfb3d3c7_5463ad42","updated":"2019-06-19 04:42:42.000000000","message":"Done","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":27458,"name":"Li Liu","email":"liliueecg@gmail.com","username":"liliu"},"change_message_id":"07c6d73fdccb0b7e02331e0534314805055064df","unresolved":false,"context_lines":[{"line_number":113,"context_line":"    def _get_bitstream_md_from_function_id(self, function_id):"},{"line_number":114,"context_line":"        \"\"\"Get bitstream metadata given a function id.\"\"\""},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        conn \u003d connection.Connection(cloud\u003d\u0027devstack-admin\u0027)"},{"line_number":117,"context_line":"        properties \u003d {\u0027accel:function_id\u0027: function_id}"},{"line_number":118,"context_line":"        resp \u003d conn.image.get(\u0027/images\u0027, params\u003dproperties)"},{"line_number":119,"context_line":"        if resp:"}],"source_content_type":"text/x-python","patch_set":10,"id":"bfb3d3c7_9994838d","line":116,"range":{"start_line":116,"start_character":44,"end_line":116,"end_character":58},"updated":"2019-05-20 11:35:31.000000000","message":"shall we parameterize this? alway devstack?","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":113,"context_line":"    def _get_bitstream_md_from_function_id(self, function_id):"},{"line_number":114,"context_line":"        \"\"\"Get bitstream metadata given a function id.\"\"\""},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        conn \u003d connection.Connection(cloud\u003d\u0027devstack-admin\u0027)"},{"line_number":117,"context_line":"        properties \u003d {\u0027accel:function_id\u0027: function_id}"},{"line_number":118,"context_line":"        resp \u003d conn.image.get(\u0027/images\u0027, params\u003dproperties)"},{"line_number":119,"context_line":"        if resp:"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_9b079219","line":116,"range":{"start_line":116,"start_character":44,"end_line":116,"end_character":58},"in_reply_to":"bfb3d3c7_9994838d","updated":"2019-06-19 04:42:42.000000000","message":"Agreed. Marked this as TODO.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":17813,"name":"wangzhh","email":"wzh_1993@126.com","username":"wangzhh"},"change_message_id":"ff7ce58dac30cde964463eeef313f15c4f851686","unresolved":false,"context_lines":[{"line_number":160,"context_line":"                 db_deployable.uuid, bitstream_id)"},{"line_number":161,"context_line":"        agent \u003d AgentAPI()"},{"line_number":162,"context_line":"        # TODO do this asynchronously"},{"line_number":163,"context_line":"        agent.fpga_program_v2(context, hostname,"},{"line_number":164,"context_line":"                              controlpath_id, bitstream_id,"},{"line_number":165,"context_line":"                              driver_name)"},{"line_number":166,"context_line":"        LOG.info(\u0027Finished programming for host: (%s) deployable (%s)\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"dfbec78f_11053546","line":163,"updated":"2019-05-15 02:34:27.000000000","message":"It\u0027s better not to do program logic in the object layer. Could we move this call to agent\u0027s or conductor\u0027s manager?","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":160,"context_line":"                 db_deployable.uuid, bitstream_id)"},{"line_number":161,"context_line":"        agent \u003d AgentAPI()"},{"line_number":162,"context_line":"        # TODO do this asynchronously"},{"line_number":163,"context_line":"        agent.fpga_program_v2(context, hostname,"},{"line_number":164,"context_line":"                              controlpath_id, bitstream_id,"},{"line_number":165,"context_line":"                              driver_name)"},{"line_number":166,"context_line":"        LOG.info(\u0027Finished programming for host: (%s) deployable (%s)\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fb8cfa7_5b111a53","line":163,"in_reply_to":"bfb3d3c7_39e6b746","updated":"2019-06-19 04:42:42.000000000","message":"Agree too. :) Marked it as TODO.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":27458,"name":"Li Liu","email":"liliueecg@gmail.com","username":"liliu"},"change_message_id":"07c6d73fdccb0b7e02331e0534314805055064df","unresolved":false,"context_lines":[{"line_number":160,"context_line":"                 db_deployable.uuid, bitstream_id)"},{"line_number":161,"context_line":"        agent \u003d AgentAPI()"},{"line_number":162,"context_line":"        # TODO do this asynchronously"},{"line_number":163,"context_line":"        agent.fpga_program_v2(context, hostname,"},{"line_number":164,"context_line":"                              controlpath_id, bitstream_id,"},{"line_number":165,"context_line":"                              driver_name)"},{"line_number":166,"context_line":"        LOG.info(\u0027Finished programming for host: (%s) deployable (%s)\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"bfb3d3c7_39e6b746","line":163,"in_reply_to":"dfbec78f_11053546","updated":"2019-05-20 11:35:31.000000000","message":"Agree+1","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":29745,"name":"Dustin Cowles","email":"cowlesd@gmail.com","username":"dustinc","status":"inactive"},"change_message_id":"b28755e3236bda761c9a10c3557b06007babe475","unresolved":false,"context_lines":[{"line_number":120,"context_line":"            obj_extarq \u003d objects.ExtARQ.get(context, uuid)"},{"line_number":121,"context_line":"            # TODO If ARQ is in bound state, first unbind it."},{"line_number":122,"context_line":"            # TODO Defer deletion to conductor"},{"line_number":123,"context_line":"            obj_extarq.destroy(context )"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"    @classmethod"},{"line_number":126,"context_line":"    def delete_by_instance(cls, context, instance_uuid):"}],"source_content_type":"text/x-python","patch_set":16,"id":"7faddb67_27e63b46","line":123,"range":{"start_line":123,"start_character":38,"end_line":123,"end_character":39},"updated":"2019-07-29 19:33:26.000000000","message":"this is the pep8 failure","commit_id":"f3b4b306b8067084f7f0e99f1954b335bbc353f5"}],"cyborg/tests/unit/api/controllers/v1/_test_accelerators.py":[{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"bf3a68c47fcd96ad8073501e99951855243d7e81","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        self.mock_create.assert_called_once_with(mock.ANY, mock.ANY)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"class TestList(v1_test.APITestV1):"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def setUp(self):"},{"line_number":71,"context_line":"        super(TestList, self).setUp()"}],"source_content_type":"text/x-python","patch_set":9,"id":"dfbec78f_f44caa77","line":68,"range":{"start_line":68,"start_character":6,"end_line":68,"end_character":14},"updated":"2019-06-03 07:21:59.000000000","message":"Why don\u0027t you merge these test functions into one class TestAccelerator, like what has done in test_deployable.py?","commit_id":"92a19909dd7a95deb2fae5b32bf63081d9c18e26"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"b07d65415fd850996fc8051e6c6f01561b604aeb","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        self.mock_create.assert_called_once_with(mock.ANY, mock.ANY)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"class TestList(v1_test.APITestV1):"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def setUp(self):"},{"line_number":71,"context_line":"        super(TestList, self).setUp()"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fb8cfa7_4a3d0fc2","line":68,"range":{"start_line":68,"start_character":6,"end_line":68,"end_character":14},"in_reply_to":"9fb8cfa7_61003e35","updated":"2019-07-01 05:34:54.000000000","message":"Sure, we can talk about it in IRC meeting.","commit_id":"92a19909dd7a95deb2fae5b32bf63081d9c18e26"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"bc7f1c76339cdd0a3975bc15ef84080198e60a40","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        self.mock_create.assert_called_once_with(mock.ANY, mock.ANY)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"class TestList(v1_test.APITestV1):"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def setUp(self):"},{"line_number":71,"context_line":"        super(TestList, self).setUp()"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fb8cfa7_61003e35","line":68,"range":{"start_line":68,"start_character":6,"end_line":68,"end_character":14},"in_reply_to":"9fb8cfa7_9c336cf6","updated":"2019-07-01 03:28:56.000000000","message":"This is v1, and I haven\u0027t modified v1 code. It is not clear to me that it is worth investing in v1 beyond ensuring that it still works. But I am not averse if somebody else wants to improve it.","commit_id":"92a19909dd7a95deb2fae5b32bf63081d9c18e26"},{"author":{"_account_id":25738,"name":"Xinran WANG","email":"xin-ran.wang@intel.com","username":"Xinran"},"change_message_id":"35b4ef2ecfdfe830b8276633803b26e3b8a94407","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        self.mock_create.assert_called_once_with(mock.ANY, mock.ANY)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"class TestList(v1_test.APITestV1):"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def setUp(self):"},{"line_number":71,"context_line":"        super(TestList, self).setUp()"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fb8cfa7_9c336cf6","line":68,"range":{"start_line":68,"start_character":6,"end_line":68,"end_character":14},"in_reply_to":"dfbec78f_f44caa77","updated":"2019-06-28 03:30:21.000000000","message":"Maybe you have missed this comments? Please recheck it :)  \nIt\u0027s better to have the consistent code structure.","commit_id":"92a19909dd7a95deb2fae5b32bf63081d9c18e26"}],"devstack/lib/cyborg":[{"author":{"_account_id":29845,"name":"Ikuo Otani","email":"ikuo.otani.rw@gmail.com","username":"ikuo_o"},"change_message_id":"754c1781369a407be856aac16208de0696d0dbc6","unresolved":false,"context_lines":[{"line_number":120,"context_line":"    get_or_create_service \"cyborg\" \"accelerator\" \"Cyborg Accelerators Service\""},{"line_number":121,"context_line":"    get_or_create_endpoint \"cyborg\" \\"},{"line_number":122,"context_line":"        \"$REGION_NAME\" \\"},{"line_number":123,"context_line":"        \"$CYBORG_API_URL/v2\" \\"},{"line_number":124,"context_line":"        \"$CYBORG_API_URL/v2\" \\"},{"line_number":125,"context_line":"        \"$CYBORG_API_URL/v2\""},{"line_number":126,"context_line":"}"}],"source_content_type":"application/x-shellscript","patch_set":10,"id":"bfb3d3c7_94fa8540","line":123,"range":{"start_line":123,"start_character":7,"end_line":123,"end_character":30},"updated":"2019-05-28 11:38:03.000000000","message":"Can we omit v1 API like this, even though deployable may be dependent on v1 API ?","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"ddf8f15a0db05cb25c377d9181f173a2448f08cc","unresolved":false,"context_lines":[{"line_number":120,"context_line":"    get_or_create_service \"cyborg\" \"accelerator\" \"Cyborg Accelerators Service\""},{"line_number":121,"context_line":"    get_or_create_endpoint \"cyborg\" \\"},{"line_number":122,"context_line":"        \"$REGION_NAME\" \\"},{"line_number":123,"context_line":"        \"$CYBORG_API_URL/v2\" \\"},{"line_number":124,"context_line":"        \"$CYBORG_API_URL/v2\" \\"},{"line_number":125,"context_line":"        \"$CYBORG_API_URL/v2\""},{"line_number":126,"context_line":"}"}],"source_content_type":"application/x-shellscript","patch_set":10,"id":"9fb8cfa7_c0175b51","line":123,"range":{"start_line":123,"start_character":7,"end_line":123,"end_character":30},"in_reply_to":"bfb3d3c7_94fa8540","updated":"2019-06-19 04:42:42.000000000","message":"This means that devstack will install only v2 API. Since devstack is meant only for developers, I believe this is ok. We still need to support v1 (as deprecated but still supported version) in general.","commit_id":"bc25e9b1b2cd4d34b195184d211acd29c6159dc6"}]}
