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

Implement OpenShift Route creation for InferenceGraphs #480

Open
wants to merge 1 commit into
base: release-v0.14
Choose a base branch
from

Conversation

israel-hdez
Copy link

@israel-hdez israel-hdez commented Jan 31, 2025

What this PR does / why we need it:

InferenceGraphs doesn't have any ingress reconciler. Despite that, in ODH we need a mechanism to expose InferenceGraphs. This implements exposing InferenceGraphs on OpenShift using Routes.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes https://issues.redhat.com/browse/RHOAIENG-17831

Type of changes
Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Feature/Issue validation/testing:

  • Create InferenceGraph in Raw mode. Then, check that a route is created and accessible.
    • Delete the created Route. Check that the controller restores it.
    • Delete the InferenceGraph. Check that the Route is deleted.

Checklist:

  • Have you added unit/e2e tests that prove your fix is effective or that this feature works?
  • [ x Has code been commented, particularly in hard-to-understand areas?
  • [N/A] Have you made corresponding changes to the documentation?

@israel-hdez israel-hdez requested a review from Jooho January 31, 2025 21:55
Copy link

openshift-ci bot commented Jan 31, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: israel-hdez

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

}

func (r *OpenShiftRouteReconciler) Reconcile(ctx context.Context, inferenceGraph *v1alpha1.InferenceGraph) (string, error) {
logger := log2.FromContext(ctx, "subreconciler", "OpenShiftRoute")
Copy link

Choose a reason for hiding this comment

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

log2 seems something weird to me. is there a reason you use log2 instead of just log?

Copy link
Author

Choose a reason for hiding this comment

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

There was a conflict with this variable:

var log = logf.Log.WithName("GraphKsvcReconciler")

But I agree the naming is not good. I renamed to ctrlLog.

Name: fmt.Sprintf("%s-route", inferenceGraph.Name),
Namespace: inferenceGraph.Namespace,
},
Spec: v1.RouteSpec{
Copy link

Choose a reason for hiding this comment

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

looks it uses http protocol. do we need to use https?

Copy link
Author

Choose a reason for hiding this comment

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

That would be the goal of this Jira: https://issues.redhat.com/browse/RHOAIENG-18978

Type: routev1.RouteAdmitted,
Status: v1.ConditionTrue,
},
}
Copy link

Choose a reason for hiding this comment

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

is this for inferencegraph test?

Copy link
Author

Choose a reason for hiding this comment

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

Nope. I updated the CRD test file test/crds/route.openshift.io_routes.yaml. This unit was failing after updating that CRD. I had to do these changes to make it pass again.

Something was wrong with the old CRD definition. The kube client typically doesn't save the Status field. So, it made sense to me that the unit started failing. To fix, I had to do these changes to fist create the resource with k8sClient.Create() and later update the status with k8sClient.Status().Update().

@Jooho
Copy link

Jooho commented Jan 31, 2025

is this pr for release branch first?

InferenceGraphs doesn't have any ingress reconciler. Despite that, in ODH we need a mechanism to expose InferenceGraphs. This implements exposing InferenceGraphs on OpenShift using Routes.

Signed-off-by: Edgar Hernández <[email protected]>
@israel-hdez
Copy link
Author

is this pr for release branch first?

@Jooho Thinking it twice, I think the release branch can wait. I created another PR in master: #481

@Jooho
Copy link

Jooho commented Feb 5, 2025

I leaved /lgtm on the other PR for master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: New/Backlog
Development

Successfully merging this pull request may close these issues.

2 participants