Fixed issue related with deactivated nuclio dashboard (#2008)

* Fixed issue related with deactivated nuclio dashboard

* Updated version, updated changelog
main
Boris Sekachev 6 years ago committed by GitHub
parent ca4b320d23
commit 2c661020b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
- Issue loading openvino models for semi-automatic and automatic annotation (<https://github.com/opencv/cvat/pull/1996>) - Issue loading openvino models for semi-automatic and automatic annotation (<https://github.com/opencv/cvat/pull/1996>)
- Basic functions of CVAT works without activated nuclio dashboard
### Security ### Security
- -

@ -1,6 +1,6 @@
{ {
"name": "cvat-ui", "name": "cvat-ui",
"version": "1.7.0", "version": "1.7.1",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

@ -1,6 +1,6 @@
{ {
"name": "cvat-ui", "name": "cvat-ui",
"version": "1.7.0", "version": "1.7.1",
"description": "CVAT single-page application", "description": "CVAT single-page application",
"main": "src/index.tsx", "main": "src/index.tsx",
"scripts": { "scripts": {

@ -9,7 +9,6 @@ import PluginChecker from 'utils/plugin-checker';
export enum PluginsActionTypes { export enum PluginsActionTypes {
CHECK_PLUGINS = 'CHECK_PLUGINS', CHECK_PLUGINS = 'CHECK_PLUGINS',
CHECKED_ALL_PLUGINS = 'CHECKED_ALL_PLUGINS', CHECKED_ALL_PLUGINS = 'CHECKED_ALL_PLUGINS',
RAISE_PLUGIN_CHECK_ERROR = 'RAISE_PLUGIN_CHECK_ERROR'
} }
type PluginObjects = Record<SupportedPlugins, boolean>; type PluginObjects = Record<SupportedPlugins, boolean>;
@ -21,11 +20,6 @@ const pluginActions = {
list, list,
}) })
), ),
raisePluginCheckError: (error: Error) => (
createAction(PluginsActionTypes.RAISE_PLUGIN_CHECK_ERROR, {
error,
})
),
}; };
export type PluginActions = ActionUnion<typeof pluginActions>; export type PluginActions = ActionUnion<typeof pluginActions>;
@ -40,18 +34,15 @@ export function checkPluginsAsync(): ThunkAction {
}; };
const promises: Promise<boolean>[] = [ const promises: Promise<boolean>[] = [
// check must return true/false with no exceptions
PluginChecker.check(SupportedPlugins.ANALYTICS), PluginChecker.check(SupportedPlugins.ANALYTICS),
PluginChecker.check(SupportedPlugins.GIT_INTEGRATION), PluginChecker.check(SupportedPlugins.GIT_INTEGRATION),
PluginChecker.check(SupportedPlugins.DEXTR_SEGMENTATION), PluginChecker.check(SupportedPlugins.DEXTR_SEGMENTATION),
]; ];
try { const values = await Promise.all(promises);
const values = await Promise.all(promises); [plugins.ANALYTICS, plugins.GIT_INTEGRATION,
[plugins.ANALYTICS, plugins.GIT_INTEGRATION, plugins.DEXTR_SEGMENTATION] = values;
plugins.DEXTR_SEGMENTATION] = values; dispatch(pluginActions.checkedAllPlugins(plugins));
dispatch(pluginActions.checkedAllPlugins(plugins));
} catch (error) {
dispatch(pluginActions.raisePluginCheckError(error));
}
}; };
} }

@ -34,6 +34,7 @@ interface CVATAppProps {
verifyAuthorized: () => void; verifyAuthorized: () => void;
loadUserAgreements: () => void; loadUserAgreements: () => void;
initPlugins: () => void; initPlugins: () => void;
initModels: () => void;
resetErrors: () => void; resetErrors: () => void;
resetMessages: () => void; resetMessages: () => void;
switchShortcutsDialog: () => void; switchShortcutsDialog: () => void;
@ -44,6 +45,8 @@ interface CVATAppProps {
userFetching: boolean; userFetching: boolean;
pluginsInitialized: boolean; pluginsInitialized: boolean;
pluginsFetching: boolean; pluginsFetching: boolean;
modelsInitialized: boolean;
modelsFetching: boolean;
formatsInitialized: boolean; formatsInitialized: boolean;
formatsFetching: boolean; formatsFetching: boolean;
usersInitialized: boolean; usersInitialized: boolean;
@ -88,6 +91,7 @@ class CVATApplication extends React.PureComponent<CVATAppProps & RouteComponentP
loadAbout, loadAbout,
loadUserAgreements, loadUserAgreements,
initPlugins, initPlugins,
initModels,
loadAuthActions, loadAuthActions,
userInitialized, userInitialized,
userFetching, userFetching,
@ -99,6 +103,8 @@ class CVATApplication extends React.PureComponent<CVATAppProps & RouteComponentP
aboutFetching, aboutFetching,
pluginsInitialized, pluginsInitialized,
pluginsFetching, pluginsFetching,
modelsInitialized,
modelsFetching,
user, user,
userAgreementsFetching, userAgreementsFetching,
userAgreementsInitialized, userAgreementsInitialized,
@ -139,6 +145,10 @@ class CVATApplication extends React.PureComponent<CVATAppProps & RouteComponentP
loadAbout(); loadAbout();
} }
if (!modelsInitialized && !modelsFetching) {
initModels();
}
if (!pluginsInitialized && !pluginsFetching) { if (!pluginsInitialized && !pluginsFetching) {
initPlugins(); initPlugins();
} }
@ -166,8 +176,8 @@ class CVATApplication extends React.PureComponent<CVATAppProps & RouteComponentP
let shown = false; let shown = false;
for (const where of Object.keys(notifications.messages)) { for (const where of Object.keys(notifications.messages)) {
for (const what of Object.keys(notifications.messages[where])) { for (const what of Object.keys((notifications as any).messages[where])) {
const message = notifications.messages[where][what]; const message = (notifications as any).messages[where][what];
shown = shown || !!message; shown = shown || !!message;
if (message) { if (message) {
showMessage(message); showMessage(message);
@ -207,8 +217,8 @@ class CVATApplication extends React.PureComponent<CVATAppProps & RouteComponentP
let shown = false; let shown = false;
for (const where of Object.keys(notifications.errors)) { for (const where of Object.keys(notifications.errors)) {
for (const what of Object.keys(notifications.errors[where])) { for (const what of Object.keys((notifications as any).errors[where])) {
const error = notifications.errors[where][what]; const error = (notifications as any).errors[where][what];
shown = shown || !!error; shown = shown || !!error;
if (error) { if (error) {
showError(error.message, error.reason); showError(error.message, error.reason);

@ -11,7 +11,6 @@ import Checkbox from 'antd/lib/checkbox';
import Tooltip from 'antd/lib/tooltip'; import Tooltip from 'antd/lib/tooltip';
import Modal from 'antd/lib/modal'; import Modal from 'antd/lib/modal';
import Tag from 'antd/lib/tag'; import Tag from 'antd/lib/tag';
import Spin from 'antd/lib/spin';
import notification from 'antd/lib/notification'; import notification from 'antd/lib/notification';
import Text from 'antd/lib/typography/Text'; import Text from 'antd/lib/typography/Text';
import InputNumber from 'antd/lib/input-number'; import InputNumber from 'antd/lib/input-number';
@ -22,13 +21,10 @@ import {
} from 'reducers/interfaces'; } from 'reducers/interfaces';
interface Props { interface Props {
modelsFetching: boolean;
modelsInitialized: boolean;
models: Model[]; models: Model[];
activeProcesses: StringObject; activeProcesses: StringObject;
visible: boolean; visible: boolean;
taskInstance: any; taskInstance: any;
getModels(): void;
closeDialog(): void; closeDialog(): void;
runInference( runInference(
taskInstance: any, taskInstance: any,
@ -93,21 +89,14 @@ export default class ModelRunnerModalComponent extends React.PureComponent<Props
public componentDidUpdate(prevProps: Props, prevState: State): void { public componentDidUpdate(prevProps: Props, prevState: State): void {
const { const {
taskInstance, taskInstance,
modelsInitialized,
modelsFetching,
models, models,
visible, visible,
getModels,
} = this.props; } = this.props;
const { const {
selectedModel, selectedModel,
} = this.state; } = this.state;
if (!modelsInitialized && !modelsFetching) {
getModels();
}
if (!prevProps.visible && visible) { if (!prevProps.visible && visible) {
this.setState({ this.setState({
selectedModel: null, selectedModel: null,
@ -428,7 +417,6 @@ export default class ModelRunnerModalComponent extends React.PureComponent<Props
models, models,
visible, visible,
taskInstance, taskInstance,
modelsInitialized,
runInference, runInference,
closeDialog, closeDialog,
} = this.props; } = this.props;
@ -466,9 +454,7 @@ export default class ModelRunnerModalComponent extends React.PureComponent<Props
title='Automatic annotation' title='Automatic annotation'
visible visible
> >
{!modelsInitialized { this.renderContent() }
&& <Spin size='large' className='cvat-spinner' />}
{modelsInitialized && this.renderContent()}
</Modal> </Modal>
) )
); );

@ -4,7 +4,6 @@
import './styles.scss'; import './styles.scss';
import React from 'react'; import React from 'react';
import Spin from 'antd/lib/spin';
import TopBarComponent from './top-bar'; import TopBarComponent from './top-bar';
import DeployedModelsList from './deployed-models-list'; import DeployedModelsList from './deployed-models-list';
@ -13,27 +12,11 @@ import FeedbackComponent from '../feedback/feedback';
import { Model } from '../../reducers/interfaces'; import { Model } from '../../reducers/interfaces';
interface Props { interface Props {
modelsInitialized: boolean;
modelsFetching: boolean;
deployedModels: Model[]; deployedModels: Model[];
getModels(): void;
} }
export default function ModelsPageComponent(props: Props): JSX.Element { export default function ModelsPageComponent(props: Props): JSX.Element {
const { const { deployedModels } = props;
modelsInitialized,
modelsFetching,
deployedModels,
} = props;
if (!modelsInitialized) {
if (!modelsFetching) {
props.getModels();
}
return (
<Spin size='large' className='cvat-spinner' />
);
}
return ( return (
<div className='cvat-models-page'> <div className='cvat-models-page'>

@ -5,20 +5,10 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import ModelRunnerModalComponent from 'components/model-runner-modal/model-runner-modal'; import ModelRunnerModalComponent from 'components/model-runner-modal/model-runner-modal';
import { import { Model, CombinedState } from 'reducers/interfaces';
Model, import { startInferenceAsync, modelsActions } from 'actions/models-actions';
CombinedState,
} from 'reducers/interfaces';
import {
getModelsAsync,
startInferenceAsync,
modelsActions,
} from 'actions/models-actions';
interface StateToProps { interface StateToProps {
modelsFetching: boolean;
modelsInitialized: boolean;
models: Model[]; models: Model[];
activeProcesses: { activeProcesses: {
[index: string]: string; [index: string]: string;
@ -33,7 +23,6 @@ interface DispatchToProps {
model: Model, model: Model,
body: object, body: object,
): void; ): void;
getModels(): void;
closeDialog(): void; closeDialog(): void;
} }
@ -41,8 +30,6 @@ function mapStateToProps(state: CombinedState): StateToProps {
const { models } = state; const { models } = state;
return { return {
modelsFetching: models.fetching,
modelsInitialized: models.initialized,
models: models.models, models: models.models,
activeProcesses: {}, activeProcesses: {},
taskInstance: models.activeRunTask, taskInstance: models.activeRunTask,
@ -59,9 +46,6 @@ function mapDispatchToProps(dispatch: any): DispatchToProps {
): void { ): void {
dispatch(startInferenceAsync(taskInstance, model, body)); dispatch(startInferenceAsync(taskInstance, model, body));
}, },
getModels(): void {
dispatch(getModelsAsync());
},
closeDialog(): void { closeDialog(): void {
dispatch(modelsActions.closeRunModelDialog()); dispatch(modelsActions.closeRunModelDialog());
}, },

@ -9,37 +9,19 @@ import {
Model, Model,
CombinedState, CombinedState,
} from 'reducers/interfaces'; } from 'reducers/interfaces';
import { getModelsAsync } from 'actions/models-actions';
interface StateToProps { interface StateToProps {
modelsInitialized: boolean;
modelsFetching: boolean;
deployedModels: Model[]; deployedModels: Model[];
} }
interface DispatchToProps {
getModels(): void;
}
function mapStateToProps(state: CombinedState): StateToProps { function mapStateToProps(state: CombinedState): StateToProps {
const { models } = state; const { models } = state;
return { return {
modelsInitialized: models.initialized,
modelsFetching: models.fetching,
deployedModels: models.models, deployedModels: models.models,
}; };
} }
function mapDispatchToProps(dispatch: any): DispatchToProps {
return {
getModels(): void {
dispatch(getModelsAsync());
},
};
}
export default connect( export default connect(
mapStateToProps, mapStateToProps, {},
mapDispatchToProps,
)(ModelsPageComponent); )(ModelsPageComponent);

@ -22,6 +22,7 @@ import { getFormatsAsync } from 'actions/formats-actions';
import { checkPluginsAsync } from 'actions/plugins-actions'; import { checkPluginsAsync } from 'actions/plugins-actions';
import { getUsersAsync } from 'actions/users-actions'; import { getUsersAsync } from 'actions/users-actions';
import { getAboutAsync } from 'actions/about-actions'; import { getAboutAsync } from 'actions/about-actions';
import { getModelsAsync } from 'actions/models-actions';
import { getUserAgreementsAsync } from 'actions/useragreements-actions'; import { getUserAgreementsAsync } from 'actions/useragreements-actions';
import { shortcutsActions } from 'actions/shortcuts-actions'; import { shortcutsActions } from 'actions/shortcuts-actions';
import { switchSettingsDialog } from 'actions/settings-actions'; import { switchSettingsDialog } from 'actions/settings-actions';
@ -30,7 +31,6 @@ import {
resetMessages, resetMessages,
} from './actions/notification-actions'; } from './actions/notification-actions';
import { import {
CombinedState, CombinedState,
NotificationsState, NotificationsState,
@ -42,6 +42,8 @@ const cvatStore = getCVATStore();
interface StateToProps { interface StateToProps {
pluginsInitialized: boolean; pluginsInitialized: boolean;
pluginsFetching: boolean; pluginsFetching: boolean;
modelsInitialized: boolean;
modelsFetching: boolean;
userInitialized: boolean; userInitialized: boolean;
userFetching: boolean; userFetching: boolean;
usersInitialized: boolean; usersInitialized: boolean;
@ -65,6 +67,7 @@ interface DispatchToProps {
verifyAuthorized: () => void; verifyAuthorized: () => void;
loadUsers: () => void; loadUsers: () => void;
loadAbout: () => void; loadAbout: () => void;
initModels: () => void;
initPlugins: () => void; initPlugins: () => void;
resetErrors: () => void; resetErrors: () => void;
resetMessages: () => void; resetMessages: () => void;
@ -82,12 +85,15 @@ function mapStateToProps(state: CombinedState): StateToProps {
const { about } = state; const { about } = state;
const { shortcuts } = state; const { shortcuts } = state;
const { userAgreements } = state; const { userAgreements } = state;
const { models } = state;
return { return {
userInitialized: auth.initialized, userInitialized: auth.initialized,
userFetching: auth.fetching, userFetching: auth.fetching,
pluginsInitialized: plugins.initialized, pluginsInitialized: plugins.initialized,
pluginsFetching: plugins.fetching, pluginsFetching: plugins.fetching,
modelsInitialized: models.initialized,
modelsFetching: models.fetching,
usersInitialized: users.initialized, usersInitialized: users.initialized,
usersFetching: users.fetching, usersFetching: users.fetching,
aboutInitialized: about.initialized, aboutInitialized: about.initialized,
@ -111,6 +117,7 @@ function mapDispatchToProps(dispatch: any): DispatchToProps {
verifyAuthorized: (): void => dispatch(authorizedAsync()), verifyAuthorized: (): void => dispatch(authorizedAsync()),
loadUserAgreements: (): void => dispatch(getUserAgreementsAsync()), loadUserAgreements: (): void => dispatch(getUserAgreementsAsync()),
initPlugins: (): void => dispatch(checkPluginsAsync()), initPlugins: (): void => dispatch(checkPluginsAsync()),
initModels: (): void => dispatch(getModelsAsync()),
loadUsers: (): void => dispatch(getUsersAsync()), loadUsers: (): void => dispatch(getUsersAsync()),
loadAbout: (): void => dispatch(getAboutAsync()), loadAbout: (): void => dispatch(getAboutAsync()),
resetErrors: (): void => dispatch(resetErrors()), resetErrors: (): void => dispatch(resetErrors()),

@ -241,9 +241,6 @@ export interface NotificationsState {
userAgreements: { userAgreements: {
fetching: null | ErrorState; fetching: null | ErrorState;
}; };
plugins: {
initializationError: null | ErrorState;
};
}; };
messages: { messages: {
tasks: { tasks: {

@ -15,7 +15,6 @@ import { AnnotationActionTypes } from 'actions/annotation-actions';
import { NotificationsActionType } from 'actions/notification-actions'; import { NotificationsActionType } from 'actions/notification-actions';
import { BoundariesActionTypes } from 'actions/boundaries-actions'; import { BoundariesActionTypes } from 'actions/boundaries-actions';
import { UserAgreementsActionTypes } from 'actions/useragreements-actions'; import { UserAgreementsActionTypes } from 'actions/useragreements-actions';
import { PluginsActionTypes } from 'actions/plugins-actions';
import { NotificationsState } from './interfaces'; import { NotificationsState } from './interfaces';
@ -88,9 +87,6 @@ const defaultState: NotificationsState = {
userAgreements: { userAgreements: {
fetching: null, fetching: null,
}, },
plugins: {
initializationError: null,
},
}, },
messages: { messages: {
tasks: { tasks: {
@ -857,21 +853,6 @@ export default function (state = defaultState, action: AnyAction): Notifications
}, },
}; };
} }
case PluginsActionTypes.RAISE_PLUGIN_CHECK_ERROR: {
return {
...state,
errors: {
...state.errors,
plugins: {
...state.errors.plugins,
initializationError: {
message: 'Could not initialize plugins state',
reason: action.payload.error.toString(),
},
},
},
};
}
case NotificationsActionType.RESET_ERRORS: { case NotificationsActionType.RESET_ERRORS: {
return { return {
...state, ...state,

@ -18,8 +18,12 @@ class PluginChecker {
return isReachable(`${serverHost}/git/repository/meta/get`, 'OPTIONS'); return isReachable(`${serverHost}/git/repository/meta/get`, 'OPTIONS');
} }
case SupportedPlugins.DEXTR_SEGMENTATION: { case SupportedPlugins.DEXTR_SEGMENTATION: {
const list = await core.lambda.list(); try {
return list.map((func: any): boolean => func.id).includes('openvino.dextr'); const list = await core.lambda.list();
return list.map((func: any): boolean => func.id).includes('openvino.dextr');
} catch (_) {
return false;
}
} }
case SupportedPlugins.ANALYTICS: { case SupportedPlugins.ANALYTICS: {
return isReachable(`${serverHost}/analytics/app/kibana`, 'GET'); return isReachable(`${serverHost}/analytics/app/kibana`, 'GET');

Loading…
Cancel
Save