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

rust/src/main.rs: Add bootc entry point #4506

Merged
merged 2 commits into from
Jul 24, 2023
Merged

Conversation

jmarrero
Copy link
Member

closes #4469

@openshift-ci
Copy link

openshift-ci bot commented Jul 19, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@jmarrero jmarrero force-pushed the add-bootc branch 3 times, most recently from 5c74c86 to effeac4 Compare July 19, 2023 20:51
@jmarrero
Copy link
Member Author

This seems to work:

[jmarrero@silverblue debug]$ cat Dockerfile 
FROM quay.io/fedora/fedora-coreos:stable
ADD rpm-ostree /usr/bin/rpm-ostree
RUN ln -s /usr/bin/rpm-ostree /usr/bin/bootc
RUN bootc --help
[jmarrero@silverblue debug]$ podman build .
STEP 1/4: FROM quay.io/fedora/fedora-coreos:stable
STEP 2/4: ADD rpm-ostree /usr/bin/rpm-ostree
--> Using cache 5496e78b39f5e067233edeafb7e311604d7b2a985b61f644bc6f1c391af2b096
--> 5496e78b39f5
STEP 3/4: RUN ln -s /usr/bin/rpm-ostree /usr/bin/bootc
--> Using cache b6c95d0b62e0fb4caba319b71a8a741a1041a532f7b630e79161c03aafaa3fd3
--> b6c95d0b62e0
STEP 4/4: RUN bootc --help
[rust/src/main.rs:99] "CALLNAME:  {:?}" = "CALLNAME:  {:?}"
[rust/src/main.rs:99] &callname = "bootc"
Deploy and upgrade via bootable container images

Usage: bootc <COMMAND>

Commands:
  upgrade                Look for updates to the booted container image
  switch                 Target a new container image reference to boot
  edit                   Change host specification
  status                 Display status
  usr-overlay            Add a transient writable overlayfs on `/usr` that will be discarded on reboot
  install                Install to the target block device
  install-to-filesystem  Install to the target filesystem
  help                   Print this message or the help of the given subcommand(s)

Options:
  -h, --help  Print help
COMMIT

@jmarrero
Copy link
Member Author

Need to figure out why this is failing in CI and not locally.

[2023-07-20T02:09:20.702Z] error: could not compile `k8s-openapi` (lib)

[2023-07-20T02:09:20.702Z] 

[2023-07-20T02:09:20.702Z] Caused by:

