Skip to content
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

Makefile: Add disk image files to TUF repo during cargo make repo #1787

Merged
merged 1 commit into from Nov 8, 2021

Conversation

zmrow
Copy link
Contributor

@zmrow zmrow commented Oct 25, 2021

Description of changes:

This change adds the disk image files, if they exist, to the targets that are linked
into the TUF repository during the `cargo make repo` target.  When the
image files are in the repo, we can download them with `tuftool` which
can simplify the process of creating AMIs at a different time or from a
different machine.

Testing done:

  • Ran cargo make and cargo make repo to build an aws-k8s-1.21 and a vmware-k8s-1.20 repo locally and observed the disk image files present in the repo.
$ ls build/repos/default/latest/targets/

053689b3deeb42a241afaa31e475b7d654c4f40914c99a401aea63a431823e6f.bottlerocket-aws-k8s-1.21-x86_64-1.3.0-5827e52a-data.img.lz4
06e08aa7765fc2442e6faf9135928ee9f1a976193592ad44f86e7e1312831043.manifest.json
4280b317fa9d37c0534a1547c91dfd5a0cc5c7e5bda5b7f9d88bbb2caa89df98.aws-k8s-1.21-x86_64-kmod-kit-v1.3.0.tar.xz
71136b20803e7bb78157010ac3ef812f5d8ac80809815461302c000460e642a7.bottlerocket-aws-k8s-1.21-x86_64-1.3.0-5827e52a-boot.ext4.lz4
7115fadc493a99afd385f9bbb34f55fb6014abd455699a83c4cf26bd6e10b278.migrate_v1.3.0_control-container-v0-5-2.lz4
80ed4ddbb6af54f2590d6bbda17521889e1f64121680b5525a2fca5d9d63f7c0.migrate_v1.3.0_etc-hosts-service.lz4
8eb06d78727a41919eb54060ee22dbe03d69f6e6523c6f0ac8ffe9fc4ec959ca.bottlerocket-aws-k8s-1.21-x86_64-1.3.0-5827e52a-root.ext4.lz4
b558db24565a3ea639e71340dd69a83469c54d1a1ab94c7c5db87e7e36e96b7f.bottlerocket-aws-k8s-1.21-x86_64-1.3.0-5827e52a-root.verity.lz4
e9fd64b187693e158addc1302544fac319f214e7d3bb7f85a052cb32dde4dd4b.bottlerocket-aws-k8s-1.21-x86_64-1.3.0-5827e52a.img.lz4
ea456c4377bf00ee5f08e0034582bfbdd0b1e080b86b70ccf91d5158254b8157.migrate_v1.3.0_hostname-affects-etc-hosts.lz4
  • Also ensured that the images ended up in the TUF repo targets.json
$ cat build/repos/default/latest/aws-k8s-1.21/x86_64/1635186997.targets.json
...
      "bottlerocket-aws-k8s-1.21-x86_64-1.3.0-5827e52a-data.img.lz4": {
        "length": 4220096,
        "hashes": {
          "sha256": "053689b3deeb42a241afaa31e475b7d654c4f40914c99a401aea63a431823e6f"
        }
      },
      "bottlerocket-aws-k8s-1.21-x86_64-1.3.0-5827e52a.img.lz4": {
        "length": 325141152,
        "hashes": {
          "sha256": "e9fd64b187693e158addc1302544fac319f214e7d3bb7f85a052cb32dde4dd4b"
        }
      },
...
  • Pushed the files to a test TUF repository in S3 and verified I could pull them down with tuftool
  • Ensure that running cargo make -e BUILDSYS_VARIANT=vmware-k8s-1.20 repo doesn't break.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Makefile.toml Outdated Show resolved Hide resolved
This change adds the disk image files, if they exist, to the targets
that are linked into the TUF repository during the `cargo make repo`
target.  When the image files are in the repo, we can download them with
`tuftool` which can simplify the process of creating AMIs at a different
time or from a different machine.
@zmrow
Copy link
Contributor Author

zmrow commented Oct 27, 2021

^ Fixed the variable names and conditionalized the linking logic based on the existence of the files. With the previous code, cargo make repo would break if there weren't *img* files, like in the VMware case.

@zmrow zmrow merged commit 5a083d9 into bottlerocket-os:develop Nov 8, 2021
@zmrow zmrow deleted the makefile-repo-img branch November 8, 2021 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants