I have created an Azure ML pipeline with different steps (data preprocess, train, validation ...). And for pass data from one step to the next I have used the PipelineData object.
Example passing the model from train step to validate one:
# Create a PipelineData to pass model from train to register
model_path = PipelineData('model')
# Step 2
train_step = PythonScriptStep(
name = 'Train the Model',
script_name = 'TrainStepScript.py',
source_directory = source_folder,
arguments = ['--training_data', prepped_data,
'--model_name', model_name,
'--model_path', model_path],
outputs = [model_path],
compute_target = compute_target,
runconfig = aml_run_config,
allow_reuse = True
)
# Step 3
third_step = PythonScriptStep(
name = 'Evaluate & register the Model',
script_name = 'ValidateStepScript.py',
source_directory = source_folder,
arguments = ['--model_name', model_name,
'--model_path', model_path],
inputs = [model_path],
compute_target = compute_target,
runconfig = aml_run_config,
allow_reuse = True
)
Now for debugging and development purposes I want to create a script to run separately the different steps using a ScriptRunConfig (with the same environment and arguments of the StepScript in the pipeline). But the problem is I don't know how to simulate the data input/output of each step, because the DataPipeline object is not working for this purpose.
Just for clarification, my goal is to NOT modify the original pipeline StepScripts, so I can use them after debugging in the final pipeline. To sum up, my question is: how can I emulate the DataPipeline object (if possible) in this case?
Example of what I'm trying to build:
# Passing in some way the model path (from local)
model_path = PipelineData('model')
# Create a script config for validate step
validate_script_config = ScriptRunConfig(
source_directory = source_folder,
script = 'ValidateStepScript.py',
arguments = ['--model_name', model_name,
'--model_path', model_path],
environment = experiment_env,
docker_runtime_config = DockerConfiguration(use_docker=True)
)
experiment = Experiment(workspace=ws, name=experiment_name)
data_run = experiment.submit(config=data_script_config)