-
Notifications
You must be signed in to change notification settings - Fork 105
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
feat: add support for systemd socket activation #2186
Open
rgl
wants to merge
1
commit into
project-zot:main
Choose a base branch
from
rgl:feature-add-systemd-socket-activation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rgl
requested review from
rchincha,
andaaron and
eusebiu-constantin-petu-dbk
as code owners
January 26, 2024 08:07
andaaron
reviewed
Jan 26, 2024
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.
Thank you for the PR!
rgl
force-pushed
the
feature-add-systemd-socket-activation
branch
2 times, most recently
from
January 26, 2024 20:08
a21de08
to
2c52ccb
Compare
@rgl sorry, could you rebase and push pls. |
rgl
force-pushed
the
feature-add-systemd-socket-activation
branch
5 times, most recently
from
February 7, 2024 19:41
995fae3
to
50dad18
Compare
@rgl do you rebase and try again? |
rgl
force-pushed
the
feature-add-systemd-socket-activation
branch
from
February 16, 2024 09:18
50dad18
to
43ca3c7
Compare
@rchincha sure. I've rebased it. please note that |
Let's target this PR for v2.1.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
feature
Which issue does this PR fix:
#2182
What does this PR do / Why do we need it:
WARNING I'm unsure about the go.mod version changes. Should they be done? If so, should CI be upgraded too?
It allows zot to use systemd socket activation.
This was implemented using the coreos/go-systemd library (see the httpserver example).
With this change, we configure systemd to use a privileged port like 80 or 443 with the zot.socket file. With this, we do not need to grant zot the CAP_NET_BIND_SERVICE capability. systemd will bind the socket and will pass it to zot as a file descriptor.
Testing done on this change:
This can be tested using:
The example systemd zot.service file was modified to depend on the zot.socket file too.
This can be installed using:
install examples/zot.service /etc/systemd/system/zot.service install examples/zot.socket /etc/systemd/system/zot.socket systemctl daemon-reload systemctl enable zot.service zot.socket systemctl restart zot.service zot.socket
Automation added to e2e:
Will this break upgrades or downgrades?
No.
Does this PR introduce any user-facing change?:
Yes and No. If you want to use this feature, the zot listening address will no longer be configured from the zot configuration file, instead it will be configured from the zot.socket file.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.