)]}'
{"heat_docker_agent/Dockerfile":[{"author":{"_account_id":8833,"name":"Rabi Mishra","email":"ramishra@redhat.com","username":"rabi"},"change_message_id":"07e2133d13d865d290e3179cdf8488e81e7a6691","unresolved":false,"context_lines":[{"line_number":7,"context_line":"# Just use a script to configure the agent container.  This way we can"},{"line_number":8,"context_line":"# Split up the operations and do it all in a single layer."},{"line_number":9,"context_line":"ADD configure_container.sh /tmp/"},{"line_number":10,"context_line":"ADD hook-docker.py /var/lib/heat-config/hooks/docker-cmd"},{"line_number":11,"context_line":"RUN /tmp/configure_container.sh"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"# This is a script which:"}],"source_content_type":"text/x-dockerfile","patch_set":9,"id":"dab17558_abb6b7d9","line":10,"range":{"start_line":10,"start_character":0,"end_line":10,"end_character":56},"updated":"2016-05-09 09:12:47.000000000","message":"Is it intentional to add it here rather than configure_container.sh?","commit_id":"eb97ab9c723849f9d2199df67a52e859413dfdf1"},{"author":{"_account_id":2011,"name":"Ian Main","email":"imain@redhat.com","username":"imain"},"change_message_id":"1e3e6a8afabc435bfb120e270a98cef9316c800e","unresolved":false,"context_lines":[{"line_number":7,"context_line":"# Just use a script to configure the agent container.  This way we can"},{"line_number":8,"context_line":"# Split up the operations and do it all in a single layer."},{"line_number":9,"context_line":"ADD configure_container.sh /tmp/"},{"line_number":10,"context_line":"ADD hook-docker.py /var/lib/heat-config/hooks/docker-cmd"},{"line_number":11,"context_line":"RUN /tmp/configure_container.sh"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"# This is a script which:"}],"source_content_type":"text/x-dockerfile","patch_set":9,"id":"7aa08908_7a278912","line":10,"range":{"start_line":10,"start_character":0,"end_line":10,"end_character":56},"in_reply_to":"dab17558_abb6b7d9","updated":"2016-06-06 17:30:57.000000000","message":"Yeah you have to add files outside of the configure script as the configure script runs in the container.","commit_id":"eb97ab9c723849f9d2199df67a52e859413dfdf1"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"f9df4e7156f454a77192c17481b9b24a59c89043","unresolved":false,"context_lines":[{"line_number":9,"context_line":"# Just use a script to configure the agent container.  This way we can"},{"line_number":10,"context_line":"# Split up the operations and do it all in a single layer."},{"line_number":11,"context_line":"ADD configure_container.sh /tmp/"},{"line_number":12,"context_line":"ADD hook-docker-cmd.py /var/lib/heat-config/hooks/docker-cmd"},{"line_number":13,"context_line":"ADD 50-heat-config-docker-cmd /usr/libexec/os-refresh-config/configure.d/50-heat-config-hook-docker-cmd"},{"line_number":14,"context_line":"RUN /tmp/configure_container.sh \u0026\u0026 rm /tmp/configure_container.sh"},{"line_number":15,"context_line":""}],"source_content_type":"text/x-dockerfile","patch_set":31,"id":"9a629dbe_cd1ee062","line":12,"updated":"2016-11-08 16:46:32.000000000","message":"Could you move these 2 ADD instructions above the one in L11?\n\nAs it is, I believe every change in configure_container will invalidate the cache for these 2 new instructions. Is that intentional?","commit_id":"2f94cec96c8d36f089ec95e0c02686a5e0a052c5"},{"author":{"_account_id":4571,"name":"Steve Baker","email":"sbaker@redhat.com","username":"steve-stevebaker"},"change_message_id":"f14f79dd0c35b19f91e67b1a01ccf6ef9180ace3","unresolved":false,"context_lines":[{"line_number":9,"context_line":"# Just use a script to configure the agent container.  This way we can"},{"line_number":10,"context_line":"# Split up the operations and do it all in a single layer."},{"line_number":11,"context_line":"ADD configure_container.sh /tmp/"},{"line_number":12,"context_line":"ADD hook-docker-cmd.py /var/lib/heat-config/hooks/docker-cmd"},{"line_number":13,"context_line":"ADD 50-heat-config-docker-cmd /usr/libexec/os-refresh-config/configure.d/50-heat-config-hook-docker-cmd"},{"line_number":14,"context_line":"RUN /tmp/configure_container.sh \u0026\u0026 rm /tmp/configure_container.sh"},{"line_number":15,"context_line":""}],"source_content_type":"text/x-dockerfile","patch_set":31,"id":"9a629dbe_fb26ebcc","line":12,"in_reply_to":"9a629dbe_cd1ee062","updated":"2016-11-09 00:30:06.000000000","message":"Done","commit_id":"2f94cec96c8d36f089ec95e0c02686a5e0a052c5"},{"author":{"_account_id":4571,"name":"Steve Baker","email":"sbaker@redhat.com","username":"steve-stevebaker"},"change_message_id":"e4f8958907af2968e1b18deda328a1a4af8c00d6","unresolved":false,"context_lines":[{"line_number":6,"context_line":"ENV container docker"},{"line_number":7,"context_line":"ENV DOCKER_HOST unix:///var/run/docker.sock"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"ADD hook-docker-cmd.py /var/lib/heat-config/hooks/docker-cmd"},{"line_number":10,"context_line":"ADD 50-heat-config-docker-cmd /usr/libexec/os-refresh-config/configure.d/50-heat-config-hook-docker-cmd"},{"line_number":11,"context_line":"# Just use a script to configure the agent container.  This way we can"},{"line_number":12,"context_line":"# Split up the operations and do it all in a single layer."}],"source_content_type":"text/x-dockerfile","patch_set":32,"id":"9a629dbe_42a97a7a","line":9,"updated":"2016-11-09 23:23:45.000000000","message":"this should be /usr/libexec/heat-config/hooks/docker-cmd","commit_id":"8a1993db8f6db8c080da5e861f53bad372713d65"}],"heat_docker_agent/configure_container.sh":[{"author":{"_account_id":4571,"name":"Steve Baker","email":"sbaker@redhat.com","username":"steve-stevebaker"},"change_message_id":"325e2bbf424a65ff93fc7f536e32d895cffc7304","unresolved":false,"context_lines":[{"line_number":9,"context_line":"/bin/bash -c \"cat \u003c\u003cEOF\u003e\u003e/etc/yum.repos.d/delorean-current.repo"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"includepkgs\u003ddiskimage-builder,instack,instack-undercloud,os-apply-config,os-cloud-config,os-collect-config,os-net-config,os-refresh-config,python-tripleoclient,tripleo-common,openstack-tripleo-heat-templates,openstack-tripleo-image-elements,openstack-tripleo,openstack-tripleo-puppet-elements,openstack-puppet-modules"},{"line_number":12,"context_line":"EOF\""},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"curl -L -o /etc/yum.repos.d/delorean-deps.repo http://trunk.rdoproject.org/centos7/delorean-deps.repo"},{"line_number":15,"context_line":""}],"source_content_type":"text/x-sh","patch_set":23,"id":"7a8ec9b2_270c63eb","line":12,"updated":"2016-09-22 04:25:07.000000000","message":"As a matter of interest, how are we going to handle different repos as this change travels down the CI chain?","commit_id":"b177eec35d2bfc7a2c8fe33b5c2f03935a0d118c"},{"author":{"_account_id":2011,"name":"Ian Main","email":"imain@redhat.com","username":"imain"},"change_message_id":"45cd43da1250479efbc65b1f2ecf984e38933551","unresolved":false,"context_lines":[{"line_number":9,"context_line":"/bin/bash -c \"cat \u003c\u003cEOF\u003e\u003e/etc/yum.repos.d/delorean-current.repo"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"includepkgs\u003ddiskimage-builder,instack,instack-undercloud,os-apply-config,os-cloud-config,os-collect-config,os-net-config,os-refresh-config,python-tripleoclient,tripleo-common,openstack-tripleo-heat-templates,openstack-tripleo-image-elements,openstack-tripleo,openstack-tripleo-puppet-elements,openstack-puppet-modules"},{"line_number":12,"context_line":"EOF\""},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"curl -L -o /etc/yum.repos.d/delorean-deps.repo http://trunk.rdoproject.org/centos7/delorean-deps.repo"},{"line_number":15,"context_line":""}],"source_content_type":"text/x-sh","patch_set":23,"id":"1a95cdbc_93797996","line":12,"in_reply_to":"7a8ec9b2_270c63eb","updated":"2016-10-05 15:00:03.000000000","message":"Environment variables or config file?","commit_id":"b177eec35d2bfc7a2c8fe33b5c2f03935a0d118c"},{"author":{"_account_id":4571,"name":"Steve Baker","email":"sbaker@redhat.com","username":"steve-stevebaker"},"change_message_id":"325e2bbf424a65ff93fc7f536e32d895cffc7304","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        openvswitch \\"},{"line_number":40,"context_line":"        puppet \\"},{"line_number":41,"context_line":"        file \\"},{"line_number":42,"context_line":"        python-ipaddr"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"# NOTE(flaper87): openstack packages"},{"line_number":45,"context_line":"# We need these packages just to install the config files."}],"source_content_type":"text/x-sh","patch_set":23,"id":"7a8ec9b2_070be7d6","line":42,"updated":"2016-09-22 04:25:07.000000000","message":"The following can be removed and replaced with package python-heat-agent-puppet:\n\n- openstack-heat-templates\n- os-apply-config\n- os-collect-config\n- os-refresh-config\n- python-psutil\n- puppet","commit_id":"b177eec35d2bfc7a2c8fe33b5c2f03935a0d118c"},{"author":{"_account_id":4571,"name":"Steve Baker","email":"sbaker@redhat.com","username":"steve-stevebaker"},"change_message_id":"325e2bbf424a65ff93fc7f536e32d895cffc7304","unresolved":false,"context_lines":[{"line_number":74,"context_line":""},{"line_number":75,"context_line":"# NOTE(flaper87): Remove unnecessary packages"},{"line_number":76,"context_line":"yum autoremove -y"},{"line_number":77,"context_line":"yum clean all"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"# Heat config setup."},{"line_number":80,"context_line":"mkdir -p /var/lib/heat-config/hooks"}],"source_content_type":"text/x-sh","patch_set":23,"id":"7a8ec9b2_67402ba6","line":77,"updated":"2016-09-22 04:25:07.000000000","message":"Maybe move this to the end, see the below comment about ln vs install","commit_id":"b177eec35d2bfc7a2c8fe33b5c2f03935a0d118c"},{"author":{"_account_id":4571,"name":"Steve Baker","email":"sbaker@redhat.com","username":"steve-stevebaker"},"change_message_id":"325e2bbf424a65ff93fc7f536e32d895cffc7304","unresolved":false,"context_lines":[{"line_number":83,"context_line":"/var/lib/heat-config/hooks/puppet"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"ln -sf /usr/share/openstack-heat-templates/software-config/elements/heat-config-script/install.d/hook-script.py \\"},{"line_number":86,"context_line":"/var/lib/heat-config/hooks/script"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"# Install puppet modules"},{"line_number":89,"context_line":"mkdir -p /etc/puppet/modules"}],"source_content_type":"text/x-sh","patch_set":23,"id":"7a8ec9b2_67210b4d","line":86,"updated":"2016-09-22 04:25:07.000000000","message":"With package python-heat-agent-puppet, lines 79-86 can be removed","commit_id":"b177eec35d2bfc7a2c8fe33b5c2f03935a0d118c"},{"author":{"_account_id":4571,"name":"Steve Baker","email":"sbaker@redhat.com","username":"steve-stevebaker"},"change_message_id":"325e2bbf424a65ff93fc7f536e32d895cffc7304","unresolved":false,"context_lines":[{"line_number":91,"context_line":""},{"line_number":92,"context_line":"# And puppet hiera"},{"line_number":93,"context_line":"mkdir -p /usr/libexec/os-apply-config/templates/etc/puppet"},{"line_number":94,"context_line":"ln -sf /usr/share/tripleo-puppet-elements/hiera/os-apply-config/etc/puppet/hiera.yaml /usr/libexec/os-apply-config/templates/etc/puppet/"},{"line_number":95,"context_line":"ln -sf /etc/puppet/hiera.yaml /etc/hiera.yaml"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"# Configure os-*"}],"source_content_type":"text/x-sh","patch_set":23,"id":"7a8ec9b2_2780e3be","line":94,"updated":"2016-09-22 04:25:07.000000000","message":"Can I suggest that the install command be used for all these templates and scripts instead of ln? That would allow the openstack-tripleo-puppet-elements and openstack-tripleo-image-elements packages to be removed at the end of this script, leading to a smaller image.","commit_id":"b177eec35d2bfc7a2c8fe33b5c2f03935a0d118c"},{"author":{"_account_id":4571,"name":"Steve Baker","email":"sbaker@redhat.com","username":"steve-stevebaker"},"change_message_id":"325e2bbf424a65ff93fc7f536e32d895cffc7304","unresolved":false,"context_lines":[{"line_number":99,"context_line":"ln -sf /usr/share/tripleo-image-elements/os-apply-config/os-refresh-config/configure.d/20-os-apply-config \\"},{"line_number":100,"context_line":"/usr/libexec/os-refresh-config/configure.d/"},{"line_number":101,"context_line":"ln -sf /usr/share/openstack-heat-templates/software-config/elements/heat-config/os-refresh-config/configure.d/55-heat-config \\"},{"line_number":102,"context_line":"/usr/libexec/os-refresh-config/configure.d/"},{"line_number":103,"context_line":"ln -sf /usr/share/tripleo-puppet-elements/hiera/os-refresh-config/configure.d/40-hiera-datafiles \\"},{"line_number":104,"context_line":"/usr/libexec/os-refresh-config/configure.d/"},{"line_number":105,"context_line":"mkdir -p /usr/libexec/os-refresh-config/post-configure.d"}],"source_content_type":"text/x-sh","patch_set":23,"id":"7a8ec9b2_27ad4384","line":102,"updated":"2016-09-22 04:25:07.000000000","message":"With package python-heat-agent-puppet, lines 97-102 can be removed","commit_id":"b177eec35d2bfc7a2c8fe33b5c2f03935a0d118c"},{"author":{"_account_id":4571,"name":"Steve Baker","email":"sbaker@redhat.com","username":"steve-stevebaker"},"change_message_id":"325e2bbf424a65ff93fc7f536e32d895cffc7304","unresolved":false,"context_lines":[{"line_number":110,"context_line":"echo \"{{deployments}}\" \u003e /usr/libexec/os-apply-config/templates/var/run/heat-config/heat-config"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"ln -sf /usr/share/openstack-heat-templates/software-config/elements/heat-config/bin/heat-config-notify \\"},{"line_number":113,"context_line":"/usr/local/bin/"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"mkdir -p /usr/libexec/os-apply-config/templates/etc/os-net-config/"},{"line_number":116,"context_line":"ln -sf /usr/share/tripleo-image-elements/os-net-config/os-apply-config/etc/os-net-config/config.json \\"}],"source_content_type":"text/x-sh","patch_set":23,"id":"7a8ec9b2_a7d8731f","line":113,"updated":"2016-09-22 04:25:07.000000000","message":"With package python-heat-agent-puppet, lines 109-113 can be removed","commit_id":"b177eec35d2bfc7a2c8fe33b5c2f03935a0d118c"},{"author":{"_account_id":4571,"name":"Steve Baker","email":"sbaker@redhat.com","username":"steve-stevebaker"},"change_message_id":"325e2bbf424a65ff93fc7f536e32d895cffc7304","unresolved":false,"context_lines":[{"line_number":118,"context_line":""},{"line_number":119,"context_line":"mkdir -p /usr/libexec/os-apply-config/templates/etc/"},{"line_number":120,"context_line":"ln -sf /usr/share/tripleo-image-elements/os-collect-config/os-apply-config/etc/os-collect-config.conf \\"},{"line_number":121,"context_line":"/usr/libexec/os-apply-config/templates/etc"},{"line_number":122,"context_line":""}],"source_content_type":"text/x-sh","patch_set":23,"id":"7a8ec9b2_47008f66","line":121,"updated":"2016-09-22 04:25:07.000000000","message":"With package python-heat-agent-puppet, lines 119-121 can be removed","commit_id":"b177eec35d2bfc7a2c8fe33b5c2f03935a0d118c"},{"author":{"_account_id":4571,"name":"Steve Baker","email":"sbaker@redhat.com","username":"steve-stevebaker"},"change_message_id":"5af6f97e3488142dbf3b58cb6c0025ffede57420","unresolved":false,"context_lines":[{"line_number":28,"context_line":"        openstack-tripleo-image-elements \\"},{"line_number":29,"context_line":"        openstack-heat-templates \\"},{"line_number":30,"context_line":"        openstack-puppet-modules \\"},{"line_number":31,"context_line":"        os-apply-config \\"},{"line_number":32,"context_line":"        os-collect-config \\"},{"line_number":33,"context_line":"        os-refresh-config \\"},{"line_number":34,"context_line":"        os-net-config \\"}],"source_content_type":"text/x-sh","patch_set":25,"id":"1a95cdbc_1b9ec9b8","line":31,"updated":"2016-10-09 23:25:23.000000000","message":"This file lost all the changes from changeset 24","commit_id":"ec719952c5b49ed1a5ad5f08b24c1859f50cf700"},{"author":{"_account_id":13039,"name":"Martin André","email":"m.andre@redhat.com","username":"mandre"},"change_message_id":"731e8e10dc0cc25a8aea6cb156fe6f479b1d3311","unresolved":false,"context_lines":[{"line_number":28,"context_line":"        openstack-tripleo-image-elements \\"},{"line_number":29,"context_line":"        openstack-heat-templates \\"},{"line_number":30,"context_line":"        openstack-puppet-modules \\"},{"line_number":31,"context_line":"        os-apply-config \\"},{"line_number":32,"context_line":"        os-collect-config \\"},{"line_number":33,"context_line":"        os-refresh-config \\"},{"line_number":34,"context_line":"        os-net-config \\"}],"source_content_type":"text/x-sh","patch_set":25,"id":"1a95cdbc_5344a348","line":31,"in_reply_to":"1a95cdbc_1b9ec9b8","updated":"2016-10-10 13:37:26.000000000","message":"Ughh, you\u0027re right. In reality, this has nothing to do here, I\u0027m going to extract configure_containers.sh cleanup in its own commit.","commit_id":"ec719952c5b49ed1a5ad5f08b24c1859f50cf700"},{"author":{"_account_id":4571,"name":"Steve Baker","email":"sbaker@redhat.com","username":"steve-stevebaker"},"change_message_id":"f14f79dd0c35b19f91e67b1a01ccf6ef9180ace3","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        openstack-tripleo-puppet-elements \\"},{"line_number":36,"context_line":"        openvswitch \\"},{"line_number":37,"context_line":"        os-net-config \\"},{"line_number":38,"context_line":"        python-heat-agent-puppet \\"},{"line_number":39,"context_line":"        python-ipaddr \\"},{"line_number":40,"context_line":"        python2-oslo-log"},{"line_number":41,"context_line":""}],"source_content_type":"text/x-sh","patch_set":31,"id":"9a629dbe_3b314306","line":38,"updated":"2016-11-09 00:30:06.000000000","message":"This is missing python-heat-agent-apply-config and python-heat-agent-hiera","commit_id":"2f94cec96c8d36f089ec95e0c02686a5e0a052c5"}],"heat_docker_agent/hook-docker.py":[{"author":{"_account_id":8833,"name":"Rabi Mishra","email":"ramishra@redhat.com","username":"rabi"},"change_message_id":"07e2133d13d865d290e3179cdf8488e81e7a6691","unresolved":false,"context_lines":[{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        # Remove old container before deploying just in case it\u0027s an update."},{"line_number":124,"context_line":"        # Heat does not seem to reliably define updates vs creates."},{"line_number":125,"context_line":"        remove_container(container.encode(\u0027ascii\u0027, \u0027ignore\u0027), log)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        log.debug(\"cmd: %s\" % cmd)"},{"line_number":128,"context_line":"        subproc \u003d subprocess.Popen(cmd, stdout\u003dsubprocess.PIPE,"}],"source_content_type":"text/x-python","patch_set":9,"id":"dab17558_d1a80ede","line":125,"range":{"start_line":125,"start_character":8,"end_line":125,"end_character":66},"updated":"2016-05-09 09:12:47.000000000","message":"Probably we can we use some hash(container config) to check if there is any change to a \u0027named\u0027 container?","commit_id":"eb97ab9c723849f9d2199df67a52e859413dfdf1"},{"author":{"_account_id":2011,"name":"Ian Main","email":"imain@redhat.com","username":"imain"},"change_message_id":"1e3e6a8afabc435bfb120e270a98cef9316c800e","unresolved":false,"context_lines":[{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        # Remove old container before deploying just in case it\u0027s an update."},{"line_number":124,"context_line":"        # Heat does not seem to reliably define updates vs creates."},{"line_number":125,"context_line":"        remove_container(container.encode(\u0027ascii\u0027, \u0027ignore\u0027), log)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        log.debug(\"cmd: %s\" % cmd)"},{"line_number":128,"context_line":"        subproc \u003d subprocess.Popen(cmd, stdout\u003dsubprocess.PIPE,"}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_7a030943","line":125,"range":{"start_line":125,"start_character":8,"end_line":125,"end_character":66},"in_reply_to":"dab17558_d1a80ede","updated":"2016-06-06 17:30:57.000000000","message":"We could but this seems to work well for now.  I think for a first cut this is fine.  This whole setup will be improved upon this dev cycle.","commit_id":"eb97ab9c723849f9d2199df67a52e859413dfdf1"},{"author":{"_account_id":1247,"name":"Mark McLoughlin","email":"markmc@redhat.com","username":"markmc"},"change_message_id":"bf713a13e9652f82a3c997dc9c370e66250009e5","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        \u0027pid\u0027: \"--pid\u003d%s\" % value,"},{"line_number":56,"context_line":"        \u0027restart\u0027: \"--restart\u003d%s\" % value,"},{"line_number":57,"context_line":"        \u0027image\u0027: value,"},{"line_number":58,"context_line":"        \u0027container_name\u0027: \"--name\u003d%s\" % value,"},{"line_number":59,"context_line":"        \u0027volumes\u0027: \"--volume\u003d%s\" % value,"},{"line_number":60,"context_line":"        \u0027environment\u0027: \"--env\u003d%s\" % value,"},{"line_number":61,"context_line":"        \u0027privileged\u0027: \"--privileged\u003d%s\" % value,"}],"source_content_type":"text/x-python","patch_set":21,"id":"9a89bdaa_6655084f","line":58,"updated":"2016-09-05 20:52:02.000000000","message":"It looks a bit pointless to have a way of overriding the name we passed, right?\n\n     group: docker-cmd\n      config:\n        computedata:\n          image: ...\n          container_name: computedata\n\nWhy pass the same name twice?","commit_id":"eee745d711a714ccb7b843683a181077012f2d6d"},{"author":{"_account_id":8833,"name":"Rabi Mishra","email":"ramishra@redhat.com","username":"rabi"},"change_message_id":"ffdd57b5eedce2e450d17e8bc75f292e8f917ba5","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        \u0027pid\u0027: \"--pid\u003d%s\" % value,"},{"line_number":56,"context_line":"        \u0027restart\u0027: \"--restart\u003d%s\" % value,"},{"line_number":57,"context_line":"        \u0027image\u0027: value,"},{"line_number":58,"context_line":"        \u0027container_name\u0027: \"--name\u003d%s\" % value,"},{"line_number":59,"context_line":"        \u0027volumes\u0027: \"--volume\u003d%s\" % value,"},{"line_number":60,"context_line":"        \u0027environment\u0027: \"--env\u003d%s\" % value,"},{"line_number":61,"context_line":"        \u0027privileged\u0027: \"--privileged\u003d%s\" % value,"}],"source_content_type":"text/x-python","patch_set":21,"id":"7a8ec9b2_d55d777a","line":58,"in_reply_to":"7a8ec9b2_5990d995","updated":"2016-09-21 04:02:37.000000000","message":"The original docker hook[1] that we wrote in heat(though it was removed in favor of the docker-compose hook later) used kubernetes pod manifest as the format. I agree with Steve that it would be good to use something like kubernetes pod manifest[2] or the appc pod manifest[3].\n\n[1] https://git.openstack.org/cgit/openstack/heat-templates/commit/?id\u003d717246d99a9d8057dc0192bc148bddec1b116287\n[2] http://kubernetes.io/docs/user-guide/pods/multi-container/#pod-configuration-file\n[3] https://github.com/appc/spec/blob/master/spec/pods.md#pod-manifest-schema","commit_id":"eee745d711a714ccb7b843683a181077012f2d6d"},{"author":{"_account_id":2011,"name":"Ian Main","email":"imain@redhat.com","username":"imain"},"change_message_id":"c0c534ed48d5868a4657f17acdfbe9c941663c85","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        \u0027pid\u0027: \"--pid\u003d%s\" % value,"},{"line_number":56,"context_line":"        \u0027restart\u0027: \"--restart\u003d%s\" % value,"},{"line_number":57,"context_line":"        \u0027image\u0027: value,"},{"line_number":58,"context_line":"        \u0027container_name\u0027: \"--name\u003d%s\" % value,"},{"line_number":59,"context_line":"        \u0027volumes\u0027: \"--volume\u003d%s\" % value,"},{"line_number":60,"context_line":"        \u0027environment\u0027: \"--env\u003d%s\" % value,"},{"line_number":61,"context_line":"        \u0027privileged\u0027: \"--privileged\u003d%s\" % value,"}],"source_content_type":"text/x-python","patch_set":21,"id":"9a89bdaa_b0e0ab97","line":58,"in_reply_to":"9a89bdaa_6655084f","updated":"2016-09-07 19:53:20.000000000","message":"Basically I\u0027m just reproducing the interface as defined by the docker-compose hook.  For whatever reason they did this as well.  I could change it now that I\u0027m not so worried about backwards compatibility.","commit_id":"eee745d711a714ccb7b843683a181077012f2d6d"},{"author":{"_account_id":360,"name":"Dan Prince","email":"dprince@redhat.com","username":"dan-prince"},"change_message_id":"ea1657daf78eb81bde98c6c59bc39f3507c7d4d8","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        \u0027pid\u0027: \"--pid\u003d%s\" % value,"},{"line_number":56,"context_line":"        \u0027restart\u0027: \"--restart\u003d%s\" % value,"},{"line_number":57,"context_line":"        \u0027image\u0027: value,"},{"line_number":58,"context_line":"        \u0027container_name\u0027: \"--name\u003d%s\" % value,"},{"line_number":59,"context_line":"        \u0027volumes\u0027: \"--volume\u003d%s\" % value,"},{"line_number":60,"context_line":"        \u0027environment\u0027: \"--env\u003d%s\" % value,"},{"line_number":61,"context_line":"        \u0027privileged\u0027: \"--privileged\u003d%s\" % value,"}],"source_content_type":"text/x-python","patch_set":21,"id":"7a8ec9b2_5990d995","line":58,"in_reply_to":"9a89bdaa_9e7f5adf","updated":"2016-09-20 16:53:06.000000000","message":"For that matter we recently (Ian\u0027s idea I think) spoke about having an abstraction that could work with either format: docker-cmd or kubernetes pod, etc. These hooks are really small things so I think I\u0027d like to see us go on and land this as-is and we can propose a new hook if we need to soon enough.","commit_id":"eee745d711a714ccb7b843683a181077012f2d6d"},{"author":{"_account_id":4571,"name":"Steve Baker","email":"sbaker@redhat.com","username":"steve-stevebaker"},"change_message_id":"57fc18a44f2150b4bd423ee300beb4c4f7d24a5c","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        \u0027pid\u0027: \"--pid\u003d%s\" % value,"},{"line_number":56,"context_line":"        \u0027restart\u0027: \"--restart\u003d%s\" % value,"},{"line_number":57,"context_line":"        \u0027image\u0027: value,"},{"line_number":58,"context_line":"        \u0027container_name\u0027: \"--name\u003d%s\" % value,"},{"line_number":59,"context_line":"        \u0027volumes\u0027: \"--volume\u003d%s\" % value,"},{"line_number":60,"context_line":"        \u0027environment\u0027: \"--env\u003d%s\" % value,"},{"line_number":61,"context_line":"        \u0027privileged\u0027: \"--privileged\u003d%s\" % value,"}],"source_content_type":"text/x-python","patch_set":21,"id":"9a89bdaa_9e7f5adf","line":58,"in_reply_to":"9a89bdaa_b0e0ab97","updated":"2016-09-13 00:54:06.000000000","message":"If the format is up in the air it might be worth looking at adopting the kubernetes pod format rather than something which resembles docker-compose","commit_id":"eee745d711a714ccb7b843683a181077012f2d6d"},{"author":{"_account_id":4571,"name":"Steve Baker","email":"sbaker@redhat.com","username":"steve-stevebaker"},"change_message_id":"f1e68268d596257c7bc4b8484ec434dca7cf94b5","unresolved":false,"context_lines":[{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    # convert config to dict"},{"line_number":96,"context_line":"    if not isinstance(config, dict):"},{"line_number":97,"context_line":"        config \u003d ast.literal_eval(json.dumps(yaml.load(config)))"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    for container in config:"},{"line_number":100,"context_line":"        cmd \u003d ["}],"source_content_type":"text/x-python","patch_set":21,"id":"9a89bdaa_032d0946","line":97,"updated":"2016-09-06 03:59:15.000000000","message":"Is there a reason why this isn\u0027t enough here?\n\n  config \u003d yaml.load(config)","commit_id":"eee745d711a714ccb7b843683a181077012f2d6d"},{"author":{"_account_id":2011,"name":"Ian Main","email":"imain@redhat.com","username":"imain"},"change_message_id":"c0c534ed48d5868a4657f17acdfbe9c941663c85","unresolved":false,"context_lines":[{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    # convert config to dict"},{"line_number":96,"context_line":"    if not isinstance(config, dict):"},{"line_number":97,"context_line":"        config \u003d ast.literal_eval(json.dumps(yaml.load(config)))"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    for container in config:"},{"line_number":100,"context_line":"        cmd \u003d ["}],"source_content_type":"text/x-python","patch_set":21,"id":"9a89bdaa_90fac741","line":97,"in_reply_to":"9a89bdaa_032d0946","updated":"2016-09-07 19:53:20.000000000","message":"You would think that would work.  I\u0027ll give it a go. :)","commit_id":"eee745d711a714ccb7b843683a181077012f2d6d"},{"author":{"_account_id":8833,"name":"Rabi Mishra","email":"ramishra@redhat.com","username":"rabi"},"change_message_id":"ffdd57b5eedce2e450d17e8bc75f292e8f917ba5","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        # Image name must come last."},{"line_number":124,"context_line":"        cmd.append(image_name)"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        # Remove old container before deploying just in case it\u0027s an update."},{"line_number":127,"context_line":"        # Heat does not seem to reliably define updates vs creates."},{"line_number":128,"context_line":"        try:"},{"line_number":129,"context_line":"            remove_container(container.encode(\u0027ascii\u0027, \u0027ignore\u0027), log)"},{"line_number":130,"context_line":"        except OSError:"},{"line_number":131,"context_line":"            log.debug(\"Error removing container, ignoring\\n\")"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"        log.debug(\"cmd: %s\" % cmd)"},{"line_number":134,"context_line":"        subproc \u003d subprocess.Popen(cmd, stdout\u003dsubprocess.PIPE,"}],"source_content_type":"text/x-python","patch_set":21,"id":"7a8ec9b2_b5e8eb7d","line":131,"range":{"start_line":126,"start_character":0,"end_line":131,"end_character":61},"updated":"2016-09-21 04:02:37.000000000","message":"As we all agree this is not efficient and we should fix this somehow. As I mentioned earlier, docker-compose hook had a way to support updates without recreating the containers all the time.","commit_id":"eee745d711a714ccb7b843683a181077012f2d6d"},{"author":{"_account_id":4571,"name":"Steve Baker","email":"sbaker@redhat.com","username":"steve-stevebaker"},"change_message_id":"325e2bbf424a65ff93fc7f536e32d895cffc7304","unresolved":false,"context_lines":[{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    if input_values.get(\u0027deploy_action\u0027) \u003d\u003d \u0027DELETE\u0027:"},{"line_number":85,"context_line":"        json.dump(build_response(stdout, stderr, 0), sys.stdout)"},{"line_number":86,"context_line":"        return"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    config \u003d c.get(\u0027config\u0027, \u0027\u0027)"},{"line_number":89,"context_line":"    if not config:"}],"source_content_type":"text/x-python","patch_set":23,"id":"5a8bc5a2_1da3f39f","line":86,"updated":"2016-09-22 04:25:07.000000000","message":"The docker-compose can do this because it has a dedicated os-refresh-config script to cleanup any containers which are no longer represented by a deployment resource:\nhttp://git.openstack.org/cgit/openstack/heat-templates/tree/hot/software-config/elements/heat-config-docker-compose/os-refresh-config/configure.d/50-heat-config-docker-compose\n\nI don\u0027t see anything in this hook which stops containers once they are started if the deployment is removed.","commit_id":"b177eec35d2bfc7a2c8fe33b5c2f03935a0d118c"},{"author":{"_account_id":2011,"name":"Ian Main","email":"imain@redhat.com","username":"imain"},"change_message_id":"45cd43da1250479efbc65b1f2ecf984e38933551","unresolved":false,"context_lines":[{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    if input_values.get(\u0027deploy_action\u0027) \u003d\u003d \u0027DELETE\u0027:"},{"line_number":85,"context_line":"        json.dump(build_response(stdout, stderr, 0), sys.stdout)"},{"line_number":86,"context_line":"        return"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    config \u003d c.get(\u0027config\u0027, \u0027\u0027)"},{"line_number":89,"context_line":"    if not config:"}],"source_content_type":"text/x-python","patch_set":23,"id":"3a98d1f4_1b1d5b0f","line":86,"in_reply_to":"5a8bc5a2_1da3f39f","updated":"2016-10-05 15:00:03.000000000","message":"You are right, I\u0027ll fix this.  Does this hook get run on removal?  Can I do like you say and keep state or do a comparison to see which containers need to be killed?","commit_id":"b177eec35d2bfc7a2c8fe33b5c2f03935a0d118c"},{"author":{"_account_id":4571,"name":"Steve Baker","email":"sbaker@redhat.com","username":"steve-stevebaker"},"change_message_id":"325e2bbf424a65ff93fc7f536e32d895cffc7304","unresolved":false,"context_lines":[{"line_number":92,"context_line":"        return"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    # convert config to dict"},{"line_number":95,"context_line":"    if not isinstance(config, dict):"},{"line_number":96,"context_line":"        config \u003d yaml.load(config)"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    for container in config:"}],"source_content_type":"text/x-python","patch_set":23,"id":"5a8bc5a2_5dc49b3f","line":95,"updated":"2016-09-22 04:25:07.000000000","message":"config could be any json type (list, dict, string, number, boolean) so this should do nothing if its a dict, attempt a load if its a string (handling the errors if the string isn\u0027t valid yaml) and error for other types","commit_id":"b177eec35d2bfc7a2c8fe33b5c2f03935a0d118c"},{"author":{"_account_id":4571,"name":"Steve Baker","email":"sbaker@redhat.com","username":"steve-stevebaker"},"change_message_id":"325e2bbf424a65ff93fc7f536e32d895cffc7304","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    # convert config to dict"},{"line_number":95,"context_line":"    if not isinstance(config, dict):"},{"line_number":96,"context_line":"        config \u003d yaml.load(config)"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    for container in config:"},{"line_number":99,"context_line":"        cmd \u003d ["}],"source_content_type":"text/x-python","patch_set":23,"id":"5a8bc5a2_9ddc631a","line":96,"updated":"2016-09-22 04:25:07.000000000","message":"this should be yaml.safe_load","commit_id":"b177eec35d2bfc7a2c8fe33b5c2f03935a0d118c"},{"author":{"_account_id":4571,"name":"Steve Baker","email":"sbaker@redhat.com","username":"steve-stevebaker"},"change_message_id":"325e2bbf424a65ff93fc7f536e32d895cffc7304","unresolved":false,"context_lines":[{"line_number":125,"context_line":"        # Remove old container before deploying just in case it\u0027s an update."},{"line_number":126,"context_line":"        # Heat does not seem to reliably define updates vs creates."},{"line_number":127,"context_line":"        try:"},{"line_number":128,"context_line":"            remove_container(container.encode(\u0027ascii\u0027, \u0027ignore\u0027), log)"},{"line_number":129,"context_line":"        except OSError:"},{"line_number":130,"context_line":"            log.debug(\"Error removing container, ignoring\\n\")"},{"line_number":131,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"5a8bc5a2_3df50f83","line":128,"updated":"2016-09-22 04:25:07.000000000","message":"Removing and restarting on every run isn\u0027t ideal. This is  declarative configuration so this hook needs to just figure out how the config differs from reality and make the required changes (thats why there is no differentiation between create and update)\n\nI\u0027ll come up with a more concrete suggestion tomorrow, but the choices are basically storing some state yourself and comparing the config with that, or introspecting the running containers and comparing the config with that.","commit_id":"b177eec35d2bfc7a2c8fe33b5c2f03935a0d118c"},{"author":{"_account_id":4571,"name":"Steve Baker","email":"sbaker@redhat.com","username":"steve-stevebaker"},"change_message_id":"5af6f97e3488142dbf3b58cb6c0025ffede57420","unresolved":false,"context_lines":[{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    # convert config to dict"},{"line_number":97,"context_line":"    if not isinstance(config, dict):"},{"line_number":98,"context_line":"        config \u003d ast.literal_eval(json.dumps(yaml.load(config)))"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    for container in config:"},{"line_number":101,"context_line":"        cmd \u003d ["}],"source_content_type":"text/x-python","patch_set":25,"id":"1a95cdbc_b8231bbc","line":98,"updated":"2016-10-09 23:25:23.000000000","message":"Is this an accidental regression from changeset 24, or does this not work?\n\n  config \u003d yaml.safe_load(config)","commit_id":"ec719952c5b49ed1a5ad5f08b24c1859f50cf700"},{"author":{"_account_id":13039,"name":"Martin André","email":"m.andre@redhat.com","username":"mandre"},"change_message_id":"731e8e10dc0cc25a8aea6cb156fe6f479b1d3311","unresolved":false,"context_lines":[{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    # convert config to dict"},{"line_number":97,"context_line":"    if not isinstance(config, dict):"},{"line_number":98,"context_line":"        config \u003d ast.literal_eval(json.dumps(yaml.load(config)))"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    for container in config:"},{"line_number":101,"context_line":"        cmd \u003d ["}],"source_content_type":"text/x-python","patch_set":25,"id":"1a95cdbc_fc066184","line":98,"in_reply_to":"1a95cdbc_b8231bbc","updated":"2016-10-10 13:37:26.000000000","message":"Spot on! I just meant to add a new \u0027user\u0027 arg to the docker hook and not revert any previous changes. Dunno what happened.","commit_id":"ec719952c5b49ed1a5ad5f08b24c1859f50cf700"}]}
