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

Skip using the active slot as a seed when installing bundles #513

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

fhackenberger
Copy link

@fhackenberger fhackenberger commented Nov 19, 2019

As a workaround for resource intensive and slow install procedures when using casync and tar images (see #511) I created an option for the install command, which skips using the active slot as a seed when running casync.

This enables the following use case:

  • Remote repository chunk store contains only chunks for most recent update
  • Images have a .caexclude file included, which prevents /var/tmp/update.casync.castr from being chunked
  • Device does the bind-mount & casync make --store /var/tmp/update.casync.castr /var/tmp/update.casync.caidx /mnt/rauc/ step in the background once.
  • Device does an rsync with --delete on remote chunks store / index file / raucb
  • Device installs without using slot as seed rauc install --ignore-seed bundle.raucb

The workaround decribed splits the long running operations into separate units, which can be run independently and frees the device to do a full casync make on every update. Downside is that additional storage is used permanently. But that's probably good, as it makes it clear how much space is actually left, if updates should still work.

When using a local chunk store, it's useful to ignore using the
active slot as a seed.

Signed-off-by: fhackenberger <[email protected]>
Signed-off-by: fhackenberger <[email protected]>
The code in 03665b7 wasn't working
yet. This commit is now tested using the DBus daemon.

Signed-off-by: fhackenberger <[email protected]>
@codecov
Copy link

codecov bot commented Nov 20, 2019

Codecov Report

Merging #513 into master will decrease coverage by 0.02%.
The diff coverage is 27.27%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #513      +/-   ##
==========================================
- Coverage    66.5%   66.47%   -0.03%     
==========================================
  Files          24       24              
  Lines        6463     6470       +7     
==========================================
+ Hits         4298     4301       +3     
- Misses       2165     2169       +4
Impacted Files Coverage Δ
src/main.c 67.43% <0%> (-0.06%) ⬇️
src/update_handler.c 37.05% <0%> (-0.1%) ⬇️
src/service.c 75.27% <100%> (+0.09%) ⬆️
src/install.c 80.7% <66.66%> (-0.08%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 41d5f33...dc02088. Read the comment docs.

@fhackenberger
Copy link
Author

I'm not really familiar with your testing requirements. Can someone else contribute a test for this new feature?

@fhackenberger
Copy link
Author

@ejoerns How do you feel about the tests? Would you or someone else be able to add them? I've looked at the testing code, but I'm quite unfamiliar with the framework.

@ejoerns
Copy link
Member

ejoerns commented Jan 3, 2020

I agree that it is a use case to disable seeding. Mainly because of casync's limited capabilities in seed store cleanup and for devices with really constrained temporary storage.

Thus basically introducing an option to disable seeding is something that I'd like to see.

But the way for selecting this option you chose is probably the wrong one:

  • You break the API of the Install D-Bus command which will prevent all current API users from simply updating to a new RAUC release
  • Deciding to not use the slot as a seed store is probably not a property of an installation but instead a property of the system.

To target the first point, we have #446 hanging around and waiting for getting merged.
But because of the second point I would prefer having a simple system config option that allows disabling seeding.

I thought that we already had some own developments towards this direction, but I was not able to find any.

@OnkelUlla could you also please have a look at this as you just cared for the casync stuff in context of #501 ?

@fhackenberger
Copy link
Author

Thanks for the feedback @ejoerns! I agree it should rather be a system setting in system.conf, having it as an argument for the install command is less than ideal. Not sure if I have the time to adapt this soon, so I'd also be happy if someone else continues this work.

@ejoerns ejoerns added enhancement Adds new functionality or enhanced handling to RAUC needs rework labels Jan 9, 2020
Esco441-91 added a commit to Esco441-91/rauc that referenced this pull request Oct 22, 2021
ignore-slot-seed is required in configuration file. Add it to config -structure
to be configurable, with reading in load_config.

Add test to check that the new configuration option is read, and that it has
a default value (false) when not specified. Casync options in general are
missing a test in config_file.test.

Add a bare minimum test to check that other options (storepath and tmppath)
are also read in some way.

ignore-slot-seed flag checks in installation are based on code made by
fhackenerger, located in PR rauc#513, with
excess code refactored/removed to fit into config option.

Signed-off-by: Esa Laakso <[email protected]>
@jluebbe jluebbe added the casync casync-related label Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
casync casync-related enhancement Adds new functionality or enhanced handling to RAUC needs rework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants