Skip to content

Commit ea8b1b5

Browse files
committed
Fix script meta docs
1 parent 4ea212e commit ea8b1b5

File tree

1 file changed

+93
-70
lines changed

1 file changed

+93
-70
lines changed

docs/targets/script/meta.md

Lines changed: 93 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,166 +1,189 @@
1-
# Script Meta
1+
# Script Meta
22

3-
This page provides a walkthrough of the `meta.yaml` file.
3+
This page provides a walkthrough of the `meta.yaml` file.
44

5-
## Important Keys and Data Types
5+
## Important Keys and Data Types
66

77
- **alias** (`string`)
88

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.
1010

1111
- **uid** (`string`)
1212

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.
1414

1515
- **automation_alias** (`string`)
1616

17-
Alias specific to script automation.
17+
Alias specific to script automation.
1818

1919
- **automation_uid** (`string`)
2020

21-
Unique identifier for script automation.
21+
Unique identifier for script automation.
2222

2323
- **category** (`string`)
2424

25-
Defines the script category.
25+
Defines the script category.
2626

2727
- **tags** (`list of strings`)
2828

29-
List of tags users can specify to run the script.
29+
List of tags users can specify to run the script.
3030

3131
- **default_env** (`dictionary` with `string` values)
3232

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.
3435

3536
- **env** (`dictionary` with `string` values)
3637

37-
Defines environment variables and their corresponding values.
38+
Defines environment variables and their corresponding values.
3839

3940
- **input_mapping** (`dictionary` with `string` values)
4041

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.
4244

4345
- **env_key_mapping** (`dictionary` with `string` values)
4446

4547
Maps one environment key to another just for the `run` script execution.
4648

4749
- **new_env_keys** (`list of strings`)
4850

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.
5052

5153
- **new_state_keys** (`list of strings`)
5254

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.
5456

5557
- **add_deps_recursive** (`dictionary`)
5658

57-
Customizes recursive dependencies with nested `tags` and other attributes.
59+
Customizes recursive dependencies with nested `tags` and other attributes.
5860

59-
### Dependencies
61+
---
6062

61-
Dependencies in a script are specified as a list of dictionaries. Each dictionary can contain:
63+
## Dependencies
6264

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:
6567

66-
- **names** (`list of strings`)
68+
- **tags**
69+
Comma-separated list of tags to identify a dependent script.
6770

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.
6974

7075
- **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**.
7378

7479
- **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**.
7782

7883
- **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**.
8186

8287
- **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**.
8390

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.
9192

92-
- Executes after processing the script meta, but before the `preprocess` function
93+
### Types of Dependencies
9394

94-
- **prehook_deps**
95+
In MLC scripts, there are **four types of dependencies**:
9596

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.
9799

98-
- **posthook_deps**
100+
2. **prehook_deps**
101+
- Executes **after** the `preprocess` function, but **before** the `run` script.
99102

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.
101105

102-
- **post_deps**
106+
4. **post_deps**
107+
- Executes **after** the `postprocess` function.
103108

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).
107110

111+
---
108112

109-
### Variation Configuration
113+
## Variation Configuration
110114

111115
- **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`.
114118

115119
- **group** (`string`)
116120

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.
118124

119125
- **default_variations** (`dictionary` with `string` values)
120126

121-
- Specifies default variations for the script.
122-
127+
- Specifies default variations for the script.
123128

129+
---
124130

125-
### Docker Configuration
126-
127-
- **docker** (`dictionary`)
131+
## Docker Configuration
128132

129-
- Contains Docker-specific configurations:
133+
!!! tip
134+
The `docker` key contains Docker-specific configurations:
130135

131-
- **base_image** (`string`) – Base Docker image
136+
- **base_image** (`string`)
137+
Base Docker image.
132138

133-
- **image_name** (`string`) – Docker image name
139+
- **image_name** (`string`)
140+
Docker image name.
134141

135-
- **os** (`string`) – Operating system
142+
- **os** (`string`)
143+
Operating system.
136144

137-
- **os_version** (`string`) – OS version
145+
- **os_version** (`string`)
146+
OS version.
138147

139-
- **deps** (`list of dictionaries`) – Specifies dependencies required in Docker
148+
- **deps** (`list of dictionaries`)
149+
Specifies dependencies required in Docker.
140150

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.
142153

143-
- **interactive** (`boolean`) – Indicates if the container should be interactive
154+
- **interactive** (`boolean`)
155+
Indicates if the container should be interactive.
144156

145-
- **extra_run_args** (`string`) – Additional arguments for `docker run`
157+
- **extra_run_args** (`string`)
158+
Additional arguments for `docker run`.
146159

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"`.
148162

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.
150165

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.
152168

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.
154171

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.
156174

157-
- **skip_run_cmd** (`string`) – Command to skip execution
175+
- **skip_run_cmd** (`string`)
176+
Command to **skip execution**.
158177

159-
- **shm_size** (`string`) – Defines shared memory size
178+
- **shm_size** (`string`)
179+
Defines shared memory size.
160180

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.
162184

163-
- **all_gpus** (`string`) – Use all available GPUs
185+
- **all_gpus** (`string`)
186+
Use all available GPUs.
164187

165188
---
166189

0 commit comments

Comments
 (0)