Skip to content

Commit

Permalink
Merge branch 'mlperf-inference' into anandhu-eng-patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsuresh authored Oct 30, 2024
2 parents 9e3392b + cc323b5 commit b230509
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 9 deletions.
32 changes: 26 additions & 6 deletions automation/script/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -2431,18 +2431,38 @@ def test(self, i):
if test_config:
logging.info(test_config)
test_all_variations = test_config.get('test-all-variations', False)
use_docker = test_config.get('use_docker', False)
if test_all_variations:
variations = meta.get("variations")
individual_variations = [ v for v in variations if variations[v].get('group', '') == '' and str(variations[v].get('exclude-in-test', '')).lower() not in [ "1", "true", "yes" ] ]
tags_string = ",".join(meta.get("tags"))
for variation in individual_variations:
run_tags = f"{tags_string},_{variation}"
r = self.cmind.access({'action':'run',
'automation':'script',
'tags': run_tags,
'quiet': i.get('quiet') })
if r['return'] > 0:
return r
if use_docker:
docker_images = test_config.get('docker_images', [ "ubuntu-22.04" ])
for docker_image in docker_images:
ii = {'action':'docker',
'automation':'script',
'tags': run_tags,
'quiet': i.get('quiet'),
'docker_image': docker_image,
'docker_image_name': alias
}
if i.get('docker_cm_repo', '') != '':
ii['docker_cm_repo'] = i['docker_cm_repo']
if i.get('docker_cm_repo_branch', '') != '':
ii['docker_cm_repo_branch'] = i['docker_cm_repo_branch']

r = self.cmind.access(ii)
if r['return'] > 0:
return r
else:
r = self.cmind.access({'action':'run',
'automation':'script',
'tags': run_tags,
'quiet': i.get('quiet') })
if r['return'] > 0:
return r

logging.info(' Test: WIP')

Expand Down
6 changes: 5 additions & 1 deletion script/get-generic-sys-util/_cm.json
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,10 @@
}
},
"tests": {
"test-all-variations": "yes"
"test-all-variations": "yes",
"use_docker": "yes",
"docker_images": [
"ubuntu-22.04"
]
}
}
2 changes: 1 addition & 1 deletion script/run-docker-container/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def update_docker_info(env):
if env.get('CM_DOCKER_IMAGE_NAME', '') != '':
docker_image_name = env['CM_DOCKER_IMAGE_NAME']
else:
docker_image_name = 'cm-script-'+env['CM_DOCKER_RUN_SCRIPT_TAGS'].replace(',', '-').replace('_','-')
docker_image_name = 'cm-script-'+env['CM_DOCKER_RUN_SCRIPT_TAGS'].replace(',', '-').replace('_','-').replace('+','plus')
env['CM_DOCKER_IMAGE_NAME'] = docker_image_name

docker_image_tag_extra = env.get('CM_DOCKER_IMAGE_TAG_EXTRA', '-latest')
Expand Down
2 changes: 1 addition & 1 deletion tests/script/process_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

for file in files:
print(file)
if not os.path.isfile(file):
if not os.path.isfile(file) or not "script" in file:
continue
if not file.endswith("_cm.json") and not file.endswith("_cm.yaml"):
continue
Expand Down

0 comments on commit b230509

Please sign in to comment.