-
Notifications
You must be signed in to change notification settings - Fork 1
Webportal support jobType in job protocol and dedicated parameters in inference job #113
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
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
a1a5bf3
add job type support; add inference job support
zhogu 3941484
update
zhogu c54e75d
deploy webportal-dind when webportal changed
zhogu 6ecfb23
update
zhogu 5ab7f32
update
zhogu a7f495e
update
zhogu b994dc0
update
zhogu 92f5646
update
zhogu 9d292ec
update
zhogu e58e60d
Merge branch 'dev' into zhogu/webportal-support-job-type
zhogu c7cc609
Merge branch 'dev' into zhogu/webportal-support-job-type
zhogu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
src/webportal/src/app/job-submission/components/job-type.jsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| import React, { useMemo, useCallback } from 'react'; | ||
| import { BasicSection } from './basic-section'; | ||
| import { Dropdown } from 'office-ui-fabric-react'; | ||
| import { FormShortSection } from './form-page'; | ||
| import PropTypes from 'prop-types'; | ||
| import context from './context'; | ||
|
|
||
| export const JobType = React.memo(props => { | ||
| const { onChange, jobType } = props; | ||
| const jobTypes = ['others', 'training', 'inference']; | ||
|
|
||
| const options = useMemo( | ||
| () => | ||
| jobTypes.map((jobType, index) => { | ||
| return { | ||
| key: `jobType_${index}`, | ||
| text: jobType, | ||
| }; | ||
| }), | ||
| [jobTypes], | ||
| ); | ||
zhogu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| const _onChange = useCallback( | ||
| (_, item) => { | ||
| if (onChange !== undefined) { | ||
| onChange(item.text); | ||
| if (item.text === 'inference') { | ||
| alert( | ||
zhogu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| `Inference jobs have three forced parameters: | ||
| 1. INTERNAL_SERVER_IP=$PAI_HOST_IP_taskrole_0 : Fix value, used to inference service IP | ||
zhogu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 2. INTERNAL_SERVER_PORT=$PAI_PORT_LIST_taskrole_0_http : Fixed Value used to inference service port | ||
zhogu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 3. API_KEY="...": A random generated string, can be set arbitrarily) | ||
| The three parameters will be automatically added to your job parameters upon switching to inference job type. | ||
| `, | ||
| ); | ||
| } | ||
| } | ||
| }, | ||
| [onChange], | ||
| ); | ||
|
|
||
| const jobTypeIndex = options.findIndex(value => value.text === jobType); | ||
| return ( | ||
| <BasicSection sectionLabel={'Job type'}> | ||
| <FormShortSection> | ||
| <Dropdown | ||
| placeholder='Select an option' | ||
| options={options} | ||
| onChange={_onChange} | ||
| selectedKey={jobTypeIndex === -1 ? null : `jobType_${jobTypeIndex}`} | ||
| /> | ||
| </FormShortSection> | ||
| </BasicSection> | ||
| ); | ||
| }); | ||
|
|
||
| JobType.propTypes = { | ||
| onChange: PropTypes.func, | ||
| jobType: PropTypes.string, | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.