Skip to content

Commit affc8b9

Browse files
authored
Merge pull request #875 from cgwalters/merge-ostree-rs-ext
Merge ostree-ext
2 parents ad95463 + 7359e69 commit affc8b9

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

+15285
-9
lines changed

Cargo.lock

Lines changed: 27 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[workspace]
2-
members = ["cli", "lib", "xtask", "tests-integration"]
2+
members = ["cli", "lib", "ostree-ext", "xtask", "tests-integration"]
33
resolver = "2"
44

55
[profile.dev]
@@ -23,9 +23,13 @@ camino = "1.1.6"
2323
cap-std-ext = "4.0.2"
2424
chrono = { version = "0.4.38", default-features = false }
2525
clap = "4.5.4"
26+
clap_mangen = { version = "0.2.20" }
27+
hex = "0.4.3"
2628
indoc = "2.0.5"
29+
indicatif = "0.17.0"
2730
fn-error-context = "0.2.1"
2831
libc = "0.2.154"
32+
openssl = "0.10.33"
2933
rustix = { "version" = "0.38.34", features = ["thread", "fs", "system", "process", "mount"] }
3034
serde = "1.0.199"
3135
serde_json = "1.0.116"
@@ -34,6 +38,7 @@ static_assertions = "1.1.0"
3438
tempfile = "3.10.1"
3539
tracing = "0.1.40"
3640
tokio = ">= 1.37.0"
41+
tokio-util = { features = ["io-util"], version = "0.7.10" }
3742

3843
# See https://github.com/coreos/cargo-vendor-filterer
3944
[workspace.metadata.vendor-filter]

lib/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ anstyle = "1.0.6"
1919
anyhow = { workspace = true }
2020
bootc-utils = { path = "../utils" }
2121
camino = { workspace = true, features = ["serde1"] }
22-
ostree-ext = { version = "0.15.0" }
22+
ostree-ext = { path = "../ostree-ext" }
2323
chrono = { workspace = true, features = ["serde"] }
2424
clap = { workspace = true, features = ["derive","cargo"] }
25-
clap_mangen = { version = "0.2.20", optional = true }
25+
clap_mangen = { workspace = true, optional = true }
2626
cap-std-ext = { workspace = true, features = ["fs_utf8"] }
27-
hex = "^0.4.3"
27+
hex = { workspace = true }
2828
fn-error-context = { workspace = true }
29-
indicatif = "0.17.8"
29+
indicatif = { workspace = true }
3030
libc = { workspace = true }
3131
liboverdrop = "0.1.0"
3232
libsystemd = "0.7"
33-
openssl = "^0.10.64"
33+
openssl = { workspace = true }
3434
regex = "1.10.4"
3535
rustix = { workspace = true }
3636
schemars = { version = "0.8.17", features = ["chrono"] }
@@ -39,7 +39,7 @@ serde_ignored = "0.1.10"
3939
serde_json = { workspace = true }
4040
serde_yaml = "0.9.34"
4141
tokio = { workspace = true, features = ["io-std", "time", "process", "rt", "net"] }
42-
tokio-util = { features = ["io-util"], version = "0.7.10" }
42+
tokio-util = { workspace = true }
4343
tracing = { workspace = true }
4444
tempfile = { workspace = true }
4545
toml = "0.8.12"
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: bootc
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+
jobs:
14+
build-c9s:
15+
runs-on: ubuntu-latest
16+
container: quay.io/centos/centos:stream9
17+
steps:
18+
- run: dnf -y install git-core
19+
- uses: actions/checkout@v3
20+
with:
21+
repository: containers/bootc
22+
path: bootc
23+
- uses: actions/checkout@v3
24+
with:
25+
path: ostree-rs-ext
26+
- name: Patch bootc to use ostree-rs-ext
27+
run: |
28+
set -xeuo pipefail
29+
cd bootc
30+
cat >> Cargo.toml << 'EOF'
31+
[patch.crates-io]
32+
ostree-ext = { path = "../ostree-rs-ext/lib" }
33+
EOF
34+
- name: Install deps
35+
run: ./bootc/ci/installdeps.sh
36+
- name: Cache Dependencies
37+
uses: Swatinem/rust-cache@v2
38+
with:
39+
key: "build-bootc-c9s"
40+
workspaces: bootc
41+
- name: Build
42+
run: cd bootc && make test-bin-archive
43+
- name: Upload binary
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: bootc-c9s.tar.zst
47+
path: bootc/target/bootc.tar.zst
48+
privtest-alongside:
49+
name: "Test install-alongside"
50+
needs: build-c9s
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Download
54+
uses: actions/[email protected]
55+
with:
56+
name: bootc-c9s.tar.zst
57+
- name: Install
58+
run: tar -xvf bootc.tar.zst
59+
- name: Integration tests
60+
run: |
61+
set -xeuo pipefail
62+
sudo podman run --rm -ti --privileged -v /:/target -v /var/lib/containers:/var/lib/containers -v ./usr/bin/bootc:/usr/bin/bootc --pid=host --security-opt label=disable \
63+
quay.io/centos-bootc/centos-bootc-dev:stream9 bootc install to-filesystem \
64+
--karg=foo=bar --disable-selinux --replace=alongside /target
65+

