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
Summary:
- Fix prettier
- Add to new metalos docs location
Format all the `.md`:
- `find metalos/docs/ -name '*.md' | xargs arc lint -a`
- `find antlir/website/ -name '*.md' | xargs arc lint -a`
All the changes here are automated. `arc lint` + vscode etc. will now automagically keep these formatted.
Test Plan: - `arc lint`
Reviewed By: snarkmaster
Differential Revision: D41158049
fbshipit-source-id: 0fa3135a0414b5ef2a88d31b6c156e8c370a9ef3
Copy file name to clipboardexpand all lines: antlir/website/docs/concepts/flavors/inheritance-in-parent-layers.md
+8-24
Original file line number
Diff line number
Diff line change
@@ -5,13 +5,9 @@ title: Inheritance in Parent Layers
5
5
6
6
## Inheritance from Parent Layers
7
7
8
-
Layers with parents should have the same flavor as their parent.
9
-
This is because the child layer contains the same OS and RPM
10
-
installer as the parent layer.
8
+
Layers with parents should have the same flavor as their parent. This is because the child layer contains the same OS and RPM installer as the parent layer.
11
9
12
-
We have a simplification in our API that lets you skip specifying
13
-
the flavor for child layers. The flavor is read instead from
14
-
`/.meta/flavor` in the parent.
10
+
We have a simplification in our API that lets you skip specifying the flavor for child layers. The flavor is read instead from `/.meta/flavor` in the parent.
15
11
16
12
```
17
13
image.layer(
@@ -26,24 +22,15 @@ image.layer(
26
22
)
27
23
```
28
24
29
-
This greatly reduces the verbosity of the flavor API as we don't have
30
-
to specify the flavor everywhere.
25
+
This greatly reduces the verbosity of the flavor API as we don't have to specify the flavor everywhere.
31
26
32
27
## RPMs in inherited flavors
33
28
34
-
Due to BUCK limitations, we cannot read the flavor information
35
-
from the BUCK target. We also cannot do file I/O in `.bzl` to read
36
-
the flavor information. The flavor information is only available
37
-
in `python`.
29
+
Due to BUCK limitations, we cannot read the flavor information from the BUCK target. We also cannot do file I/O in `.bzl` to read the flavor information. The flavor information is only available in `python`.
38
30
39
-
This creates an issue when adding installing RPMs on a layer.
40
-
RPM installation requires that we add a dependency on BUCK targets
41
-
in the repo snapshot to make sure we only add valid RPMs. But since
42
-
we don't know what the flavor is, we don't know which dependencies we need.
31
+
This creates an issue when adding installing RPMs on a layer. RPM installation requires that we add a dependency on BUCK targets in the repo snapshot to make sure we only add valid RPMs. But since we don't know what the flavor is, we don't know which dependencies we need.
43
32
44
-
The behavior we have is that we just add all dependencies for all possible
45
-
flavors in [`REPO_CFG.stable_flavors`](stable-flavors.md). For rpms that only available for specific
46
-
flavors like `centos8` you will have to explicitly specify the flavor on `rpms_install`
33
+
The behavior we have is that we just add all dependencies for all possible flavors in [`REPO_CFG.stable_flavors`](stable-flavors.md). For rpms that only available for specific flavors like `centos8` you will have to explicitly specify the flavor on `rpms_install`
47
34
48
35
```
49
36
# This layer also has the flavor `centos8`.
@@ -63,9 +50,7 @@ image.layer(
63
50
)
64
51
```
65
52
66
-
We also have coverage checks to make sure that you have at least one (possibly empty)
67
-
`rpms_install` for every flavor in `REPO_CFG.flavor_available`. This is to make
68
-
explicit that no RPMs are being installed.
53
+
We also have coverage checks to make sure that you have at least one (possibly empty) `rpms_install` for every flavor in `REPO_CFG.flavor_available`. This is to make explicit that no RPMs are being installed.
When attempting to install test rpms of flavor `antlir_test` we have helpers in [`antlir/bzl/test_rpms.bzl`](../../api/bzl/test_rpms.bzl.md)
101
-
that wrap adding the empty `rpms_install` to simplify the api.
85
+
When attempting to install test rpms of flavor `antlir_test` we have helpers in [`antlir/bzl/test_rpms.bzl`](../../api/bzl/test_rpms.bzl.md) that wrap adding the empty `rpms_install` to simplify the api.
Copy file name to clipboardexpand all lines: antlir/website/docs/concepts/flavors/overview.md
+7-20
Original file line number
Diff line number
Diff line change
@@ -5,22 +5,14 @@ title: Overview
5
5
6
6
## Introduction to Flavors
7
7
8
-
A flavor is a string identifier that controls build configurations.
9
-
Options contained in a flavor can include `build_appliance` as well
10
-
as `rpm_installer`.
8
+
A flavor is a string identifier that controls build configurations. Options contained in a flavor can include `build_appliance` as well as `rpm_installer`.
11
9
12
-
This allows us to specify compability between
13
-
different images. For example, we can make sure that `centos7` images
14
-
do not depend on `centos8` images, which is a breaking version.
10
+
This allows us to specify compability between different images. For example, we can make sure that `centos7` images do not depend on `centos8` images, which is a breaking version.
15
11
16
-
It also allows to reuse common build opts throughout the codebase
17
-
with less duplication.
12
+
It also allows to reuse common build opts throughout the codebase with less duplication.
13
+
14
+
Flavors are strings instead of functions because a flavor must have a stable identity as the source tree evolves. We must be able to compare flavors between old revs and new. The container runtime must also be able to rely on stable flavor IDs. Flavors names must follow two critical rules:
18
15
19
-
Flavors are strings instead of functions because a flavor must have
20
-
a stable identity as the source tree evolves. We must be able to
21
-
compare flavors between old revs and new. The container runtime must
22
-
also be able to rely on stable flavor IDs. Flavors names must
23
-
follow two critical rules:
24
16
- Never change a flavor name
25
17
- Never reuse a flavor name
26
18
@@ -42,8 +34,7 @@ shim = struct(
42
34
)
43
35
```
44
36
45
-
Then, you can pass the flavor to images. You can also override the
46
-
default value in the flavor with custom ones.
37
+
Then, you can pass the flavor to images. You can also override the default value in the flavor with custom ones.
47
38
48
39
```
49
40
image.layer(
@@ -64,8 +55,4 @@ image.layer(
64
55
)
65
56
```
66
57
67
-
The flavor of an image is written as a string to the file
68
-
`/.meta/flavor` in the image. This allows you to check the compatibility
69
-
of different layers. We use the flavor file to check the compatibility between cached layers
70
-
built on older revisions and layers built on the current revision. We also use
71
-
the flavor file to deduce the flavor of the child layer from the parent.
58
+
The flavor of an image is written as a string to the file `/.meta/flavor` in the image. This allows you to check the compatibility of different layers. We use the flavor file to check the compatibility between cached layers built on older revisions and layers built on the current revision. We also use the flavor file to deduce the flavor of the child layer from the parent.
Copy file name to clipboardexpand all lines: antlir/website/docs/concepts/flavors/stable-flavors.md
+11-17
Original file line number
Diff line number
Diff line change
@@ -5,8 +5,8 @@ title: Stable Flavors
5
5
6
6
## Stable Flavors
7
7
8
-
`REPO_CFG.stable_flavors` defines which flavors of rpms are included
9
-
by default into layers that determine their flavor from the parent
8
+
`REPO_CFG.stable_flavors` defines which flavors of rpms are included by default into layers that determine their flavor from the parent
9
+
10
10
```
11
11
REPO_CFG = {
12
12
"stable_flavors": [
@@ -27,16 +27,13 @@ image.layer(
27
27
]
28
28
)
29
29
```
30
-
Flavors not included in `REPO_CFG.stable_flavors` are considered unstable,
31
-
and can have incorrect rpm snapshots that do not include rpms.
32
30
33
-
We cannot include rpms from unstable flavors by default into layers
34
-
with inherited flavors. This is because when an rpm snapshot fails for unstable
35
-
flavor it will have no available rpms. Then all layers using inherited flavors
36
-
will have a missing dependency.
31
+
Flavors not included in `REPO_CFG.stable_flavors` are considered unstable, and can have incorrect rpm snapshots that do not include rpms.
32
+
33
+
We cannot include rpms from unstable flavors by default into layers with inherited flavors. This is because when an rpm snapshot fails for unstable flavor it will have no available rpms. Then all layers using inherited flavors will have a missing dependency.
34
+
35
+
Instead, if a user wants to install an rpm onto a layer with an unstable flavor, they have to explicitly mark the flavor with
37
36
38
-
Instead, if a user wants to install an rpm onto a layer with an
39
-
unstable flavor, they have to explicitly mark the flavor with
40
37
```
41
38
image.layer(
42
39
name = "test-layer",
@@ -51,17 +48,14 @@ image.layer(
51
48
flavor = "centos8-untested",
52
49
)
53
50
```
54
-
This ensures when an rpm snapshot fails, we only break layers of
55
-
that specific flavor.
51
+
52
+
This ensures when an rpm snapshot fails, we only break layers of that specific flavor.
56
53
57
54
## Restrictions on `rpms_install`
58
55
59
-
We also have a restriction that when using an unstable flavor, the rpm
60
-
action must include the flavor.
56
+
We also have a restriction that when using an unstable flavor, the rpm action must include the flavor.
61
57
62
-
This is to make it clear to the user that unflavored rpm actions only
63
-
affect layers with a stable flavor. They do not affect layers with
64
-
an unstable flavor.
58
+
This is to make it clear to the user that unflavored rpm actions only affect layers with a stable flavor. They do not affect layers with an unstable flavor.
Copy file name to clipboardexpand all lines: antlir/website/docs/concepts/pre-built-artifacts/fetched-artifacts.md
+10-21
Original file line number
Diff line number
Diff line change
@@ -3,30 +3,19 @@ id: fetched-artifacts
3
3
title: Fetched Artifacts
4
4
---
5
5
6
-
While Antlir provides utilities to build and install binaries directly into
7
-
images as part of image creation, it can also be advantageous to include
8
-
"fetched" artifacts. These provide two core benefits:
6
+
While Antlir provides utilities to build and install binaries directly into images as part of image creation, it can also be advantageous to include "fetched" artifacts. These provide two core benefits:
9
7
10
8
-**Speed**: One can explicitly cache large, infrequently changed artifacts.
11
-
-**Controlled release cadence**: An image may want to use a "stable", released
12
-
version of a given dependency rather than build it directly alongside the
13
-
image build.
9
+
-**Controlled release cadence**: An image may want to use a "stable", released version of a given dependency rather than build it directly alongside the image build.
14
10
15
-
However, fetched packages are naturally opposed to Antlir's underlying goal of
16
-
hermeticity and determinism, in that any fetch to an external artifact store is
17
-
not guaranteed to deterministically produce the same result.
11
+
However, fetched packages are naturally opposed to Antlir's underlying goal of hermeticity and determinism, in that any fetch to an external artifact store is not guaranteed to deterministically produce the same result.
18
12
19
13
To tackle this, Antlir relies on the concept of "in-repo databases", which:
20
-
- Store an address and cryptographic hash of each fetched artifact in a file
21
-
in the repo.
22
-
- Provide a build target that fetches the package, checks the hash, and
23
-
presents the package contents to be used by images.
24
14
25
-
The above process is hermetic (unless the package is unavailable). Antlir
26
-
accomplishes this by:
27
-
- Exposing an interface that can then be implemented by different artifact
28
-
stores. The code is well documented and can be found in
- Store an address and cryptographic hash of each fetched artifact in a file in the repo.
16
+
- Provide a build target that fetches the package, checks the hash, and presents the package contents to be used by images.
17
+
18
+
The above process is hermetic (unless the package is unavailable). Antlir accomplishes this by:
19
+
20
+
- Exposing an interface that can then be implemented by different artifact stores. The code is well documented and can be found in [fetched_package_layer.bzl](https://www.internalfb.com/intern/diffusion/FBS/browse/master/fbcode/antlir/bzl/fetched_package_layer.bzl).
21
+
- Providing a binary that can be called to update the in-repo database for a given artifact: [update_package_db.py](https://www.internalfb.com/intern/diffusion/FBS/browse/master/fbcode/antlir/update_package_db.py).
0 commit comments