Merge "SRIOV derive parameters workflows"

This commit is contained in:
Zuul 2017-12-20 16:34:02 +00:00 committed by Gerrit Code Review
commit 4beb26bb0e
2 changed files with 152 additions and 35 deletions

View File

@ -218,10 +218,13 @@ workflows:
# Establish an empty dictionary of derived_parameters prior to # Establish an empty dictionary of derived_parameters prior to
# invoking the individual "feature" algorithms # invoking the individual "feature" algorithms
derived_parameters: <% dict() %> derived_parameters: <% dict() %>
on-success: handle_dpdk_feature
on-error: set_status_failed_get_introspection_data
handle_dpdk_feature:
on-success: on-success:
- get_dpdk_derive_params: <% $.role_features.contains('DPDK') %> - get_dpdk_derive_params: <% $.role_features.contains('DPDK') %>
- get_hci_derive_params: <% not $.role_features.contains('DPDK') and $.role_features.contains('HCI') %> - handle_sriov_feature: <% not $.role_features.contains('DPDK') %>
on-error: set_status_failed_get_introspection_data
get_dpdk_derive_params: get_dpdk_derive_params:
workflow: tripleo.derive_params_formulas.v1.dpdk_derive_params workflow: tripleo.derive_params_formulas.v1.dpdk_derive_params
@ -232,9 +235,30 @@ workflows:
user_inputs: <% $.user_inputs %> user_inputs: <% $.user_inputs %>
publish: publish:
derived_parameters: <% task().result.get('derived_parameters', {}) %> derived_parameters: <% task().result.get('derived_parameters', {}) %>
on-success: get_host_derive_params on-success: handle_sriov_feature
on-error: set_status_failed_get_dpdk_derive_params on-error: set_status_failed_get_dpdk_derive_params
handle_sriov_feature:
on-success:
- get_sriov_derive_params: <% $.role_features.contains('SRIOV') %>
- handle_host_feature: <% not $.role_features.contains('SRIOV') %>
get_sriov_derive_params:
workflow: tripleo.derive_params_formulas.v1.sriov_derive_params
input:
role_name: <% $.role_name %>
hw_data: <% $.hw_data %>
derived_parameters: <% $.derived_parameters %>
publish:
derived_parameters: <% task().result.get('derived_parameters', {}) %>
on-success: handle_host_feature
on-error: set_status_failed_get_sriov_derive_params
handle_host_feature:
on-success:
- get_host_derive_params: <% $.role_features.contains('HOST') %>
- handle_hci_feature: <% not $.role_features.contains('HOST') %>
get_host_derive_params: get_host_derive_params:
workflow: tripleo.derive_params_formulas.v1.host_derive_params workflow: tripleo.derive_params_formulas.v1.host_derive_params
input: input:
@ -244,9 +268,12 @@ workflows:
derived_parameters: <% $.derived_parameters %> derived_parameters: <% $.derived_parameters %>
publish: publish:
derived_parameters: <% task().result.get('derived_parameters', {}) %> derived_parameters: <% task().result.get('derived_parameters', {}) %>
on-success: handle_hci_feature
on-error: set_status_failed_get_host_derive_params
handle_hci_feature:
on-success: on-success:
- get_hci_derive_params: <% $.role_features.contains('HCI') %> - get_hci_derive_params: <% $.role_features.contains('HCI') %>
on-error: set_status_failed_get_host_derive_params
get_hci_derive_params: get_hci_derive_params:
workflow: tripleo.derive_params_formulas.v1.hci_derive_params workflow: tripleo.derive_params_formulas.v1.hci_derive_params
@ -311,6 +338,13 @@ workflows:
message: <% task(get_dpdk_derive_params).result %> message: <% task(get_dpdk_derive_params).result %>
on-success: fail on-success: fail
set_status_failed_get_sriov_derive_params:
publish:
role_name: <% $.role_name %>
status: FAILED
message: <% task(get_sriov_derive_params).result %>
on-success: fail
set_status_failed_get_host_derive_params: set_status_failed_get_host_derive_params:
publish: publish:
role_name: <% $.role_name %> role_name: <% $.role_name %>
@ -376,13 +410,16 @@ workflows:
# The role supports the DPDK feature in ODL if the OvsEnableDpdk parameter value is true in role parameters. # The role supports the DPDK feature in ODL if the OvsEnableDpdk parameter value is true in role parameters.
odl_dpdk: <% let(role => $.role_name) -> $.heat_resource_tree.parameters.get(concat($role, 'Parameters'), {}).get('default', {}).get('OvsEnableDpdk', false) %> odl_dpdk: <% let(role => $.role_name) -> $.heat_resource_tree.parameters.get(concat($role, 'Parameters'), {}).get('default', {}).get('OvsEnableDpdk', false) %>
# The role supports the SRIOV feature if it includes NeutronSriovAgent services.
sriov: <% $.role_services.any($.get('type', '').endsWith('::NeutronSriovAgent')) %>
# The role supports the HCI feature if it includes both NovaCompute and CephOSD services. # The role supports the HCI feature if it includes both NovaCompute and CephOSD services.
hci: <% $.role_services.any($.get('type', '').endsWith('::NovaCompute')) and $.role_services.any($.get('type', '').endsWith('::CephOSD')) %> hci: <% $.role_services.any($.get('type', '').endsWith('::NovaCompute')) and $.role_services.any($.get('type', '').endsWith('::CephOSD')) %>
build_feature_dict: build_feature_dict:
on-success: filter_features on-success: filter_features
publish: publish:
feature_dict: <% dict(DPDK => ($.dpdk or $.odl_dpdk), HCI => $.hci) %> feature_dict: <% dict(DPDK => ($.dpdk or $.odl_dpdk), SRIOV => $.sriov, HOST => ($.dpdk or $.odl_dpdk or $.sriov), HCI => $.hci) %>
filter_features: filter_features:
publish: publish:

