)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"7320269c0eefc1640e4de58f679c8504b6f3aef0","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Change pickup_hosts() for affinity\u003dTrue/None"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The pickup_hosts() fuction, called for create/update/reallocate"},{"line_number":10,"context_line":"instance reservation, assumed affinity\u003dFalse and returned sets of"},{"line_number":11,"context_line":"host ids to add/remove."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"9fdfeff1_4fb50dd0","line":9,"range":{"start_line":9,"start_character":19,"end_line":9,"end_character":26},"updated":"2019-02-18 19:12:20.000000000","message":"function","commit_id":"9323099b0bb237109f8bf024ef78eb0e857c4b5d"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"e7516b266b6398a7272712584f226bdd0ec2388f","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Change pickup_hosts() for affinity\u003dTrue/None"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The pickup_hosts() fuction, called for create/update/reallocate"},{"line_number":10,"context_line":"instance reservation, assumed affinity\u003dFalse and returned sets of"},{"line_number":11,"context_line":"host ids to add/remove."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"9fdfeff1_82609f0f","line":9,"range":{"start_line":9,"start_character":19,"end_line":9,"end_character":26},"in_reply_to":"9fdfeff1_4fb50dd0","updated":"2019-02-19 06:18:52.000000000","message":"Done","commit_id":"9323099b0bb237109f8bf024ef78eb0e857c4b5d"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"7320269c0eefc1640e4de58f679c8504b6f3aef0","unresolved":false,"context_lines":[{"line_number":10,"context_line":"instance reservation, assumed affinity\u003dFalse and returned sets of"},{"line_number":11,"context_line":"host ids to add/remove."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"To support affinity\u003dTrue/None, this patch changes the pickup_hosts()"},{"line_number":14,"context_line":"to return lists of hosts ids to add/remove allowing duplicate host"},{"line_number":15,"context_line":"ids according to the number of instances to reserve on that host."},{"line_number":16,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"9fdfeff1_8fc21534","line":13,"range":{"start_line":13,"start_character":50,"end_line":13,"end_character":53},"updated":"2019-02-18 19:12:20.000000000","message":"Remove \u0027the\u0027","commit_id":"9323099b0bb237109f8bf024ef78eb0e857c4b5d"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"e7516b266b6398a7272712584f226bdd0ec2388f","unresolved":false,"context_lines":[{"line_number":10,"context_line":"instance reservation, assumed affinity\u003dFalse and returned sets of"},{"line_number":11,"context_line":"host ids to add/remove."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"To support affinity\u003dTrue/None, this patch changes the pickup_hosts()"},{"line_number":14,"context_line":"to return lists of hosts ids to add/remove allowing duplicate host"},{"line_number":15,"context_line":"ids according to the number of instances to reserve on that host."},{"line_number":16,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"9fdfeff1_a265a31f","line":13,"range":{"start_line":13,"start_character":50,"end_line":13,"end_character":53},"in_reply_to":"9fdfeff1_8fc21534","updated":"2019-02-19 06:18:52.000000000","message":"Done","commit_id":"9323099b0bb237109f8bf024ef78eb0e857c4b5d"}],"blazar/db/migration/alembic_migrations/versions/9593f3656974_no_affinity_instance_reservation.py":[{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"e6f57d45d25cf1550dbc8d23a560088bb3c0f398","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"def downgrade():"},{"line_number":39,"context_line":"    op.alter_column(\u0027instance_reservations\u0027, \u0027affinity\u0027,"},{"line_number":40,"context_line":"                    existing_type\u003dmysql.TINYINT(display_width\u003d1),"},{"line_number":41,"context_line":"                    nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":5,"id":"bfdaf3ff_59ccac60","line":40,"range":{"start_line":40,"start_character":0,"end_line":40,"end_character":65},"updated":"2019-01-21 15:55:45.000000000","message":"Should the downgrade set the column \"False\"?","commit_id":"fbb158f4bd3040956e1729ba357f46ba6406f53f"}],"blazar/plugins/instances/instance_plugin.py":[{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"e6f57d45d25cf1550dbc8d23a560088bb3c0f398","unresolved":false,"context_lines":[{"line_number":202,"context_line":"        old_allocs \u003d db_api.host_allocation_get_all_by_values("},{"line_number":203,"context_line":"            reservation_id\u003dreservation_id)"},{"line_number":204,"context_line":"        if old_allocs:"},{"line_number":205,"context_line":"            # This is a path for *update* reservation. Add the specific"},{"line_number":206,"context_line":"            # query param not to consider resources reserved by existing"},{"line_number":207,"context_line":"            # reservations to update"},{"line_number":208,"context_line":"            query_params[\u0027excludes_res\u0027] \u003d [reservation_id]"}],"source_content_type":"text/x-python","patch_set":5,"id":"bfdaf3ff_99ed348d","line":205,"range":{"start_line":205,"start_character":12,"end_line":205,"end_character":71},"updated":"2019-01-21 15:55:45.000000000","message":"Nice comment.","commit_id":"fbb158f4bd3040956e1729ba357f46ba6406f53f"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"e6f57d45d25cf1550dbc8d23a560088bb3c0f398","unresolved":false,"context_lines":[{"line_number":223,"context_line":"            available \u003d {k for k, v in host_id_map.items() if v \u003e\u003d req_amount}"},{"line_number":224,"context_line":"            if not available:"},{"line_number":225,"context_line":"                raise mgr_exceptions.NotEnoughHostsAvailable()"},{"line_number":226,"context_line":"            new_host_ids \u003d set(old_host_id_list) \u0026 available"},{"line_number":227,"context_line":"            if new_host_ids:"},{"line_number":228,"context_line":"                new_host_id \u003d new_host_ids.pop()"},{"line_number":229,"context_line":"            else:"},{"line_number":230,"context_line":"                # We\u0027d like to consider the order of the `candidate_id_list`"},{"line_number":231,"context_line":"                for host_id in candidate_id_list:"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_8de9a681","line":228,"range":{"start_line":226,"start_character":0,"end_line":228,"end_character":48},"updated":"2019-01-21 15:55:45.000000000","message":"Just a question. What\u0027s the purpose of the if-statement? L230-235 looks enough for the affinity rule.","commit_id":"fbb158f4bd3040956e1729ba357f46ba6406f53f"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"ec11812f229e35e7252e6a3bf34273b0eee247e8","unresolved":false,"context_lines":[{"line_number":223,"context_line":"            available \u003d {k for k, v in host_id_map.items() if v \u003e\u003d req_amount}"},{"line_number":224,"context_line":"            if not available:"},{"line_number":225,"context_line":"                raise mgr_exceptions.NotEnoughHostsAvailable()"},{"line_number":226,"context_line":"            new_host_ids \u003d set(old_host_id_list) \u0026 available"},{"line_number":227,"context_line":"            if new_host_ids:"},{"line_number":228,"context_line":"                new_host_id \u003d new_host_ids.pop()"},{"line_number":229,"context_line":"            else:"},{"line_number":230,"context_line":"                # We\u0027d like to consider the order of the `candidate_id_list`"},{"line_number":231,"context_line":"                for host_id in candidate_id_list:"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_30d8eb51","line":228,"range":{"start_line":226,"start_character":0,"end_line":228,"end_character":48},"in_reply_to":"9fdfeff1_8de9a681","updated":"2019-01-23 04:59:33.000000000","message":"That\u0027s to prioritize the hosts that are already reserved by the reservation to update in case of *update* reservations. We\u0027d like to keep it as much as possible.\n\nFor example, consider a case where 3 instances with True affinity reservation are already started and a user wants to update that reservation to 4 instances with True affinity. If this function picks up a completely different host, the update fails since we can\u0027t delete the started instance via update reservation, while it succeeds if this function picks up the same host.\n\nAdded some more comments in the code.","commit_id":"fbb158f4bd3040956e1729ba357f46ba6406f53f"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"e6f57d45d25cf1550dbc8d23a560088bb3c0f398","unresolved":false,"context_lines":[{"line_number":235,"context_line":"            new_host_id_list \u003d [new_host_id] * req_amount"},{"line_number":236,"context_line":"        else:"},{"line_number":237,"context_line":"            # Hosts that can accommodate but doesn\u0027t satisfy requirement 1"},{"line_number":238,"context_line":"            possible_host_list, _ \u003d plugins_utils.list_difference("},{"line_number":239,"context_line":"                candidate_id_list, old_host_id_list)"},{"line_number":240,"context_line":"            # Hosts that satisfies requirement 1"},{"line_number":241,"context_line":"            new_host_id_list, _ \u003d plugins_utils.list_difference("},{"line_number":242,"context_line":"                candidate_id_list, possible_host_list)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_40270514","line":239,"range":{"start_line":238,"start_character":0,"end_line":239,"end_character":52},"updated":"2019-01-21 15:55:45.000000000","message":"Could do you change the order of the candidate_id_list and old_host_id_list?\n\nFrom my understand, possible_host_list represents the list of host that\u0027s newly added in candidate_id_list. But the list_difference returns removed host as first return value. It\u0027s not straight forward.","commit_id":"fbb158f4bd3040956e1729ba357f46ba6406f53f"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"ec11812f229e35e7252e6a3bf34273b0eee247e8","unresolved":false,"context_lines":[{"line_number":235,"context_line":"            new_host_id_list \u003d [new_host_id] * req_amount"},{"line_number":236,"context_line":"        else:"},{"line_number":237,"context_line":"            # Hosts that can accommodate but doesn\u0027t satisfy requirement 1"},{"line_number":238,"context_line":"            possible_host_list, _ \u003d plugins_utils.list_difference("},{"line_number":239,"context_line":"                candidate_id_list, old_host_id_list)"},{"line_number":240,"context_line":"            # Hosts that satisfies requirement 1"},{"line_number":241,"context_line":"            new_host_id_list, _ \u003d plugins_utils.list_difference("},{"line_number":242,"context_line":"                candidate_id_list, possible_host_list)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_b01e1b0a","line":239,"range":{"start_line":238,"start_character":0,"end_line":239,"end_character":52},"in_reply_to":"9fdfeff1_40270514","updated":"2019-01-23 04:59:33.000000000","message":"Done","commit_id":"fbb158f4bd3040956e1729ba357f46ba6406f53f"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"7320269c0eefc1640e4de58f679c8504b6f3aef0","unresolved":false,"context_lines":[{"line_number":150,"context_line":"        The list is in the order of reserved hosts to free hosts."},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"        1. filter hosts that have a spec enough to accommodate the flavor"},{"line_number":153,"context_line":"        2. categorize hosts allocated_hosts and not_allocated_hosts"},{"line_number":154,"context_line":"           at the reservation time frame"},{"line_number":155,"context_line":"        3. filter out hosts used by physical host reservation from"},{"line_number":156,"context_line":"           allocate_host"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fdfeff1_6ff25172","line":153,"range":{"start_line":153,"start_character":27,"end_line":153,"end_character":28},"updated":"2019-02-18 19:12:20.000000000","message":"into","commit_id":"9323099b0bb237109f8bf024ef78eb0e857c4b5d"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"e7516b266b6398a7272712584f226bdd0ec2388f","unresolved":false,"context_lines":[{"line_number":150,"context_line":"        The list is in the order of reserved hosts to free hosts."},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"        1. filter hosts that have a spec enough to accommodate the flavor"},{"line_number":153,"context_line":"        2. categorize hosts allocated_hosts and not_allocated_hosts"},{"line_number":154,"context_line":"           at the reservation time frame"},{"line_number":155,"context_line":"        3. filter out hosts used by physical host reservation from"},{"line_number":156,"context_line":"           allocate_host"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fdfeff1_426ab7ed","line":153,"range":{"start_line":153,"start_character":27,"end_line":153,"end_character":28},"in_reply_to":"9fdfeff1_6ff25172","updated":"2019-02-19 06:18:52.000000000","message":"Done","commit_id":"9323099b0bb237109f8bf024ef78eb0e857c4b5d"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"7320269c0eefc1640e4de58f679c8504b6f3aef0","unresolved":false,"context_lines":[{"line_number":149,"context_line":""},{"line_number":150,"context_line":"        The list is in the order of reserved hosts to free hosts."},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"        1. filter hosts that have a spec enough to accommodate the flavor"},{"line_number":153,"context_line":"        2. categorize hosts allocated_hosts and not_allocated_hosts"},{"line_number":154,"context_line":"           at the reservation time frame"},{"line_number":155,"context_line":"        3. filter out hosts used by physical host reservation from"},{"line_number":156,"context_line":"           allocate_host"},{"line_number":157,"context_line":"        4. filter out hosts that can\u0027t accommodate the flavor at the"},{"line_number":158,"context_line":"           time frame because of other reservations"},{"line_number":159,"context_line":"        \"\"\""},{"line_number":160,"context_line":"        flavor_definitions \u003d ["},{"line_number":161,"context_line":"            \u0027and\u0027,"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fdfeff1_be014509","line":158,"range":{"start_line":152,"start_character":0,"end_line":158,"end_character":51},"updated":"2019-02-18 19:12:20.000000000","message":"The names allocated_hosts and not_allocated_hosts don\u0027t appear to be used in the code.","commit_id":"9323099b0bb237109f8bf024ef78eb0e857c4b5d"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"e7516b266b6398a7272712584f226bdd0ec2388f","unresolved":false,"context_lines":[{"line_number":149,"context_line":""},{"line_number":150,"context_line":"        The list is in the order of reserved hosts to free hosts."},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"        1. filter hosts that have a spec enough to accommodate the flavor"},{"line_number":153,"context_line":"        2. categorize hosts allocated_hosts and not_allocated_hosts"},{"line_number":154,"context_line":"           at the reservation time frame"},{"line_number":155,"context_line":"        3. filter out hosts used by physical host reservation from"},{"line_number":156,"context_line":"           allocate_host"},{"line_number":157,"context_line":"        4. filter out hosts that can\u0027t accommodate the flavor at the"},{"line_number":158,"context_line":"           time frame because of other reservations"},{"line_number":159,"context_line":"        \"\"\""},{"line_number":160,"context_line":"        flavor_definitions \u003d ["},{"line_number":161,"context_line":"            \u0027and\u0027,"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fdfeff1_0274afcf","line":158,"range":{"start_line":152,"start_character":0,"end_line":158,"end_character":51},"in_reply_to":"9fdfeff1_be014509","updated":"2019-02-19 06:18:52.000000000","message":"Reworded.","commit_id":"9323099b0bb237109f8bf024ef78eb0e857c4b5d"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"7320269c0eefc1640e4de58f679c8504b6f3aef0","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        # the following order of priority:"},{"line_number":226,"context_line":"        #  1. hosts reserved by the reservation to update"},{"line_number":227,"context_line":"        #  2. hosts with reservations followed by hosts without reservations"},{"line_number":228,"context_line":"        # Note that the `candidate_id_list` has already ordered satisfying the"},{"line_number":229,"context_line":"        # second requirement."},{"line_number":230,"context_line":"        if affinity:"},{"line_number":231,"context_line":"            host_id_map \u003d collections.Counter(candidate_id_list)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fdfeff1_1e3891ec","line":228,"range":{"start_line":228,"start_character":48,"end_line":228,"end_character":63},"updated":"2019-02-18 19:12:20.000000000","message":"already been ordered","commit_id":"9323099b0bb237109f8bf024ef78eb0e857c4b5d"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"e7516b266b6398a7272712584f226bdd0ec2388f","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        # the following order of priority:"},{"line_number":226,"context_line":"        #  1. hosts reserved by the reservation to update"},{"line_number":227,"context_line":"        #  2. hosts with reservations followed by hosts without reservations"},{"line_number":228,"context_line":"        # Note that the `candidate_id_list` has already ordered satisfying the"},{"line_number":229,"context_line":"        # second requirement."},{"line_number":230,"context_line":"        if affinity:"},{"line_number":231,"context_line":"            host_id_map \u003d collections.Counter(candidate_id_list)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fdfeff1_c27d47b3","line":228,"range":{"start_line":228,"start_character":48,"end_line":228,"end_character":63},"in_reply_to":"9fdfeff1_1e3891ec","updated":"2019-02-19 06:18:52.000000000","message":"Done","commit_id":"9323099b0bb237109f8bf024ef78eb0e857c4b5d"}]}
