File tree Expand file tree Collapse file tree 3 files changed +21
-4
lines changed
run-mlperf-inference-submission-checker Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,8 @@ post_deps:
80
80
tags : run,tar
81
81
env :
82
82
MLC_TAR_INPUT_DIR : <<<MLC_MLPERF_INFERENCE_SUBMISSION_DIR>>>
83
+ MLC_TAR_SUB_FOLDERS_TO_INCLUDE : closed,open,network
84
+ COPYFILE_DISABLE : 1
83
85
- enable_if_env :
84
86
MLC_MLPERF_SUBMITTER_ID :
85
87
- ' yes'
Original file line number Diff line number Diff line change @@ -21,10 +21,24 @@ def preprocess(i):
21
21
env ['MLC_TAR_OUTFILE' ] = output_file
22
22
from pathlib import Path
23
23
input_path = Path (input_dir )
24
- cd_dir = input_path .parent .absolute ()
25
- CMD = 'tar --directory ' + \
26
- str (cd_dir ) + ' -czf ' + os .path .join (output_dir ,
27
- output_file ) + ' ' + input_dirname
24
+ sub_folders_to_include = env .get ('MLC_TAR_SUB_FOLDERS_TO_INCLUDE' , '' )
25
+ if sub_folders_to_include != '' :
26
+ cd_dir = input_path .absolute ()
27
+ r = sub_folders_to_include .split ("," )
28
+ v_sub_folders = []
29
+ for sub_folder in r :
30
+ f = sub_folder .strip ()
31
+ if os .path .exists (os .path .join (input_path , f )):
32
+ v_sub_folders .append (f )
33
+ CMD = 'tar --directory ' + \
34
+ str (cd_dir ) + ' -czf ' + os .path .join (output_dir ,
35
+ output_file ) + ' ' + ' ' .join (v_sub_folders )
36
+ else :
37
+ cd_dir = input_path .parent .absolute ()
38
+ CMD = 'tar --directory ' + \
39
+ str (cd_dir ) + ' -czf ' + os .path .join (output_dir ,
40
+ output_file ) + ' ' + input_dirname
41
+
28
42
print (CMD )
29
43
ret = os .system (CMD )
30
44
print ("Tar file " + os .path .join (output_dir , output_file ) + " created" )
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ input_mapping:
9
9
input_dir : MLC_TAR_INPUT_DIR
10
10
outfile : MLC_TAR_OUTFILE
11
11
output_dir : MLC_TAR_OUTPUT_DIR
12
+ sub_folders_to_include : MLC_TAR_SUB_FOLDERS_TO_INCLUDE
12
13
new_env_keys :
13
14
- MLC_TAR_OUTFILE
14
15
tags :
You can’t perform that action at this time.
0 commit comments