View File

@ -98,22 +98,14 @@ workflows:
on-error: set_status_failed_get_pmd_cpus_range_list on-error: set_status_failed_get_pmd_cpus_range_list
get_host_cpus: get_host_cpus:
action: tripleo.derive_params.get_host_cpus_list inspect_data=<% $.hw_data %> workflow: tripleo.derive_params_formulas.v1.get_host_cpus
publish:
host_cpus: <% task().result %>
on-success:
- get_host_cpus_range_list: <% $.host_cpus %>
- set_status_failed_get_host_cpus: <% not $.host_cpus %>
on-error: set_status_failed_on_error_get_host_cpus
get_host_cpus_range_list:
action: tripleo.derive_params.convert_number_to_range_list
input: input:
num_list: <% $.host_cpus %> role_name: <% $.role_name %>
hw_data: <% $.hw_data %>
publish: publish:
host_cpus: <% task().result %> host_cpus: <% task().result.get('host_cpus', '') %>
on-success: get_sock_mem on-success: get_sock_mem
on-error: set_status_failed_get_host_cpus_range_list on-error: set_status_failed_get_host_cpus
get_sock_mem: get_sock_mem:
action: tripleo.derive_params.get_dpdk_socket_memory action: tripleo.derive_params.get_dpdk_socket_memory
@ -196,19 +188,7 @@ workflows:
set_status_failed_get_host_cpus: set_status_failed_get_host_cpus:
publish: publish:
status: FAILED status: FAILED
message: 'Unable to determine OvsDpdkCoreList parameter' message: <% task(get_host_cpus).result.get('message', '') %>
on-success: fail
set_status_failed_on_error_get_host_cpus:
publish:
status: FAILED
message: <% task(get_host_cpus).result %>
on-success: fail
set_status_failed_get_host_cpus_range_list:
publish:
status: FAILED
message: <% task(get_host_cpus_range_list).result %>
on-success: fail on-success: fail
set_status_failed_get_sock_mem: set_status_failed_get_sock_mem:
@ -224,6 +204,94 @@ workflows:
on-success: fail on-success: fail
sriov_derive_params:
description: >
This workflow derives parameters for the SRIOV feature.
input:
- role_name
- hw_data # introspection data
- derived_parameters: {}
output:
derived_parameters: <% $.derived_parameters.mergeWith($.get('sriov_parameters', {})) %>
tags:
- tripleo-common-managed
tasks:
get_host_cpus:
workflow: tripleo.derive_params_formulas.v1.get_host_cpus
input:
role_name: <% $.role_name %>
hw_data: <% $.hw_data %>
publish:
host_cpus: <% task().result.get('host_cpus', '') %>
on-success: get_sriov_parameters
on-error: set_status_failed_get_host_cpus
get_sriov_parameters:
publish:
# SriovHostCpusList parameter is added temporarily and it's removed later from derived parameters result.
sriov_parameters: <% dict(concat($.role_name, 'Parameters') => dict('SriovHostCpusList' => $.get('host_cpus', ''))) %>
set_status_failed_get_host_cpus:
publish:
status: FAILED
message: <% task(get_host_cpus).result.get('message', '') %>
on-success: fail
get_host_cpus:
description: >
Fetching the host CPU list from the introspection data, and then converting the raw list into a range list.
input:
- hw_data # introspection data
output:
host_cpus: <% $.get('host_cpus', '') %>
tags:
- tripleo-common-managed
tasks:
get_host_cpus:
action: tripleo.derive_params.get_host_cpus_list inspect_data=<% $.hw_data %>
publish:
host_cpus: <% task().result %>
on-success:
- get_host_cpus_range_list: <% $.host_cpus %>
- set_status_failed_get_host_cpus: <% not $.host_cpus %>
on-error: set_status_failed_on_error_get_host_cpus
get_host_cpus_range_list:
action: tripleo.derive_params.convert_number_to_range_list
input:
num_list: <% $.host_cpus %>
publish:
host_cpus: <% task().result %>
on-error: set_status_failed_get_host_cpus_range_list
set_status_failed_get_host_cpus:
publish:
status: FAILED
message: 'Unable to determine host cpus'
on-success: fail
set_status_failed_on_error_get_host_cpus:
publish:
status: FAILED
message: <% task(get_host_cpus).result %>
on-success: fail
set_status_failed_get_host_cpus_range_list:
publish:
status: FAILED
message: <% task(get_host_cpus_range_list).result %>
on-success: fail
host_derive_params: host_derive_params:
description: > description: >
This workflow derives parameters for the Host process, and is mainly associated with CPU pinning and huge memory pages. This workflow derives parameters for the Host process, and is mainly associated with CPU pinning and huge memory pages.
@ -242,7 +310,6 @@ workflows:
- tripleo-common-managed - tripleo-common-managed
tasks: tasks:
get_cpus: get_cpus:
publish: publish:
cpus: <% $.hw_data.numa_topology.cpus %> cpus: <% $.hw_data.numa_topology.cpus %>
@ -253,11 +320,23 @@ workflows:
get_role_derive_params: get_role_derive_params:
publish: publish:
role_derive_params: <% $.derived_parameters.get(concat($.role_name, 'Parameters'), {}) %> role_derive_params: <% $.derived_parameters.get(concat($.role_name, 'Parameters'), {}) %>
# removing the role parameters (eg. ComputeParameters) in derived_parameters dictionary since already copied in role_derive_params.
derived_parameters: <% $.derived_parameters.delete(concat($.role_name, 'Parameters')) %>
on-success: get_host_cpus
get_host_cpus:
publish:
host_cpus: <% $.role_derive_params.get('OvsDpdkCoreList', '') or $.role_derive_params.get('SriovHostCpusList', '') %>
# SriovHostCpusList parameter is added temporarily for host_cpus and not needed in derived_parameters result.
# SriovHostCpusList parameter is deleted in derived_parameters list and adding the updated role parameters
# back in the derived_parameters.
derived_parameters: <% $.derived_parameters + dict(concat($.role_name, 'Parameters') => $.role_derive_params.delete('SriovHostCpusList')) %>
on-success: get_host_dpdk_combined_cpus on-success: get_host_dpdk_combined_cpus
get_host_dpdk_combined_cpus: get_host_dpdk_combined_cpus:
publish: publish:
host_dpdk_combined_cpus: <% concat($.role_derive_params.get('OvsPmdCoreList', ''), ',', $.role_derive_params.get('OvsDpdkCoreList', '')) %> host_dpdk_combined_cpus: <% let(pmd_cpus => $.role_derive_params.get('OvsPmdCoreList', '')) -> switch($pmd_cpus => concat($pmd_cpus, ',', $.host_cpus), not $pmd_cpus => $.host_cpus) %>
reserved_cpus: []
on-success: on-success:
- get_host_dpdk_combined_cpus_num_list: <% $.host_dpdk_combined_cpus %> - get_host_dpdk_combined_cpus_num_list: <% $.host_dpdk_combined_cpus %>
- set_status_failed_get_host_dpdk_combined_cpus: <% not $.host_dpdk_combined_cpus %> - set_status_failed_get_host_dpdk_combined_cpus: <% not $.host_dpdk_combined_cpus %>
@ -268,12 +347,13 @@ workflows:
range_list: <% $.host_dpdk_combined_cpus %> range_list: <% $.host_dpdk_combined_cpus %>
publish: publish:
host_dpdk_combined_cpus: <% task().result %> host_dpdk_combined_cpus: <% task().result %>
reserved_cpus: <% task().result.split(',') %>
on-success: get_nova_cpus on-success: get_nova_cpus
on-error: set_status_failed_get_host_dpdk_combined_cpus_num_list on-error: set_status_failed_get_host_dpdk_combined_cpus_num_list
get_nova_cpus: get_nova_cpus:
publish: publish:
nova_cpus: <% let(reserved_cpus => $.host_dpdk_combined_cpus.split(',')) -> $.cpus.select($.thread_siblings).flatten().where(not (str($) in $reserved_cpus)).join(',') %> nova_cpus: <% let(reserved_cpus => $.reserved_cpus) -> $.cpus.select($.thread_siblings).flatten().where(not (str($) in $reserved_cpus)).join(',') %>
on-success: on-success:
- get_isol_cpus: <% $.nova_cpus %> - get_isol_cpus: <% $.nova_cpus %>
- set_status_failed_get_nova_cpus: <% not $.nova_cpus %> - set_status_failed_get_nova_cpus: <% not $.nova_cpus %>
@ -282,7 +362,7 @@ workflows:
# example: concatinates '12-15,19' and 16-18' ranges '12-15,19,16-18' # example: concatinates '12-15,19' and 16-18' ranges '12-15,19,16-18'
get_isol_cpus: get_isol_cpus:
publish: publish:
isol_cpus: <% concat($.role_derive_params.get('OvsPmdCoreList',''), ',', $.nova_cpus) %> isol_cpus: <% let(pmd_cpus => $.role_derive_params.get('OvsPmdCoreList','')) -> switch($pmd_cpus => concat($pmd_cpus, ',', $.nova_cpus), not $pmd_cpus => $.nova_cpus) %>
on-success: get_isol_cpus_num_list on-success: get_isol_cpus_num_list
# Gets the isol_cpus in the number list # Gets the isol_cpus in the number list