Example 1 - Operate on a parameter
Problem statement
Submit a single-component pipeline where the component operates on a value passed as parameter (pass the parameter value through a config file or via the command line at pipeline submission time). In this example, let's just add 1000 to the parameter value, and print both operands and the result.
Motivation
The goal of this problem is to get you familiar with how to create components that consume parameters, and how to set parameter values.
Configure the example
The various parameters controlling the execution of an experiment can be defined via the command line, or via a configuration file. Open the experiment configuration file ./examples/pipelines/config/experiments/demo_component_with_parameter.yaml, and set the default value.
Submit the example ...
-
... with the parameter value defined in the config file To submit your experiment with the parameter value defined in the config file, just run the command shown at the top of the experiment python file.
python pipelines/experiments/demo_component_with_parameter.py --config-dir pipelines/config --config-name experiments/demo_component_with_parameter run.submit=True
-
... with the parameter value defined from the command line To submit your experiment with the parameter value defined in the command line (and thus overriding the value in the config file), just run the command shown at the top of the experiment python file with the following addition.
python pipelines/experiments/demo_component_with_parameter.py --config-dir pipelines/config --config-name experiments/demo_component_with_parameter run.submit=True democomponent.value=51
Check the logs
Once your experiment has executed successfully, click on the component, then on "Outputs + logs". In the driver log (usually called "70_driver_log.txt"), look for the line starting with "The value passed as parameter is...".
Links to successful execution
A successful run of the experiment can be found here. (This is mostly for internal use, as you likely will not have access to that workspace.)