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

Redesign and simplify container creation/removal #843

Merged
merged 10 commits into from
Nov 28, 2024
Merged

Redesign and simplify container creation/removal #843

merged 10 commits into from
Nov 28, 2024

Conversation

troglobit
Copy link
Contributor

Description

The main purpose of this PR is to fix the unreliable behavior seen in #835, a few other bugs were also hunted down and fixed in the process:

  • Pager does not exit if content fits on first screen, e.g., show containers
  • Avahi (mDNS) spams logs ... now silenced
  • Zeroconf agent not stopped when interfaces are removed
  • Finit template fix, e.g., creating another container marks all other containers "dirty"

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):

Instead of having to scroll to the end (Shift G, or page down til end),
let's instead start at the end now that we have control over paging in
the CLI ourselves.

Signed-off-by: Joachim Wiberg <[email protected]>
The -S switch to less seemed at the time a good idea -- chop off too
long lines and allow horizontal scrolling -- however, the -F option, to
skip pager for content that fit the first screen is overridden by the -S
switch.  This makes commands like "show containers", and similar that
normally have waaaaay too few lines for a pager to always page.

So let's drop -S to regain the original behavior.  This will cause lines
to be wrapped, but with the new raw mode in the CLI this seems to work
without any weird screen artifacts.

Signed-off-by: Joachim Wiberg <[email protected]>
The mDNS daemon, Avahi, is very verbose in its syslog output.  So much
that it often overshadows other subsystems, and on switches and routers
with more than the "normal" amount of ports and interfaces, it quickly
becomes unbearable.

The patches consist of:

 - Add -l LEVEL support to avahi-daemon
 - Add missing casll to setlogmask() in libdaemon:daemon_set_verbosity()

Signed-off-by: Joachim Wiberg <[email protected]>
When deleting interfaces we skip a lot of steps in netdag_gen_iface(),
this patch ensures we at least call netdag_gen_ipv4_autoconf() to drop
any running zeroconf agent in the same generation.

Signed-off-by: Joachim Wiberg <[email protected]>
@troglobit troglobit added the ci:main Build default defconfig, not minimal label Nov 28, 2024
@troglobit troglobit added this to the Infix v24.11.1 milestone Nov 28, 2024
@troglobit troglobit requested a review from wkz November 28, 2024 14:21
@troglobit troglobit self-assigned this Nov 28, 2024
Copy link
Contributor

@mattiaswal mattiaswal left a comment

Choose a reason for hiding this comment

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

Cool, now even a dumbass as myself have a chance to understand how containers setup 👍

package/execd/tmpfiles.conf Show resolved Hide resolved
Copy link
Contributor

@wkz wkz left a comment

Choose a reason for hiding this comment

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

All hail @troglobit - destroyer of complexity! 😆

Just want to check the "no enable" behavior before approving.

src/confd/src/infix-containers.c Show resolved Hide resolved
troglobit and others added 5 commits November 28, 2024 16:36
This is a complete redesign of how the system creates/deletes containers
from the running-config.  Containers are now removed synchronously from
confd before any interfaces they may be using are removed, and created
in parallel, using a Finit task, well after confd has finished setting
up interfaces.

The logic previously provided by execd to retry container create on any
route/address changes, or periodically every 60 seconds, is now handled
by a new 'setup' command in the container wrapper script.

Additionally, container create is now split in wget/curl/podman pull of
the image and 'podman create'.  This to both consolidate image fetching
and improve user feedback since most of the retry logic (above) revolves
around the image download.

Fixes #835

Signed-off-by: Joachim Wiberg <[email protected]>
Since `conmon` only logs the output from the monitored container's
`stdout`/`stderr`, we might as well get rid of `k8s-logger`, and let
the output pass through to finit, which will then pipe the messages to
syslog.

Fix #836
When disabling a container in the configuration we should not remove it,
because then any volumes used by it may be lost.  Instead, we now simply
disable the service to prevent it from starting, or stopping it, if it
was running.

Signed-off-by: Joachim Wiberg <[email protected]>
Copy link
Contributor

@wkz wkz left a comment

Choose a reason for hiding this comment

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

Perfect! 🏅

@troglobit troglobit merged commit 3fd4f2c into main Nov 28, 2024
6 checks passed
@troglobit troglobit deleted the drop-execd branch November 28, 2024 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:main Build default defconfig, not minimal
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Refactor container logging New container tests fail intermittently on Aarch64
3 participants