ostree-ext/.github/workflows/rust.yml

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
# Inspired by https://github.com/rust-analyzer/rust-analyzer/blob/master/.github/workflows/ci.yaml
2+
# but tweaked in several ways. If you make changes here, consider doing so across other
3+
# repositories in e.g. ostreedev etc.
4+
name: Rust
5+
6+
permissions:
7+
actions: read
8+
9+
on:
10+
push:
11+
branches: [main]
12+
pull_request:
13+
branches: [main]
14+
workflow_dispatch: {}
15+
16+
env:
17+
CARGO_TERM_COLOR: always
18+
19+
jobs:
20+
tests:
21+
runs-on: ubuntu-latest
22+
container: quay.io/coreos-assembler/fcos-buildroot:testing-devel
23+
steps:
24+
- uses: actions/checkout@v3
25+
- name: Code lints
26+
run: ./ci/lints.sh
27+
- name: Install deps
28+
run: ./ci/installdeps.sh
29+
# xref containers/containers-image-proxy-rs
30+
- name: Cache Dependencies
31+
uses: Swatinem/rust-cache@v2
32+
with:
33+
key: "tests"
34+
- name: cargo fmt (check)
35+
run: cargo fmt -- --check -l
36+
- name: Build
37+
run: cargo test --no-run
38+
- name: Individual checks
39+
run: (cd cli && cargo check) && (cd lib && cargo check)
40+
- name: Run tests
41+
run: cargo test -- --nocapture --quiet
42+
- name: Manpage generation
43+
run: mkdir -p target/man && cargo run --features=docgen -- man --directory target/man
44+
- name: cargo clippy
45+
run: cargo clippy
46+
build:
47+
runs-on: ubuntu-latest
48+
container: quay.io/coreos-assembler/fcos-buildroot:testing-devel
49+
steps:
50+
- uses: actions/checkout@v3
51+
- name: Install deps
52+
run: ./ci/installdeps.sh
53+
- name: Cache Dependencies
54+
uses: Swatinem/rust-cache@v2
55+
with:
56+
key: "build"
57+
- name: Build
58+
run: cargo build --release --features=internal-testing-api
59+
- name: Upload binary
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: ostree-ext-cli
63+
path: target/release/ostree-ext-cli
64+
build-minimum-toolchain:
65+
name: "Build using MSRV"
66+
runs-on: ubuntu-latest
67+
container: quay.io/coreos-assembler/fcos-buildroot:testing-devel
68+
steps:
69+
- name: Checkout repository
70+
uses: actions/checkout@v3
71+
- name: Install deps
72+
run: ./ci/installdeps.sh
73+
- name: Detect crate MSRV
74+
shell: bash
75+
run: |
76+
msrv=$(cargo metadata --format-version 1 --no-deps | \
77+
jq -r '.packages[1].rust_version')
78+
echo "Crate MSRV: $msrv"
79+
echo "ACTION_MSRV_TOOLCHAIN=$msrv" >> $GITHUB_ENV
80+
- name: Remove system Rust toolchain
81+
run: dnf remove -y rust cargo
82+
- uses: dtolnay/rust-toolchain@master
83+
with:
84+
toolchain: ${{ env['ACTION_MSRV_TOOLCHAIN'] }}
85+
- name: Cache Dependencies
86+
uses: Swatinem/rust-cache@v2
87+
with:
88+
key: "min"
89+
- name: cargo check
90+
run: cargo check
91+
cargo-deny:
92+
runs-on: ubuntu-latest
93+
steps:
94+
- uses: actions/checkout@v3
95+
- uses: EmbarkStudios/cargo-deny-action@v1
96+
with:
97+
log-level: warn
98+
command: check bans sources licenses
99+
integration:
100+
name: "Integration"
101+
needs: build
102+
runs-on: ubuntu-latest
103+
container: quay.io/fedora/fedora-coreos:testing-devel
104+
steps:
105+
- name: Checkout repository
106+
uses: actions/checkout@v3
107+
- name: Download ostree-ext-cli
108+
uses: actions/[email protected]
109+
with:
110+
name: ostree-ext-cli
111+
- name: Install
112+
run: install ostree-ext-cli /usr/bin && rm -v ostree-ext-cli
113+
- name: Integration tests
114+
run: ./ci/integration.sh
115+
ima:
116+
name: "Integration (IMA)"
117+
needs: build
118+
runs-on: ubuntu-latest
119+
container: quay.io/fedora/fedora-coreos:testing-devel
120+
steps:
121+
- name: Checkout repository
122+
uses: actions/checkout@v3
123+
- name: Download ostree-ext-cli
124+
uses: actions/[email protected]
125+
with:
126+
name: ostree-ext-cli
127+
- name: Install
128+
run: install ostree-ext-cli /usr/bin && rm -v ostree-ext-cli
129+
- name: Integration tests
130+
run: ./ci/ima.sh
131+
privtest:
132+
name: "Privileged testing"
133+
needs: build
134+
runs-on: ubuntu-latest
135+
container:
136+
image: quay.io/fedora/fedora-coreos:testing-devel
137+
options: "--privileged --pid=host -v /var/tmp:/var/tmp -v /run/dbus:/run/dbus -v /run/systemd:/run/systemd -v /:/run/host"
138+
steps:
139+
- name: Checkout repository
140+
uses: actions/checkout@v3
141+
- name: Download
142+
uses: actions/[email protected]
143+
with:
144+
name: ostree-ext-cli
145+
- name: Install
146+
run: install ostree-ext-cli /usr/bin && rm -v ostree-ext-cli
147+
- name: Integration tests
148+
run: ./ci/priv-integration.sh
149+
privtest-cockpit:
150+
name: "Privileged testing (cockpit)"
151+
needs: build
152+
runs-on: ubuntu-latest
153+
container:
154+
image: quay.io/fedora/fedora-bootc:41
155+
options: "--privileged --pid=host -v /var/tmp:/var/tmp -v /run/dbus:/run/dbus -v /run/systemd:/run/systemd -v /:/run/host"
156+
steps:
157+
- name: Checkout repository
158+
uses: actions/checkout@v4
159+
- name: Download
160+
uses: actions/[email protected]
161+
with:
162+
name: ostree-ext-cli
163+
- name: Install
164+
run: install ostree-ext-cli /usr/bin && rm -v ostree-ext-cli
165+
- name: Integration tests
166+
run: ./ci/priv-test-cockpit-selinux.sh
167+
container-build:
168+
name: "Container build"
169+
needs: build
170+
runs-on: ubuntu-latest
171+
steps:
172+
- name: Checkout repository
173+
uses: actions/checkout@v3
174+
- name: Checkout coreos-layering-examples
175+
uses: actions/checkout@v3
176+
with:
177+
repository: coreos/coreos-layering-examples
178+
path: coreos-layering-examples
179+
- name: Download
180+
uses: actions/[email protected]
181+
with:
182+
name: ostree-ext-cli
183+
- name: Integration tests
184+
run: ./ci/container-build-integration.sh

0 commit comments

Comments
 (0)