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

Graceful restart for l3afd #432

Merged
merged 35 commits into from
Sep 26, 2024
Merged

Conversation

Atul-source
Copy link
Contributor

@Atul-source Atul-source commented Jul 22, 2024

In this PR I have implemented graceful restart of l3afd means upgrading/restarting the l3afd without affecting ebpf programs state and having same level of control on eBPF programs as we were having on old instance.

This PR is dependent on
l3af-project/eBPF-Package-Repository#92
l3af-project/l3af-arch#124

@Atul-source Atul-source changed the title (WIP) GraceFull restart for l3afd (Please DO NOT MERGE) Graceful restart for l3afd Aug 1, 2024
@Atul-source Atul-source marked this pull request as ready for review August 1, 2024 09:05
@sanfern sanfern linked an issue Aug 1, 2024 that may be closed by this pull request
apis/handlers/restart.go Fixed Show fixed Hide fixed
apis/handlers/restart.go Outdated Show resolved Hide resolved
apis/handlers/restart.go Outdated Show resolved Hide resolved
apis/handlers/restart.go Outdated Show resolved Hide resolved
apis/handlers/restart.go Outdated Show resolved Hide resolved
bpfprogs/bpf.go Show resolved Hide resolved
bpfprogs/bpf.go Show resolved Hide resolved
testdata/Test_l3af-config.json Show resolved Hide resolved
config/config.go Outdated Show resolved Hide resolved
config/l3afd.cfg Outdated Show resolved Hide resolved
restart/restart.go Outdated Show resolved Hide resolved
Copy link

@pmoroney pmoroney left a comment

Choose a reason for hiding this comment

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

Some minor changes and questions

apis/handlers/restart_linux.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
// @Param cfgs body []models.L3afBPFPrograms true "BPF programs"
// @Success 200
// @Router /l3af/configs/v1/restart [put]
func HandleRestart(bpfcfg *bpfprogs.NFConfigs) http.HandlerFunc {

Choose a reason for hiding this comment

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

Should this endpoint be authenticated or anything? Is that handled elsewhere?

restart/restart.go Fixed Show fixed Hide fixed
restart/restart.go Fixed Show fixed Hide fixed
restart/restart.go Fixed Show fixed Hide fixed
restart/restart.go Fixed Show fixed Hide fixed
@Atul-source Atul-source force-pushed the graceful-restart branch 3 times, most recently from 78ab85d to 7b73b40 Compare September 3, 2024 18:04
apis/handlers/addprog.go Outdated Show resolved Hide resolved
apis/handlers/addprog.go Outdated Show resolved Hide resolved
apis/handlers/restart_linux.go Outdated Show resolved Hide resolved
apis/handlers/restart_linux.go Outdated Show resolved Hide resolved
apis/handlers/restart_linux.go Outdated Show resolved Hide resolved
restart/restart.go Outdated Show resolved Hide resolved
restart/restart.go Outdated Show resolved Hide resolved
restart/restart.go Outdated Show resolved Hide resolved
restart/restart.go Outdated Show resolved Hide resolved
restart/restart.go Outdated Show resolved Hide resolved
@Atul-source Atul-source force-pushed the graceful-restart branch 3 times, most recently from cb54123 to 0ca2c36 Compare September 3, 2024 18:41
bpfprogs/bpf.go Fixed Show fixed Hide fixed
@Atul-source Atul-source force-pushed the graceful-restart branch 2 times, most recently from 971031e to 4e2e20c Compare September 3, 2024 18:57
bpfprogs/bpf.go Fixed Show fixed Hide fixed
@Atul-source Atul-source force-pushed the graceful-restart branch 2 times, most recently from 656c654 to 5b07cb2 Compare September 4, 2024 04:14
Signed-off-by: Atul-source <atulprajapati6031@gmail.com>
Signed-off-by: Atul-source <atulprajapati6031@gmail.com>
Signed-off-by: Atul-source <atulprajapati6031@gmail.com>
Signed-off-by: Atul-source <atulprajapati6031@gmail.com>
Signed-off-by: Atul-source <atulprajapati6031@gmail.com>
Signed-off-by: Atul-source <atulprajapati6031@gmail.com>
Signed-off-by: Atul-source <atulprajapati6031@gmail.com>
Signed-off-by: Atul-source <atulprajapati6031@gmail.com>
Signed-off-by: Atul-source <atulprajapati6031@gmail.com>
Signed-off-by: Atul-source <atulprajapati6031@gmail.com>
Signed-off-by: Atul-source <atulprajapati6031@gmail.com>
Signed-off-by: Atul-source <atulprajapati6031@gmail.com>
Signed-off-by: Atul-source <atulprajapati6031@gmail.com>
Signed-off-by: Atul-source <atulprajapati6031@gmail.com>
Signed-off-by: Atul-source <atulprajapati6031@gmail.com>
Signed-off-by: Atul-source <atulprajapati6031@gmail.com>
Signed-off-by: Atul-source <atulprajapati6031@gmail.com>
Signed-off-by: Atul-source <atulprajapati6031@gmail.com>
bpfprogs/nfconfig.go Outdated Show resolved Hide resolved
bpfprogs/nfconfig.go Outdated Show resolved Hide resolved
bpfprogs/nfconfig.go Outdated Show resolved Hide resolved
main.go Show resolved Hide resolved
Signed-off-by: Atul-source <atulprajapati6031@gmail.com>
pmoroney
pmoroney previously approved these changes Sep 18, 2024
Copy link

@pmoroney pmoroney left a comment

Choose a reason for hiding this comment

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

Looks pretty good to me, just a few inline questions. And make sure to modify that line that was pointed out by @sanfern

apis/handlers/restart_linux_test.go Show resolved Hide resolved
bpfprogs/bpf.go Show resolved Hide resolved
bpfprogs/bpf.go Show resolved Hide resolved
Signed-off-by: Atul-source <atulprajapati6031@gmail.com>
Copy link
Contributor

@sanfern sanfern left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@pmoroney pmoroney left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for this amazing work!

Although, next time let's try to make multiple smaller PRs, 40 files is a lot to review. ;)

@sanfern sanfern merged commit 552225f into l3af-project:main Sep 26, 2024
8 checks passed
@sanfern sanfern added the feat New Feature label Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New Feature
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Support graceful restart of l3afd
4 participants