Compare two pipelines with exporting pipeline to code

Overview

Based on Export existing pipeline to code, we support comparing two pipelines by running az-ml compare command.

With this feature, provided two pipelines will be exported to code in the same parent folder. And user can run relevant CLI command or open local comparing tool (e.g BeyondCompare or Compare Folders to compare differences of the exported code.

[Command line] Generate two pipeline runs code

Supported scenarios

  • compare pipeline run

Sample

  • Copy url of two existing pipeline runs.

  • Run az-ml compare COPIED_URL1 COPIED_URL2 to export two pipeline runs to code.

    • Get all components’ snapshot along with the graph, run az-ml compare pipeline1 pipeline2 --include-components "*".

    • Get no components’ snapshot, run az-ml compare pipeline1 pipeline2.

    • Compare in specific path, run with --path, by default a folder with name of 2 compared pipelines will be created in current directory, eg: “pipeline1-pipeline2”.

    • When same pipeline got exported multiple times, new folder with auto incremental suffix will be created.

    • Specify --debug to get more debug info.

  • The generated code structure looks like this:

    • pipeline1 folder

      • .azureml folder: the workspace used in current pipeline.

      • components folder: all components(and snapshots) used in current pipeline.

      • pipelines/subgraphs folder: all sub graphs used in current pipeline.

      • pipelines/xx.py file: the root pipeline.

      • run.py file: entry to run current pipeline.

    • pipeline2 folder: same as pipeline1 folder

All command line options to generate comparing code:

image-20220114192639623

[Command line] Run CLI command to get differences of the exported code

Sample

  • BeyondCompare

    • Download BeyondCompare and add path to environment variable.

      image-20220126192639601

    • Run $target=xx; az-ml compare pipeline1, pipeline2; Bcompare $target/pipelin1 $target/pipeline2 in powershell.

  • VS Code extension: Compare Folders

    • Install extension Compare Folders.

    • Run $target=xx; New-Item $target/.vscode/settings.json in powershell.

    • Write settings.json like: {"compareFolders.folderLeft": "absolute path to pipeline1", "compareFolders.folderRight": "absolute path to pipeline2"}

    • Run code "target folder" in command palette.