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

[Feature Request]: Support a default-less StorageClass cluster in DS Projects #1701

Closed
andrewballantyne opened this issue Aug 24, 2023 · 10 comments · Fixed by #1740
Closed
Assignees
Labels
feature/ds-projects Data Science Projects feature (formerly Data Science Groupings - DSG) kind/story A user story for larger work. Should always be referenced by a "tracker" labelled issue. priority/normal An issue with the product; fix when possible

Comments

@andrewballantyne
Copy link
Member

Feature description

Today we have support for Jupyter to set a spec.notebookController.storageClassName that allows them, if set, to override and configure the Jupyter Notebooks with PVCs containing that particular storage class value.

@shalberd has made a request for an early adoption of Storage Classes in DS Projects. We have been trying to prep for it for a while now but it seems unlikely to be done in a timely manner.

Sven's scenario is one of no default storage class on the OpenShift Cluster.

Upon talking with Sven, we have agreed to do the following on construction of new PVCs (does not apply to edit path):

  • List all storage classes (all users should have access RBAC wise)
  • Look for a default storage class
    • if one is found, do nothing (continue with the flow today)
    • If one is not found, read the spec.notebookController.storageClassName value
      • if set & in the list, use it on the name on the PVC
      • if not set, do nothing (continue with the flow today)
      • if set & not in the list, print an error to the dev console console.error(...) and do nothing else (continue with the flow today)

Implementation is up for debate, but I imagine all the logic will be found in the createPVC function. We'll have it updated to take in the DashboardConfig & it will use Promises to fetch the storage class information and do the business logic.

This design is intended to be low footprint and to allow for us to adopt the future storage class feature as a whole and improve everything across the board.

Describe alternatives you've considered

Wait for Storage Classes -- which doesn't have a timeline, best to go forward with something small for an easy win.

Anything else?

@shalberd has agreed to take a shot at doing this work. So I'll be DM'ing him about steps to get into the incubation branch.

@andrewballantyne andrewballantyne added kind/enhancement New functionality request (existing augments or new additions) untriaged Indicates the newly create issue has not been triaged yet priority/normal An issue with the product; fix when possible labels Aug 24, 2023
@github-project-automation github-project-automation bot moved this to Needs prioritization in ODH Dashboard Planning Aug 24, 2023
@andrewballantyne
Copy link
Member Author

/assign @shalberd

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 24, 2023

@andrewballantyne: GitHub didn't allow me to assign the following users: shalberd.

Note that only opendatahub-io members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

/assign @shalberd

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@andrewballantyne andrewballantyne self-assigned this Aug 24, 2023
@andrewballantyne
Copy link
Member Author

I'll be assigned to this for now until we figure that out.

@shalberd
Copy link
Contributor

commenting ... maybe that helps :-)

@andrewballantyne
Copy link
Member Author

There we go!

@shalberd
Copy link
Contributor

shalberd commented Aug 24, 2023

regarding looking for a default storageclass, if any, at least with oc get, it seems easy. The name column has (default) in case the default annotation is present. In future work, maybe once could make use of that to quickly get the default storageclass, if any. If I were using bash scripting, I'd just parse that or get that default one, if present, with oc get storageclasses -o jsonpath='{range .items[*].metadata}{.....

Bildschirmfoto 2023-08-24 um 21 30 58

@andrewballantyne
Copy link
Member Author

So when you go to do the code logic, have a look at how we do any gets for other resources:

export const getProjects = (withLabel?: string): Promise<ProjectKind[]> =>
  k8sListResource<ProjectKind>({ // you'll likely need to create a StorageClassKind
    model: ProjectModel, // the models are pretty simple (see below)
    queryOptions: {} // you probably don't need any query options as you're not looking to get by name or namespace or label
  }).then((listResource) => listResource.items);

// The project model -- see `/frontend/src/api/models/...`
export const ProjectModel: K8sModelCommon = {
  apiVersion: 'v1',
  apiGroup: 'project.openshift.io',
  kind: 'Project',
  plural: 'projects',
};

@alexcreasy alexcreasy removed the untriaged Indicates the newly create issue has not been triaged yet label Aug 30, 2023
@alexcreasy alexcreasy moved this from Needs prioritization to To do in ODH Dashboard Planning Aug 30, 2023
@alexcreasy alexcreasy added the feature/ds-projects Data Science Projects feature (formerly Data Science Groupings - DSG) label Aug 30, 2023
@alexcreasy alexcreasy moved this from To do to In progress in ODH Dashboard Planning Aug 30, 2023
@andrewballantyne andrewballantyne linked a pull request Oct 3, 2023 that will close this issue
7 tasks
@andrewballantyne andrewballantyne added kind/story A user story for larger work. Should always be referenced by a "tracker" labelled issue. and removed kind/enhancement New functionality request (existing augments or new additions) labels Oct 6, 2023
@andrewballantyne
Copy link
Member Author

This will need multiple iterations and we track all incubating items via trackers now. See #1919

@github-project-automation github-project-automation bot moved this from Dev In progress to Done in ODH Dashboard Planning Oct 6, 2023
@shalberd
Copy link
Contributor

shalberd commented Feb 14, 2024

@andrewballantyne yes LOL turns out I forgot to also add my logic to the Storage Section - Add New Storage

in addition to what I implemented here for New Workbench and creation of PVC along with a notebook.

See https://github.com/opendatahub-io/odh-dashboard/pull/2503/files#r1489215627 and

https://github.com/opendatahub-io/odh-dashboard/pull/2503/files#r1489362341 and

https://github.com/opendatahub-io/odh-dashboard/pull/2503/files#r1489400693

@andrewballantyne
Copy link
Member Author

haha, thanks @shalberd -- @alexcreasy is working to get your work in as you saw. I've got a lot of juggling of other things, so I'll leave you two discuss any questions and what have you -- Alex or you can let me know if things get stalled and needs my attention -- otherwise I'll come back through when it is all set and address getting it into main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/ds-projects Data Science Projects feature (formerly Data Science Groupings - DSG) kind/story A user story for larger work. Should always be referenced by a "tracker" labelled issue. priority/normal An issue with the product; fix when possible
Projects
Status: Done
Status: No status
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants