def main()

in ftl/benchmark/ftl_python_benchmark_yaml.py [0:0]


def main():
    args = parser.parse_args()
    if not (args.dep_test and args.app_size):
        args.dep_test = True
        args.app_size = True

    cloudbuild_yaml = {
        'steps': [
            # We need to chmod in some cases for permissions.
            {
                'name': 'ubuntu',
                'args': ['chmod', 'a+rx', '-R', '/workspace']
            },
            # Build the FTL image from source and load it into the daemon.
            {
                'name':
                'gcr.io/cloud-builders/bazel@sha256:7360c36bded15db68a35cfb1740a994f0a09ad5ce378a97f96d698bc223e442a',
                'args': [
                    'run', '//ftl/python/benchmark:python_benchmark_image',
                    '--', '--norun'
                ],
            },
            # Build the python builder par file
            {
                'name': 'gcr.io/cloud-builders/bazel@sha256:7360c36bded15db68a35cfb1740a994f0a09ad5ce378a97f96d698bc223e442a',
                'args': ['build', 'ftl:python_builder.par']
            },
        ]
    }

    # Generate a set of steps for each test and add them.
    if args.dep_test:
        for app_dir in DEP_TESTS:
            cloudbuild_yaml['steps'] += dependency_test_step(
                app_dir, args.iterations)

    # Generate a set of steps for each test and add them.
    if args.app_size_test:
        for app_dir in APP_SIZE_TESTS:
            cloudbuild_yaml['steps'] += app_size_test_step(
                app_dir, args.iterations, APP_SIZE_TESTS[app_dir])

    print yaml.dump(cloudbuild_yaml)