<div dir="ltr">Hi All,<div><br></div><div>I've made some additional updates to my wireframes[1] and I think they are in a good spot now for a discussion/review at the PTG next week.</div><div><br></div><div>Please feel free to reach out with any questions or feedback!</div><div><br></div><div>Thanks,</div><div>Liz</div><div><br></div><div>[1] <a href="https://lizsurette.github.io/OpenStack-Design/tripleo-ui/3-tripleo-ui-edge-cases/7.advancednetworkconfigurationandtopology">https://lizsurette.github.io/OpenStack-Design/tripleo-ui/3-tripleo-ui-edge-cases/7.advancednetworkconfigurationandtopology</a></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 22, 2018 at 7:55 PM, Dan Sneddon <span dir="ltr"><<a href="mailto:dsneddon@redhat.com" target="_blank">dsneddon@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 dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Thu, Feb 15, 2018 at 2:00 AM, Jiri Tomasek <span dir="ltr"><<a href="mailto:jtomasek@redhat.com" target="_blank">jtomasek@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_3765471036263504428gmail-h5">On Wed, Feb 14, 2018 at 11:16 PM, Ben Nemec <span dir="ltr"><<a href="mailto:openstack@nemebean.com" target="_blank">openstack@nemebean.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><br>
<br>
On 02/09/2018 08:49 AM, Jiri Tomasek wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
*Step 2. network-environment -> NIC configs*<span><br>
<br>
Second step of network configuration is NIC config. For this network-environment.yaml is used which references NIC config templates which define network_config in their resources section. User is currently required to configure these templates manually. We would like to provide interactive view which would allow user to setup these templates using TripleO UI. A good example is a standalone tool created by Ben Nemec [3].<br>
<br>
There is currently work aimed for Pike to introduce jinja templating for network environments and templates [4] (single-nic-with-vlans, bond-with-vlans) to support composable networks and roles (integrate data from roles_data.yaml and network_data.yaml) It would be great if we could move this one step further by using these samples as a starting point and let user specify full NIC configuration.<br>
<br>
Available information at this point:<br>
- list of roles and networks as well as which networks need to be configured at which role's NIC Config template<br>
- os-net-config schema which defines NIC configuration elements and relationships [5]<br>
- jinja templated sample NIC templates<br>
<br>
Requirements:<br>
- provide feedback to the user about networks assigned to role and have not been configured in NIC config yet<br>
</span></blockquote>
<br>
I don't have much to add on this point, but I will note that because my UI is standalone and pre-dates composable networks it takes the opposite approach. As a user adds a network to a role, it exposes the configuration for that network. Since you have the networks ahead of time, you can obviously expose all of those settings up front and ensure the correct networks are configured for each nic-config.<br>
<br>
I say this mostly for everyone's awareness so design elements of my tool don't get copied where they don't make sense.<span><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
- let user construct network_config section of NIC config templates for each role (brigdes/bonds/vlans/interface<wbr>s...)<br>
- provide means to assign network to vlans/interfaces and automatically construct network_config section parameter references<br>
</blockquote>
<br></span>
So obviously your UI code is going to differ, but I will point out that the code in my tool for generating the actual os-net-config data is semi-standalone: <a href="https://github.com/cybertron/tripleo-scripts/blob/master/net_processing.py" rel="noreferrer" target="_blank">https://github.com/cybertron/t<wbr>ripleo-scripts/blob/master/net<wbr>_processing.py</a><br>
<br>
It's also about 600 lines of code and doesn't even handle custom roles or networks yet. I'm not clear whether it ever will at this point given the change in my focus.<br>
<br>
Unfortunately the input JSON schema isn't formally documented, although the unit tests do include a number of examples. <a href="https://github.com/cybertron/tripleo-scripts/blob/master/test-data/all-the-things/nic-input.json" rel="noreferrer" target="_blank">https://github.com/cybertron/t<wbr>ripleo-scripts/blob/master/tes<wbr>t-data/all-the-things/nic-inpu<wbr>t.json</a> covers quite a few different cases.<span><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
- populate parameter definitions in NIC config templates based on role/networks assignment<br>
- populate parameter definitions in NIC config templates based on specific elements which use them e.g. BondInterfaceOvsOptions in case when ovs_bond is used<br>
</blockquote>
<br></span>
I guess there's two ways to handle this - you could use the new jinja templating to generate parameters, or you could handle it in the generation code.<br>
<br>
I'm not sure if there's a chicken-and-egg problem with the UI generating jinja templates, but that's probably the simplest option if it works. The approach I took with my tool was to just throw all the parameters into all the files and if they're unused then oh well. With jinja templating you could do the same thing - just copy a single boilerplate parameter header that includes the jinja from the example nic-configs and let the templating handle all the logic for you.<br>
<br>
It would be cleaner to generate static templates that don't need to be templated, but it would require re-implementing all of the custom network logic for the UI. I'm not sure being cleaner is sufficient justification for doing that.<span><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
- store NIC config templates in deployment plan and reference them from network-environment.yaml<br>
<br>
Problems to solve:<br>
As a biggest problem to solve I see defining logic which would automatically handle assigning parameters to elements in network_config based on Network which user assigns to the element. For example: Using GUI, user is creating network_config for compute role based on network/config/multiple-nics/c<wbr>ompute.yaml, user adds an interface and assigns the interface to Tenant network. Resulting template should then automatically populate addresses/ip_netmask: get_param: TenantIpSubnet. Question is whether all this logic should live in GUI or should GUI pass simplified format to Mistral workflow which will convert it to proper network_config format and populates the template with it.<br>
</blockquote>
<br></span>
I guess the fact that I separated the UI and config generation code in my tool is my answer to this question. I don't remember all of my reasons for that design, but I think the main thing was to keep the input and generation cleanly separated. Otherwise there was a danger of making a UI change and having it break the generation process because they were tightly coupled. Having a JSON interface between the two avoids a lot of those problems. It also made it fairly easy to unit test the generation code, whereas trying to mock out all of the UI elements would have been a fragile nightmare.<br>
<br>
It does require a bunch of translation code[1], but a lot of it is fairly boilerplate (just map UI inputs to JSON keys).<br>
<br>
1: <a href="https://github.com/cybertron/tripleo-scripts/blob/171aedabfead1f27f4dc0fce41a8b82da28923ed/net-iso-gen.py#L515" rel="noreferrer" target="_blank">https://github.com/cybertron/t<wbr>ripleo-scripts/blob/171aedabfe<wbr>ad1f27f4dc0fce41a8b82da28923ed<wbr>/net-iso-gen.py#L515</a><br>
<br>
Hope this helps.</blockquote><div><br></div></div></div>Ben, thanks a lot for your input. I think this makes the direction with NIC configs clearer:<div><br></div><div>1. The generated template will include all possible parameters definitions unless we find a suitable way of populating parameters section part of template generation process. Note that current jinja templates for NIC config (e.g. network/config/multiple-nics/r<wbr>ole.role.j2.yaml:127) create these definitions conditionally by specific role name which is not very elegant in terms of custom roles.</div></div></div></div></blockquote><div><br></div></div></div><div>This patch recently landed, which generates all the needed parameters in the sample NIC configs based on the composable networks defined in network_data.yaml:</div><div><a href="https://review.openstack.org/#/c/523638" target="_blank">https://review.openstack.org/#<wbr>/c/523638</a><br></div><div><br></div><div>Furthermore, this patch removes all the role-specific hard-coded templates, and generates templates based on the role-to-network association in roles_data.yaml.</div><div><br></div><div>I think we could use this method to generate the needed parameters for the templates generated in the UI. I would personally like to see a workflow where the user chose one of the built-in NIC config designs to generate samples, which could then be further edited. Presenting a blank slate to the user, and requiring them to build up the hierarchy is very confusing unless the installer is very familiar with the desired architecture (first add a bridge, then add a bond to the bridge, then add interfaces to the bond, then add VLANs to the bridge). It's better to start with a basic example (VLANs on a single NIC, one NIC per network, DPDK, etc.), and allow the user to customize from there.</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>2. GUI is going to define forms to add/configure network elements (interface, bridge, bond, vlan, ...) and provide user friendly way to combine these together. The whole data construct (per Role) is going to be sent to tripleo-common workflow as json. Workflow consumes json input and produces final template yaml. I think we should be able to reuse bunch of the logic which Ben already created.</div><div><br></div><div>Example: </div><div>json input from GUI:</div><div><font face="monospace, monospace">..., {</font></div><div><font face="monospace, monospace"> type: 'interface',</font></div><div><font face="monospace, monospace"> name: 'nic1',</font></div><div><font face="monospace, monospace"> network_name_lower: 'external'</font></div><div><font face="monospace, monospace">},...</font></div><div>transformed by tripleo-common:</div><div><font face="monospace, monospace">...</font></div><div><div><font face="monospace, monospace">- type: interface</font></div><div><font face="monospace, monospace"> name: nic{{loop.index + 1}}</font></div><div><font face="monospace, monospace"> use_dhcp: false</font></div><div><font face="monospace, monospace"> addresses:</font></div><div><font face="monospace, monospace"> - ip_netmask:</font></div><div><font face="monospace, monospace"> get_param: {{<a href="http://network.name/" target="_blank">network.name</a>}}IpSubnet</font></div></div><div><font face="monospace, monospace">...</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">With this approach, we'll create common API provided by Mistral to generate NIC config templates which can be reused by CLI and other clients, not TripleO UI specifically. Note that we will also need a 'reverse' Mistral workflow which is going to convert template yaml network_config into the input json format, so GUI can display current configuration to the user and let him change that.</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Liz has updated network configuration wireframes which can be found here <a href="https://lizsurette.github.io/OpenStack-Design/tripleo-ui/3-tripleo-ui-edge-cases/7.advancednetworkconfigurationandtopology" target="_blank">https://lizsurette.github<wbr>.io/OpenStack-Design/tripleo-<wbr>ui/3-tripleo-ui-edge-cases/7.a<wbr>dvancednetworkconfigurationand<wbr>topology</a> . The goal is to provide a graphical network configuration overview and let user perform actions from it. This ensures that with every action performed, user immediately gets clear feedback on how does the network configuration look.</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">-- Jirka</font></div></div></div></div></blockquote><div><br></div></span><div>I like the wireframes overall. However, I'm trying to avoid a flexible and open-ended configuration if it isn't clear what the final configuration should look like. We want to present the user with some basic forms, and let them modify those forms to their needs.</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class="m_3765471036263504428gmail-m_3800312315228686251gmail-m_7957400931392313882HOEnZb"><font color="#888888"><br>
<br>
-Ben<br>
</font></span></blockquote></div><br></div></div>
<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></span></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="m_3765471036263504428gmail_signature"><div dir="ltr">Dan Sneddon | Senior Principal OpenStack Engineer<br><a href="mailto:dsneddon@redhat.com" target="_blank">dsneddon@redhat.com</a> | <a href="http://redhat.com/openstack" target="_blank">redhat.com/openstack</a><br>dsneddon:irc | @dxs:twitter<br></div></div>
</font></span></div></div>
<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.<wbr>openstack.org?subject:<wbr>unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/<wbr>cgi-bin/mailman/listinfo/<wbr>openstack-dev</a><br>
<br></blockquote></div><br></div>