Skip to content

Commit

Permalink
Merge branch 'development' into ML-5027
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/components/JobWizard/JobWizard.util.js
#	src/components/JobWizard/JobWizardSteps/JobWizardRunDetails/JobWizardRunDetails.js
  • Loading branch information
mavdryk committed Nov 20, 2023
2 parents 07c7e0c + 3e05eef commit 1d2cc57
Show file tree
Hide file tree
Showing 65 changed files with 690 additions and 348 deletions.
6 changes: 3 additions & 3 deletions src/actions/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,12 @@ const functionsActions = {
payload: err
}),
fetchFunctions:
(project, filters, withoutLoader = false) =>
(project, filters, setLargeRequestErrorMessage) =>
dispatch => {
dispatch(functionsActions.fetchFunctionsBegin(withoutLoader))
dispatch(functionsActions.fetchFunctionsBegin())

return functionsApi
.getFunctions(project, filters)
.getFunctions(project, filters, null, setLargeRequestErrorMessage)
.then(({ data }) => {
dispatch(functionsActions.fetchFunctionsSuccess(data.funcs))

Expand Down
8 changes: 4 additions & 4 deletions src/actions/jobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ const jobsActions = {
type: EDIT_JOB_FAILURE,
payload: error
}),
fetchAllJobRuns: (project, filters, jobName, cancelToken) => dispatch => {
fetchAllJobRuns: (project, filters, jobName, setLargeRequestErrorMessage) => dispatch => {
dispatch(jobsActions.fetchAllJobRunsBegin())

return jobsApi
.getAllJobRuns(project, jobName, filters, cancelToken)
.getAllJobRuns(project, jobName, filters, setLargeRequestErrorMessage)
.then(({ data }) => {
dispatch(jobsActions.fetchAllJobRunsSuccess(data.runs || []))

Expand Down Expand Up @@ -257,12 +257,12 @@ const jobsActions = {
fetchJobLogsSuccess: () => ({
type: FETCH_JOB_LOGS_SUCCESS
}),
fetchJobs: (project, filters, scheduled) => dispatch => {
fetchJobs: (project, filters, scheduled, setLargeRequestErrorMessage) => dispatch => {
const getJobs = scheduled ? jobsApi.getScheduledJobs : jobsApi.getJobs

dispatch(jobsActions.fetchJobsBegin())

return getJobs(project, filters)
return getJobs(project, filters, setLargeRequestErrorMessage)
.then(({ data }) => {
const newJobs = scheduled
? (data || {}).schedules
Expand Down
4 changes: 2 additions & 2 deletions src/actions/workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ const workflowActions = {
type: FETCH_WORKFLOW_FAILURE,
payload: error
}),
fetchWorkflows: (project, filter) => dispatch => {
fetchWorkflows: (project, filter, setLargeRequestErrorMessage) => dispatch => {
dispatch(workflowActions.fetchWorkflowsBegin())

return workflowApi
.getWorkflows(project, filter)
.getWorkflows(project, filter, setLargeRequestErrorMessage)
.then(response =>
dispatch(workflowActions.fetchWorkflowsSuccess(parseWorkflows(response.data.runs)))
)
Expand Down
51 changes: 38 additions & 13 deletions src/api/artifacts-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,16 @@ const artifactsApi = {
}
)
},
getDataSets: (project, filters, config) => {
return fetchArtifacts(project, filters, { ...config, params: { category: DATASET_TYPE } })
getDataSets: (project, filters, config, setLargeRequestErrorMessage) => {
const newConfig = {
...config,
params: { category: DATASET_TYPE },
ui: {
setLargeRequestErrorMessage
}
}

return fetchArtifacts(project, filters, newConfig)
},
getFile: (project, file, iter, tag) => {
return fetchArtifacts(
Expand All @@ -115,10 +123,15 @@ const artifactsApi = {
}
)
},
getFiles: (project, filters) => {
return fetchArtifacts(project, filters, {
params: { category: ARTIFACT_OTHER_TYPE, format: 'full' }
})
getFiles: (project, filters, setLargeRequestErrorMessage) => {
const config = {
params: { category: ARTIFACT_OTHER_TYPE, format: 'full' },
ui: {
setLargeRequestErrorMessage
}
}

return fetchArtifacts(project, filters, config)
},
getModel: (project, model, iter, tag) => {
return fetchArtifacts(
Expand All @@ -134,17 +147,29 @@ const artifactsApi = {
}
)
},
getModelEndpoints: (project, filters, params = {}) => {
getModelEndpoints: (project, filters, params = {}, setLargeRequestErrorMessage) => {
const config = {
params,
ui: {
setLargeRequestErrorMessage
}
}

if (filters?.labels) {
params.label = filters.labels?.split(',')
config.params.label = filters.labels?.split(',')
}

return mainHttpClient.get(`/projects/${project}/model-endpoints`, {
params
})
return mainHttpClient.get(`/projects/${project}/model-endpoints`, config)
},
getModels: (project, filters) => {
return fetchArtifacts(project, filters, { params: { category: MODEL_TYPE, format: 'full' } })
getModels: (project, filters, setLargeRequestErrorMessage) => {
const config = {
params: { category: MODEL_TYPE, format: 'full' },
ui: {
setLargeRequestErrorMessage
}
}

return fetchArtifacts(project, filters, config)
},
registerArtifact: (project, data) =>
mainHttpClient.post(
Expand Down
15 changes: 10 additions & 5 deletions src/api/functions-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,23 @@ const functionsApi = {
deleteSelectedFunction: (func, project) =>
mainHttpClient.delete(`/projects/${project}/functions/${func}`),
deployFunction: data => mainHttpClient.post('/build/function', data),
getFunctions: (project, filters, hash) => {
const params = {}
getFunctions: (project, filters, hash, setLargeRequestErrorMessage) => {
const config = {
params: {},
ui: {
setLargeRequestErrorMessage
}
}

if (filters?.name) {
params.name = `~${filters.name}`
config.params.name = `~${filters.name}`
}

if (hash) {
params.hash_key = hash
config.params.hash_key = hash
}

return mainHttpClient.get(`/projects/${project}/functions`, { params })
return mainHttpClient.get(`/projects/${project}/functions`, config)
},
getFunction: (project, functionName, hash, tag) => {
const params = {}
Expand Down
47 changes: 28 additions & 19 deletions src/api/jobs-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,23 @@ const jobsApi = {
`/projects/${project}/schedules/${postData.scheduled_object.task.metadata.name}`,
postData
),
getJobs: (project, filters, isAllJobs) => {
const params = {
project,
...generateRequestParams(filters)
getJobs: (project, filters, setLargeRequestErrorMessage, isAllJobs) => {
const config = {
params: {
project,
...generateRequestParams(filters)
},
ui: {
setLargeRequestErrorMessage
}
}

if (!isAllJobs) {
params['partition-by'] = 'name'
params['partition-sort-by'] = 'updated'
config.params['partition-by'] = 'name'
config.params['partition-sort-by'] = 'updated'
}

return mainHttpClient.get('/runs', { params })
return mainHttpClient.get('/runs', config)
},
getSpecificJobs: (project, filters, jobList) => {
const params = {
Expand All @@ -97,19 +102,18 @@ const jobsApi = {

return mainHttpClient.get(`/runs?${jobListQuery}`, { params })
},
getAllJobRuns: (project, jobName, filters, cancelToken) => {
getAllJobRuns: (project, jobName, filters, setLargeRequestErrorMessage) => {
const config = {
params: {
project,
name: jobName,
...generateRequestParams(filters)
},
ui: {
setLargeRequestErrorMessage
}
}

if (cancelToken) {
config.cancelToken = cancelToken
}

return mainHttpClient.get('/runs', config)
},
getJob: (project, jobId, iter) => {
Expand All @@ -125,24 +129,29 @@ const jobsApi = {
fetch(`${mainBaseUrl}/log/${project}/${id}`, {
method: 'get'
}),
getScheduledJobs: (project, filters) => {
const params = {
include_last_run: 'yes'
getScheduledJobs: (project, filters, setLargeRequestErrorMessage) => {
const config = {
params: {
include_last_run: 'yes'
},
ui: {
setLargeRequestErrorMessage
}
}

if (filters?.owner) {
params.owner = filters.owner
config.params.owner = filters.owner
}

if (filters?.name) {
params.name = `~${filters.name}`
config.params.name = `~${filters.name}`
}

if (filters?.labels) {
params.labels = filters.labels?.split(',')
config.params.labels = filters.labels?.split(',')
}

return mainHttpClient.get(`/projects/${project}/schedules`, { params })
return mainHttpClient.get(`/projects/${project}/schedules`, config)
},
removeScheduledJob: (project, scheduleName) =>
mainHttpClient.delete(`/projects/${project}/schedules/${scheduleName}`),
Expand Down
3 changes: 2 additions & 1 deletion src/api/projects-iguazio-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ const projectsIguazioApi = {
return iguazioHttpClient.post('/async_transactions', data)
},
getScrubbedUsers: config => iguazioHttpClient.get('/scrubbed_users', config),
getScrubbedUserGroups: config => iguazioHttpClient.get('/scrubbed_user_groups', config)
getScrubbedUserGroups: config => iguazioHttpClient.get('/scrubbed_user_groups', config),
getActiveUser: () => iguazioHttpClient.get('/self')
}

export default projectsIguazioApi
15 changes: 10 additions & 5 deletions src/api/workflow-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,26 @@ const generateQueryParams = filter => {
}
}

return `?filter=${encodeURI(JSON.stringify(queryParams))}`
return JSON.stringify(queryParams)
}

const workflowsApi = {
getWorkflow: (project, workflowId) => {
return mainHttpClient.get(`/projects/${project}/pipelines/${workflowId}`)
},
getWorkflows: (project, filter) => {
let queryParams = ''
getWorkflows: (project, filter, setLargeRequestErrorMessage) => {
const config = {
params: {},
ui: {
setLargeRequestErrorMessage
}
}

if (filter?.groupBy === GROUP_BY_WORKFLOW) {
queryParams = generateQueryParams(filter)
config.params.filter = generateQueryParams(filter)
}

return mainHttpClient.get(`/projects/${project}/pipelines` + queryParams)
return mainHttpClient.get(`/projects/${project}/pipelines`, config)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/common/Breadcrumbs/breadcrumbs.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const generateProjectScreens = params => [
label: 'Quick actions',
id: PROJECT_QUICK_ACTIONS_PAGE
},
{ label: 'Feature Store', id: 'feature-store' },
{ label: 'Feature store', id: 'feature-store' },
{ label: 'Datasets', id: 'datasets' },
{ label: 'Artifacts', id: 'files' },
{ label: 'Models', id: 'models' },
Expand Down
70 changes: 39 additions & 31 deletions src/common/ProjectDetailsHeader/ProjectDetailsHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,38 +35,46 @@ const ProjectDetailsHeader = ({ projectData, projectName }) => {
<div className="project-details__header">
<span className="project-details__title">{projectName}</span>
</div>
<p className="project-details__description">{projectData.spec.description ?? ''}</p>

<p className="project-details__description">
{projectData && projectData.spec.description}
</p>
</div>
<ul className="project-details__details">
<li>
<span className="project-details__details-label">Created:</span>
<span>
{getDateAndTimeByFormat(projectData.metadata.created, 'MM/DD/YYYY, HH:mm:ss A')}
</span>
</li>
<li>
<span className="project-details__details-label">Owner:</span>
<span>{projectData.spec.owner}</span>
</li>
<li>
<span className="project-details__details-label">Status:</span>
<div>
<i className={`state-${projectData.status.state}`} />
<span>{projectData.status.state}</span>
</div>
</li>
<li>
{location.pathname.includes(PROJECT_MONITOR) ? (
<Link to={`/projects/${projectName}/${PROJECT_QUICK_ACTIONS_PAGE}`} className="link">
Project quick actions
</Link>
) : (
<Link to={`/projects/${projectName}/${PROJECT_MONITOR}`} className="link">
Project monitoring
</Link>
)}
</li>
</ul>
{projectData && (
<ul className="project-details__details">
<li>
<span className="project-details__details-label">Created:</span>
<span>
{getDateAndTimeByFormat(projectData.metadata.created, 'MM/DD/YYYY, HH:mm:ss A')}
</span>
</li>
<li>
<span className="project-details__details-label">Owner:</span>
<span>{projectData.spec.owner}</span>
</li>
<li>
<span className="project-details__details-label">Status:</span>
<div>
<i className={`state-${projectData.status.state}`} />
<span>{projectData.status.state}</span>
</div>
</li>
<li>
{location.pathname.includes(PROJECT_MONITOR) ? (
<Link
to={`/projects/${projectName}/${PROJECT_QUICK_ACTIONS_PAGE}`}
className="link"
>
Project quick actions
</Link>
) : (
<Link to={`/projects/${projectName}/${PROJECT_MONITOR}`} className="link">
Project monitoring
</Link>
)}
</li>
</ul>
)}
</div>
</div>
)
Expand Down
3 changes: 2 additions & 1 deletion src/common/ProjectDetailsHeader/ProjectDetailsHeader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
}

&__description {
max-width: 75%;
max-width: 90%;
margin: 0;
word-break: break-word;
}

&__details {
Expand Down
Loading

0 comments on commit 1d2cc57

Please sign in to comment.