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

feat: policy optimizer #518

Closed
wants to merge 6 commits into from
Closed

Conversation

flavio
Copy link
Member

@flavio flavio commented Aug 10, 2023

This PR introduces a new cli tool called policy-optimizer. This binary will download the policies and optimize them. The goal is to implement what is described inside of this RFC.

Currently the code doesn't do any download/optimization. It just leverages the Lease primitive declared by Kubernetes to ensure only one process can have write access to the directory where the optimized policies are going to be written.
The actual code similates the download & optimize work with a simple sleep.

The change is pretty invasive as you can see, I don't want to merge it in the main branch yet.

Move policy-server to a sub-crate. This makes possible to handle a rust
project which delivers multiple binaries.

Signed-off-by: Flavio Castelli <[email protected]>
Prepare the repo layout to accomodate for the policy-optimizer binary

Signed-off-by: Flavio Castelli <[email protected]>
Now that we moved to a cargo workspace, the lock file is handled at the
root of the workspace. Meaning `crates/policy-server/Cargo.lock` is
no longer used.

Signed-off-by: Flavio Castelli <[email protected]>
Update the local Dockerfile to add the policy-optimizer binary to it.

Signed-off-by: Flavio Castelli <[email protected]>
Declare the shared dependencies of policy-server and policy-optimizer in
a single place.

Signed-off-by: Flavio Castelli <[email protected]>
Add the initial implementation of policy-optimizer. Right now the code
use the Lease objects to ensure only one policy-optimizer process can
write to the shared storage.

Right now no real work is done, the code just enters a long sleep. This
is enough to test if this approach works as we expect.

Signed-off-by: Flavio Castelli <[email protected]>
@flavio flavio requested a review from a team as a code owner August 10, 2023 15:45
@flavio
Copy link
Member Author

flavio commented Aug 10, 2023

Closing in favor of #519, which is open against a feature branch of policy-server

@flavio flavio closed this Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant