diff --git a/.github/workflows/instant_benchmark.yml b/.github/workflows/instant_benchmark.yml index d4407ab442..0b8a48598a 100644 --- a/.github/workflows/instant_benchmark.yml +++ b/.github/workflows/instant_benchmark.yml @@ -142,7 +142,8 @@ jobs: run: | echo "${{ needs.environment-setup.outputs.template }}" >> template.json python3 instant_benchmark.py --template template.json \ - --job ${{ matrix.job }} --instance ${{ inputs.instance }} + --job ${{ matrix.job }} --instance ${{ inputs.instance }} \ + --record ${{ inputs.record }} bash instant_benchmark.sh - name: Get serving logs diff --git a/tests/integration/instant_benchmark.py b/tests/integration/instant_benchmark.py index b78156612d..e3103c27f4 100644 --- a/tests/integration/instant_benchmark.py +++ b/tests/integration/instant_benchmark.py @@ -29,6 +29,10 @@ required=False, type=str, help="The current instance name") +parser.add_argument("--record", + required=False, + type=str, + help="Place to record metrics") parser.add_argument("--job", required=False, type=str, help="The job string") args = parser.parse_args() @@ -232,7 +236,7 @@ def machine_translation(machine_name: str): return "lmi" -def build_running_script(template, job, instance): +def build_running_script(template, job, instance, record): with open(template) as f: template = json.load(f) job_template = template[job] @@ -244,10 +248,9 @@ def build_running_script(template, job, instance): container = job_template['container'] benchmark_command = [] - record_benchmark = ( - 'python3 record_benchmark.py --template template.json ' - '--job ${{ matrix.job }} --instance ${{ inputs.instance }} ' - '--model models/test --record ${{ inputs.record }}') + record_benchmark = ('python3 record_benchmark.py --template template.json ' + f'--job {job} --instance {instance} ' + f'--model models/test --record {record}') for key, value in job_template['awscurl'].items(): benchmark_command.append(value) @@ -273,7 +276,8 @@ def build_running_script(template, job, instance): command = f"echo \"template={json.dumps(json.dumps(json.dumps(result)))}\" >> $GITHUB_OUTPUT" sp.call(command, shell=True) elif args.template and args.job and args.instance: - build_running_script(args.template, args.job, args.instance) + build_running_script(args.template, args.job, args.instance, + args.record) else: parser.print_help() raise ValueError("args not supported")