You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/maintaining/tagging.md
+17-16Lines changed: 17 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,8 @@
1
1
# Tagging and manifest creation
2
2
3
-
The main purpose of the source code in [the `tagging` folder](https://github.com/jupyter/docker-stacks/tree/main/tagging) is to properly write tag files and manifests for single-platform images,
4
-
apply these tags, and merge single-platform images into one multi-arch image.
3
+
The main purpose of the source code in [the `tagging` folder](https://github.com/jupyter/docker-stacks/tree/main/tagging) is to
4
+
properly write tags file, build history line and manifest for a single-platform image,
5
+
apply these tags, and then merge single-platform images into one multi-arch image.
5
6
6
7
## What is a tag and a manifest
7
8
@@ -16,9 +17,9 @@ For example, we dump all `conda` packages with their versions into the manifest.
16
17
17
18
- All images are organized in a hierarchical tree.
18
19
More info on [image relationships](../using/selecting.md#image-relationships).
19
-
-Classes inherit from `TaggerInterface` and `ManifestInterface` to generate tags and manifest pieces by running commands in Docker containers.
20
+
-`TaggerInterface` and `ManifestInterface` are interfaces for functions to generate tags and manifest pieces by running commands in Docker containers.
20
21
- Tags and manifests are reevaluated for each image in the hierarchy since values may change between parent and child images.
21
-
- To tag an image and create its manifest, run `make hook/<somestack>` (e.g., `make hook/base-notebook`).
22
+
- To tag an image and create its manifest and build history line, run `make hook/<somestack>` (e.g., `make hook/base-notebook`).
22
23
23
24
## Utils
24
25
@@ -46,42 +47,42 @@ The prefix of commit hash (namely, 12 letters) is used as an image tag to make i
46
47
47
48
### Tagger
48
49
49
-
`Tagger` is a class that can be run inside a docker container to calculate a tag for an image.
50
+
`Tagger` is a function that runs commands inside a docker container to calculate a tag for an image.
50
51
51
-
All the taggers are inherited from`TaggerInterface`:
So, the `tag_value(container)` method gets a docker container as an input and returns a tag.
59
+
So, the `tagger(container)` gets a docker container as an input and returns a tag.
59
60
60
-
`SHATagger` example:
61
+
`commit_sha_tagger` example:
61
62
62
63
```{literalinclude} ../../tagging/taggers/sha.py
63
64
:language: py
64
-
:start-at: class SHATagger
65
+
:start-at: def
65
66
```
66
67
67
-
-`taggers/` subdirectory contains all the taggers.
68
+
-`taggers/` subdirectory contains all taggers.
68
69
-`apps/write_tags_file.py`, `apps/apply_tags.py`, and `apps/merge_tags.py` are Python executable used to write tags for an image, apply tags from a file, and create multi-arch images.
69
70
70
71
### Manifest
71
72
72
-
All manifest classes except `BuildInfo` are inherited from`ManifestInterface`
73
-
and `markdown_piece(container)` method returns a piece of the build manifest.
73
+
All manifest functions except `build_info_manifest` follow`ManifestInterface`
74
+
and `manifest(container)` method returns a piece of the build manifest.
-`quoted_output(container, cmd)` simply runs the command inside a container using `DockerRunner.exec_cmd` and wraps it to triple quotes to create a valid markdown piece.
0 commit comments