[2023-07-20T02:09:20.703Z]   process didn't exit successfully: `rustc --crate-name k8s_openapi --edition=2021 /home/jenkins/agent/workspace/rpm-ostree_PR-4506/rpm-ostree-2023.5.19.geffeac4d/vendor/k8s-openapi/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C panic=abort -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="api"' --cfg 'feature="default"' --cfg 'feature="http"' --cfg 'feature="percent-encoding"' --cfg 'feature="url"' --cfg 'feature="v1_25"' -C metadata=df2f859b7d5968ca -C extra-filename=-df2f859b7d5968ca --out-dir /home/jenkins/agent/workspace/rpm-ostree_PR-4506/rpm-ostree-2023.5.19.geffeac4d/target/release/deps -L dependency=/home/jenkins/agent/workspace/rpm-ostree_PR-4506/rpm-ostree-2023.5.19.geffeac4d/target/release/deps --extern base64=/home/jenkins/agent/workspace/rpm-ostree_PR-4506/rpm-ostree-2023.5.19.geffeac4d/target/release/deps/libbase64-83b2a0613e736ac7.rmeta --extern bytes=/home/jenkins/agent/workspace/rpm-ostree_PR-4506/rpm-ostree-2023.5.19.geffeac4d/target/release/deps/libbytes-b4ce8976458143d9.rmeta --extern chrono=/home/jenkins/agent/workspace/rpm-ostree_PR-4506/rpm-ostree-2023.5.19.geffeac4d/target/release/deps/libchrono-7cd2d65cb1a546a9.rmeta --extern http=/home/jenkins/agent/workspace/rpm-ostree_PR-4506/rpm-ostree-2023.5.19.geffeac4d/target/release/deps/libhttp-aea824e4d5883e1c.rmeta --extern percent_encoding=/home/jenkins/agent/workspace/rpm-ostree_PR-4506/rpm-ostree-2023.5.19.geffeac4d/target/release/deps/libpercent_encoding-aef2ed335e558e08.rmeta --extern serde=/home/jenkins/agent/workspace/rpm-ostree_PR-4506/rpm-ostree-2023.5.19.geffeac4d/target/release/deps/libserde-9d08324affe04c50.rmeta --extern serde_value=/home/jenkins/agent/workspace/rpm-ostree_PR-4506/rpm-ostree-2023.5.19.geffeac4d/target/release/deps/libserde_value-629348bdbe71a350.rmeta --extern serde_json=/home/jenkins/agent/workspace/rpm-ostree_PR-4506/rpm-ostree-2023.5.19.geffeac4d/target/release/deps/libserde_json-c807c23fc8bf2876.rmeta --extern url=/home/jenkins/agent/workspace/rpm-ostree_PR-4506/rpm-ostree-2023.5.19.geffeac4d/target/release/deps/liburl-d85b157bbcc6509e.rmeta --cap-lints allow -Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cforce-frame-pointers=yes -Clink-arg=-Wl,-z,relro -Clink-arg=-Wl,-z,now -Clink-arg=-specs=/usr/lib/rpm/redhat/redhat-package-notes --cap-lints=warn --cfg 'k8s_openapi_enabled_version="1.25"'` (signal: 9, SIGKILL: kill)

[2023-07-20T02:09:20.703Z] warning: build failed, waiting for other jobs to finish...

@jmarrero jmarrero force-pushed the add-bootc branch 2 times, most recently from 83987ea to e245a0b Compare July 20, 2023 17:32
@cgwalters
Copy link
Member

/test all

@cgwalters
Copy link
Member

@cgwalters
Copy link
Member

Looks sane to me!

@cgwalters
Copy link
Member

One thing we could consider doing here (as a followup, no reason not to merge this as is):

  • Introduce /usr/libexec/rpm-ostree-bootc as a distinct binary. We'd need to rework the buildsystem for this. But a key advantage of this that that binary would not link to librpm (for example).
  • Then we can introduce an rpm-ostree-bootc subpackage of the main rpm-ostree.spec
  • Then we can add just that tool into a container image, without dragging in the full rpm-ostree stack.

@cgwalters
Copy link
Member

(I think this will conflict textually (but not semantically) with #4510 - but can we get that one in first?)

@jmarrero
Copy link
Member Author

(I think this will conflict textually (but not semantically) with #4510 - but can we get that one in first?)

of course

@jmarrero
Copy link
Member Author

Will open a follow up with docs too, after that: #4506 (comment)

@jmarrero jmarrero merged commit dd370d1 into coreos:main Jul 24, 2023
13 checks passed
@cgwalters
Copy link
Member

@jmarrero this also broke the build on ppc64le/s390x https://download.copr.fedorainfracloud.org/results/@CoreOS/continuous/centos-stream-9-s390x/06225783-rpm-ostree/build.log.gz - it's actually a bootc bug though

@jmarrero
Copy link
Member Author

@jmarrero this also broke the build on ppc64le/s390x https://download.copr.fedorainfracloud.org/results/@CoreOS/continuous/centos-stream-9-s390x/06225783-rpm-ostree/build.log.gz - it's actually a bootc bug though

We are vendoring from main, so if we fix:
containers/bootc#112 (the issue I oppened for this) then we should not need to back this out.) Ill look into this Monday, we are getting close to needing a release so if the fix is not obvious to me I will back this out for until I figure it out.

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.

consider vendoring bootc
2 participants