GithubHelp home page GithubHelp logo

openshift / pivot Goto Github PK

View Code? Open in Web Editor NEW
12.0 16.0 13.0 286 KB

Pivots from on ostree OS/Deployment to another via containers

License: Apache License 2.0

Makefile 8.71% Go 91.29%
ostree pivot update

pivot's Introduction

pivot ➰

Deprecated: Please see machine-config-operator.

Build Status

pivot provides a simple command allowing you to upgrade an OSTree-based system from an OSTree repo embedded within a container image. Such container images are generated by the coreos-assembler oscontainer command.

It works by (1) downloading the oscontainer, (2) mounting it using podman mount, (3) looking for the OSTree commit stored inside the container, and (4) invoking rpm-ostree to rebase the OS to that commit.

It's not intended to be run manually, but rather as part of the installation and upgrade process of a cluster. Though one can certainly test it today by provisioning an RHCOS node and running it directly (see the internal guide and release page) for more information).

Building

make build

OR

make static

Example Usage

pivot -r $REGISTRY/os:latest

Though normally, one wants to use digests rather than tags, e.g.:

pivot -r $REGISTRY/os@sha256:fdf70521df4ed1dc135d81fd3c4608574aeca45dc22d1b4e38d16630e9d6f1a7

It also comes with a systemd unit to provide a "host API". For example:

mkdir -p /etc/pivot
echo $REGISTRY/os:latest > /etc/pivot/image-pullspec
touch /run/pivot/reboot-needed
systemctl start pivot

This will start pivot, which will read the file and execute the pivot. If the pivot is completed, the file will be deleted. The expected way to make use of this is to create the necessary files from Ignition.

See

pivot's People

Contributors

ashcrow avatar cgwalters avatar jlebon avatar peterbaouoft avatar yuqi-zhang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pivot's Issues

Logs are all prefixed with: "ERROR: logging before flag.Parse:"

E.g.:

ERROR: logging before flag.Parse: I0615 15:14:29.656551    1415 run.go:15] Running: podman rmi <registry>:3.10@sha256:2c56c7fbfeafc3adf5874fb323be5e3f3c9a7eb10f99556d61d7f9bc16e9b838
168863f78fc62f5d864fc0081abb49e1acc982ce0ce7728de71e1e97862fe35e
ERROR: logging before flag.Parse: I0615 15:14:31.367064    1415 run.go:15] Running: systemctl reboot

Looks similar to kubernetes/kubernetes#17162.

RPM package availability

As there is a pivot.spec file, I'm wondering if there is any repository where folks can download it (maybe make it available in EPEL for upstream?)

cut a new release

The instructions for using pivot in our internal docs (https://url.corp.redhat.com/redhat-coreos) instruct users to pull the 0.0.0 release, but that is missing an important change about the location of the repo, commit 4ce06e3.

Looks like we could use a new release and updates to the instructions internally.

CentOS atomic host 7.1812 rpm-ostree complains about "Unknown option --custom-origin-url"

Trying to pivot from CentOS atomic host 7.1812:

[root@rhcos01 ~]# curl -L https://github.com/openshift/pivot/releases/download/0.0.3/pivot -o /tmp/pivot
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   596    0   596    0     0   1090      0 --:--:-- --:--:-- --:--:--  1091
100 3439k  100 3439k    0     0  2588k      0  0:00:01  0:00:01 --:--:-- 7660k
[root@rhcos01 ~]# chmod a+x /tmp/pivot
[root@rhcos01 ~]# /tmp/pivot XXX/rhcos/maipo@sha256:XXX
pivot version 0.0.3 (fb4c73f5cd9f552059b5e35377b2760224416b0f)
I0211 08:23:17.720742   27666 run.go:16] Running: rpm-ostree status --json
I0211 08:23:18.024209   27666 run.go:16] Running: skopeo inspect docker://XXX/rhcos/maipo@sha256:XXX
I0211 08:23:20.542784   27666 root.go:89] Resolved to: XXX/rhcos/maipo@sha256:XXX
I0211 08:23:20.542811   27666 run.go:16] Running: podman pull XXX/rhcos/maipo@sha256:XXX
Trying to pull XXX/rhcos/maipo@sha256:XXX...Getting image source signatures
Copying blob sha256:1c6e94365414c4751de1032a1446c5dc3e74002b803527e7ad2d09cac474cc46
 591.20 MB / 591.20 MB [===================================================] 12s
Copying config sha256:1930b338e555e4d8bbe85b881309d8db66b1a1c808cb2c317ec71f588683477e
 412 B / 412 B [============================================================] 0s
Writing manifest to image destination
Storing signatures
1930b338e555e4d8bbe85b881309d8db66b1a1c808cb2c317ec71f588683477e
I0211 08:23:54.246092   27666 run.go:16] Running: podman kill ostree-container-pivot
unable to find container ostree-container-pivot: no container with name or ID ostree-container-pivot found: no such container
W0211 08:23:54.329188   27666 run.go:69] (ignored) podman: exit status 125
I0211 08:23:54.329232   27666 run.go:16] Running: podman rm -f ostree-container-pivot
unable to find container ostree-container-pivot: no container with name or ID ostree-container-pivot found: no such container
W0211 08:23:54.532822   27666 run.go:69] (ignored) podman: exit status 125
I0211 08:23:54.532874   27666 run.go:16] Running: podman create --net=none --name ostree-container-pivot XXX/rhcos/maipo@sha256:XXX
I0211 08:23:54.800028   27666 run.go:16] Running: podman mount d4cb185cc60116928eade00a27b313aaa1ca74d35d2a9aacc416e5c7c974db87
I0211 08:23:54.979589   27666 root.go:114] Pivoting to: 47.312 (15d0f8f272ad7cb53f1dfcd90b7a0e120396ee90ba5b0942c9395a1de0f68437)
I0211 08:23:54.979638   27666 run.go:16] Running: rpm-ostree rebase --experimental /var/lib/containers/storage/overlay/c2795dceb7c8a0341c469a173763465bbccb7f4d0ce0ae9aaee7d0a5aa5c8bc3/merged/srv/repo:15d0f8f272ad7cb53f1dfcd90b7a0e120396ee90ba5b0942c9395a1de0f68437 --custom-origin-url pivot://XXX/rhcos/maipo@sha256:XXX --custom-origin-description Managed by pivot tool
error: Unknown option --custom-origin-url
F0211 08:23:54.998593   27666 run.go:62] rpm-ostree: exit status 1

rpm-ostree:

# rpm-ostree --version
rpm-ostree:
 Version: 2018.5
 Git: 4a4d4fb373d9c0c276d78149f68fff9ab90ab3a0
 Features:

Pivot error: "Docker references with both a tag and digest are currently not supported"

pivot version 0.0.1 (613316e4504010f953e1df4587152ef09c19f444)
Running: skopeo inspect docker://registry.svc.ci.openshift.org/rhcos/os-maipo:latest
error pulling image "registry.svc.ci.openshift.org/rhcos/os-maipo:latest@sha256:31220b35b7ca38d431b7e699ad848222cd14cef55fe219570086e31c78a15af5": unable to pull registry.svc.ci.openshift.org/rhcos/os-maipo:latest@sha256:31220b35b7ca38d431b7e699ad848222cd14cef55fe219570086e31c78a15af5: error getting default registries to try: unable to parse 'registry.svc.ci.openshift.org/rhcos/os-maipo:latest@sha256:31220b35b7ca38d431b7e699ad848222cd14cef55fe219570086e31c78a15af5': Docker references with both a tag and digest are currently not supported
F0911 15:59:20.056969    1308 run.go:22] podman: exit status 125

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.