Skip to content

Commit c1baf42

Browse files
cooperleesvmagro
authored and
vmagro
committed
[antlir/metalos] Autoformat all Markdown docs
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
1 parent 5ec7067 commit c1baf42

20 files changed

+493
-1246
lines changed

antlir/website/docs/concepts/flavors/inheritance-in-parent-layers.md

+8-24
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,9 @@ title: Inheritance in Parent Layers
55

66
## Inheritance from Parent Layers
77

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

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

1612
```
1713
image.layer(
@@ -26,24 +22,15 @@ image.layer(
2622
)
2723
```
2824

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

3227
## RPMs in inherited flavors
3328

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`.
3830

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

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`
4734

4835
```
4936
# This layer also has the flavor `centos8`.
@@ -63,9 +50,7 @@ image.layer(
6350
)
6451
```
6552

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

7055
```
7156
REPO_CFG.flavor_available = ["centos7", "centos8"]
@@ -97,5 +82,4 @@ image.layer(
9782
)
9883
```
9984

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

antlir/website/docs/concepts/flavors/overview.md

+7-20
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,14 @@ title: Overview
55

66
## Introduction to Flavors
77

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`.
119

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

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

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:
2416
- Never change a flavor name
2517
- Never reuse a flavor name
2618

@@ -42,8 +34,7 @@ shim = struct(
4234
)
4335
```
4436

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

4839
```
4940
image.layer(
@@ -64,8 +55,4 @@ image.layer(
6455
)
6556
```
6657

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.

antlir/website/docs/concepts/flavors/stable-flavors.md

+11-17
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ title: Stable Flavors
55

66
## Stable Flavors
77

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+
1010
```
1111
REPO_CFG = {
1212
"stable_flavors": [
@@ -27,16 +27,13 @@ image.layer(
2727
]
2828
)
2929
```
30-
Flavors not included in `REPO_CFG.stable_flavors` are considered unstable,
31-
and can have incorrect rpm snapshots that do not include rpms.
3230

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
3736

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
4037
```
4138
image.layer(
4239
name = "test-layer",
@@ -51,17 +48,14 @@ image.layer(
5148
flavor = "centos8-untested",
5249
)
5350
```
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.
5653

5754
## Restrictions on `rpms_install`
5855

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

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

6660
```
6761
image.layer(

antlir/website/docs/concepts/pre-built-artifacts/fetched-artifacts.md

+10-21
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,19 @@ id: fetched-artifacts
33
title: Fetched Artifacts
44
---
55

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

108
- **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.
1410

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

1913
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.
2414

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
29-
[fetched_package_layer.bzl](https://www.internalfb.com/intern/diffusion/FBS/browse/master/fbcode/antlir/bzl/fetched_package_layer.bzl).
30-
- Providing a binary that can be called to update the in-repo database for a
31-
given artifact:
32-
[update_package_db.py](https://www.internalfb.com/intern/diffusion/FBS/browse/master/fbcode/antlir/update_package_db.py).
15+
- 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

Comments
 (0)