Skip to content

Commit

Permalink
docs: added READMEs
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
  • Loading branch information
therealbobo committed Jul 26, 2023
1 parent fd4fd7d commit 54fd266
Show file tree
Hide file tree
Showing 2 changed files with 160 additions and 0 deletions.
78 changes: 78 additions & 0 deletions images/generated-images/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Mainline Images

The Makefile present in this directory is designed to facilitate the generation of Docker images needed for running Ignite tests with mainline kernels. The workflow provided by this Makefile is designed to be simple and efficient, and it revolves around the following targets:

1. `build-all`: This target builds all the necessary Docker images for the different versions and distributions required for testing Firecracker with mainline kernels.

2. `docker-push`: Optionally, you can use this target to push the resulting Docker images to a Docker Hub registry for easier distribution and access.

3. `generate-yaml`: This target allows you to generate a YAML file (`images.yaml`) containing the matrix of new image information. The generated YAML file can be conveniently copied to the variables file of Ansible to keep the test environment up to date.

## Prerequisites

Before using the Makefile, ensure you have the following installed:

- Docker: The containerization platform used for building and pushing images.

## Mainline Script

Before using the Makefile, you should also be aware of the `mainline.sh` script. This script is used to download Ubuntu mainline kernel packages and generate Docker images with different Ubuntu versions as the base. It also clones a repository to add the source code for building drivers, which allows the recompilation of kernel modules.

## Makefile Targets

The Makefile provides several targets, each serving a specific purpose:

- `initrd-builder`, `builder`, and `modernprobe-builder`: These targets build specific builder images used in the test environment.

- `build-rootfs` and `build-kernel`: These targets build root filesystem and kernel images, respectively.

- `docker-push`: This target pushes the built images to a Docker Hub registry. You can use this step to make the images accessible to other systems.

- `generate-yaml`: This target generates a YAML file named `images.yaml`, which contains information about the built images. The YAML file includes details about the kernel and rootfs images for each version and distribution. This generated YAML file can be conveniently copied to the variables file of Ansible to keep the test environment up to date.

- `build-all`: This target is a convenience target that sequentially builds both root filesystem and kernel images.

## Usage

The typical workflow for using this Makefile with the `mainline.sh` script is as follows:

1. Run the `mainline.sh` script to download Ubuntu mainline kernel packages and generate Docker images with different Ubuntu versions as the base. This script will create a directory structure in the `generated` folder with images for different Ubuntu versions.

```
./mainline.sh
```

2. Build all the required images for testing with Firecracker using the following command:

```
make build-all
```

3. Optionally, push the built images to a Docker Hub registry with:

```
make docker-push
```

4. Generate the YAML file containing the image matrix with:

```
make generate-yaml
```

After running these commands, you will have the necessary Docker images for your Firecracker test environment with mainline kernels, and the image matrix will be available in the `images.yaml` file. You can then easily integrate this information into your Ansible setup.

## Customization

You can customize the Makefile to suit your specific requirements. The variables you can modify include:

- `DRY_RUN`: Set this variable to `true` for a dry run, where the build commands will be printed but not executed.

- `REPOSITORY`: The Docker repository where the built images will be tagged and pushed.

- `ARCH`: The architecture for which the images will be built. By default, it will use the output of `uname -p`.

- `YAML_FILE`: The name of the YAML file that will be generated by the `generate-yaml` target.

Feel free to adjust these variables to match your desired configuration.

82 changes: 82 additions & 0 deletions images/static-images/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Static Images

Makefile present in this directory is specifically designed to generate the static Docker images required by Ignite to run tests on different Linux distributions. The workflow provided by this Makefile is designed to be straightforward, consisting of three main commands:

1. `build-all`: This target builds all the necessary Docker images for the different versions and distributions required for testing with Firecracker.

2. `docker-push`: Optionally, you can use this target to push the resulting Docker images to a Docker Hub registry for easier distribution and access.

3. `generate-yaml`: This target allows you to generate a YAML file (`images.yaml`) containing the matrix of new image information. The generated YAML file can be conveniently copied to the variables file of Ansible to keep the test environment up to date.

## Prerequisites

Before using the Makefile, ensure you have the following installed:

- Docker: The containerization platform used for building and pushing images.

## Makefile Targets

The Makefile provides several targets, each serving a specific purpose:

- `initrd-builder`: This target builds the `initrd-builder` image, necessary for creating the initrd for each image.

- `builder`, `modernprobe-builder`: These targets build specific builder images used by the CI system to prepare all the precompiled files for the tests.

- `build-rootfs` and `build-kernel`: These targets build root filesystem and kernel images, respectively. The `build-kernel` target depends on `initrd-builder`, which must be built first.

- `docker-push`: This target pushes the built images to a Docker Hub registry. You can use this step to make the images accessible to other systems.

- `generate-yaml`: This target generates a YAML file named `images.yaml`, which contains information about the built images. The YAML file includes details about the kernel and rootfs images for each version and distribution. This generated YAML file can be conveniently copied to the variables file of Ansible to keep the test environment up to date.

- `build-all`: This target is a convenience target that sequentially builds both root filesystem and kernel images.

## Usage

The typical workflow for using this Makefile is as follows:

1. Build the `initrd-builder` image first, which is required for creating the initrd for each image:

```
make initrd-builder
```

2. Build the specific builder images (`builder`, `modernprobe-builder`) used by the CI system:

```
make builder
make modernprobe-builder
```

3. Build all the required images for testing with Firecracker using the following command:

```
make build-all
```

4. Optionally, push the built images to a Docker Hub registry with:

```
make docker-push
```

5. Generate the YAML file containing the image matrix with:

```
make generate-yaml
```

After running these commands, you will have the necessary Docker images for your Firecracker test environment, and the image matrix will be available in the `images.yaml` file. You can then easily integrate this information into your Ansible setup.

## Customization

You can customize the Makefile to suit your specific requirements. The variables you can modify include:

- `DRY_RUN`: Set this variable to `true` for a dry run, where the build commands will be printed but not executed.

- `REPOSITORY`: The Docker repository where the built images will be tagged and pushed.

- `ARCH`: The architecture for which the images will be built. By default, it will use the output of `uname -p`.

- `YAML_FILE`: The name of the YAML file that will be generated by the `generate-yaml` target.

Feel free to adjust these variables to match your desired configuration.

0 comments on commit 54fd266

Please sign in to comment.