Skip to content

feat(ws): add http service paths to WS get on backend #213

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

Merged

Conversation

yehudit1987
Copy link

This PR is for adding missing ports field to workspace model.

@thesuperzapper
Copy link
Member

/ok-to-test

Ports []ImagePort `json:"ports,omitempty"`
}

type ImagePort struct {
Copy link
Member

@thesuperzapper thesuperzapper Feb 20, 2025

Choose a reason for hiding this comment

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

@yehudit1987 it might be more useful for the frontend if we do something more abstract like "services" (which initially only includes "HTTP" type services).

That makes it a bit easier to populate the front-end "connect" box, because rather than constructing the HTTP path in the front end we could just include the httpPath (relative to the UI base, not absolute) rather than constructing it in the front end.

Also, stuff like "port number" don't need to be included because this is hidden from the end user.

For example (written in YAML for clarity, but payload is JSON in app):

...
  services:
    - httpService:
       displayName: "XXXXX"
       httpPath: "/workspace/{namespace}/{workspace_name}/{port_id}/

Copy link
Author

Choose a reason for hiding this comment

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

Hey @thesuperzapper, thanks for the review! I totally agree with your suggestion—it makes more sense. I initially followed the frontend mock, but once the PR is approved, I'll update the frontend accordingly. Also, I’ve moved the location in the struct; hope that makes sense to you as well!

Copy link
Member

@ederign ederign left a comment

Choose a reason for hiding this comment

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

@yehudit1987 thank you for the PR. Just two small comments there.

if len(val.Spec.Ports) == 0 {
continue
}
firstPort := val.Spec.Ports[0]
Copy link
Member

Choose a reason for hiding this comment

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

// ports that the container listens on
	//   - if multiple ports are defined, the user will see multiple "Connect" buttons
	//     in a dropdown menu on the Workspace overview page
	// +kubebuilder:validation:MinItems:=1
	// +listType:="map"
	// +listMapKey:="id"
	Ports []ImagePort `json:"ports"`	

Shall we support here multiple ports here?

Copy link
Member

Choose a reason for hiding this comment

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

Or we deliberatelly are going to always use the first port here?

Copy link
Member

Choose a reason for hiding this comment

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

@thesuperzapper maybe you can chime in on this one. ^

I'm good to support just one for now and do a FUP PR on it.

Copy link
Author

Choose a reason for hiding this comment

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

@ederign I think it's a mistake (mine). Will fix it soon.

Copy link
Member

Choose a reason for hiding this comment

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

No worries @yehudit1987 ! Thank you for the PR

if displayName == "" {
displayName = val.Id
}
basePath := "/workspace"
Copy link
Member

Choose a reason for hiding this comment

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

Just out of my curiosity, where this /workspace path comes from?

@ederign
Copy link
Member

ederign commented Feb 27, 2025

/assign @ederign

@thesuperzapper thesuperzapper changed the title feat(ws): Notebooks 2.0 // Backend// Add missing field feat(ws): add http service paths to WS get on backend Feb 27, 2025
Yehudit Kerido and others added 6 commits March 6, 2025 14:31
@thesuperzapper
Copy link
Member

@ederign @yehudit1987 I have made significant changes in 4e91e38

I am happy to merge it now so we can unblock #188 (which will need to be rebased to remove the backend updates).

@thesuperzapper
Copy link
Member

/lgtm
/approve

Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: thesuperzapper

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

@google-oss-prow google-oss-prow bot merged commit f216c3e into kubeflow:notebooks-v2 Mar 7, 2025
10 of 11 checks passed
@github-project-automation github-project-automation bot moved this from Needs Triage to Done in Kubeflow Notebooks Mar 7, 2025
caponetto pushed a commit to caponetto/kubeflow-notebooks that referenced this pull request Apr 30, 2025
* Add missing ports field to workspace model

Signed-off-by: Yehudit Kerido <[email protected]>

* Add missing ports field to workspace model

Signed-off-by: Yehudit Kerido <[email protected]>

* Add services field to workspace model

Signed-off-by: Yehudit Kerido <[email protected]>

* Add services field to workspace model

Signed-off-by: Yehudit Kerido <[email protected]>

* Add services field to workspace model

Signed-off-by: Yehudit Kerido <[email protected]>

* mathew updates: 1

Signed-off-by: Mathew Wicks <[email protected]>

---------

Signed-off-by: Yehudit Kerido <[email protected]>
Signed-off-by: Mathew Wicks <[email protected]>
Co-authored-by: Yehudit Kerido <[email protected]>
Co-authored-by: Mathew Wicks <[email protected]>
mkoushni pushed a commit to mkoushni/notebooks that referenced this pull request May 28, 2025
* Add missing ports field to workspace model

Signed-off-by: Yehudit Kerido <[email protected]>

* Add missing ports field to workspace model

Signed-off-by: Yehudit Kerido <[email protected]>

* Add services field to workspace model

Signed-off-by: Yehudit Kerido <[email protected]>

* Add services field to workspace model

Signed-off-by: Yehudit Kerido <[email protected]>

* Add services field to workspace model

Signed-off-by: Yehudit Kerido <[email protected]>

* mathew updates: 1

Signed-off-by: Mathew Wicks <[email protected]>

---------

Signed-off-by: Yehudit Kerido <[email protected]>
Signed-off-by: Mathew Wicks <[email protected]>
Co-authored-by: Yehudit Kerido <[email protected]>
Co-authored-by: Mathew Wicks <[email protected]>
Signed-off-by: CI Bot <[email protected]>
mkoushni pushed a commit to mkoushni/notebooks that referenced this pull request Jun 4, 2025
* Add missing ports field to workspace model

Signed-off-by: Yehudit Kerido <[email protected]>

* Add missing ports field to workspace model

Signed-off-by: Yehudit Kerido <[email protected]>

* Add services field to workspace model

Signed-off-by: Yehudit Kerido <[email protected]>

* Add services field to workspace model

Signed-off-by: Yehudit Kerido <[email protected]>

* Add services field to workspace model

Signed-off-by: Yehudit Kerido <[email protected]>

* mathew updates: 1

Signed-off-by: Mathew Wicks <[email protected]>

---------

Signed-off-by: Yehudit Kerido <[email protected]>
Signed-off-by: Mathew Wicks <[email protected]>
Co-authored-by: Yehudit Kerido <[email protected]>
Co-authored-by: Mathew Wicks <[email protected]>
Signed-off-by: CI Bot <[email protected]>
andyatmiami pushed a commit to andyatmiami/kubeflow-notebooks that referenced this pull request Jun 13, 2025
* Add missing ports field to workspace model

Signed-off-by: Yehudit Kerido <[email protected]>

* Add missing ports field to workspace model

Signed-off-by: Yehudit Kerido <[email protected]>

* Add services field to workspace model

Signed-off-by: Yehudit Kerido <[email protected]>

* Add services field to workspace model

Signed-off-by: Yehudit Kerido <[email protected]>

* Add services field to workspace model

Signed-off-by: Yehudit Kerido <[email protected]>

* mathew updates: 1

Signed-off-by: Mathew Wicks <[email protected]>

---------

Signed-off-by: Yehudit Kerido <[email protected]>
Signed-off-by: Mathew Wicks <[email protected]>
Co-authored-by: Yehudit Kerido <[email protected]>
Co-authored-by: Mathew Wicks <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

3 participants