simple-framework / simple_grid_yaml_compiler

Generates the extended YAML output for an input site_level_configuration_file
Apache License 2.0
0 stars 9 forks source link

augmented site level schema : process type from_component_repository() in simple-*-schema.yaml files #43

Closed maany closed 5 years ago

maany commented 5 years ago

Is your feature request related to a problem? Please describe. The schema files at present include a from_component_repository() validator in the config field for a lightweight_component. For instance, https://github.com/WLCG-Lightweight-Sites/simple_grid_site_repo/issues/4

---
lightweight_component:
  name: {type: str(), required: true, use_default: false}
  ..
  ..
  config: {type: component_repository_schema(), required: true, use_default: false}

Describe the solution you'd like The yaml compiler has access to the site-level-config-file at its input. After implementing #42 , the compiler would also have access to the schema for the site-level-config-file. The compiler needs to augment the schema with the config-schema.yaml files of lightweight components specified in the site-level-config-file.

This functionality can be implemented in a new compiler phase.

schema: {type: url(), required: true, use_default: true}
global_variables: {type: list(global_variable), required: false, use_default: false}
site_infrastructure: {type: list(include('node'), required: true, use_default: false}
lightweight_components: 
  - name: {type: str(), required: true, use_default: false}
     ..
     ..
     config: 
       mysql_password: { type: password(), required: true, use_default: false}
      globus_tcp_port_range: { type: range(), required: true, use_default: true}
      ce_capability: { type: str(), required: true, use_default: true} #glue
      ce_cpu_model: { type: str(), required: true, use_default: true} #glue
      ce_cpu_speed: { type: int(), required: true, use_default: true} #GlueHostProcessorClockSpeed
      ...
  - name: {type: str(), required: true, use_default: false}
     ..
     ..
     config:
       fields_from_the_config_schema_yaml_file_that_can_be fetched_from_the_repository_url_field_in_the_site_level_config_file.

---
node:
  ...
---

### Remove the lightweight_component section from the final output###
lightweight_component:
  name: {type: str(), required: true, use_default: false}
  ..
  ..
  config: {type: list(), required: true, use_default: false} ~~

This augmented schema file must be saved as "{output}_schema.yaml".format( output = https://github.com/WLCG-Lightweight-Sites/simple_grid_yaml_compiler/blob/master/simple_grid_yaml_compiler.py#L120) Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. Additional context Add any other context or screenshots about the feature request here.

maany commented 5 years ago

phase_7 added