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

Add webhook framework #713

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

Add webhook framework #713

wants to merge 10 commits into from

Conversation

kerthcet
Copy link
Collaborator

@kerthcet kerthcet commented Feb 19, 2025

Pull Request Description

  • add the webhook for validations, which uses an internal cert.
  • add the integration test framework and add a simple example
  • Update the update-codegen.sh

Related Issues

xref: #710

Important: Before submitting, please complete the description above and review the checklist below.


Contribution Guidelines (Expand for Details)

We appreciate your contribution to aibrix! To ensure a smooth review process and maintain high code quality, please adhere to the following guidelines:

Pull Request Title Format

Your PR title should start with one of these prefixes to indicate the nature of the change:

  • [Bug]: Corrections to existing functionality
  • [CI]: Changes to build process or CI pipeline
  • [Docs]: Updates or additions to documentation
  • [API]: Modifications to aibrix's API or interface
  • [CLI]: Changes or additions to the Command Line Interface
  • [Misc]: For changes not covered above (use sparingly)

Note: For changes spanning multiple categories, use multiple prefixes in order of importance.

Submission Checklist

  • PR title includes appropriate prefix(es)
  • Changes are clearly explained in the PR description
  • New and existing tests pass successfully
  • Code adheres to project style and best practices
  • Documentation updated to reflect changes (if applicable)
  • Thorough testing completed, no regressions introduced

By submitting this PR, you confirm that you've read these guidelines and your changes align with the project's contribution standards.

@kerthcet
Copy link
Collaborator Author

I hope to push the changes commit by commit, however, the dependency is really coupled, so ...

@kerthcet
Copy link
Collaborator Author

I think the doc build error is not related because it's a private repo at this moment.

Signed-off-by: kerthcet <[email protected]>
Signed-off-by: kerthcet <[email protected]>
Signed-off-by: kerthcet <[email protected]>
Signed-off-by: kerthcet <[email protected]>
Signed-off-by: kerthcet <[email protected]>
Signed-off-by: kerthcet <[email protected]>
@kerthcet kerthcet force-pushed the feat/add-integration-test branch from 550f63e to afcfa62 Compare February 20, 2025 05:25
Signed-off-by: kerthcet <[email protected]>
Signed-off-by: kerthcet <[email protected]>
@kerthcet
Copy link
Collaborator Author

Failed by TestBaseModelInferenceFailures/Invalid_API_Key, rerun.

@kerthcet
Copy link
Collaborator Author

Could you take a look @Jeffwan This is the first step to introduce the webhook framework. Thanks!

@Jeffwan
Copy link
Collaborator

Jeffwan commented Feb 21, 2025

I was busy on the open source stuff yesterday. I will spend some time on the review todya

@Jeffwan
Copy link
Collaborator

Jeffwan commented Feb 21, 2025

doc build failure is expected, I switch to free version and it only supports public repo. It will come back soon

Copy link
Collaborator

@Jeffwan Jeffwan left a comment

Choose a reason for hiding this comment

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

Overall looks good to me. I suggest to move some webhook unrelated refactor or optimization to separate PRs

.PHONY: manifests
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=controller-manager-role crd:maxDescLen=0,generateEmbeddedObjectMeta=true webhook paths="./..." output:crd:artifacts:config=config/crd/bases
$(CONTROLLER_GEN) \
rbac:roleName=controller-manager-role output:rbac:artifacts:config=config/rbac/controller-manager \
Copy link
Collaborator

Choose a reason for hiding this comment

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

In the past, we maintain this manually. some internal users want to use the component separately. so we change the folder structure to component based. If we use config/rbac/controller-manager. other components like orchestration will land into same subfolder?

@@ -81,6 +94,11 @@ vet: ## Run go vet against code.
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out

.PHONY: test-integration
Copy link
Collaborator

Choose a reason for hiding this comment

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

great!


# Copy everything back.
cp -a "${TEMP_DIR}/${ROOT_PKG}/." "${SCRIPT_ROOT}/"
REPO_ROOT="$(git rev-parse --show-toplevel)"
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's have a separate PR for common tool updates? WDYT?

// +kubebuilder:default:=3
Replicas int `json:"replicas,omitempty"`
// +optional
Replicas *int `json:"replicas,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

separate PR

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

Successfully merging this pull request may close these issues.

2 participants