-
Notifications
You must be signed in to change notification settings - Fork 54
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
Support systemd socket activation #1378
base: main
Are you sure you want to change the base?
Conversation
9db5fdf
to
fbd8126
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to add an integration test to this? My understanding is that this doesn't change anything in the integration tests so maybe a quick one using socket activation. (Though actually, alpine doesn't support systemd, so maybe not something very feasible?)
cmd/soci-snapshotter-grpc/main.go
Outdated
return nil, err | ||
} | ||
if len(listeners) == 0 { | ||
log.G(ctx).Info("Address was set to listen on a file descriptor, but no file descriptors were passed. Perhaps soci was launched directly without using systemd socket activation? Using the default address.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can we separate the last sentence into a separate log message for clarity?
fbd8126
to
aa45f75
Compare
This change adds 2 features: 1) the --address flag of the soci snapshotter supports a network prefix 2) The soci snapshotter can listen on a file descriptor passed by systemd socket activation. If the user tells soci to listen on a file descriptor, but doesn't use systemd socket activation to launch the process, the snapshotter will fall back to the default address as a unix socket. The example systemd service file is updated to use systemd activation if possible. There is an example systemd socket file, but no strict dependency from the service file so that users who are always starting SOCI on boot won't get a warning from systemd. Signed-off-by: Kern Walster <walster@amazon.com>
This change consolidates snapshotter startup tests into a single file instead of putting it in pull_test.go Signed-off-by: Kern Walster <walster@amazon.com>
aa45f75
to
abd0e3b
Compare
Issue #, if available:
Closes #1088
Description of changes:
This change adds 2 features:
systemd socket activation.
If the user tells soci to listen on a file descriptor, but doesn't use systemd socket activation to launch the process, the snapshotter will fall back to the default address as a unix socket.
The example systemd service file is updated to use systemd activation if possible. There is an example systemd socket file, but no strict dependency from the service file so that users who are always starting SOCI on boot won't get a warning from systemd.
Testing performed:
Tested manually and verified that:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.