Skip to content

Commit 57d008a

Browse files
committed
Merge remote-tracking branch 'bootupd/main' into merge-bootupd
This executes on coreos/bootupd#432 Basically, bootupd doesn't have any users outside of the rpm-ostree/bootc ecosystem and carrying a separate project adds huge amounts of logistical overhead.
2 parents f1ae028 + 0aedf55 commit 57d008a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+7351
-0
lines changed

bootupd/.cargo/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[alias]
2+
xtask = "run --manifest-path ./xtask/Cargo.toml --"

bootupd/.cci.jenkinsfile

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
// Documentation: https://github.com/coreos/coreos-ci/blob/main/README-upstream-ci.md
2+
3+
properties([
4+
// abort previous runs when a PR is updated to save resources
5+
disableConcurrentBuilds(abortPrevious: true)
6+
])
7+
8+
stage("Build") {
9+
parallel build: {
10+
def n = 5
11+
buildPod(runAsUser: 0, memory: "2Gi", cpu: "${n}") {
12+
checkout scm
13+
stage("Core build") {
14+
shwrap("""
15+
make -j ${n}
16+
""")
17+
}
18+
stage("Unit tests") {
19+
shwrap("""
20+
cargo test
21+
""")
22+
}
23+
shwrap("""
24+
make install DESTDIR=\$(pwd)/insttree/
25+
tar -c -C insttree/ -zvf insttree.tar.gz .
26+
""")
27+
stash includes: 'insttree.tar.gz', name: 'build'
28+
}
29+
},
30+
codestyle: {
31+
buildPod {
32+
checkout scm
33+
shwrap("cargo fmt -- --check")
34+
}
35+
}
36+
}
37+
38+
// Build FCOS and do a kola basic run
39+
// FIXME update to main branch once https://github.com/coreos/fedora-coreos-config/pull/595 merges
40+
cosaPod(runAsUser: 0, memory: "4608Mi", cpu: "4") {
41+
stage("Build FCOS") {
42+
checkout scm
43+
unstash 'build'
44+
// Note that like {rpm-,}ostree we want to install to both / and overrides/rootfs
45+
// because bootupd is used both during the `rpm-ostree compose tree` as well as
46+
// inside the target operating system.
47+
shwrap("""
48+
mkdir insttree
49+
tar -C insttree -xzvf insttree.tar.gz
50+
rsync -rlv insttree/ /
51+
coreos-assembler init --force https://github.com/coreos/fedora-coreos-config
52+
mkdir -p overrides/rootfs
53+
mv insttree/* overrides/rootfs/
54+
rmdir insttree
55+
cosa fetch
56+
cosa build
57+
""")
58+
}
59+
// The e2e-adopt test will use the ostree commit we just generated above
60+
// but a static qemu base image.
61+
try {
62+
// Now a test that upgrades using bootupd
63+
stage("e2e upgrade test") {
64+
shwrap("""
65+
git config --global --add safe.directory "\$(pwd)"
66+
env COSA_DIR=${env.WORKSPACE} ./tests/e2e-update/e2e-update.sh
67+
""")
68+
}
69+
stage("Kola testing") {
70+
// The previous e2e leaves things only having built an ostree update
71+
shwrap("cosa build")
72+
// bootupd really can't break upgrades for the OS
73+
kola(cosaDir: "${env.WORKSPACE}", extraArgs: "ext.*bootupd*", skipUpgrade: true, skipBasicScenarios: true)
74+
}
75+
} finally {
76+
archiveArtifacts allowEmptyArchive: true, artifacts: 'tmp/console.txt'
77+
}
78+
}

