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 teacher/judge section to ilab form #3777

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

Conversation

DaoDaoNoCode
Copy link
Member

@DaoDaoNoCode DaoDaoNoCode commented Feb 19, 2025

JIRA: RHOAIENG-19108

Description

Screenshot 2025-02-19 at 4 35 59 PM Screenshot 2025-02-19 at 4 36 14 PM

Added 2 similar sections to the form: Teacher model and Judge model. Here are the descriptions.

  1. Added validation to these 2 sections. When the public endpoint is chosen, it doesn't require a token to be input. When the private endpoint is selected, it requires the token field not to be empty. Also, the endpoint field needs to follow the URI format.
  2. I leave the links to the docs in the description as empty for now
  3. When submitting, it will create 2 separate secrets for both teacher and judge. There are 3 fields in the secrets: api_token, 'endpoint' and model_name. When it's public, the api_token field will be set as empty string.
  4. The name of these 2 secrets are not decided yet, thus, after creating the 2 secrets, the corresponding parameters in the pipeline run form are not decided, either. I added some TODO comments to it.

How Has This Been Tested?

  1. Test whether the submit button is disabled/enabled as described in the description by changing it between public/private and changing the format of the endpoint
  2. Test whether submitting it will create 2 secrets

Test Impact

Added unit tests for the validation
Added cypress tests for the 2 sections

Request review criteria:

Self checklist (all need to be checked):

  • The developer has manually tested the changes and verified that the changes work
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has added tests or explained why testing cannot be added (unit or cypress tests for related changes)

If you have UI changes:

  • Included any necessary screenshots or gifs if it was a UI change.
  • Included tags to the UX team if it was a UI/UX change.

After the PR is posted & before it merges:

  • The developer has tested their solution on a cluster by using the image produced by the PR to main

Copy link
Contributor

openshift-ci bot commented Feb 19, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign manosnoam for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

Copy link

codecov bot commented Feb 19, 2025

Codecov Report

Attention: Patch coverage is 54.60993% with 64 lines in your changes missing coverage. Please review.

Project coverage is 84.62%. Comparing base (652b75c) to head (19c45b6).

Files with missing lines Patch % Lines
...s/global/modelCustomization/FineTunePageFooter.tsx 18.60% 35 Missing ⚠️
frontend/src/api/k8s/secrets.ts 20.00% 8 Missing ⚠️
...pages/pipelines/global/modelCustomization/utils.ts 20.00% 8 Missing ⚠️
...mization/teacherJudgeSection/JudgeModelSection.tsx 66.66% 5 Missing ⚠️
...zation/teacherJudgeSection/TeacherModelSection.tsx 66.66% 5 Missing ⚠️
...eacherJudgeSection/TeacherJudgeInputComponents.tsx 87.50% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3777      +/-   ##
==========================================
- Coverage   84.67%   84.62%   -0.06%     
==========================================
  Files        1518     1522       +4     
  Lines       35140    35235      +95     
  Branches     9836     9854      +18     
==========================================
+ Hits        29754    29816      +62     
- Misses       5386     5419      +33     
Files with missing lines Coverage Δ
...oncepts/pipelines/content/createRun/submitUtils.ts 90.90% <100.00%> (ø)
...rm/modelCustomizationFormSchema/validationUtils.ts 51.35% <100.00%> (+16.97%) ⬆️
...pelines/global/modelCustomization/FineTunePage.tsx 100.00% <100.00%> (ø)
...obal/modelCustomization/ModelCustomizationForm.tsx 81.25% <ø> (ø)
...pages/pipelines/global/modelCustomization/const.ts 100.00% <100.00%> (ø)
...eacherJudgeSection/TeacherJudgeInputComponents.tsx 87.50% <87.50%> (ø)
...mization/teacherJudgeSection/JudgeModelSection.tsx 66.66% <66.66%> (ø)
...zation/teacherJudgeSection/TeacherModelSection.tsx 66.66% <66.66%> (ø)
frontend/src/api/k8s/secrets.ts 84.61% <20.00%> (-11.75%) ⬇️
...pages/pipelines/global/modelCustomization/utils.ts 20.00% <20.00%> (ø)
... and 1 more

... and 9 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 652b75c...19c45b6. Read the comment docs.

Copy link
Contributor

@dpanshug dpanshug left a comment

Choose a reason for hiding this comment

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

it looks good to me, just a nit

@DaoDaoNoCode DaoDaoNoCode force-pushed the jira-rhoaieng-19108 branch 2 times, most recently from 7c526b4 to 75bede7 Compare February 25, 2025 00:34
@DaoDaoNoCode
Copy link
Member Author

Updated the PR, use teacher-secret-${randomChars} and judge-secret-${randomChars} as the secret names and set them to the judge_secret and teacher_secret field to the run parameters.
What's more, I added dryRun to the submit run function as well, so we can make sure we dry run everything before really creating a run, in case we really create some secrets but meet errors later when creating the run.
Now the question is - Is there a way to use the set function that's provided by the useRunFormData hook? You can see I am simply mapping the values when creating the run here instead of setting them to the run form state because I cannot do the state setting and reading simultaneously. Any ideas? cc @Gkrumbach07

@pnaik1
Copy link
Contributor

pnaik1 commented Feb 25, 2025

The functionality and Zod validation work well. I'm also waiting for the above comment so I can also make changes in my PR accordingly

@pnaik1
Copy link
Contributor

pnaik1 commented Feb 25, 2025

@DaoDaoNoCode , I just notice that start run button is enabled even when we dont have any value in the endpoint
Can you look at the zod validation for this??
Screenshot 2025-02-25 at 6 53 25 PM

@DaoDaoNoCode
Copy link
Member Author

@pnaik1 Nice catch! I updated the zod validation functions.

@Gkrumbach07
Copy link
Member

@DaoDaoNoCode take a look at what Purva did for here taxonomy PR
https://github.com/opendatahub-io/odh-dashboard/pull/3785/files#diff-c01f9880ad8c80ab019ba783fb672667a3199b2daabc6be55a355bf9e53e9461

we should just do something like

const [runFormData] = useRunFormData(ilabPipelineVersion);

then with on submit you do something like

handleSubmit({
   ...runFormData,
   ...translateIlabFormToPipelineInput(formData, judgeSecretName, teacherSecretName)
})

@@ -33,8 +53,109 @@ const FineTunePageFooter: React.FC<FineTunePageFooterProps> = ({ isInvalid, onSu
// TODO: translate data to `RunFormData`
const [runFormData] = useRunFormData(null, {});
Copy link
Member

Choose a reason for hiding this comment

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

can you put the ilabPipeline in instead of null

Copy link
Member

Choose a reason for hiding this comment

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

also {} is optional so no need to have that

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.

4 participants