<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 21, 2017 at 8:53 PM, Jiří Stránský <span dir="ltr"><<a href="mailto:jistr@redhat.com" target="_blank">jistr@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 21.9.2017 18:04, Marios Andreou wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Thu, Sep 21, 2017 at 3:53 PM, Jiří Stránský <<a href="mailto:jistr@redhat.com" target="_blank">jistr@redhat.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 21.9.2017 12:31, Giulio Fidente wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 09/20/2017 07:36 PM, James Slagle wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Tue, Sep 19, 2017 at 8:37 AM, Giulio Fidente <<a href="mailto:gfidente@redhat.com" target="_blank">gfidente@redhat.com</a>><br>
wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 09/18/2017 05:37 PM, James Slagle wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- The entire sequence and flow is driven via Mistral on the Undercloud<br>
by default. This preserves the API layer and provides a clean reusable<br>
interface for the CLI and GUI.<br>
<br>
</blockquote>
<br>
I think it's worth saying that we want to move the deployment steps out<br>
of heat and in ansible, not in mistral so that mistral will run the<br>
workflow only once and let ansible go through the steps<br>
<br>
I think having the steps in mistral would be a nice option to be able to<br>
rerun easily a particular deployment step from the GUI, versus having<br>
them in ansible which is instead a better option for CLI users ... but<br>
it looks like having them in ansible is the only option which permits us<br>
to reuse the same code to deploy an undercloud because having the steps<br>
in mistral would require the undercloud installation itself to depend on<br>
mistral which we don't want to<br>
<br>
James, Dan, please comment on the above if I am wrong<br>
<br>
</blockquote>
<br>
That's correct. We don't want to require Mistral to install the<br>
Undercloud. However, I don't think that necessarily means it has to be<br>
a single call to ansible-playbook. We could have multiple invocations<br>
of ansible-playbook. Both Mistral and CLI code for installing the<br>
undercloud could handle that easily.<br>
<br>
You wouldn't be able to interleave an external playbook among the<br>
deploy steps however. That would have to be done under a single call<br>
to ansible-playbook (at least how that is written now). We could<br>
however have hooks that could serve as integration points to call<br>
external playbooks after each step.<br>
<br>
</blockquote>
<br>
the benefits of driving the steps from mistral are that then we could<br>
also interleave the deployment steps and we won't need the<br>
ansible-playbook hook for the "external" services:<br>
<br>
1) collect the ansible tasks *and* the workflow_tasks (per step) from heat<br>
<br>
2) launch the stepN deployment workflow (ansible-playbook)<br>
<br>
3) execute any workflow_task defined for stepN (like ceph-ansible<br>
playbook)<br>
<br>
4) repeat 2 and 3 for stepN+1<br>
<br>
I think this would also provide a nice interface for the UI ... but then<br>
we'd need mistral to be able to deploy the undercloud<br>
<br>
<br>
</blockquote></blockquote>
<br>
Why not launch the _single_  deploy_steps playbook (so we have<br>
when/conditionals with step numbers), passing in the step you want to have<br>
executed (we can pass this in as a parameter to the mistral workflow and<br>
pass through to the ansible-playbook invocation?), otherwise execute all<br>
the steps.<br>
</blockquote>
<br></div></div>
+1 that's the sort of thing i meant by "it's not baked in by default but we could make it so". We could even give it a list of steps like `tripleo_run_steps: [4, 5, 6]`.<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
In either case whether it should be ansible handling the loop<br>
based on a passed in parameter.<br>
'Ansible-native' looping is currently the<br>
case for the current deploy_steps_playbook here<br>
<a href="https://github.com/openstack/tripleo-heat-templates/blob/259cf512b3b7e3539105cdb52421e3239701ef73/common/deploy-steps.j2#L335" rel="noreferrer" target="_blank">https://github.com/openstack/t<wbr>ripleo-heat-templates/blob/259<wbr>cf512b3b7e3539105cdb52421e3239<wbr>701ef73/common/deploy-steps.<wbr>j2#L335</a><br>
- can we not work parameterise that playbook so that we either do loop with<br>
the variable, or just step X?<br>
<br>
Then for the upgrade workflow it is as above but  1.5 first launch the<br>
upgrade_tasks_playbook  then the deploy_steps playbook for all the steps<br>
(consider this<br>
<a href="https://review.openstack.org/#/c/505624/3/scripts/upgrade-non-controller.sh@162" rel="noreferrer" target="_blank">https://review.openstack.org/#<wbr>/c/505624/3/scripts/upgrade-no<wbr>n-controller.sh@162</a><br>
- download and run the playbooks for non-controllers in O->P upgrade<br>
pointing this out to illustrate the workflow I have in mind). So I don't<br>
see why we can't have mistral invoking ansible-playbook and taking<br>
parameters like which playbook, which step etc.<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Alternatively we could do the main step loop in Ansible directly, and have<br>
the tasks do whatever they need to get the particular service deployed,<br>
from  to launching a nested ansible-playbook run if that's what it takes.<br>
<br>
</blockquote>
<br>
<br>
I think you can do both, I mean mistral invoking ansible-playbook and still<br>
let ansible handle the steps with a loop.<br>
</blockquote>
<br></span>
+1 exactly. FWIW i'm totally on board with wrapping everything in Mistral on the outermost level, as that's required for UI. I'm just not keen on having Mistral enter the process in between each step and drive the step loop.<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
In fact that is what the current<br>
upgrade_steps_playbook does here<br>
<a href="https://github.com/openstack/tripleo-heat-templates/blob/259cf512b3b7e3539105cdb52421e3239701ef73/common/deploy-steps.j2#L363-L365" rel="noreferrer" target="_blank">https://github.com/openstack/t<wbr>ripleo-heat-templates/blob/259<wbr>cf512b3b7e3539105cdb52421e3239<wbr>701ef73/common/deploy-steps.<wbr>j2#L363-L365</a><br>
with a loop variable 'step'. The upgrade_tasks have their 'tags: stepX'<br>
converted to 'when: step == X' in the client here<br>
<a href="https://github.com/openstack/python-tripleoclient/blob/4d342826d6c3db38ee88dccc92363b655b1161a5/tripleoclient/v1/overcloud_config.py#L63" rel="noreferrer" target="_blank">https://github.com/openstack/p<wbr>ython-tripleoclient/blob/4d342<wbr>826d6c3db38ee88dccc92363b655b1<wbr>161a5/tripleoclient/v1/overclo<wbr>ud_config.py#L63</a><br>
- we must come up with a better solution than that; ultimately we can just<br>
update the existing upgrade_tasks to have 'when' and the main reason for<br>
not doing so already was not to break the heat-driven upgrade workflow but<br>
that is going away for Q.<br>
<br>
</blockquote>
<br></span>
+1 for `when` instead of `tags`, ideally we'd switch the main deployment tasks to that too.<div><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
That way we could run the whole thing end-to-end via ansible-playbook, or<br>
if needed one could execute smaller bits by themselves (steps or nested<br>
playbook runs) -- that capability is not baked in by default, but i think<br>
we could make it so.<br>
<br>
Also the interface for services would be clean and simple -- it's always<br>
the ansible tasks.<br>
<br>
And Mistral-less use cases become easier to handle too (= undercloud<br>
installation when Mistral isn't present yet, or development envs when you<br>
want to tune the playbook directly without being forced to go through<br>
Mistral).<br>
<br>
</blockquote>
<br>
You don't *have* to go through mistral either way I mean you can always<br>
just run ansible-playbook directly using the generated playbooks if that is<br>
what you need for dev/debug etc.<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Logging becomes a bit more unwieldy in this scenario though, as for the<br>
nested ansible-playbook execution, all output would go into a task in the<br>
outer playbook, which would be harder to follow and the log of the outer<br>
playbook could be huge.<br>
<br>
So this solution is no silver bullet, but from my current point of view it<br>
seems a bit less conceptually foreign than using Mistral to provide step<br>
loop functionality to Ansible, which should be able to handle that on its<br>
own.<br>
<br>
<br>
</blockquote>
just saying using mistral to invoke ansible-playbook doesn't imply having<br>
mistral do the looping/step control. I think it was already mentioned that<br>
we can/will have multiple invocations of ansible-playbook. Having the loop<br>
in the playbook then means organising our templates a certain way so that<br>
there is a _single_ parent playbook which we can parameterise to then run<br>
all or some of the steps (which as pointed above is currently the case for<br>
the upgrade and deployment steps playbooks).<br>
</blockquote>
<br></div></div>
Yup, +1 again :) However, the 1)2)3)4) approach discussed earlier in the thread suggested to hand over the step loop control to Mistral and keep using the Mistral workflow_tasks, which would make it impossible to have a single parent playbook, if i understood correctly. So Mistral would be a requirement for running all steps via a single command (impacting UC install and developer workflow).<br>
<br>
Or if you really wanted to create a single playbook from the 1)2)3)4) approach, it could create a Mistral->Ansible[->Mistral->An<wbr>sible] chain for things like Ceph install, which sounds suboptimal as well.<br>
<br>
Having loop control in Ansible allows going just Mistral->Ansible[->Ansible], with the option to run just Ansible[->Ansible] for UC install and dev workflow.<br>
<br>
(^ The bracketed parts only come into play with the external playbooks like for Ceph and Kubernetes.)<br>
<br>
Sorry for the overcommunication here in case it's clear. Just want to make sure that we're on the same page about what are the options that we're discussing.<br></blockquote><div><br></div><div><br></div><div>+1 thanks Jirka in fact I got the impression you were advocating more for mistral to own the workflow and steps rather than having it just invoke the playbooks & passing through params about what would be executed.</div><div><br></div><div>marios</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Jirka<div class="HOEnZb"><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
For me the main advantage of using mistral is the integration with UI -<br>
we've never had 'proper' client/common support for upgrades or updates and<br>
getting that is a goal for Q (<br>
<a href="https://etherpad.openstack.org/p/tripleo-ptg-queens-upgrades" rel="noreferrer" target="_blank">https://etherpad.openstack.org<wbr>/p/tripleo-ptg-queens-upgrades</a> - if nothing<br>
else, we need a more decent way of handling the ansible-playbook<br>
invocations than a bash script like upgrade-non-controller). There is<br>
already some relevant work under way here FYI<br>
<a href="https://review.openstack.org/#/c/487496/" rel="noreferrer" target="_blank">https://review.openstack.org/#<wbr>/c/487496/</a><br>
<a href="https://review.openstack.org/#/c/487488/" rel="noreferrer" target="_blank">https://review.openstack.org/#<wbr>/c/487488/</a> that will be used for P minor<br>
update.<br>
<br>
thanks, marios<br>
<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
- It would still be possible to run ansible-playbook directly for<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
various use cases (dev/test/POC/demos). This preserves the quick<br>
iteration via Ansible that is often desired.<br>
<br>
- The remaining SoftwareDeployment resources in tripleo-heat-templates<br>
need to be supported by config download so that the entire<br>
configuration can be driven with Ansible, not just the deployment<br>
steps. The success criteria for this point would be to illustrate<br>
using an image that does not contain a running os-collect-config.<br>
<br>
- The ceph-ansible implementation done in Pike could be reworked to<br>
use this model. "config download" could generate playbooks that have<br>
hooks for calling external playbooks, or those hooks could be<br>
represented in the templates directly. The result would be the same<br>
either way though in that Heat would no longer be triggering a<br>
separate Mistral workflow just for ceph-ansible.<br>
<br>
</blockquote>
<br>
I'd say for ceph-ansible, kubernetes and in general anything else which<br>
needs to run with a standard playbook installed on the undercloud and<br>
not one generated via the heat templates... these "external" services<br>
usually require the inventory file to be in different format, to<br>
describe the hosts to use on a per-service basis, not per-role (and I<br>
mean tripleo roles here, not ansible roles obviously)<br>
<br>
About that, we discussed a more long term vision where the playbooks<br>
(static data) needd to describe how to deploy/upgrade a given service is<br>
in a separate repo (like tripleo-apb) and we "compose" from heat the<br>
list of playbooks to be executed based on the roles/enabled services; in<br>
this scenario we'd be much closer to what we had to do for ceph-ansible<br>
and I feel like that might finally allow us merge back the ceph<br>
deployment (or kubernetes deployment) process into the more general<br>
approach driven by tripleo<br>
<br>
James, Dan, comments?<br>
<br>
</blockquote>
<br>
Agreed, I think this is the longer term plan in regards to using<br>
APB's, where everything consumed is an external playbook/role.<br>
<br>
We definitely want to consider this plan in parallel with the POC work<br>
that Flavio is pulling together and make sure that they are aligned so<br>
that we're not constantly reworking the framework.<br>
<br>
I've not yet had a chance to review the material he sent out this<br>
morning, but perhaps we could work together to update the sequence<br>
diagram to also have a "future" state to indicate where we are going<br>
and what it would look like with APB's and external paybooks.<br>
<br>
</blockquote>
<br>
</blockquote>
Indeed that would be great :) IIUC, APBs are deployed by running a<br>
short-lived container with Ansible inside, which then connects to<br>
Kubernetes endpoint to create resources. So this should be a less<br>
complicated case than running non-containerized external playbooks.<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
this would be awesome, note that it isn't only ceph and kubernetes<br>
anymore in this scenario ... I just spotted a submission for the Skydive<br>
composable service and it uses the same mistral/ansible-playbook<br>
approach ... so it's already 3 looking forward for this!<br>
<br>
<a href="https://review.openstack.org/#/c/502353/" rel="noreferrer" target="_blank">https://review.openstack.org/#<wbr>/c/502353/</a><br>
<br>
<br>
</blockquote>
[1] <a href="https://github.com/ansibleplaybookbundle/ansible-playbook-" rel="noreferrer" target="_blank">https://github.com/ansibleplay<wbr>bookbundle/ansible-playbook-</a><br>
bundle/blob/master/docs/<a href="http://design.md#deploy" rel="noreferrer" target="_blank">design<wbr>.md#deploy</a><br>
<br>
<br>
______________________________<wbr>______________________________<wbr>______________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.op<wbr>enstack.org?subject:unsubscrib<wbr>e</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi<wbr>-bin/mailman/listinfo/openstac<wbr>k-dev</a><br>
<br>
</blockquote>
<br>
<br>
<br>
______________________________<wbr>______________________________<wbr>______________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.op<wbr>enstack.org?subject:unsubscrib<wbr>e</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi<wbr>-bin/mailman/listinfo/openstac<wbr>k-dev</a><br>
<br>
</blockquote>
<br>
<br>
______________________________<wbr>______________________________<wbr>______________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.op<wbr>enstack.org?subject:unsubscrib<wbr>e</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi<wbr>-bin/mailman/listinfo/openstac<wbr>k-dev</a><br>
</div></div></blockquote></div><br></div></div>