Exemplo n.º 1
0
        /// <summary>
        /// ステータスを更新して、出力モデルに変換する
        /// </summary>
        private async Task <InferenceIndexOutputModel> GetUpdatedIndexOutputModelAsync(InferenceHistory history)
        {
            var model = new InferenceIndexOutputModel(history);

            var status = history.GetStatus();

            if (status.Exist())
            {
                //推論がまだ進行中の場合、情報を更新する
                var newStatus = await clusterManagementLogic.GetContainerStatusAsync(history.Key, CurrentUserInfo.SelectedTenant.Name, false);

                if (status.Key != newStatus.Key)
                {
                    //更新があったので、変更処理
                    await inferenceHistoryRepository.UpdateStatusAsync(history.Id, newStatus, false);

                    unitOfWork.Commit();

                    model.Status = newStatus.Name;
                }
            }

            // storageへの出力値があれば取得し、modelに格納
            var outputFileName = "value.txt";   //値を読み込むファイル名
            var outputPath     = history.Id + "/" + outputFileName;
            var content        = await storageLogic.GetFileContentAsync(ResourceType.InferenceContainerOutputFiles, outputPath, outputFileName, true);

            if (content != null)
            {
                model.OutputValue = content;
            }
            return(model);
        }
Exemplo n.º 2
0
        /// <summary>
        /// ステータスを更新して、出力モデルに変換する
        /// </summary>
        /// <param name="history">ノートブック履歴</param>
        private async Task <IndexOutputModel> GetUpdatedIndexOutputModelAsync(NotebookHistory history)
        {
            var model = new IndexOutputModel(history);

            var status = history.GetStatus();

            if (status.Exist())
            {
                //ノートブックコンテナがまだ進行中の場合、情報を更新する
                var newStatus = await clusterManagementLogic.GetContainerStatusAsync(history.Key, CurrentUserInfo.SelectedTenant.Name, false);

                if (status.Key != newStatus.Key)
                {
                    //更新があったので、変更処理
                    await notebookHistoryRepository.UpdateStatusAsync(history.Id, newStatus, false);

                    unitOfWork.Commit();

                    model.Status = newStatus.Name;
                }
            }
            return(model);
        }
Exemplo n.º 3
0
        /// <summary>
        /// ステータスを更新して、出力モデルに変換する
        /// </summary>
        /// <param name="history">前処理履歴</param>
        /// <param name="model">出力モデル</param>
        private async Task <HistoriesOutputModel> GetUpdatedIndexOutputModelAsync(PreprocessHistory history, HistoriesOutputModel model)
        {
            var status = ContainerStatus.Convert(history.Status);

            model.StatusType = status.StatusType;
            if (status.Exist())
            {
                // コンテナがまだ存在している場合、情報を更新する
                var newStatus = await clusterManagementLogic.GetContainerStatusAsync(history.Name, CurrentUserInfo.SelectedTenant.Name, false);

                if (status.Key != newStatus.Key)
                {
                    // 更新があったので、変更処理
                    history.Status = newStatus.Key;
                    unitOfWork.Commit();

                    model.Status     = newStatus.Name;
                    model.StatusType = newStatus.StatusType;
                }
            }
            return(model);
        }
Exemplo n.º 4
0
        public static async Task <ContainerStatus> DoGetUpdatedIndexOutputModelAsync(TrainingHistory history,
                                                                                     IClusterManagementLogic clusterManagementLogic, UserInfo currentUserInfo, ITrainingHistoryRepository trainingHistoryRepository,
                                                                                     IUnitOfWork unitOfWork)
        {
            var status = history.GetStatus();

            if (status.Exist())
            {
                //学習がまだ進行中の場合、情報を更新する
                var newStatus = await clusterManagementLogic.GetContainerStatusAsync(history.Key, currentUserInfo.SelectedTenant.Name, false);

                if (status.Key != newStatus.Key)
                {
                    //更新があったので、変更処理
                    await trainingHistoryRepository.UpdateStatusAsync(history.Id, newStatus, false);

                    unitOfWork.Commit();
                    return(newStatus);
                }
            }
            return(status);
        }