Skip to content

confd: upload a software bundle in pieces over NETCONF and RESTCONF - #1853

Open
mattiaswal wants to merge 3 commits into
mainfrom
upload-bundle
Open

mattiaswal wants to merge 3 commits into
mainfrom
upload-bundle

Conversation

@mattiaswal

@mattiaswal mattiaswal commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Description

A management station can now send a software bundle to the device over
NETCONF or RESTCONF, for when the device cannot reach a file server.

  • New infix-system:upload-bundle RPC. The bundle is sent in pieces of
    at most 512 KiB, each with its offset, and the reply has the size of
    the upload so far. A piece at the wrong offset is rejected with the
    offset the device expects.
  • install-bundle takes a new uploaded source, as an alternative to
    url.

A bundle as one binary leaf is held in full by every layer between the
client and confd, about ten times its size in RAM. In pieces, each call
costs a few MB and the bundle only exists as the file RAUC installs
from.

The upload is kept in /tmp, is limited to 1 GiB like a download, and
is dropped after five minutes without activity unless RAUC is installing
from it.

The upgrade test now takes the bundle from a URL or from an upload,
picked per run the way the transport is. It also runs over RESTCONF;
it was pinned to NETCONF because the software state was read without
the module name of the augment, which RESTCONF rejects.

Checklist

Tick relevant boxes, this PR is-a or has-a:

  • Bugfix
    • Regression tests
    • ChangeLog updates (for next release)
  • Feature
    • YANG model change => revision updated?
    • Regression tests added?
    • ChangeLog updates (for next release)
    • Documentation added?
  • Test changes
    • Checked in changed Readme.adoc (make test-spec)
    • Added new test to group Readme.adoc and yaml file
  • Code style update (formatting, renaming)
  • Refactoring (please detail in commit messages)
  • Build related changes
  • Documentation content changes
    • ChangeLog updated (for major changes)
  • Other (please describe):

A bundle as one binary leaf is held in full by every layer between the
client and confd, about ten times its size in RAM.  Sent in pieces of
at most 512 KiB, each call costs a few MB and the bundle only exists as
the file RAUC installs from.

The file lives in /tmp, /run is capped at a tenth of RAM.  An upload
nobody finishes is dropped after five minutes, unless RAUC is installing
from it, and it is limited to 1 GiB like a download.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
It was pinned to NETCONF for a suspected RESTCONF bug.  The software
state was read without the module name of the augment, which RESTCONF
rejects.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
The upgrade test takes the bundle from a URL or from an upload, picked
per run the way the transport is.

The uploaded source is an empty leaf, which libyang does not take in
its JSON form, [null], from call_dict() over NETCONF.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
@mattiaswal mattiaswal changed the title Upload bundle confd: upload a software bundle in pieces over NETCONF and RESTCONF Dec 4, 2026

@troglobit troglobit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure this is a good idea, I suggest we use /var/lib/misc or something instead of a RAM disk. Although most of our supported devices have >= 1 GiB of RAM, I don't think we should disqualify lesser systems during this ramageddon period ...

"The upload is kept in /tmp, is limited to 1 GiB like a download, and is dropped after five minutes without activity unless RAUC is installing from it."

@mattiaswal

mattiaswal commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor Author

I'm not sure this is a good idea, I suggest we use /var/lib/misc or something instead of a RAM disk. Although most of our supported devices have >= 1 GiB of RAM, I don't think we should disqualify lesser systems during this ramageddon period ...

"The upload is kept in /tmp, is limited to 1 GiB like a download, and is dropped after five minutes without activity unless RAUC is installing from it."

1GiB is just a boundary, it is the same as rauc. If getting out of memory earlier it gets stopped and the file removed. If you just assemble an image that is only 128Mb, thats all that will be used.

@troglobit

Copy link
Copy Markdown
Contributor

I'm not sure this is a good idea, I suggest we use /var/lib/misc or something instead of a RAM disk. Although most of our supported devices have >= 1 GiB of RAM, I don't think we should disqualify lesser systems during this ramageddon period ...

"The upload is kept in /tmp, is limited to 1 GiB like a download, and is dropped after five minutes without activity unless RAUC is installing from it."

1GiB is just a boundary, it is the same as rauc. If getting out of memory earlier it gets stopped and the file removed. If you just assemble an image that is only 128Mb, thats all that will be used.

Still, I don't like downloading an image as big as ours to RAM. The double buffering alone (with the browser) is enough to bring lesser devices over the cliff.

@mattiaswal

Copy link
Copy Markdown
Contributor Author

I'm not sure this is a good idea, I suggest we use /var/lib/misc or something instead of a RAM disk. Although most of our supported devices have >= 1 GiB of RAM, I don't think we should disqualify lesser systems during this ramageddon period ...

"The upload is kept in /tmp, is limited to 1 GiB like a download, and is dropped after five minutes without activity unless RAUC is installing from it."

1GiB is just a boundary, it is the same as rauc. If getting out of memory earlier it gets stopped and the file removed. If you just assemble an image that is only 128Mb, thats all that will be used.

Still, I don't like downloading an image as big as ours to RAM. The double buffering alone (with the browser) is enough to bring lesser devices over the cliff.

Doublebuffer? this only adds ~1mb per packet, then it gets assembled into the real image. Have not converted the WebUI the new API yet.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants