-
Notifications
You must be signed in to change notification settings - Fork 0
Hla 1142 module creation docs #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
9ae97d6
Add explanation doc for the configuration structure and contents
MJGaughran 82b721c
Add docs on writing Module configuration
MJGaughran d6042cf
Clarify use of container with deploy-tools
MJGaughran 95c62ee
Mention possibility of associating schemas to config globally
MJGaughran 1e78091
Use more specific links between docs pages
MJGaughran b6f5ef5
Merge branch 'main' into hla-1142-module-creation-docs
MJGaughran ae7ce94
Improve organisation of configuration-model diagram
MJGaughran 1395dfa
Include all fields in configuration-model table and improve wording
MJGaughran a959723
Break out fields in configuration-model.md to separate tables
MJGaughran b645411
Move configuration-model.md into the reference section
MJGaughran 0796057
Rename configuration-model.md to configuration.md
MJGaughran aab06d3
Add bolded highlights to improve distinction between tables in docs
MJGaughran 5eeac17
Indicate requirements for yaml-language-server in how-to doc
MJGaughran 22b27bd
Add small note on schema linking for settings.yaml
MJGaughran f74aa39
Clarify that using CI pipeline for deploy-tools is only a recommendation
MJGaughran 3acc69b
Rename "per-version file" to "Release file"
MJGaughran 57bda27
Use separate table to indicate Release-level fields
MJGaughran 05afedf
Clarify docs regarding our recommended CI pipeline
MJGaughran 947ef50
Remove outdated text (typo) in README
MJGaughran File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| # Write a Module configuration | ||
|
|
||
| To add or change a Module, you edit YAML in the configuration folder. This guide covers | ||
| the mechanics. For the shape of the files and every field they take, see | ||
| [the configuration reference](../reference/configuration.md); to point your editor at | ||
| the matching schema, the [schema reference](../schemas.md). | ||
|
|
||
| ## Add a new Module version | ||
|
|
||
| 1. Create the Release file at `<config folder>/<name>/<version>.yaml`. The folder name | ||
| is the Module `name` and the filename is the `version`, so `phoebus/0.1.yaml` defines | ||
| version `0.1` of `phoebus`. The `name` and `version` inside the file must match the | ||
| path. | ||
|
|
||
| 2. Add the schema line as the first line so your editor validates as you type: | ||
|
|
||
| ```yaml | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/DiamondLightSource/deploy-tools/main/src/deploy_tools/models/schemas/release.json | ||
| ``` | ||
|
|
||
| The line is read by [`yaml-language-server`](https://github.com/redhat-developer/yaml-language-server), | ||
| so it takes effect in VS Code with the Red Hat YAML extension or any other editor | ||
| running that language server; elsewhere it is an inert comment. See the | ||
| [schema reference](../schemas.md) for details. | ||
|
|
||
| 3. Define the Module. Most Modules provide one or more applications; the smallest useful | ||
| one is a single shell script: | ||
|
|
||
| ```yaml | ||
| module: | ||
| name: my-module | ||
| version: "1.0" | ||
| description: What this Module provides | ||
| applications: | ||
| - app_type: shell | ||
| name: hello | ||
| script: | ||
| - echo "hello from my-module" | ||
| ``` | ||
|
|
||
| Swap the application for an `apptainer` or `binary` one as needed — see | ||
| [the three application types](../reference/configuration.md#the-three-application-types). | ||
|
|
||
| A Module doesn't have to provide an application: it can instead just set environment | ||
| variables or pull in other Modules as | ||
| [dependencies](../reference/configuration.md#a-module). Give such a Module an | ||
| empty `applications: []`. | ||
|
|
||
| ## Set the default version | ||
|
|
||
| `module load <name>` with no version loads the default. If you don't choose one the | ||
| highest version is picked automatically; to pin a specific version, add it to | ||
| `settings.yaml`: | ||
|
|
||
| ```yaml | ||
| default_versions: | ||
| my-module: "1.0" | ||
| ``` | ||
|
|
||
| `settings.yaml` can take a schema line of its own, as | ||
| [above](#add-a-new-module-version), pointing at `deployment-settings.json`. | ||
|
|
||
| To keep a version out of automatic selection — an alpha or release candidate, say — while | ||
| still allowing an explicit `module load <name>/<version>`, set | ||
| `exclude_from_defaults: true` on that Module. | ||
|
|
||
| See [default version resolution](../explanations/default-versions.md) for how the | ||
| automatic choice is made. | ||
|
|
||
| ## Get your change deployed | ||
|
|
||
| How your change reaches the deployment area depends on how your site runs `deploy-tools`. | ||
| The recommended setup is a CI pipeline in the configuration repository: you open a merge | ||
| request, CI validates the change, and merging it deploys (see | ||
| [drive deploy-tools from CI](ci-pipeline.md)). CI is not a requirement — an administrator | ||
| can run the same `validate` and `sync` commands by hand instead. Either way, the | ||
| `yaml-language-server` schema line catches structural mistakes in your editor as you type, | ||
| before anyone else looks at the change. | ||
|
|
||
| ## Change or retire a version | ||
|
|
||
| - **Update an existing version in place.** Rejected by default so published versions stay | ||
| stable; prefer publishing a new version. If you must, set `allow_updates: true` on the | ||
| Module — see [the guard rails](../explanations/deprecation-lifecycle.md#the-guard-rails). | ||
| - **Retire a version.** Set `deprecated: true` in the Release file to steer users away | ||
| from it. Deleting it outright has to wait until after it is deprecated (unless the | ||
| Module has `allow_updates: true`). See | ||
| [the guard rails](../explanations/deprecation-lifecycle.md#the-guard-rails). | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.