bootupd/.copr/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
srpm:
2+
dnf -y install cargo git openssl-devel
3+
# similar to https://github.com/actions/checkout/issues/760, but for COPR
4+
git config --global --add safe.directory '*'
5+
cargo install cargo-vendor-filterer
6+
cargo xtask package-srpm
7+
mv target/*.src.rpm $$outdir

bootupd/.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
target
2+
.cosa
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Release process
2+
3+
The release process follows the usual PR-and-review flow, allowing an external reviewer to have a final check before publishing.
4+
5+
In order to ease downstream packaging of Rust binaries, an archive of vendored dependencies is also provided (only relevant for offline builds).
6+
7+
## Requirements
8+
9+
This guide requires:
10+
11+
* A web browser (and network connectivity)
12+
* `git`
13+
* [GPG setup][GPG setup] and personal key for signing
14+
* [git-evtag](https://github.com/cgwalters/git-evtag/)
15+
* `cargo` (suggested: latest stable toolchain from [rustup][rustup])
16+
* A verified account on crates.io
17+
* Write access to this GitHub project
18+
* Upload access to this project on GitHub, crates.io
19+
* Membership in the [Fedora CoreOS Crates Owners group](https://github.com/orgs/coreos/teams/fedora-coreos-crates-owners/members)
20+
21+
## Release checklist
22+
23+
- Prepare local branch+commit
24+
- [ ] `git checkout -b release`
25+
- [ ] Bump the version number in `Cargo.toml`. Usually you just want to bump the patch.
26+
- [ ] Run `cargo build` to ensure `Cargo.lock` would be updated
27+
- [ ] Commit changes `git commit -a -m 'Release x.y.z'`; include some useful brief changelog.
28+
29+
- Prepare the release
30+
- [ ] Run `./ci/prepare-release.sh`
31+
32+
- Validate that `origin` points to the canonical upstream repository and not your fork:
33+
`git remote show origin` should not be `github.com/$yourusername/$project` but should
34+
be under the organization ownership. The remote `yourname` should be for your fork.
35+
36+
- open and merge a PR for this release:
37+
- [ ] `git push --set-upstream origin release`
38+
- [ ] open a web browser and create a PR for the branch above
39+
- [ ] make sure the resulting PR contains the commit
40+
- [ ] in the PR body, write a short changelog with relevant changes since last release
41+
- [ ] get the PR reviewed, approved and merged
42+
43+
- publish the artifacts (tag and crate):
44+
- [ ] `git fetch origin && git checkout ${RELEASE_COMMIT}`
45+
- [ ] verify `Cargo.toml` has the expected version
46+
- [ ] `git-evtag sign v${RELEASE_VER}`
47+
- [ ] `git push --tags origin v${RELEASE_VER}`
48+
- [ ] `cargo publish`
49+
50+
- publish this release on GitHub:
51+
- [ ] find the new tag in the [GitHub tag list](https://github.com/coreos/bootupd/tags), click the triple dots menu, and create a release for it
52+
- [ ] write a short changelog (i.e. re-use the PR content)
53+
- [ ] upload `target/${PROJECT}-${RELEASE_VER}-vendor.tar.gz`
54+
- [ ] record digests of local artifacts:
55+
- `sha256sum target/package/${PROJECT}-${RELEASE_VER}.crate`
56+
- `sha256sum target/${PROJECT}-${RELEASE_VER}-vendor.tar.gz`
57+
- [ ] publish release
58+
59+
- clean up:
60+
- [ ] `git push origin :release`
61+
- [ ] `cargo clean`
62+
- [ ] `git checkout main`
63+
64+
- Fedora packaging:
65+
- [ ] update the `rust-bootupd` spec file in [Fedora](https://src.fedoraproject.org/rpms/rust-bootupd)
66+
- bump the `Version`
67+
- switch the `Release` back to `1%{?dist}`
68+
- remove any patches obsoleted by the new release
69+
- update changelog
70+
- [ ] run `spectool -g -S rust-bootupd.spec`
71+
- [ ] run `kinit [email protected]`
72+
- [ ] run `fedpkg new-sources <crate-name> <vendor-tarball-name>`
73+
- [ ] PR the changes in [Fedora](https://src.fedoraproject.org/rpms/rust-bootupd)
74+
- [ ] once the PR merges to rawhide, merge rawhide into the other relevant branches (e.g. f35) then push those, for example:
75+
```bash
76+
git checkout rawhide
77+
git pull --ff-only
78+
git checkout f35
79+
git merge --ff-only rawhide
80+
git push origin f35
81+
```
82+
- [ ] on each of those branches run `fedpkg build`
83+
- [ ] once the builds have finished, submit them to [bodhi](https://bodhi.fedoraproject.org/updates/new), filling in:
84+
- `rust-bootupd` for `Packages`
85+
- selecting the build(s) that just completed, except for the rawhide one (which gets submitted automatically)
86+
- writing brief release notes like "New upstream release; see release notes at `link to GitHub release`"
87+
- leave `Update name` blank
88+
- `Type`, `Severity` and `Suggestion` can be left as `unspecified` unless it is a security release. In that case select `security` with the appropriate severity.
89+
- `Stable karma` and `Unstable` karma can be set to `2` and `-1`, respectively.
90+
- [ ] [submit a fast-track](https://github.com/coreos/fedora-coreos-config/actions/workflows/add-override.yml) for FCOS testing-devel
91+
- [ ] [submit a fast-track](https://github.com/coreos/fedora-coreos-config/actions/workflows/add-override.yml) for FCOS next-devel if it is [open](https://github.com/coreos/fedora-coreos-pipeline/blob/main/next-devel/README.md)
92+
93+
- RHCOS packaging:
94+
- [ ] update the `rust-bootupd` spec file
95+
- bump the `Version`
96+
- switch the `Release` back to `1%{?dist}`
97+
- remove any patches obsoleted by the new release
98+
- update changelog
99+
- [ ] run `spectool -g -S rust-bootupd.spec`
100+
- [ ] run `kinit [email protected]`
101+
- [ ] run `rhpkg new-sources <crate-name> <vendor-tarball-name>`
102+
- [ ] PR the changes
103+
- [ ] get the PR reviewed and merge it
104+
- [ ] update your local repo and run `rhpkg build`
105+
106+
CentOS Stream 9 packaging:
107+
- [ ] to be written
108+
109+
[rustup]: https://rustup.rs/
110+
[crates-io]: https://crates.io/
111+
[GPG setup]: https://docs.github.com/en/github/authenticating-to-github/managing-commit-signature-verification

bootupd/.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Maintained in https://github.com/coreos/repo-templates
2+
# Do not edit downstream.
3+
4+
version: 2
5+
updates:
6+
- package-ecosystem: cargo
7+
directory: /
8+
schedule:
9+
interval: weekly
10+
open-pull-requests-limit: 10
11+
labels:
12+
- area/dependencies

bootupd/.github/workflows/ci.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
3+
permissions:
4+
actions: read
5+
6+
on:
7+
push:
8+
branches: [main]
9+
pull_request:
10+
branches: [main]
11+
workflow_dispatch: {}
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
env:
18+
CARGO_TERM_COLOR: always
19+
20+
jobs:
21+
c9s-bootc-e2e:
22+
runs-on: ubuntu-24.04
23+
steps:
24+
- uses: actions/checkout@v3
25+
- name: build
26+
run: sudo podman build -t localhost/bootupd:latest -f ci/Containerfile.c9s .
27+
- name: bootc install to disk
28+
run: |
29+
set -xeuo pipefail
30+
sudo truncate -s 10G myimage.raw
31+
sudo podman run --rm -ti --privileged -v .:/target --pid=host --security-opt label=disable \
32+
-v /var/lib/containers:/var/lib/containers \
33+
-v /dev:/dev \
34+
localhost/bootupd:latest bootc install to-disk --skip-fetch-check \
35+
--disable-selinux --generic-image --via-loopback /target/myimage.raw
36+
# Verify we installed grub.cfg and shim on the disk
37+
sudo losetup -P -f myimage.raw
38+
device=$(losetup --list --noheadings --output NAME,BACK-FILE | grep myimage.raw | awk '{print $1}')
39+
sudo mount "${device}p2" /mnt/
40+
sudo ls /mnt/EFI/centos/{grub.cfg,shimx64.efi}
41+
sudo umount /mnt
42+
sudo losetup -D "${device}"
43+
sudo rm -f myimage.raw
44+
- name: bootc install to filesystem
45+
run: |
46+
set -xeuo pipefail
47+
sudo podman run --rm -ti --privileged -v /:/target --pid=host --security-opt label=disable \
48+
-v /dev:/dev -v /var/lib/containers:/var/lib/containers \
49+
localhost/bootupd:latest bootc install to-filesystem --skip-fetch-check \
50+
--disable-selinux --replace=alongside /target
51+
# Verify we injected static configs
52+
jq -re '.["static-configs"].version' /boot/bootupd-state.json
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Cross build
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
actions: read
7+
8+
jobs:
9+
crossarch-check:
10+
runs-on: ubuntu-latest
11+
name: Build on ${{ matrix.arch }}
12+
13+
strategy:
14+
matrix:
15+
include:
16+
- arch: aarch64
17+
distro: ubuntu_latest
18+
- arch: s390x
19+
distro: ubuntu_latest
20+
- arch: ppc64le
21+
distro: ubuntu_latest
22+
steps:
23+
- uses: actions/[email protected]
24+
with:
25+
submodules: true
26+
set-safe-directory: true
27+
28+
- uses: uraimo/[email protected]
29+
name: Build
30+
id: build
31+
with:
32+
arch: ${{ matrix.arch }}
33+
distro: ${{ matrix.distro }}
34+
35+
githubToken: ${{ github.token }}
36+
37+
run: |
38+
set -xeu
39+
apt update -y
40+
apt install -y gcc make cargo libssl-dev pkg-config
41+
cargo check

0 commit comments

Comments
 (0)