)]}'
{"kuryr_kubernetes/controller/drivers/utils.py":[{"author":{"_account_id":28396,"name":"Alexey Perevalov","email":"alexey.perevalov@huawei.com","username":"a.perevalov"},"change_message_id":"c0db6e4952aba6ecc903f8e7ffea74b5b308f235","unresolved":false,"context_lines":[{"line_number":409,"context_line":""},{"line_number":410,"context_line":"def update_ports_pci_info(pod):"},{"line_number":411,"context_line":"    state \u003d get_pod_state(pod)"},{"line_number":412,"context_line":"    if state:"},{"line_number":413,"context_line":"        for ifname, vif in state.vifs.items():"},{"line_number":414,"context_line":"            if vif.plugin \u003d\u003d \u0027sriov\u0027:"},{"line_number":415,"context_line":"                node \u003d get_host_id(pod)"}],"source_content_type":"text/x-python","patch_set":3,"id":"5fc1f717_26f14c96","line":412,"range":{"start_line":412,"start_character":6,"end_line":412,"end_character":7},"updated":"2019-03-12 11:05:14.000000000","message":"you can return and trace if state is not valid, it will help to spare ident","commit_id":"4b9c641c85a71c4866b6f5039b297391d1046845"},{"author":{"_account_id":28396,"name":"Alexey Perevalov","email":"alexey.perevalov@huawei.com","username":"a.perevalov"},"change_message_id":"c0db6e4952aba6ecc903f8e7ffea74b5b308f235","unresolved":false,"context_lines":[{"line_number":412,"context_line":"    if state:"},{"line_number":413,"context_line":"        for ifname, vif in state.vifs.items():"},{"line_number":414,"context_line":"            if vif.plugin \u003d\u003d \u0027sriov\u0027:"},{"line_number":415,"context_line":"                node \u003d get_host_id(pod)"},{"line_number":416,"context_line":"                annot_pci_info \u003d get_annot_pci_info(node)"},{"line_number":417,"context_line":"                try:"},{"line_number":418,"context_line":"                    info_for_port \u003d annot_pci_info[vif.id]"}],"source_content_type":"text/x-python","patch_set":3,"id":"5fc1f717_2674ecfd","line":415,"range":{"start_line":415,"start_character":23,"end_line":415,"end_character":34},"updated":"2019-03-12 11:05:14.000000000","message":"looks like get_host_id is not heavy function itself\n(def get_host_id(pod):\n    return pod[\u0027spec\u0027][\u0027nodeName\u0027])\nbut it looks like it persistent per pod, so we will have the same node per all vifs in state. In this case many HTTP request inside cycle is excessive.","commit_id":"4b9c641c85a71c4866b6f5039b297391d1046845"},{"author":{"_account_id":24604,"name":"Danil Golov","email":"d.golov@samsung.com","username":"d.golov"},"change_message_id":"e15d4b04eb070d0c7e67e0cc08cff1078fc86624","unresolved":false,"context_lines":[{"line_number":412,"context_line":"    if state:"},{"line_number":413,"context_line":"        for ifname, vif in state.vifs.items():"},{"line_number":414,"context_line":"            if vif.plugin \u003d\u003d \u0027sriov\u0027:"},{"line_number":415,"context_line":"                node \u003d get_host_id(pod)"},{"line_number":416,"context_line":"                annot_pci_info \u003d get_annot_pci_info(node)"},{"line_number":417,"context_line":"                try:"},{"line_number":418,"context_line":"                    info_for_port \u003d annot_pci_info[vif.id]"}],"source_content_type":"text/x-python","patch_set":3,"id":"5fc1f717_91f87c7b","line":415,"range":{"start_line":415,"start_character":23,"end_line":415,"end_character":34},"in_reply_to":"5fc1f717_2674ecfd","updated":"2019-03-12 12:20:32.000000000","message":"I agree, thanks\nwe can get node and annotations once for all vifs","commit_id":"4b9c641c85a71c4866b6f5039b297391d1046845"},{"author":{"_account_id":28396,"name":"Alexey Perevalov","email":"alexey.perevalov@huawei.com","username":"a.perevalov"},"change_message_id":"c0db6e4952aba6ecc903f8e7ffea74b5b308f235","unresolved":false,"context_lines":[{"line_number":418,"context_line":"                    info_for_port \u003d annot_pci_info[vif.id]"},{"line_number":419,"context_line":"                except KeyError:"},{"line_number":420,"context_line":"                    LOG.info(\"No pci info for port %s\", vif.id)"},{"line_number":421,"context_line":"                except Exception:"},{"line_number":422,"context_line":"                    import traceback"},{"line_number":423,"context_line":"                    traceback.print_exc()"},{"line_number":424,"context_line":"                LOG.info(\"info_for_port \u003d %s\", info_for_port)"}],"source_content_type":"text/x-python","patch_set":3,"id":"5fc1f717_0669b01f","line":421,"range":{"start_line":421,"start_character":0,"end_line":421,"end_character":33},"updated":"2019-03-12 11:05:14.000000000","message":"the same comment as in previous patch","commit_id":"4b9c641c85a71c4866b6f5039b297391d1046845"},{"author":{"_account_id":24604,"name":"Danil Golov","email":"d.golov@samsung.com","username":"d.golov"},"change_message_id":"e15d4b04eb070d0c7e67e0cc08cff1078fc86624","unresolved":false,"context_lines":[{"line_number":418,"context_line":"                    info_for_port \u003d annot_pci_info[vif.id]"},{"line_number":419,"context_line":"                except KeyError:"},{"line_number":420,"context_line":"                    LOG.info(\"No pci info for port %s\", vif.id)"},{"line_number":421,"context_line":"                except Exception:"},{"line_number":422,"context_line":"                    import traceback"},{"line_number":423,"context_line":"                    traceback.print_exc()"},{"line_number":424,"context_line":"                LOG.info(\"info_for_port \u003d %s\", info_for_port)"}],"source_content_type":"text/x-python","patch_set":3,"id":"5fc1f717_71cdd064","line":421,"range":{"start_line":421,"start_character":0,"end_line":421,"end_character":33},"in_reply_to":"5fc1f717_0669b01f","updated":"2019-03-12 12:20:32.000000000","message":"fixed","commit_id":"4b9c641c85a71c4866b6f5039b297391d1046845"},{"author":{"_account_id":28396,"name":"Alexey Perevalov","email":"alexey.perevalov@huawei.com","username":"a.perevalov"},"change_message_id":"c0db6e4952aba6ecc903f8e7ffea74b5b308f235","unresolved":false,"context_lines":[{"line_number":422,"context_line":"                    import traceback"},{"line_number":423,"context_line":"                    traceback.print_exc()"},{"line_number":424,"context_line":"                LOG.info(\"info_for_port \u003d %s\", info_for_port)"},{"line_number":425,"context_line":"                neutron \u003d clients.get_neutron_client()"},{"line_number":426,"context_line":"                neutron.update_port("},{"line_number":427,"context_line":"                    vif.id,"},{"line_number":428,"context_line":"                    {"}],"source_content_type":"text/x-python","patch_set":3,"id":"5fc1f717_a6ce9c2a","line":425,"range":{"start_line":425,"start_character":34,"end_line":425,"end_character":52},"updated":"2019-03-12 11:05:14.000000000","message":"you can obtain reference to neutron_client once","commit_id":"4b9c641c85a71c4866b6f5039b297391d1046845"},{"author":{"_account_id":24604,"name":"Danil Golov","email":"d.golov@samsung.com","username":"d.golov"},"change_message_id":"7f7645a10a74210cede52317492ba6128e587ad9","unresolved":false,"context_lines":[{"line_number":422,"context_line":"                    import traceback"},{"line_number":423,"context_line":"                    traceback.print_exc()"},{"line_number":424,"context_line":"                LOG.info(\"info_for_port \u003d %s\", info_for_port)"},{"line_number":425,"context_line":"                neutron \u003d clients.get_neutron_client()"},{"line_number":426,"context_line":"                neutron.update_port("},{"line_number":427,"context_line":"                    vif.id,"},{"line_number":428,"context_line":"                    {"}],"source_content_type":"text/x-python","patch_set":3,"id":"5fc1f717_ea02103d","line":425,"range":{"start_line":425,"start_character":34,"end_line":425,"end_character":52},"in_reply_to":"5fc1f717_6a8b806d","updated":"2019-03-13 09:12:19.000000000","message":"I see , Alexey\nThanks a lot\nI\u0027ve fixed","commit_id":"4b9c641c85a71c4866b6f5039b297391d1046845"},{"author":{"_account_id":24604,"name":"Danil Golov","email":"d.golov@samsung.com","username":"d.golov"},"change_message_id":"e15d4b04eb070d0c7e67e0cc08cff1078fc86624","unresolved":false,"context_lines":[{"line_number":422,"context_line":"                    import traceback"},{"line_number":423,"context_line":"                    traceback.print_exc()"},{"line_number":424,"context_line":"                LOG.info(\"info_for_port \u003d %s\", info_for_port)"},{"line_number":425,"context_line":"                neutron \u003d clients.get_neutron_client()"},{"line_number":426,"context_line":"                neutron.update_port("},{"line_number":427,"context_line":"                    vif.id,"},{"line_number":428,"context_line":"                    {"}],"source_content_type":"text/x-python","patch_set":3,"id":"5fc1f717_b1afb87b","line":425,"range":{"start_line":425,"start_character":34,"end_line":425,"end_character":52},"in_reply_to":"5fc1f717_a6ce9c2a","updated":"2019-03-12 12:20:32.000000000","message":"as far as I know neutron client was created once (it is a singleton) and each time we do get_neutron_client we just get previously created client","commit_id":"4b9c641c85a71c4866b6f5039b297391d1046845"},{"author":{"_account_id":28396,"name":"Alexey Perevalov","email":"alexey.perevalov@huawei.com","username":"a.perevalov"},"change_message_id":"ffd9960b304393f77b08c910a55f69e86095fd6d","unresolved":false,"context_lines":[{"line_number":422,"context_line":"                    import traceback"},{"line_number":423,"context_line":"                    traceback.print_exc()"},{"line_number":424,"context_line":"                LOG.info(\"info_for_port \u003d %s\", info_for_port)"},{"line_number":425,"context_line":"                neutron \u003d clients.get_neutron_client()"},{"line_number":426,"context_line":"                neutron.update_port("},{"line_number":427,"context_line":"                    vif.id,"},{"line_number":428,"context_line":"                    {"}],"source_content_type":"text/x-python","patch_set":3,"id":"5fc1f717_6a8b806d","line":425,"range":{"start_line":425,"start_character":34,"end_line":425,"end_character":52},"in_reply_to":"5fc1f717_b1afb87b","updated":"2019-03-13 08:15:04.000000000","message":"I meant reference, but not an instance","commit_id":"4b9c641c85a71c4866b6f5039b297391d1046845"},{"author":{"_account_id":28396,"name":"Alexey Perevalov","email":"alexey.perevalov@huawei.com","username":"a.perevalov"},"change_message_id":"c0db6e4952aba6ecc903f8e7ffea74b5b308f235","unresolved":false,"context_lines":[{"line_number":444,"context_line":"    except KeyError:"},{"line_number":445,"context_line":"        pci_info \u003d {}"},{"line_number":446,"context_line":"    except Exception:"},{"line_number":447,"context_line":"        import traceback"},{"line_number":448,"context_line":"        traceback.print_exc()"},{"line_number":449,"context_line":"    return pci_info"}],"source_content_type":"text/x-python","patch_set":3,"id":"5fc1f717_46dfb8d5","line":447,"range":{"start_line":447,"start_character":0,"end_line":447,"end_character":24},"updated":"2019-03-12 11:05:14.000000000","message":"ditto","commit_id":"4b9c641c85a71c4866b6f5039b297391d1046845"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"4bc020d5f859f5c8faa028d099dda3b46eae0d05","unresolved":false,"context_lines":[{"line_number":408,"context_line":""},{"line_number":409,"context_line":""},{"line_number":410,"context_line":"def update_ports_pci_info(pod):"},{"line_number":411,"context_line":"    state \u003d get_pod_state(pod)"},{"line_number":412,"context_line":"    if not state:"},{"line_number":413,"context_line":"        LOG.info(\"State is not valid. Neutron ports will not \""},{"line_number":414,"context_line":"                 \"be updated with pci info\")"}],"source_content_type":"text/x-python","patch_set":8,"id":"5fc1f717_fb683188","line":411,"range":{"start_line":411,"start_character":0,"end_line":411,"end_character":30},"updated":"2019-03-19 15:17:22.000000000","message":"You can pass that, we\u0027re already getting pod state in vif handler.","commit_id":"f7fa3a3cda6ca25cff7a3f0b139a9e9be27d171b"},{"author":{"_account_id":24604,"name":"Danil Golov","email":"d.golov@samsung.com","username":"d.golov"},"change_message_id":"28c884a863f22e66f6c85c41c2e680df40a93fd8","unresolved":false,"context_lines":[{"line_number":408,"context_line":""},{"line_number":409,"context_line":""},{"line_number":410,"context_line":"def update_ports_pci_info(pod):"},{"line_number":411,"context_line":"    state \u003d get_pod_state(pod)"},{"line_number":412,"context_line":"    if not state:"},{"line_number":413,"context_line":"        LOG.info(\"State is not valid. Neutron ports will not \""},{"line_number":414,"context_line":"                 \"be updated with pci info\")"}],"source_content_type":"text/x-python","patch_set":8,"id":"5fc1f717_08033f44","line":411,"range":{"start_line":411,"start_character":0,"end_line":411,"end_character":30},"in_reply_to":"5fc1f717_fb683188","updated":"2019-03-22 07:42:02.000000000","message":"done","commit_id":"f7fa3a3cda6ca25cff7a3f0b139a9e9be27d171b"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"4bc020d5f859f5c8faa028d099dda3b46eae0d05","unresolved":false,"context_lines":[{"line_number":409,"context_line":""},{"line_number":410,"context_line":"def update_ports_pci_info(pod):"},{"line_number":411,"context_line":"    state \u003d get_pod_state(pod)"},{"line_number":412,"context_line":"    if not state:"},{"line_number":413,"context_line":"        LOG.info(\"State is not valid. Neutron ports will not \""},{"line_number":414,"context_line":"                 \"be updated with pci info\")"},{"line_number":415,"context_line":"        return"},{"line_number":416,"context_line":"    node \u003d get_host_id(pod)"},{"line_number":417,"context_line":"    annot_pci_info \u003d get_annot_pci_info(node)"},{"line_number":418,"context_line":"    neutron \u003d clients.get_neutron_client()"}],"source_content_type":"text/x-python","patch_set":8,"id":"5fc1f717_9b2c8d4b","line":415,"range":{"start_line":412,"start_character":0,"end_line":415,"end_character":14},"updated":"2019-03-19 15:17:22.000000000","message":"This will also not be needed if you\u0027ll rearranged this function execution in vif handler.","commit_id":"f7fa3a3cda6ca25cff7a3f0b139a9e9be27d171b"},{"author":{"_account_id":24604,"name":"Danil Golov","email":"d.golov@samsung.com","username":"d.golov"},"change_message_id":"28c884a863f22e66f6c85c41c2e680df40a93fd8","unresolved":false,"context_lines":[{"line_number":409,"context_line":""},{"line_number":410,"context_line":"def update_ports_pci_info(pod):"},{"line_number":411,"context_line":"    state \u003d get_pod_state(pod)"},{"line_number":412,"context_line":"    if not state:"},{"line_number":413,"context_line":"        LOG.info(\"State is not valid. Neutron ports will not \""},{"line_number":414,"context_line":"                 \"be updated with pci info\")"},{"line_number":415,"context_line":"        return"},{"line_number":416,"context_line":"    node \u003d get_host_id(pod)"},{"line_number":417,"context_line":"    annot_pci_info \u003d get_annot_pci_info(node)"},{"line_number":418,"context_line":"    neutron \u003d clients.get_neutron_client()"}],"source_content_type":"text/x-python","patch_set":8,"id":"5fc1f717_28fe3b38","line":415,"range":{"start_line":412,"start_character":0,"end_line":415,"end_character":14},"in_reply_to":"5fc1f717_9b2c8d4b","updated":"2019-03-22 07:42:02.000000000","message":"done","commit_id":"f7fa3a3cda6ca25cff7a3f0b139a9e9be27d171b"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"e8abdc6bf96ebca1925a19d03324f1cee00f7ac7","unresolved":false,"context_lines":[{"line_number":488,"context_line":""},{"line_number":489,"context_line":""},{"line_number":490,"context_line":"def update_port_pci_info(pod, vif):"},{"line_number":491,"context_line":"    LOG.info(\"update_port_pci_info\")"},{"line_number":492,"context_line":"    node \u003d get_host_id(pod)"},{"line_number":493,"context_line":"    annot_port_pci_info \u003d get_port_annot_pci_info(node, vif.id)"},{"line_number":494,"context_line":"    LOG.info(\"annot_port_pci_info \u003d %s\", annot_port_pci_info)"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_1be9cbb5","line":491,"range":{"start_line":491,"start_character":0,"end_line":491,"end_character":36},"updated":"2019-05-15 12:25:29.000000000","message":"This isn\u0027t really useful log for the user, I guess it\u0027s some leftover from debugging? Otherwise it should definitely be on DEBUG log level.","commit_id":"19fa33b49c73bfb8829813585d23433a14f8d186"},{"author":{"_account_id":24604,"name":"Danil Golov","email":"d.golov@samsung.com","username":"d.golov"},"change_message_id":"b3e41e0b7eacd073b11afec7566dccadaf486dfc","unresolved":false,"context_lines":[{"line_number":488,"context_line":""},{"line_number":489,"context_line":""},{"line_number":490,"context_line":"def update_port_pci_info(pod, vif):"},{"line_number":491,"context_line":"    LOG.info(\"update_port_pci_info\")"},{"line_number":492,"context_line":"    node \u003d get_host_id(pod)"},{"line_number":493,"context_line":"    annot_port_pci_info \u003d get_port_annot_pci_info(node, vif.id)"},{"line_number":494,"context_line":"    LOG.info(\"annot_port_pci_info \u003d %s\", annot_port_pci_info)"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_36f38676","line":491,"range":{"start_line":491,"start_character":0,"end_line":491,"end_character":36},"in_reply_to":"dfbec78f_1be9cbb5","updated":"2019-05-15 13:27:41.000000000","message":"Done","commit_id":"19fa33b49c73bfb8829813585d23433a14f8d186"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"e8abdc6bf96ebca1925a19d03324f1cee00f7ac7","unresolved":false,"context_lines":[{"line_number":491,"context_line":"    LOG.info(\"update_port_pci_info\")"},{"line_number":492,"context_line":"    node \u003d get_host_id(pod)"},{"line_number":493,"context_line":"    annot_port_pci_info \u003d get_port_annot_pci_info(node, vif.id)"},{"line_number":494,"context_line":"    LOG.info(\"annot_port_pci_info \u003d %s\", annot_port_pci_info)"},{"line_number":495,"context_line":"    neutron \u003d clients.get_neutron_client()"},{"line_number":496,"context_line":"    neutron.update_port("},{"line_number":497,"context_line":"        vif.id,"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_dbced358","line":494,"range":{"start_line":494,"start_character":0,"end_line":494,"end_character":61},"updated":"2019-05-15 12:25:29.000000000","message":"ditto","commit_id":"19fa33b49c73bfb8829813585d23433a14f8d186"},{"author":{"_account_id":24604,"name":"Danil Golov","email":"d.golov@samsung.com","username":"d.golov"},"change_message_id":"b3e41e0b7eacd073b11afec7566dccadaf486dfc","unresolved":false,"context_lines":[{"line_number":491,"context_line":"    LOG.info(\"update_port_pci_info\")"},{"line_number":492,"context_line":"    node \u003d get_host_id(pod)"},{"line_number":493,"context_line":"    annot_port_pci_info \u003d get_port_annot_pci_info(node, vif.id)"},{"line_number":494,"context_line":"    LOG.info(\"annot_port_pci_info \u003d %s\", annot_port_pci_info)"},{"line_number":495,"context_line":"    neutron \u003d clients.get_neutron_client()"},{"line_number":496,"context_line":"    neutron.update_port("},{"line_number":497,"context_line":"        vif.id,"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_56f63a65","line":494,"range":{"start_line":494,"start_character":0,"end_line":494,"end_character":61},"in_reply_to":"dfbec78f_dbced358","updated":"2019-05-15 13:27:41.000000000","message":"Done","commit_id":"19fa33b49c73bfb8829813585d23433a14f8d186"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"e8abdc6bf96ebca1925a19d03324f1cee00f7ac7","unresolved":false,"context_lines":[{"line_number":503,"context_line":""},{"line_number":504,"context_line":""},{"line_number":505,"context_line":"def get_port_annot_pci_info(nodename, neutron_port):"},{"line_number":506,"context_line":"    LOG.info(\"get_port_annot_pci_info\")"},{"line_number":507,"context_line":"    k8s \u003d clients.get_kubernetes_client()"},{"line_number":508,"context_line":"    annot_name \u003d constants.K8S_ANNOTATION_NODE_PCI_DEVICE_INFO"},{"line_number":509,"context_line":"    annot_name \u003d annot_name + \u0027-\u0027 + neutron_port"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_3b092f95","line":506,"range":{"start_line":506,"start_character":0,"end_line":506,"end_character":39},"updated":"2019-05-15 12:25:29.000000000","message":"ditto","commit_id":"19fa33b49c73bfb8829813585d23433a14f8d186"},{"author":{"_account_id":24604,"name":"Danil Golov","email":"d.golov@samsung.com","username":"d.golov"},"change_message_id":"b3e41e0b7eacd073b11afec7566dccadaf486dfc","unresolved":false,"context_lines":[{"line_number":503,"context_line":""},{"line_number":504,"context_line":""},{"line_number":505,"context_line":"def get_port_annot_pci_info(nodename, neutron_port):"},{"line_number":506,"context_line":"    LOG.info(\"get_port_annot_pci_info\")"},{"line_number":507,"context_line":"    k8s \u003d clients.get_kubernetes_client()"},{"line_number":508,"context_line":"    annot_name \u003d constants.K8S_ANNOTATION_NODE_PCI_DEVICE_INFO"},{"line_number":509,"context_line":"    annot_name \u003d annot_name + \u0027-\u0027 + neutron_port"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_f6e88e7c","line":506,"range":{"start_line":506,"start_character":0,"end_line":506,"end_character":39},"in_reply_to":"dfbec78f_3b092f95","updated":"2019-05-15 13:27:41.000000000","message":"Done","commit_id":"19fa33b49c73bfb8829813585d23433a14f8d186"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"e8abdc6bf96ebca1925a19d03324f1cee00f7ac7","unresolved":false,"context_lines":[{"line_number":507,"context_line":"    k8s \u003d clients.get_kubernetes_client()"},{"line_number":508,"context_line":"    annot_name \u003d constants.K8S_ANNOTATION_NODE_PCI_DEVICE_INFO"},{"line_number":509,"context_line":"    annot_name \u003d annot_name + \u0027-\u0027 + neutron_port"},{"line_number":510,"context_line":"    LOG.info(\"annot_name \u003d %s\", annot_name)"},{"line_number":511,"context_line":""},{"line_number":512,"context_line":"    node_info \u003d k8s.get(\u0027/api/v1/nodes/{}\u0027.format(nodename))"},{"line_number":513,"context_line":"    annotations \u003d node_info[\u0027metadata\u0027][\u0027annotations\u0027]"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_fbfe3769","line":510,"range":{"start_line":510,"start_character":0,"end_line":510,"end_character":43},"updated":"2019-05-15 12:25:29.000000000","message":"ditto","commit_id":"19fa33b49c73bfb8829813585d23433a14f8d186"},{"author":{"_account_id":24604,"name":"Danil Golov","email":"d.golov@samsung.com","username":"d.golov"},"change_message_id":"b3e41e0b7eacd073b11afec7566dccadaf486dfc","unresolved":false,"context_lines":[{"line_number":507,"context_line":"    k8s \u003d clients.get_kubernetes_client()"},{"line_number":508,"context_line":"    annot_name \u003d constants.K8S_ANNOTATION_NODE_PCI_DEVICE_INFO"},{"line_number":509,"context_line":"    annot_name \u003d annot_name + \u0027-\u0027 + neutron_port"},{"line_number":510,"context_line":"    LOG.info(\"annot_name \u003d %s\", annot_name)"},{"line_number":511,"context_line":""},{"line_number":512,"context_line":"    node_info \u003d k8s.get(\u0027/api/v1/nodes/{}\u0027.format(nodename))"},{"line_number":513,"context_line":"    annotations \u003d node_info[\u0027metadata\u0027][\u0027annotations\u0027]"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_16ec428d","line":510,"range":{"start_line":510,"start_character":0,"end_line":510,"end_character":43},"in_reply_to":"dfbec78f_fbfe3769","updated":"2019-05-15 13:27:41.000000000","message":"Done","commit_id":"19fa33b49c73bfb8829813585d23433a14f8d186"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"a9e196a3dc1a88207d0f6997a70e61e4d0e5696f","unresolved":false,"context_lines":[{"line_number":497,"context_line":"        vif.id,"},{"line_number":498,"context_line":"        {"},{"line_number":499,"context_line":"            \"port\": {"},{"line_number":500,"context_line":"                \u0027binding:profile\u0027: annot_port_pci_info"},{"line_number":501,"context_line":"            }"},{"line_number":502,"context_line":"        })"},{"line_number":503,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"dfbec78f_ce391cf2","line":500,"range":{"start_line":500,"start_character":16,"end_line":500,"end_character":54},"updated":"2019-05-16 11:24:31.000000000","message":"I believe this requires admin rights. There are other parts on kuryr already requiring this for the baremetal case (not for the nested one), so perhaps worth to add documentation about the need to run kuryr with admin credentials if this is to be used","commit_id":"cce3d596f30c7c0a93d9b78fe54d0a517a0ae062"},{"author":{"_account_id":24604,"name":"Danil Golov","email":"d.golov@samsung.com","username":"d.golov"},"change_message_id":"5ff1a44d841628949b478679d24545f34a28fadd","unresolved":false,"context_lines":[{"line_number":497,"context_line":"        vif.id,"},{"line_number":498,"context_line":"        {"},{"line_number":499,"context_line":"            \"port\": {"},{"line_number":500,"context_line":"                \u0027binding:profile\u0027: annot_port_pci_info"},{"line_number":501,"context_line":"            }"},{"line_number":502,"context_line":"        })"},{"line_number":503,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"bfb3d3c7_9a048bc8","line":500,"range":{"start_line":500,"start_character":16,"end_line":500,"end_character":54},"in_reply_to":"dfbec78f_ce391cf2","updated":"2019-05-17 14:44:32.000000000","message":"Done","commit_id":"cce3d596f30c7c0a93d9b78fe54d0a517a0ae062"}],"kuryr_kubernetes/controller/handlers/vif.py":[{"author":{"_account_id":28396,"name":"Alexey Perevalov","email":"alexey.perevalov@huawei.com","username":"a.perevalov"},"change_message_id":"c0db6e4952aba6ecc903f8e7ffea74b5b308f235","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def on_present(self, pod):"},{"line_number":80,"context_line":"        if pod[\u0027status\u0027][\u0027phase\u0027] \u003d\u003d constants.K8S_POD_STATUS_RUNNING:"},{"line_number":81,"context_line":"            driver_utils.update_ports_pci_info(pod)"},{"line_number":82,"context_line":"        if driver_utils.is_host_network(pod) or not self._is_pending_node(pod):"},{"line_number":83,"context_line":"            # REVISIT(ivc): consider an additional configurable check that"},{"line_number":84,"context_line":"            # would allow skipping pods to enable heterogeneous environments"}],"source_content_type":"text/x-python","patch_set":3,"id":"5fc1f717_66051446","line":81,"range":{"start_line":81,"start_character":12,"end_line":81,"end_character":24},"updated":"2019-03-12 11:05:14.000000000","message":"how does it work for none direct ports?","commit_id":"4b9c641c85a71c4866b6f5039b297391d1046845"},{"author":{"_account_id":24604,"name":"Danil Golov","email":"d.golov@samsung.com","username":"d.golov"},"change_message_id":"e15d4b04eb070d0c7e67e0cc08cff1078fc86624","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def on_present(self, pod):"},{"line_number":80,"context_line":"        if pod[\u0027status\u0027][\u0027phase\u0027] \u003d\u003d constants.K8S_POD_STATUS_RUNNING:"},{"line_number":81,"context_line":"            driver_utils.update_ports_pci_info(pod)"},{"line_number":82,"context_line":"        if driver_utils.is_host_network(pod) or not self._is_pending_node(pod):"},{"line_number":83,"context_line":"            # REVISIT(ivc): consider an additional configurable check that"},{"line_number":84,"context_line":"            # would allow skipping pods to enable heterogeneous environments"}],"source_content_type":"text/x-python","patch_set":3,"id":"5fc1f717_d1160456","line":81,"range":{"start_line":81,"start_character":12,"end_line":81,"end_character":24},"in_reply_to":"5fc1f717_66051446","updated":"2019-03-12 12:20:32.000000000","message":"if pod doesn\u0027t contain any sriov vifs then nothing will happen.\nneutron ports related to common (non sriov) vifs will not be updated with pci info\nall checks are encapsulated in update_ports_pci_info()","commit_id":"4b9c641c85a71c4866b6f5039b297391d1046845"},{"author":{"_account_id":28396,"name":"Alexey Perevalov","email":"alexey.perevalov@huawei.com","username":"a.perevalov"},"change_message_id":"ffd9960b304393f77b08c910a55f69e86095fd6d","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def on_present(self, pod):"},{"line_number":80,"context_line":"        if pod[\u0027status\u0027][\u0027phase\u0027] \u003d\u003d constants.K8S_POD_STATUS_RUNNING:"},{"line_number":81,"context_line":"            driver_utils.update_ports_pci_info(pod)"},{"line_number":82,"context_line":"        if driver_utils.is_host_network(pod) or not self._is_pending_node(pod):"},{"line_number":83,"context_line":"            # REVISIT(ivc): consider an additional configurable check that"},{"line_number":84,"context_line":"            # would allow skipping pods to enable heterogeneous environments"}],"source_content_type":"text/x-python","patch_set":3,"id":"5fc1f717_eaad30e9","line":81,"range":{"start_line":81,"start_character":12,"end_line":81,"end_character":24},"in_reply_to":"5fc1f717_d1160456","updated":"2019-03-13 08:15:04.000000000","message":"Done","commit_id":"4b9c641c85a71c4866b6f5039b297391d1046845"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"4bc020d5f859f5c8faa028d099dda3b46eae0d05","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        self._drv_svc_sg \u003d drivers.ServiceSecurityGroupsDriver.get_instance()"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def on_present(self, pod):"},{"line_number":80,"context_line":"        if pod[\u0027status\u0027][\u0027phase\u0027] \u003d\u003d constants.K8S_POD_STATUS_RUNNING:"},{"line_number":81,"context_line":"            driver_utils.update_ports_pci_info(pod)"},{"line_number":82,"context_line":"        if driver_utils.is_host_network(pod) or not self._is_pending_node(pod):"},{"line_number":83,"context_line":"            # REVISIT(ivc): consider an additional configurable check that"},{"line_number":84,"context_line":"            # would allow skipping pods to enable heterogeneous environments"}],"source_content_type":"text/x-python","patch_set":8,"id":"5fc1f717_1b497d31","line":81,"range":{"start_line":80,"start_character":0,"end_line":81,"end_character":51},"updated":"2019-03-19 15:17:22.000000000","message":"Does this apply to pods with hots networking as well? If not please put it under the if clause below.","commit_id":"f7fa3a3cda6ca25cff7a3f0b139a9e9be27d171b"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"261dce7186fbf7f65342077aa250649f1080c3a3","unresolved":false,"context_lines":[{"line_number":120,"context_line":"                                                   security_groups)"},{"line_number":121,"context_line":"        else:"},{"line_number":122,"context_line":"            if pod[\u0027status\u0027][\u0027phase\u0027] \u003d\u003d constants.K8S_POD_STATUS_RUNNING:"},{"line_number":123,"context_line":"                driver_utils.update_ports_pci_info(pod, state)"},{"line_number":124,"context_line":"            changed \u003d False"},{"line_number":125,"context_line":"            for ifname, vif in state.vifs.items():"},{"line_number":126,"context_line":"                if not vif.active:"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_f20bd48a","line":123,"range":{"start_line":123,"start_character":16,"end_line":123,"end_character":62},"updated":"2019-03-26 11:01:38.000000000","message":"we are already iterating over state.vifs.items on line 125, perhaps worth to just call there to update_ports_pci_info for vif.plugin \u003d\u003d sriov (and modify that function accordingly","commit_id":"44009b3309cec2157cbabf676ae9753503611fea"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"07833482351a20075568bf5fd009da46b18ef4d2","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        self._drv_svc_sg \u003d drivers.ServiceSecurityGroupsDriver.get_instance()"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def on_present(self, pod):"},{"line_number":80,"context_line":"        state \u003d driver_utils.get_pod_state(pod)"},{"line_number":81,"context_line":"        if state and ("},{"line_number":82,"context_line":"                pod[\u0027status\u0027][\u0027phase\u0027] \u003d\u003d constants.K8S_POD_STATUS_RUNNING):"},{"line_number":83,"context_line":"            driver_utils.update_ports_pci_info(pod, state)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        if driver_utils.is_host_network(pod) or not self._is_pending_node(pod):"},{"line_number":86,"context_line":"            # REVISIT(ivc): consider an additional configurable check that"}],"source_content_type":"text/x-python","patch_set":13,"id":"3fce034c_bdde84d7","line":83,"range":{"start_line":80,"start_character":0,"end_line":83,"end_character":58},"updated":"2019-04-19 10:35:16.000000000","message":"Looks like I missed that in my previous review. Pods on hostNetworking or in pending state will not have annotation, so no need to place this here. It should be below the if clause on line 85.","commit_id":"2d63350f833145fd902e38eef6bb88ed09c34ed7"},{"author":{"_account_id":24604,"name":"Danil Golov","email":"d.golov@samsung.com","username":"d.golov"},"change_message_id":"4c6d64531847594116dc68170799e6f4baae9f00","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        self._drv_svc_sg \u003d drivers.ServiceSecurityGroupsDriver.get_instance()"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def on_present(self, pod):"},{"line_number":80,"context_line":"        state \u003d driver_utils.get_pod_state(pod)"},{"line_number":81,"context_line":"        if state and ("},{"line_number":82,"context_line":"                pod[\u0027status\u0027][\u0027phase\u0027] \u003d\u003d constants.K8S_POD_STATUS_RUNNING):"},{"line_number":83,"context_line":"            driver_utils.update_ports_pci_info(pod, state)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        if driver_utils.is_host_network(pod) or not self._is_pending_node(pod):"},{"line_number":86,"context_line":"            # REVISIT(ivc): consider an additional configurable check that"}],"source_content_type":"text/x-python","patch_set":13,"id":"ffb9cba7_dbc52c5d","line":83,"range":{"start_line":80,"start_character":0,"end_line":83,"end_character":58},"in_reply_to":"3fce034c_bdde84d7","updated":"2019-04-22 07:04:53.000000000","message":"I think if we place this below the if clause on line 85 we will have to get annotations there to make update_ports_pci_info(pod, state) work","commit_id":"2d63350f833145fd902e38eef6bb88ed09c34ed7"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"b8eb69d54a5656e5536913a0879b52e55098e147","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def on_present(self, pod):"},{"line_number":80,"context_line":"        state \u003d driver_utils.get_pod_state(pod)"},{"line_number":81,"context_line":"        if state and ("},{"line_number":82,"context_line":"                pod[\u0027status\u0027][\u0027phase\u0027] \u003d\u003d constants.K8S_POD_STATUS_RUNNING):"},{"line_number":83,"context_line":"            driver_utils.update_ports_pci_info(pod, state)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        if driver_utils.is_host_network(pod) or not self._is_pending_node(pod):"},{"line_number":86,"context_line":"            # REVISIT(ivc): consider an additional configurable check that"}],"source_content_type":"text/x-python","patch_set":16,"id":"ffb9cba7_380a4b26","line":83,"range":{"start_line":81,"start_character":0,"end_line":83,"end_character":58},"updated":"2019-04-22 09:43:54.000000000","message":"this is state is already included at else on line 125, perhaps worth to move this there, and only call to update_ports_pci_info if vif.plugin is sriov, as it is already iterating on the vifs items","commit_id":"29a4f50915b331ea85b7c1241cf768369e438b88"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"d0484e1748ce2a71532a58e0129d79d8c175584e","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def on_present(self, pod):"},{"line_number":80,"context_line":"        state \u003d driver_utils.get_pod_state(pod)"},{"line_number":81,"context_line":"        if state and ("},{"line_number":82,"context_line":"                pod[\u0027status\u0027][\u0027phase\u0027] \u003d\u003d constants.K8S_POD_STATUS_RUNNING):"},{"line_number":83,"context_line":"            driver_utils.update_ports_pci_info(pod, state)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        if driver_utils.is_host_network(pod) or not self._is_pending_node(pod):"},{"line_number":86,"context_line":"            # REVISIT(ivc): consider an additional configurable check that"}],"source_content_type":"text/x-python","patch_set":16,"id":"ffb9cba7_c1677625","line":83,"range":{"start_line":81,"start_character":0,"end_line":83,"end_character":58},"in_reply_to":"ffb9cba7_21cbf253","updated":"2019-04-22 12:58:56.000000000","message":"yes, but the container should not go to running before it is actually connected to the network either. Probably the proper order is:\n- create port\n- once the pod is scheduled to a node, update binding:profile on the associated port\n- once the port becomes Active update pod annotation with that information so that the kuryr-cni sees it and returns and the pod transitions to running","commit_id":"29a4f50915b331ea85b7c1241cf768369e438b88"},{"author":{"_account_id":24604,"name":"Danil Golov","email":"d.golov@samsung.com","username":"d.golov"},"change_message_id":"a026685f2ed538cc9a3282eac73aa46fb0fbaf3a","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def on_present(self, pod):"},{"line_number":80,"context_line":"        state \u003d driver_utils.get_pod_state(pod)"},{"line_number":81,"context_line":"        if state and ("},{"line_number":82,"context_line":"                pod[\u0027status\u0027][\u0027phase\u0027] \u003d\u003d constants.K8S_POD_STATUS_RUNNING):"},{"line_number":83,"context_line":"            driver_utils.update_ports_pci_info(pod, state)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        if driver_utils.is_host_network(pod) or not self._is_pending_node(pod):"},{"line_number":86,"context_line":"            # REVISIT(ivc): consider an additional configurable check that"}],"source_content_type":"text/x-python","patch_set":16,"id":"ffb9cba7_9b833157","line":83,"range":{"start_line":81,"start_character":0,"end_line":83,"end_character":58},"in_reply_to":"ffb9cba7_380a4b26","updated":"2019-04-22 10:01:06.000000000","message":"yeah, I\u0027ve thought about it. But problem is that under \u0027else\u0027 clause pod will never be in Running state. Just because if it is in Running state, self._is_pending_node(pod) returns False, and we will get return from on_present()","commit_id":"29a4f50915b331ea85b7c1241cf768369e438b88"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"d46d226c9c72161d0ea1eb267a6e61d34de72fd6","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def on_present(self, pod):"},{"line_number":80,"context_line":"        state \u003d driver_utils.get_pod_state(pod)"},{"line_number":81,"context_line":"        if state and ("},{"line_number":82,"context_line":"                pod[\u0027status\u0027][\u0027phase\u0027] \u003d\u003d constants.K8S_POD_STATUS_RUNNING):"},{"line_number":83,"context_line":"            driver_utils.update_ports_pci_info(pod, state)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        if driver_utils.is_host_network(pod) or not self._is_pending_node(pod):"},{"line_number":86,"context_line":"            # REVISIT(ivc): consider an additional configurable check that"}],"source_content_type":"text/x-python","patch_set":16,"id":"ffb9cba7_6d21cab4","line":83,"range":{"start_line":81,"start_character":0,"end_line":83,"end_character":58},"in_reply_to":"ffb9cba7_4ccbbda4","updated":"2019-04-23 08:39:28.000000000","message":"for the \u0027normal\u0027 cni the process is similar and I believe the sriov should adapt to it too. You still configure the networking on the cni before setting the container to running (and you can do the annotations) but the process itself won\u0027t finish until the port is active:\nhttps://github.com/openstack/kuryr-kubernetes/blob/master/kuryr_kubernetes/cni/plugins/k8s_cni_registry.py#L74-L80\n\nNote that is after connect function being called, which I assume is where you update the annotations that the controller will need to check","commit_id":"29a4f50915b331ea85b7c1241cf768369e438b88"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"27852006238c3f0218264a26fbdc97248175bec1","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def on_present(self, pod):"},{"line_number":80,"context_line":"        state \u003d driver_utils.get_pod_state(pod)"},{"line_number":81,"context_line":"        if state and ("},{"line_number":82,"context_line":"                pod[\u0027status\u0027][\u0027phase\u0027] \u003d\u003d constants.K8S_POD_STATUS_RUNNING):"},{"line_number":83,"context_line":"            driver_utils.update_ports_pci_info(pod, state)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        if driver_utils.is_host_network(pod) or not self._is_pending_node(pod):"},{"line_number":86,"context_line":"            # REVISIT(ivc): consider an additional configurable check that"}],"source_content_type":"text/x-python","patch_set":16,"id":"ffb9cba7_95d3ce38","line":83,"range":{"start_line":81,"start_character":0,"end_line":83,"end_character":58},"in_reply_to":"ffb9cba7_5736cc05","updated":"2019-04-24 06:19:47.000000000","message":"yep! that will follow the same flow as the normal vif/pod activation (with the addition that the cni is also annotating information on the pod/node for sriov)\n\nThat said, I don\u0027t have deep knowledge of SRIOV, so, please let me know if those steps won\u0027t work for you. Perhaps we can use the kuryr irc channel for discussing it if that is the case","commit_id":"29a4f50915b331ea85b7c1241cf768369e438b88"},{"author":{"_account_id":24604,"name":"Danil Golov","email":"d.golov@samsung.com","username":"d.golov"},"change_message_id":"64fd8968fd88211efdd8513aff9ef619b79b3eb8","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def on_present(self, pod):"},{"line_number":80,"context_line":"        state \u003d driver_utils.get_pod_state(pod)"},{"line_number":81,"context_line":"        if state and ("},{"line_number":82,"context_line":"                pod[\u0027status\u0027][\u0027phase\u0027] \u003d\u003d constants.K8S_POD_STATUS_RUNNING):"},{"line_number":83,"context_line":"            driver_utils.update_ports_pci_info(pod, state)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        if driver_utils.is_host_network(pod) or not self._is_pending_node(pod):"},{"line_number":86,"context_line":"            # REVISIT(ivc): consider an additional configurable check that"}],"source_content_type":"text/x-python","patch_set":16,"id":"ffb9cba7_bbd71524","line":83,"range":{"start_line":81,"start_character":0,"end_line":83,"end_character":58},"in_reply_to":"ffb9cba7_5b27f965","updated":"2019-04-22 10:23:35.000000000","message":"I think it is right behavior to make appropriate neutron ports active only when Pod is in Running state?\nIf no, share you ideas, please","commit_id":"29a4f50915b331ea85b7c1241cf768369e438b88"},{"author":{"_account_id":24604,"name":"Danil Golov","email":"d.golov@samsung.com","username":"d.golov"},"change_message_id":"4ccdd49403f4f0de3ca0e9fac93ae8645cf56d82","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def on_present(self, pod):"},{"line_number":80,"context_line":"        state \u003d driver_utils.get_pod_state(pod)"},{"line_number":81,"context_line":"        if state and ("},{"line_number":82,"context_line":"                pod[\u0027status\u0027][\u0027phase\u0027] \u003d\u003d constants.K8S_POD_STATUS_RUNNING):"},{"line_number":83,"context_line":"            driver_utils.update_ports_pci_info(pod, state)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        if driver_utils.is_host_network(pod) or not self._is_pending_node(pod):"},{"line_number":86,"context_line":"            # REVISIT(ivc): consider an additional configurable check that"}],"source_content_type":"text/x-python","patch_set":16,"id":"ffb9cba7_c1bafddc","line":83,"range":{"start_line":81,"start_character":0,"end_line":83,"end_character":58},"in_reply_to":"ffb9cba7_6d21cab4","updated":"2019-04-23 11:15:30.000000000","message":"Are you agree with following?\nThis code (that now is on controller side) should be work on CNI side? It is not a problem with one remark: we should add an access to get a neutron client on CNI side.\nDo I understand you right?","commit_id":"29a4f50915b331ea85b7c1241cf768369e438b88"},{"author":{"_account_id":24604,"name":"Danil Golov","email":"d.golov@samsung.com","username":"d.golov"},"change_message_id":"3c7e17384def20437bb9e7f1b646ff9b463cb2d5","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def on_present(self, pod):"},{"line_number":80,"context_line":"        state \u003d driver_utils.get_pod_state(pod)"},{"line_number":81,"context_line":"        if state and ("},{"line_number":82,"context_line":"                pod[\u0027status\u0027][\u0027phase\u0027] \u003d\u003d constants.K8S_POD_STATUS_RUNNING):"},{"line_number":83,"context_line":"            driver_utils.update_ports_pci_info(pod, state)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        if driver_utils.is_host_network(pod) or not self._is_pending_node(pod):"},{"line_number":86,"context_line":"            # REVISIT(ivc): consider an additional configurable check that"}],"source_content_type":"text/x-python","patch_set":16,"id":"ffb9cba7_5736cc05","line":83,"range":{"start_line":81,"start_character":0,"end_line":83,"end_character":58},"in_reply_to":"ffb9cba7_72e3e106","updated":"2019-04-23 13:55:42.000000000","message":"hm, let me summarize everything please:\n\n1. We can put this port update under \u0027else\u0027 at line 125.\n2. Thus if binding on CNI side was succeed then node has annotation about pci device.\n3. We can update neutron port with this pci information and make vif active. So that CNI then will discover vifs been active and transfer pod to Running state.\nDo I understand correctly?","commit_id":"29a4f50915b331ea85b7c1241cf768369e438b88"},{"author":{"_account_id":24604,"name":"Danil Golov","email":"d.golov@samsung.com","username":"d.golov"},"change_message_id":"c0fc428e97ff7317ffae3e41203a7c74cdc48025","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def on_present(self, pod):"},{"line_number":80,"context_line":"        state \u003d driver_utils.get_pod_state(pod)"},{"line_number":81,"context_line":"        if state and ("},{"line_number":82,"context_line":"                pod[\u0027status\u0027][\u0027phase\u0027] \u003d\u003d constants.K8S_POD_STATUS_RUNNING):"},{"line_number":83,"context_line":"            driver_utils.update_ports_pci_info(pod, state)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        if driver_utils.is_host_network(pod) or not self._is_pending_node(pod):"},{"line_number":86,"context_line":"            # REVISIT(ivc): consider an additional configurable check that"}],"source_content_type":"text/x-python","patch_set":16,"id":"ffb9cba7_21cbf253","line":83,"range":{"start_line":81,"start_character":0,"end_line":83,"end_character":58},"in_reply_to":"ffb9cba7_7e12ebb3","updated":"2019-04-22 12:44:11.000000000","message":"in our case port will never become active until it gets \u0027binding:profile\u0027 field.\nAnd it looks that kuryr-k8s controller exactly should update neutron ports with this information","commit_id":"29a4f50915b331ea85b7c1241cf768369e438b88"},{"author":{"_account_id":24604,"name":"Danil Golov","email":"d.golov@samsung.com","username":"d.golov"},"change_message_id":"b3141350624543ed25a7ae4fd379545a1de0257b","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def on_present(self, pod):"},{"line_number":80,"context_line":"        state \u003d driver_utils.get_pod_state(pod)"},{"line_number":81,"context_line":"        if state and ("},{"line_number":82,"context_line":"                pod[\u0027status\u0027][\u0027phase\u0027] \u003d\u003d constants.K8S_POD_STATUS_RUNNING):"},{"line_number":83,"context_line":"            driver_utils.update_ports_pci_info(pod, state)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        if driver_utils.is_host_network(pod) or not self._is_pending_node(pod):"},{"line_number":86,"context_line":"            # REVISIT(ivc): consider an additional configurable check that"}],"source_content_type":"text/x-python","patch_set":16,"id":"ffb9cba7_d8c5fd3d","line":83,"range":{"start_line":81,"start_character":0,"end_line":83,"end_character":58},"in_reply_to":"ffb9cba7_95d3ce38","updated":"2019-04-24 07:19:21.000000000","message":"ok, I see\nthanks a lot\nwill change this patch soon","commit_id":"29a4f50915b331ea85b7c1241cf768369e438b88"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"b34c8d14d1a7ec7856b996e4567ccf4e8f0e7147","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def on_present(self, pod):"},{"line_number":80,"context_line":"        state \u003d driver_utils.get_pod_state(pod)"},{"line_number":81,"context_line":"        if state and ("},{"line_number":82,"context_line":"                pod[\u0027status\u0027][\u0027phase\u0027] \u003d\u003d constants.K8S_POD_STATUS_RUNNING):"},{"line_number":83,"context_line":"            driver_utils.update_ports_pci_info(pod, state)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        if driver_utils.is_host_network(pod) or not self._is_pending_node(pod):"},{"line_number":86,"context_line":"            # REVISIT(ivc): consider an additional configurable check that"}],"source_content_type":"text/x-python","patch_set":16,"id":"ffb9cba7_5b27f965","line":83,"range":{"start_line":81,"start_character":0,"end_line":83,"end_character":58},"in_reply_to":"ffb9cba7_9b833157","updated":"2019-04-22 10:20:31.000000000","message":"why you need the pod to be running?","commit_id":"29a4f50915b331ea85b7c1241cf768369e438b88"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"5293fc30a94a17c34c8de897fa9ab06ee2e986cb","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def on_present(self, pod):"},{"line_number":80,"context_line":"        state \u003d driver_utils.get_pod_state(pod)"},{"line_number":81,"context_line":"        if state and ("},{"line_number":82,"context_line":"                pod[\u0027status\u0027][\u0027phase\u0027] \u003d\u003d constants.K8S_POD_STATUS_RUNNING):"},{"line_number":83,"context_line":"            driver_utils.update_ports_pci_info(pod, state)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        if driver_utils.is_host_network(pod) or not self._is_pending_node(pod):"},{"line_number":86,"context_line":"            # REVISIT(ivc): consider an additional configurable check that"}],"source_content_type":"text/x-python","patch_set":16,"id":"ffb9cba7_7e12ebb3","line":83,"range":{"start_line":81,"start_character":0,"end_line":83,"end_character":58},"in_reply_to":"ffb9cba7_bbd71524","updated":"2019-04-22 11:45:53.000000000","message":"for normal vif/ports is the other way around. The pod will be waiting until the port is active, and once the kuryr-controller notifies (though pod annotations) that the port is active, the cni exits and the pod transitions to running","commit_id":"29a4f50915b331ea85b7c1241cf768369e438b88"},{"author":{"_account_id":24604,"name":"Danil Golov","email":"d.golov@samsung.com","username":"d.golov"},"change_message_id":"536a0ee9c7a43449c79a6a30ca5634b1e8939aa3","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def on_present(self, pod):"},{"line_number":80,"context_line":"        state \u003d driver_utils.get_pod_state(pod)"},{"line_number":81,"context_line":"        if state and ("},{"line_number":82,"context_line":"                pod[\u0027status\u0027][\u0027phase\u0027] \u003d\u003d constants.K8S_POD_STATUS_RUNNING):"},{"line_number":83,"context_line":"            driver_utils.update_ports_pci_info(pod, state)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        if driver_utils.is_host_network(pod) or not self._is_pending_node(pod):"},{"line_number":86,"context_line":"            # REVISIT(ivc): consider an additional configurable check that"}],"source_content_type":"text/x-python","patch_set":16,"id":"ffb9cba7_4ccbbda4","line":83,"range":{"start_line":81,"start_character":0,"end_line":83,"end_character":58},"in_reply_to":"ffb9cba7_c1677625","updated":"2019-04-22 13:21:41.000000000","message":"well, I will describe the whole process:\n* There is a patch https://review.opendev.org/#/c/642703/14 that created annotations about used devices. It works the following way: once we get appropriate vf for pod we create annotations about this used device to use it then on controller side\n* On controller side we wait until CNI completes it work and then after pod becomes Running we will update binding:profile field in used neutron ports.\n\nActually we can not update ports with binding:profile information unil CNI finishes its work just because this information is a result of CNI work. There exactly we get an information about used devices.","commit_id":"29a4f50915b331ea85b7c1241cf768369e438b88"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"1b204be585d127f89c863fcd1898c7dbff5c071a","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def on_present(self, pod):"},{"line_number":80,"context_line":"        state \u003d driver_utils.get_pod_state(pod)"},{"line_number":81,"context_line":"        if state and ("},{"line_number":82,"context_line":"                pod[\u0027status\u0027][\u0027phase\u0027] \u003d\u003d constants.K8S_POD_STATUS_RUNNING):"},{"line_number":83,"context_line":"            driver_utils.update_ports_pci_info(pod, state)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        if driver_utils.is_host_network(pod) or not self._is_pending_node(pod):"},{"line_number":86,"context_line":"            # REVISIT(ivc): consider an additional configurable check that"}],"source_content_type":"text/x-python","patch_set":16,"id":"ffb9cba7_72e3e106","line":83,"range":{"start_line":81,"start_character":0,"end_line":83,"end_character":58},"in_reply_to":"ffb9cba7_c1bafddc","updated":"2019-04-23 12:29:24.000000000","message":"No, cni should not have access to the neutron API. kuryr-controller is the one handling ports creation and annotation of port status on the pod. Kuryr cni is checking those annotations to know when the port is ready to move the container to running. But kuryr-cni can do the network plumbing before the port gets to active.\n\nMy whole point here is that you don\u0027t need to ensure the pod is running here. You should handle that on the else at line 125, where you can do the annotations (if the cni has already done its own ones), perform the port updates and set the port to active so that the kuryr-cni can complete and move the pod to running","commit_id":"29a4f50915b331ea85b7c1241cf768369e438b88"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"bdd69b15986dfa611e391565c36cec03454dd6f6","unresolved":false,"context_lines":[{"line_number":119,"context_line":"                                                   project_id,"},{"line_number":120,"context_line":"                                                   security_groups)"},{"line_number":121,"context_line":"        else:"},{"line_number":122,"context_line":"            driver_utils.update_ports_pci_info(pod, state)"},{"line_number":123,"context_line":"            changed \u003d False"},{"line_number":124,"context_line":"            for ifname, vif in state.vifs.items():"},{"line_number":125,"context_line":"                if not vif.active:"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_116fd592","line":122,"range":{"start_line":122,"start_character":12,"end_line":122,"end_character":58},"updated":"2019-04-25 09:09:36.000000000","message":"this was actually not what I meant. I would call this function inside the for at line 124, if and only if the vif.plugin is sriov. There is no need to call that function for any other driver","commit_id":"bcf156bfb5c5c7cfa74ce043497ce4e956630ea7"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"bf2dc3338ccc05ba269779107b5fd848e46f038a","unresolved":false,"context_lines":[{"line_number":119,"context_line":"                                                   project_id,"},{"line_number":120,"context_line":"                                                   security_groups)"},{"line_number":121,"context_line":"        else:"},{"line_number":122,"context_line":"            driver_utils.update_ports_pci_info(pod, state)"},{"line_number":123,"context_line":"            changed \u003d False"},{"line_number":124,"context_line":"            for ifname, vif in state.vifs.items():"},{"line_number":125,"context_line":"                if not vif.active:"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_2cf39e0c","line":122,"range":{"start_line":122,"start_character":12,"end_line":122,"end_character":58},"in_reply_to":"ffb9cba7_116fd592","updated":"2019-04-25 10:05:29.000000000","message":"Yep, true.","commit_id":"bcf156bfb5c5c7cfa74ce043497ce4e956630ea7"},{"author":{"_account_id":24604,"name":"Danil Golov","email":"d.golov@samsung.com","username":"d.golov"},"change_message_id":"11efded372c6bd2cfb8f4175fb168a6fe76fbcff","unresolved":false,"context_lines":[{"line_number":119,"context_line":"                                                   project_id,"},{"line_number":120,"context_line":"                                                   security_groups)"},{"line_number":121,"context_line":"        else:"},{"line_number":122,"context_line":"            driver_utils.update_ports_pci_info(pod, state)"},{"line_number":123,"context_line":"            changed \u003d False"},{"line_number":124,"context_line":"            for ifname, vif in state.vifs.items():"},{"line_number":125,"context_line":"                if not vif.active:"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_ccfd22b2","line":122,"range":{"start_line":122,"start_character":12,"end_line":122,"end_character":58},"in_reply_to":"ffb9cba7_116fd592","updated":"2019-04-25 10:16:43.000000000","message":"ok, so it will be a little code in vif handler that is related to sriov. I mean:\n\n    if vif.plugin \u003d\u003d \u0027sriov\u0027:\n        ...\n\nby the way, now the same is done in update_ports_pci_info(). And as I understand correctly we do not want to call this function if vif.plugin is not \u0027sriov\u0027. Right?","commit_id":"bcf156bfb5c5c7cfa74ce043497ce4e956630ea7"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"e2b1d816e475f5ac866d66840d97b1e474b39239","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        else:"},{"line_number":122,"context_line":"            changed \u003d False"},{"line_number":123,"context_line":"            for ifname, vif in state.vifs.items():"},{"line_number":124,"context_line":"                if vif.plugin \u003d\u003d \u0027sriov\u0027:"},{"line_number":125,"context_line":"                    driver_utils.update_port_pci_info(pod, vif)"},{"line_number":126,"context_line":"                if not vif.active:"},{"line_number":127,"context_line":"                    self._drv_vif_pool.activate_vif(pod, vif)"}],"source_content_type":"text/x-python","patch_set":24,"id":"bfb3d3c7_b383a604","line":124,"range":{"start_line":124,"start_character":34,"end_line":124,"end_character":39},"updated":"2019-05-20 09:52:56.000000000","message":"perhaps worth to define a constant for this","commit_id":"f4a06acfdc2d4a0ab88377e223a91e206fcf0b57"},{"author":{"_account_id":24604,"name":"Danil Golov","email":"d.golov@samsung.com","username":"d.golov"},"change_message_id":"86fed91e9a1d0dd460ca24664a36786b0b0cdb7f","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        else:"},{"line_number":122,"context_line":"            changed \u003d False"},{"line_number":123,"context_line":"            for ifname, vif in state.vifs.items():"},{"line_number":124,"context_line":"                if vif.plugin \u003d\u003d \u0027sriov\u0027:"},{"line_number":125,"context_line":"                    driver_utils.update_port_pci_info(pod, vif)"},{"line_number":126,"context_line":"                if not vif.active:"},{"line_number":127,"context_line":"                    self._drv_vif_pool.activate_vif(pod, vif)"}],"source_content_type":"text/x-python","patch_set":24,"id":"bfb3d3c7_7e2415c7","line":124,"range":{"start_line":124,"start_character":34,"end_line":124,"end_character":39},"in_reply_to":"bfb3d3c7_b383a604","updated":"2019-05-20 14:23:28.000000000","message":"Done","commit_id":"f4a06acfdc2d4a0ab88377e223a91e206fcf0b57"}]}
