Skip to content

Commit 350de7a

Browse files
authored
Merge pull request #522 from casparvl/update_bot_docs
Update bot build instructions for new node_type_map update
2 parents f467e33 + bfabf12 commit 350de7a

File tree

1 file changed

+47
-15
lines changed

1 file changed

+47
-15
lines changed

docs/bot.md

Lines changed: 47 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,18 @@ should be issued by posting a comment in the pull request (see also [here](addin
6666
The most basic build instruction that can be sent to the bot is:
6767

6868
```
69-
bot: build
69+
bot: build for:arch=<for_arch>
7070
```
7171

72-
!!! warning
73-
Only use `bot: build` if you are confident that it is OK to do so.
72+
Where the `for_arch` could be e.g. `x64_64/amd/zen4`. This will trigger the bot to allocate a node of that type _and_
73+
build in the `/cvmfs/software.eessi.io/versions/<eessi-version>/software/linux/x86_64/amd/zen4` prefix.
7474

75-
Most likely, you want to supply one or more filters to avoid that the bot builds for all its configurations.
75+
!!! note
76+
The `for:` (and `on:`, see below) argument to the bot were introduced in bot version 0.9.0. They replace the `architecture=... accelerator=...` syntax used in bot versions <= v0.8.0.
77+
78+
!!! warning
79+
Most likely, you want to supply one or more filters to avoid that all bots are triggered to build for all
80+
configurations that match the above command.
7681

7782
### Filters
7883

@@ -81,13 +86,14 @@ should be executed, based on:
8186

8287
- `instance`: the `name` of the bot instance, for example `instance:aws` for the bot instance running in AWS;
8388
- `repository`: the target repository, for example `eessi-2023.06-software` which corresponds to the 2023.06 version of the EESSI software layer;
84-
- `architecture`: the name of the [CPU microarchitecture](software_layer/cpu_targets.md), for example `x86_64/amd/zen2`;
89+
- `on:architecture=<on_arch>,accelerator=<on_accelerator>`: the name of the [CPU microarchitecture](software_layer/cpu_targets.md) and GPU accelerator you want to build _on_, for example `on:architecture=x86_64/amd/zen4,accelerator=nvidia/cc90`;
90+
- `for:architecture=<for_arch>,accelerator=<for_accelerator>`: the name of the [CPU microarchitecture](software_layer/cpu_targets.md) and GPU accelerator you want to build _for_, for example `for:architecture=x86_64/amd/zen4,accelerator=nvidia/cc90`;
8591

8692
!!! note
87-
Use `:` as separator to specify a value for a particular filter, do not add spaces after the `:`.
93+
Use `:` as separator to specify a value for a particular argument, do not add spaces after the `:`.
8894

8995
The bot recognizes shorthands for the supported filters, so you can use `inst:...` instead of `instance:...`,
90-
`repo:...` instead of `repository:...`, and `arch:...` instead of `architecture:...`.
96+
`repo:...` instead of `repository:...`, and `arch=...` instead of `architecture=...`, and `accel=` instead of `accelerator`.
9197

9298
#### Combining filters
9399

@@ -97,7 +103,7 @@ Separate filters with a space, order of filters does not matter.
97103
For example:
98104

99105
```
100-
bot: build repo:eessi.io-2023.06-software arch:x86_64/amd/zen2
106+
bot: build repo:eessi.io-2023.06-software for:arch=x86_64/amd/zen2
101107
```
102108

103109
#### Multiple build instructions
@@ -108,17 +114,43 @@ repositories, and CPU targets. Specify one build instruction per line.
108114
For example:
109115

110116
```
111-
bot: build repo:eessi.io-2023.06-software arch:x86_64/amd/zen3 inst:aws
112-
bot: build repo:eessi.io-2023.06-software arch:x86_64/amd/zen4 inst:azure
117+
bot: build repo:eessi.io-2023.06-software for:arch=x86_64/amd/zen3 inst:aws
118+
bot: build repo:eessi.io-2023.06-software for:arch=x86_64/amd/zen4 inst:azure
113119
```
114120

115-
!!! note
116-
The bot applies the filters with partial matching, which you can use to combine multiple build
117-
instructions into a single one.
121+
#### Native builds
118122

119-
For example, if you only want to build for all `aarch64` CPU targets, you can use `arch:aarch64` as filter.
123+
If you want to allocate the same node type that you want to build for, you can omit the `on:` argument.
124+
For example: `bot:build for:arch=x86_64/amd/zen4` is fully equivalent to `bot:build on:arch=x86_64/amd/zen4 for:arch=x86_64/amd/zen4`.
120125

121-
The same applies to the `instance` and `repository` filters.
126+
#### Cross-compiling
127+
128+
The reason for the separate `on:` and `for:` arguments to exist is to allow cross-compilation, and to be specific about
129+
which architecture to allocate when doing so. The typical use case is to build GPU software on a CPU-only node.
130+
131+
For example: `bot:build on:arch=x86_64/amd/zen2 for:arch=x86_64/amd/zen2,accel=nvidia/cc80` will instruct the bot to
132+
build on a `zen2` CPU-only node, for a combination of a `zen2` CPU with a GPU with CUDA Compute Capability 8.0.
133+
134+
!!! warning
135+
Cross-compilation for different CPU targets can _not_ be done with the current setup. This is not a limitation of
136+
the bot, but of the build scripts in the `software-layer-scripts` repository. The only thing the bot does is
137+
prepare a job directory in which the configuration passed through `for:` is stored in a `job.cfg` file. What is
138+
_done_ with that information is up to the build scripts from `software-layer-scripts`. While these currently
139+
set the CUDA Compute Capability configuration item for EasyBuild based on the accelerator target defined in the
140+
`job.cfg`, the architecture target is _only_ used to determine the installation path. It is _not_ used to set
141+
EasyBuild's `optarch` configuration, which will still default to native optimization (i.e. for the host).
142+
143+
#### Partial filter matching
144+
The bot applies the filters with partial matching, but _not_ for the `for:` argument. I.e. you can do
145+
`bot:build on:arch=zen4 for:arch=x84_64/amd/zen4,accel=nvidia/cc80`, but not
146+
`bot:build on:arch=zen4 for:arch=zen4,accel=nvidia/cc80`
147+
The reason is that for the `on:` argument, the bot can compare against the configured node types to find a match
148+
(while for the `for:` argument, there is no such reference to match against).
149+
150+
#### Accelerator filter matching
151+
If the bot config declares that a node type has a certain accelerator, that node type will _only_ be allocated
152+
if a corresponding `accel=<on_accel>` argument is passed. This is to avoid that `on:arch=x86_64/amd/zen4` would
153+
cause builds to be triggered on a `zen4`+GPU node, while the same system also has a CPU-only `zen4` node type.
122154

123155
### Behind-the-scenes
124156

0 commit comments

Comments
 (0)