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

wip: new(cmd/driver): download compatible driver version if requested #569

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

FedeDP
Copy link
Contributor

@FedeDP FedeDP commented May 31, 2024

What type of PR is this?

/kind feature

Any specific area of the project related to this PR?

/area cli

What this PR does / why we need it:

This small patch allows to download compatible driver versions instead of the currently configured one.
This is how it works:

  • you have falco 0.37.1 installed that ships with driver 7.0.0+driver
  • you run falcoctl driver install --compatible
  • it lists prefixes on our s3 bucket under the driver/ prefix (https://download.falco.org/driver/)
  • loads all semver-like driver versions
  • fetches the newest compatible one (where compatible in this context means same major version)
  • this means that for Falco 0.37.1 it would download driver 7.2.0+driver.

Now, we cannot do the same for the compilation because we have only local sources for the driver installed Falco was shipped with, but that's not a big deal for now. We could have a post-submit job triggered whenever a new driver version is added (https://github.com/falcosecurity/test-infra/tree/master/driverkit/config) that push driver sources configured for Falco under eg: https://download.falco.org/driver/$version/src/.

Disabled by default for now.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Keeping it as wip until we decide what to do for compilation too.

FedeDP added 2 commits May 27, 2024 14:38
…er version while downloading drivers.

Signed-off-by: Federico Di Pierro <[email protected]>
Also, skip it entirely when running on development driver versions.

Signed-off-by: Federico Di Pierro <[email protected]>
@poiana
Copy link
Contributor

poiana commented May 31, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: FedeDP

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@FedeDP
Copy link
Contributor Author

FedeDP commented May 31, 2024

Example output:

sudo ./falcoctl driver install --compatible --type kmod --log-level debug --version 7.0.0+driver
[sudo] password di federico: 
2024-05-31 11:37:02 DEBUG Fetched kernel info
                      ├ arch: x86_64
                      ├ kernel release: 6.8.0-31-generic
                      └ kernel version: #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024
2024-05-31 11:37:02 DEBUG Discovered distro target: ubuntu-generic
2024-05-31 11:37:02 DEBUG Detected supported driver type: kmod
2024-05-31 11:37:02 INFO  Running falcoctl driver install
                      ├ driver version: 7.0.0+driver
                      ├ driver type: kmod
                      ├ driver name: falco
                      ├ compile: true
                      ├ download: true
                      ├ target: ubuntu-generic
                      ├ arch: x86_64
                      ├ kernel release: 6.8.0-31-generic
                      └ kernel version: #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024
2024-05-31 11:37:02 INFO  Check if kernel module is still loaded.               
2024-05-31 11:37:02 INFO  OK! There is no module loaded. 
2024-05-31 11:37:02 INFO  Check all versions of kernel module in dkms. 
2024-05-31 11:37:02 INFO  OK! There are no module versions in dkms. 
2024-05-31 11:37:02 DEBUG Loading compatible driver version from S3 
2024-05-31 11:37:03 INFO  Using compatible driver version: 7.2.0+driver

@FedeDP FedeDP force-pushed the new/driver_download_compatible branch from 4ae0a0a to 2013d5e Compare May 31, 2024 09:42
@poiana
Copy link
Contributor

poiana commented Aug 29, 2024

Issues go stale after 90d of inactivity.

Mark the issue as fresh with /remove-lifecycle stale.

Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Provide feedback via https://github.com/falcosecurity/community.

/lifecycle stale

@FedeDP
Copy link
Contributor Author

FedeDP commented Aug 29, 2024

/remove-lifecycle stale

@poiana
Copy link
Contributor

poiana commented Nov 27, 2024

Issues go stale after 90d of inactivity.

Mark the issue as fresh with /remove-lifecycle stale.

Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Provide feedback via https://github.com/falcosecurity/community.

/lifecycle stale

@FedeDP
Copy link
Contributor Author

FedeDP commented Nov 27, 2024

/remove-lifecycle stale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants