Skip to content

Commit

Permalink
merged development
Browse files Browse the repository at this point in the history
  • Loading branch information
mariana-furyk committed Nov 14, 2024
2 parents d03d453 + c4efbff commit 8b9f6cd
Show file tree
Hide file tree
Showing 149 changed files with 5,453 additions and 2,681 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"final-form-arrays": "^3.1.0",
"fs-extra": "^10.0.0",
"identity-obj-proxy": "^3.0.0",
"iguazio.dashboard-react-controls": "2.2.3",
"iguazio.dashboard-react-controls": "2.2.5",
"is-wsl": "^1.1.0",
"js-base64": "^2.5.2",
"js-yaml": "^4.1.0",
Expand Down Expand Up @@ -128,7 +128,7 @@
"body-parser": "^1.19.0",
"case-sensitive-paths-webpack-plugin": "^2.4.0",
"chai": "^4.3.4",
"chromedriver": "^128.0.0",
"chromedriver": "^130.0.0",
"css-loader": "^6.5.1",
"cucumber-html-reporter": "^5.3.0",
"eslint": "^8.57.0",
Expand Down
4 changes: 2 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ import 'igz-controls/scss/common.scss'
import './scss/main.scss'
import { createPortal } from 'react-dom'

import Notification from './common/Notification/Notification'
import Notifications from './common/Notifications/Notifications'

const Page = lazyRetry(() => import('./layout/Page/Page'))
const Datasets = lazyRetry(() => import('./components/Datasets/Datasets'))
Expand Down Expand Up @@ -298,7 +298,7 @@ const App = () => {
<Suspense fallback={<LoaderForSuspenseFallback />}>
<RouterProvider router={router} />
</Suspense>
{createPortal(<Notification />, document.getElementById('overlay_container'))}
{createPortal(<Notifications />, document.getElementById('overlay_container'))}
</div>
</div>
)
Expand Down
37 changes: 32 additions & 5 deletions src/actions/featureStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ import {
SET_NEW_FEATURE_SET_TARGET,
SET_NEW_FEATURE_SET_VERSION,
START_FEATURE_SET_INGEST_BEGIN,
START_FEATURE_SET_INGEST_SUCCESS
START_FEATURE_SET_INGEST_SUCCESS,
FETCH_FEATURE_SET_BEGIN,
FETCH_FEATURE_SET_FAILURE
} from '../constants'
import { CONFLICT_ERROR_STATUS_CODE, FORBIDDEN_ERROR_STATUS_CODE } from 'igz-controls/constants'
import { parseFeatureVectors } from '../utils/parseFeatureVectors'
Expand Down Expand Up @@ -204,14 +206,14 @@ const featureStoreActions = {
type: FETCH_FEATURE_SETS_SUCCESS,
payload: featureSets
}),
fetchFeatureSet: (project, featureSet, tag) => dispatch => {
fetchExpandedFeatureSet: (project, featureSet, tag) => dispatch => {
return featureStoreApi
.getFeatureSet(project, featureSet, tag)
.getExpandedFeatureSet(project, featureSet, tag)
.then(response => {
const generatedFeatureSets = parseFeatureSets(response.data?.feature_sets)

dispatch(
featureStoreActions.fetchFeatureSetSuccess({
featureStoreActions.fetchExpandedFeatureSetSuccess({
[getFeatureSetIdentifier(generatedFeatureSets[0])]: generatedFeatureSets
})
)
Expand All @@ -222,10 +224,35 @@ const featureStoreActions = {
throw error
})
},
fetchFeatureSetSuccess: featureSets => ({
fetchExpandedFeatureSetSuccess: featureSets => ({
type: FETCH_FEATURE_SET_SUCCESS,
payload: featureSets
}),
fetchFeatureSet: (project, featureSet, tag) => dispatch => {
dispatch(featureStoreActions.fetchFeatureSetBegin())

return featureStoreApi
.getFeatureSet(project, featureSet, tag)
.then(response => {
dispatch(featureStoreActions.fetchFeatureSetSuccess())

return parseFeatureSets(response.data?.feature_sets)[0]
})
.catch(error => {
dispatch(featureStoreActions.fetchFeatureSetFailure(error.message))
throw error
})
},
fetchFeatureSetBegin: () => ({
type: FETCH_FEATURE_SET_BEGIN
}),
fetchFeatureSetFailure: error => ({
type: FETCH_FEATURE_SET_FAILURE,
payload: error
}),
fetchFeatureSetSuccess: () => ({
type: FETCH_FEATURE_SET_SUCCESS
}),
fetchFeatureVector: (project, featureVector, tag) => dispatch => {
return featureStoreApi
.getFeatureVector(project, featureVector, tag)
Expand Down
28 changes: 15 additions & 13 deletions src/actions/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -580,23 +580,25 @@ const projectsAction = {
return summaryData
})
.catch(err => {
if (!firstServerErrorTimestamp) {
firstServerErrorTimestamp = new Date()
if (mlrunUnhealthyErrors.includes(err.response?.status)) {
if (!firstServerErrorTimestamp) {
firstServerErrorTimestamp = new Date()

dispatch(projectsAction.setMlrunUnhealthyRetrying(true))
}
dispatch(projectsAction.setMlrunUnhealthyRetrying(true))
}

const threeMinutesPassed = (new Date() - firstServerErrorTimestamp) / 1000 > 180
const threeMinutesPassed = (new Date() - firstServerErrorTimestamp) / 1000 > 180

if (mlrunUnhealthyErrors.includes(err.response?.status) && !threeMinutesPassed) {
setTimeout(() => {
dispatch(projectsAction.fetchProjectsSummary(signal, refresh))
}, 3000)
}
if (!threeMinutesPassed) {
setTimeout(() => {
dispatch(projectsAction.fetchProjectsSummary(signal, refresh))
}, 3000)
}

if (threeMinutesPassed) {
dispatch(projectsAction.setMlrunIsUnhealthy(true))
dispatch(projectsAction.setMlrunUnhealthyRetrying(true))
if (threeMinutesPassed) {
dispatch(projectsAction.setMlrunIsUnhealthy(true))
dispatch(projectsAction.setMlrunUnhealthyRetrying(true))
}
}

dispatch(projectsAction.fetchProjectsSummaryFailure(err))
Expand Down
25 changes: 20 additions & 5 deletions src/api/featureStore-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
} from '../constants'

const fetchFeatureStoreContent = (path, filters, config = {}, withLatestTag, apiV2) => {
const params = {}
const params = { ...config.params }
const httpClient = apiV2 ? mainHttpClientV2 : mainHttpClient

if (filters?.labels) {
Expand Down Expand Up @@ -66,7 +66,8 @@ const featureStoreApi = {
mainHttpClient.post(`/projects/${data.metadata.project}/feature-vectors`, data),
deleteFeatureVector: (project, featureVector) =>
mainHttpClient.delete(`/projects/${project}/feature-vectors/${featureVector}`),
fetchFeatureSetsTags: (project, config) => mainHttpClient.get(`/projects/${project}/feature-sets/*/tags`, config),
fetchFeatureSetsTags: (project, config) =>
mainHttpClient.get(`/projects/${project}/feature-sets/*/tags`, config),
fetchFeatureVectorsTags: (project, config) =>
mainHttpClient.get(`/projects/${project}/feature-vectors/*/tags`, config),
getEntity: (project, entity) =>
Expand All @@ -75,9 +76,10 @@ const featureStoreApi = {
}),
getEntities: (project, filters, config) =>
fetchFeatureStoreContent(`/projects/${project}/entities`, filters, config ?? {}, true, true),
getFeatureSet: (project, featureSet, tag) => {
getExpandedFeatureSet: (project, featureSet, tag) => {
const params = {
name: featureSet
name: featureSet,
format: 'minimal'
}

if (tag !== TAG_FILTER_ALL_ITEMS) {
Expand All @@ -88,6 +90,13 @@ const featureStoreApi = {
params
})
},
getFeatureSet: (project, featureSet, tag) => {
const params = { name: featureSet, tag }

return mainHttpClient.get(`/projects/${project}/feature-sets`, {
params
})
},
getFeatureSets: (project, filters, config) => {
return fetchFeatureStoreContent(
`/projects/${project}/${FEATURE_SETS_TAB}`,
Expand Down Expand Up @@ -125,7 +134,13 @@ const featureStoreApi = {
params: { name: feature }
}),
getFeatures: (project, filters, config) =>
fetchFeatureStoreContent(`/projects/${project}/${FEATURES_TAB}`, filters, config ?? {}, true, true),
fetchFeatureStoreContent(
`/projects/${project}/${FEATURES_TAB}`,
filters,
config ?? {},
true,
true
),
startIngest: (project, featureSet, reference, data) =>
mainHttpClient.post(
`/projects/${project}/feature-sets/${featureSet}/references/${reference}/ingest`,
Expand Down
3 changes: 3 additions & 0 deletions src/api/workflow-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ const workflowsApi = {
}

return mainHttpClient.get(`/projects/${project}/pipelines`, newConfig)
},
rerunWorkflow: (project, workflowId) => {
return mainHttpClient.post(`projects/${project}/pipelines/${workflowId}/retry`)
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/common/Accordion/Accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ illegal under applicable law, and the grant of the foregoing license
under the Apache 2.0 license is conditioned upon your compliance with
such restriction.
*/
import React, { useState, useEffect, useCallback } from 'react'
import React, { useState, useEffect, useCallback, useRef } from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'

Expand All @@ -35,7 +35,7 @@ const Accordion = ({
openByDefault = false
}) => {
const [open, setOpen] = useState(openByDefault)
const accordionRef = React.createRef()
const accordionRef = useRef()

const handleOnBlur = useCallback(
event => {
Expand Down
Loading

0 comments on commit 8b9f6cd

Please sign in to comment.