|
1 | | -# Script Meta |
| 1 | +# Script Meta |
2 | 2 |
|
3 | | -This page provides a walkthrough of the `meta.yaml` file. |
| 3 | +This page provides a walkthrough of the `meta.yaml` file. |
4 | 4 |
|
5 | | -## Important Keys and Data Types |
| 5 | +## Important Keys and Data Types |
6 | 6 |
|
7 | 7 | - **alias** (`string`) |
8 | 8 |
|
9 | | - Alias of the script, which can be used instead of tags when running a script. |
| 9 | + Alias of the script, which can be used instead of tags when running a script. |
10 | 10 |
|
11 | 11 | - **uid** (`string`) |
12 | 12 |
|
13 | | - Unique identifier for individual scripts. Can be used instead of tags when running a script. |
| 13 | + Unique identifier for individual scripts. Can be used instead of tags when running a script. |
14 | 14 |
|
15 | 15 | - **automation_alias** (`string`) |
16 | 16 |
|
17 | | - Alias specific to script automation. |
| 17 | + Alias specific to script automation. |
18 | 18 |
|
19 | 19 | - **automation_uid** (`string`) |
20 | 20 |
|
21 | | - Unique identifier for script automation. |
| 21 | + Unique identifier for script automation. |
22 | 22 |
|
23 | 23 | - **category** (`string`) |
24 | 24 |
|
25 | | - Defines the script category. |
| 25 | + Defines the script category. |
26 | 26 |
|
27 | 27 | - **tags** (`list of strings`) |
28 | 28 |
|
29 | | - List of tags users can specify to run the script. |
| 29 | + List of tags users can specify to run the script. |
30 | 30 |
|
31 | 31 | - **default_env** (`dictionary` with `string` values) |
32 | 32 |
|
33 | | - Contains key-value pairs representing environment variables and their default values for a script. These default values are overridden if the same environment variable is set in script files or inherited from a parent script. |
| 33 | + Contains key-value pairs representing environment variables and their default values for a script. |
| 34 | + These default values are overridden if the same environment variable is set in script files or inherited from a parent script. |
34 | 35 |
|
35 | 36 | - **env** (`dictionary` with `string` values) |
36 | 37 |
|
37 | | - Defines environment variables and their corresponding values. |
| 38 | + Defines environment variables and their corresponding values. |
38 | 39 |
|
39 | 40 | - **input_mapping** (`dictionary` with `string` values) |
40 | 41 |
|
41 | | - Maps input flags related to a script to corresponding environment variables. Only keys specified under `input_mapping` in `meta.yaml` are mapped to environment variables. |
| 42 | + Maps input flags related to a script to corresponding environment variables. |
| 43 | + Only keys specified under `input_mapping` in `meta.yaml` are mapped to environment variables. |
42 | 44 |
|
43 | 45 | - **env_key_mapping** (`dictionary` with `string` values) |
44 | 46 |
|
45 | 47 | Maps one environment key to another just for the `run` script execution. |
46 | 48 |
|
47 | 49 | - **new_env_keys** (`list of strings`) |
48 | 50 |
|
49 | | - Specifies environment keys that should be passed to a parent script if this script is used as a dependency. |
| 51 | + Specifies environment keys that should be passed to a parent script if this script is used as a dependency. |
50 | 52 |
|
51 | 53 | - **new_state_keys** (`list of strings`) |
52 | 54 |
|
53 | | - Specifies state keys that should be passed to a parent script when used as a dependency. |
| 55 | + Specifies state keys that should be passed to a parent script when used as a dependency. |
54 | 56 |
|
55 | 57 | - **add_deps_recursive** (`dictionary`) |
56 | 58 |
|
57 | | - Customizes recursive dependencies with nested `tags` and other attributes. |
| 59 | + Customizes recursive dependencies with nested `tags` and other attributes. |
58 | 60 |
|
59 | | -### Dependencies |
| 61 | +--- |
60 | 62 |
|
61 | | - Dependencies in a script are specified as a list of dictionaries. Each dictionary can contain: |
| 63 | +## Dependencies |
62 | 64 |
|
63 | | - - **tags** |
64 | | - Comma separated list of tags to identify a dependent script |
| 65 | +!!! note |
| 66 | + Dependencies in a script are specified as a **list of dictionaries**. Each dictionary can contain: |
65 | 67 |
|
66 | | - - **names** (`list of strings`) |
| 68 | + - **tags** |
| 69 | + Comma-separated list of tags to identify a dependent script. |
67 | 70 |
|
68 | | - - Identifiers for dependencies, allowing users to modify the deps executions when needed. |
| 71 | + - **names** (`list of strings`) |
| 72 | + |
| 73 | + - Identifiers for dependencies, allowing users to modify the dependency execution when needed. |
69 | 74 |
|
70 | 75 | - **enable_if_env** (`dictionary` with `list of strings` values) |
71 | | - |
72 | | - - Specifies conditions under which a dependency is enabled based on environment variables. The conditions are ANDed. |
| 76 | + |
| 77 | + - Specifies conditions under which a dependency is enabled based on environment variables. The conditions are **ANDed**. |
73 | 78 |
|
74 | 79 | - **enable_if_any_env** (`dictionary` with `list of strings` values) |
75 | | - |
76 | | - - Specifies conditions under which a dependency is enabled based on environment variables. The conditions are ORed. |
| 80 | + |
| 81 | + - Specifies conditions under which a dependency is enabled based on environment variables. The conditions are **ORed**. |
77 | 82 |
|
78 | 83 | - **skip_if_env** (`dictionary` with `list of strings` values) |
79 | | - |
80 | | - - Specifies conditions under which a dependency should be skipped. The conditions are ANDed. |
| 84 | + |
| 85 | + - Specifies conditions under which a dependency should be skipped. The conditions are **ANDed**. |
81 | 86 |
|
82 | 87 | - **skip_if_any_env** (`dictionary` with `list of strings` values) |
| 88 | + |
| 89 | + - Specifies conditions under which a dependency should be skipped. The conditions are **ORed**. |
83 | 90 |
|
84 | | - - Specifies conditions under which a dependency should be skipped. The conditions are ORed. |
85 | | - |
86 | | - - Any other script meta can also be included which will be passed to the dependent script |
87 | | - |
88 | | - In MLC script, there are four types of dependencies. |
89 | | - |
90 | | - - **deps** |
| 91 | + - Any other script meta keys can also be included, which will be passed to the dependent script. |
91 | 92 |
|
92 | | - - Executes after processing the script meta, but before the `preprocess` function |
| 93 | +### Types of Dependencies |
93 | 94 |
|
94 | | - - **prehook_deps** |
| 95 | +In MLC scripts, there are **four types of dependencies**: |
95 | 96 |
|
96 | | - - Executes after the `preprocess` function, but before the `run` script |
| 97 | +1. **deps** |
| 98 | + - Executes **after** processing the script meta, but **before** the `preprocess` function. |
97 | 99 |
|
98 | | - - **posthook_deps** |
| 100 | +2. **prehook_deps** |
| 101 | + - Executes **after** the `preprocess` function, but **before** the `run` script. |
99 | 102 |
|
100 | | - - Executes after the `run` script, but before the `postprocess` function |
| 103 | +3. **posthook_deps** |
| 104 | + - Executes **after** the `run` script, but **before** the `postprocess` function. |
101 | 105 |
|
102 | | - - **post_deps** |
| 106 | +4. **post_deps** |
| 107 | + - Executes **after** the `postprocess` function. |
103 | 108 |
|
104 | | - - Executes after the `postprocess` function |
105 | | - |
106 | | - More details on script execution flow can be found [here](execution-flow.md). |
| 109 | +For more details on script execution flow, see [Script Execution Flow](execution-flow.md). |
107 | 110 |
|
| 111 | +--- |
108 | 112 |
|
109 | | -### Variation Configuration |
| 113 | +## Variation Configuration |
110 | 114 |
|
111 | 115 | - **variations** (`dictionary`) |
112 | | - |
113 | | - - Contains script variations, including attributes like `alias`, `default_variations`, and `group`. |
| 116 | + |
| 117 | + - Contains script variations, including attributes like `alias`, `default_variations`, and `group`. |
114 | 118 |
|
115 | 119 | - **group** (`string`) |
116 | 120 |
|
117 | | - - Specifies the script variation group. Maximum one variation from a given group can be selected during a script invocation and if `default:true` is set for a variation in a group, that variation is turned on unless another variation is specified during the script invocation. |
| 121 | + - Specifies the script variation group. |
| 122 | + - A maximum of **one variation** from a given group can be selected during script invocation. |
| 123 | + - If `default: true` is set for a variation in a group, that variation is turned **on by default**, unless another variation is specified during script invocation. |
118 | 124 |
|
119 | 125 | - **default_variations** (`dictionary` with `string` values) |
120 | 126 |
|
121 | | - - Specifies default variations for the script. |
122 | | - |
| 127 | + - Specifies default variations for the script. |
123 | 128 |
|
| 129 | +--- |
124 | 130 |
|
125 | | -### Docker Configuration |
126 | | - |
127 | | -- **docker** (`dictionary`) |
| 131 | +## Docker Configuration |
128 | 132 |
|
129 | | - - Contains Docker-specific configurations: |
| 133 | +!!! tip |
| 134 | + The `docker` key contains Docker-specific configurations: |
130 | 135 |
|
131 | | - - **base_image** (`string`) – Base Docker image |
| 136 | +- **base_image** (`string`) |
| 137 | + Base Docker image. |
132 | 138 |
|
133 | | - - **image_name** (`string`) – Docker image name |
| 139 | +- **image_name** (`string`) |
| 140 | + Docker image name. |
134 | 141 |
|
135 | | - - **os** (`string`) – Operating system |
| 142 | +- **os** (`string`) |
| 143 | + Operating system. |
136 | 144 |
|
137 | | - - **os_version** (`string`) – OS version |
| 145 | +- **os_version** (`string`) |
| 146 | + OS version. |
138 | 147 |
|
139 | | - - **deps** (`list of dictionaries`) – Specifies dependencies required in Docker |
| 148 | +- **deps** (`list of dictionaries`) |
| 149 | + Specifies dependencies required in Docker. |
140 | 150 |
|
141 | | - - **env** (`dictionary` with `string` values) – Defines environment variables inside the container |
| 151 | +- **env** (`dictionary` with `string` values) |
| 152 | + Defines environment variables inside the container. |
142 | 153 |
|
143 | | - - **interactive** (`boolean`) – Indicates if the container should be interactive |
| 154 | +- **interactive** (`boolean`) |
| 155 | + Indicates if the container should be interactive. |
144 | 156 |
|
145 | | - - **extra_run_args** (`string`) – Additional arguments for `docker run` |
| 157 | +- **extra_run_args** (`string`) |
| 158 | + Additional arguments for `docker run`. |
146 | 159 |
|
147 | | - - **mounts** (`list of strings`) – Specifies mount paths in the format `"source:destination"` |
| 160 | +- **mounts** (`list of strings`) |
| 161 | + Specifies mount paths in the format `"source:destination"`. |
148 | 162 |
|
149 | | - - **pre_run_cmds** (`list of strings`) – Commands to execute before starting the container |
| 163 | +- **pre_run_cmds** (`list of strings`) |
| 164 | + Commands to execute **before** starting the container. |
150 | 165 |
|
151 | | - - **docker_input_mapping** (`dictionary` with `string` values) – Maps input parameters to Docker environment variables |
| 166 | +- **docker_input_mapping** (`dictionary` with `string` values) |
| 167 | + Maps input parameters to Docker environment variables. |
152 | 168 |
|
153 | | - - **use_host_user_id** (`boolean`) – Uses the host's user ID inside the container |
| 169 | +- **use_host_user_id** (`boolean`) |
| 170 | + Uses the host's user ID inside the container. |
154 | 171 |
|
155 | | - - **use_host_group_id** (`boolean`) – Uses the host's group ID inside the container |
| 172 | +- **use_host_group_id** (`boolean`) |
| 173 | + Uses the host's group ID inside the container. |
156 | 174 |
|
157 | | - - **skip_run_cmd** (`string`) – Command to skip execution |
| 175 | +- **skip_run_cmd** (`string`) |
| 176 | + Command to **skip execution**. |
158 | 177 |
|
159 | | - - **shm_size** (`string`) – Defines shared memory size |
| 178 | +- **shm_size** (`string`) |
| 179 | + Defines shared memory size. |
160 | 180 |
|
161 | | - - **real_run** (`boolean`) – Indicates if the container should do the MLC script run at end, if not only the deps will be run |
| 181 | +- **real_run** (`boolean`) |
| 182 | + - If `true`: The container **runs the MLC script**. |
| 183 | + - If `false`: Only the dependencies are executed. |
162 | 184 |
|
163 | | - - **all_gpus** (`string`) – Use all available GPUs |
| 185 | +- **all_gpus** (`string`) |
| 186 | + Use all available GPUs. |
164 | 187 |
|
165 | 188 | --- |
166 | 189 |
|
0 commit comments