Skip to content

updater: dom0 non-iteractive updater #191

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

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

Conversation

piotrbartman
Copy link
Member

  • qubes-vm-update uses qubes-dom0-update --just-print-progress for non-interactive update, only small subset of action are supported.
  • introduce agent_type: for local (dom0), remote (template vms etc.) and proxy (update vm) actions.
  • progress reporting for dom0 update (dnf4, dnf5)

requires: QubesOS/qubes-core-agent-linux/pull/576

introduce agent_type: for local (dom0), remote (template vms etc.) and proxy (update vm) actions.
`qubes-vm-update` uses `qubes-dom0-update --just-print-progress` for non-interactive update, only small subset of action are supported.
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 51.11111% with 66 lines in your changes missing coverage. Please review.

Project coverage is 70.67%. Comparing base (65eb613) to head (695d084).

Files with missing lines Patch % Lines
vmupdate/update_manager.py 33.33% 38 Missing ⚠️
vmupdate/vmupdate.py 70.83% 14 Missing ⚠️
vmupdate/qube_connection.py 16.66% 10 Missing ⚠️
vmupdate/agent/source/status.py 42.85% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #191      +/-   ##
==========================================
- Coverage   73.03%   70.67%   -2.37%     
==========================================
  Files          10       10              
  Lines        1157     1265     +108     
==========================================
+ Hits          845      894      +49     
- Misses        312      371      +59     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@marmarek marmarek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is based on initial reading the code, I haven't tested it yet.

super().__init__(log_handler, log_level, agent_type)

if self.type == AgentType.UPDATE_VM:
dnfconf = "/var/lib/qubes/dom0-updates/etc/dnf/dnf.conf"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use self.UPDATE_VM_INSTALLROOT like in the other places?


self.base = dnf.Base(conf)
if self.type == AgentType.UPDATE_VM:
self.base._allow_erasing = True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the dnf source, the only place where it's used in practice is an argument to base.resolve(). So, you can use it there (in upgrade_internal) instead of setting a private attribute.

QVMRUN_OPTS=(--quiet --filter-escape-chars --nogui --pass-io)

if [ "$PROGRESS_REPORTING" == "1" ]; then
CMD="/usr/lib/qubes/qubes-download-dom0-updates-init.sh"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to handle the case of old template too. It's okay to refuse this mode in such a case, but it needs a proper error message instead of a file not found error. Something like "Progress reporting requires updatevm based on a template with Qubes 4.3 packages", or something like this (maybe include template name and/or name of the updatevm?)
Whether it is new enough, you can check either by handling exit code 127 (file not found), or (better) by announcing some supported feature in the core-agent-linux PR and checking it 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.

3 participants