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

WIP: deploy: Attempt accelerated deploy by updating old deploy #1419

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

wmanley
Copy link
Member

@wmanley wmanley commented Jan 15, 2018

...rather than doing a complete fresh checkout.

Currently on our (embedded) system with slow eMMC disk it takes 1m40s to do
a deploy (~150000 files). Ideally if only one or two files have changed it
should be nearly instantaneous - suitable for interactive development. This
should also reduce eMMC wear.

After applying these patches (and with --no-prune #1418) it takes <2s to do a deploy - a 50x-100x speedup.

We store unpacked container images as part of our rootfs. Checkouts with O(number of changes) rather than O(number of files) is going to be more and more important for us as we add more containers.

On any failure we fall back to doing a full deploy.

This builds on top of #1408. Although it's not ready I've raised this PR to solicit opinion.

TODO:

@wmanley wmanley force-pushed the reuse-deployment-dirs branch 4 times, most recently from e588cba to c45f5ba Compare January 17, 2018 21:49
@rh-atomic-bot
Copy link

☔ The latest upstream changes (presumably 8174885) made this pull request unmergeable. Please resolve the merge conflicts.

@cgwalters
Copy link
Member

~150000

Hah, that's quite close to the number of files on this desktop:

$ rpm-ostree status
State: idle
Deployments:
● fedora-27:fedora/27/x86_64/workstation
                   Version: 27.66 (2018-02-05 15:55:38)
                BaseCommit: d0100a21ecca78f7931b4278c25528b455f9a0e62eeb4690bb93f46b345dc818
              GPGSignature: Valid signature by 860E19B0AFA800A1751881A6F55E7430F5282EE4
           LayeredPackages: emacs fuse-sshfs git-evtag keepassx krb5-workstation libvirt-client oci-kvm-hook opensc origin-clients pcsc-lite-ccid powerline strace tmux vagrant-libvirt virt-manager xsel ykclient
                            ykpers
$ find /usr | wc -l
146136
$

@cgwalters
Copy link
Member

cgwalters commented Apr 13, 2018

I just want to note I haven't forgotten about your PRs here; I feel a bit guilty every time I see the PR list as I really want to get them in. Currently the staging bits (as part of auto-updates) have stayed at the top of my priority queue for a while, and these patches also really want a better testing framework than we have today, which is also slowly happening.

As the new ansible/VM framework lands and improves we can more easily test these types of patches.

wmanley and others added 11 commits July 8, 2020 16:45
This is in preparation for adding `OSTREE_REPO_CHECKOUT_OVERWRITE_UPDATE`
where we will need to iterate through two directories simultaneously.
This is in preparation for adding `OSTREE_REPO_CHECKOUT_OVERWRITE_UPDATE`
where we will need to iterate through two directories simultaneously.
Used for updating an already checked out tree to a new version.  This is
intended to make deploys much faster in the future.  In default operation
`checkout_tree_at` now is doing an update from an empty tree to the given
one.

This implements diffs for directories.  The next commit will introduce the
same for files.
The goal is to do ostree deploys faster by updating already checked out
trees.

This commit continues the work in the previous commit. `checkout_tree_at`
now takes an `orig_dirtree_checksum` telling it to assume that the
directory it's checking out into already has this content.
The goal is to do ostree deploys faster by updating already checked out
trees.

This adds an overwrite mode and a new option to specify the original tree.
It will do a lot less work when you're updating a tree with a large number
of files but only a few files have changed.  So if you have a full distro
tree checked out and want to update `/usr/bin/ostree` we no longer have
to recurse through every file in `/usr/share/doc` to do the update.
This exposes the OSTREE_REPO_CHECKOUT_OVERWRITE_UPDATE functionality added
in the previous commit on the command line.
To avoid having any incompletely checked-out or corrupted trees as
`/ostree/deploy/OS/deploy/${treecsum}.${deployserial}`.  We'll need this
so we can trust ${treecsum} for updating existing unused deployments.
...rather than doing a complete fresh checkout.

Currently on our (embedded) system with slow eMMC disk it takes 1m40s to do
a deploy (~150000 files). Ideally if only one or two files have changed it
should be nearly instantaneous - suitable for interactive development. This
should also reduce eMMC wear.

On any failure we fall back to doing a full deploy.
to enable detailed logging of checkout operations.
so the ordering in the log files between the `sh -x` output and the diff
output is preserved.  I was getting very confused debugging an issue
because the diff was mixed in with the shell command lines which made it
look like there was no diff.
@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: wmanley
To complete the pull request process, please assign pwithnall
You can assign the PR to them by writing /assign @pwithnall in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wmanley
Copy link
Member Author

wmanley commented Jul 9, 2020

Rebased on master.

@openshift-ci-robot
Copy link
Collaborator

@wmanley: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci
Copy link

openshift-ci bot commented Jun 29, 2023

@wmanley: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/sanity 1c964f7 link true /test sanity
ci/prow/images 1c964f7 link true /test images
ci/prow/fcos-e2e 1c964f7 link true /test fcos-e2e

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants