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
- 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
-

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

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

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

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

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

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

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

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

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

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

@ -15,7 +15,6 @@ import { AnnotationActionTypes } from 'actions/annotation-actions';
import { NotificationsActionType } from 'actions/notification-actions';
import { BoundariesActionTypes } from 'actions/boundaries-actions';
import { UserAgreementsActionTypes } from 'actions/useragreements-actions';
import { PluginsActionTypes } from 'actions/plugins-actions';
import { NotificationsState } from './interfaces';
@ -88,9 +87,6 @@ const defaultState: NotificationsState = {
userAgreements: {
fetching: null,
},
plugins: {
initializationError: null,
},
},
messages: {
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: {
return {
...state,

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

Loading…
Cancel
Save