示例#1
0
 public DetailsOutputModel(Preprocess preprocessing) : base(preprocessing)
 {
     if (preprocessing.RepositoryGitId != null)
     {
         GitModel = new GitCommitOutputModel()
         {
             GitId      = preprocessing.RepositoryGitId,
             Repository = preprocessing.RepositoryName,
             Owner      = preprocessing.RepositoryOwner,
             Branch     = preprocessing.RepositoryBranch,
             CommitId   = preprocessing.RepositoryCommitId
         };
     }
     if (!string.IsNullOrEmpty(preprocessing.ContainerImage) && !string.IsNullOrEmpty(preprocessing.ContainerTag))
     {
         ContainerImage = new ContainerImageOutputModel()
         {
             RegistryId   = preprocessing.ContainerRegistryId,
             RegistryName = preprocessing.ContainerRegistry.Name,
             Image        = preprocessing.ContainerImage,
             Tag          = preprocessing.ContainerTag
         };
     }
     EntryPoint = preprocessing.EntryPoint;
 }
示例#2
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="history">学習履歴</param>
        public DetailsOutputModel(TrainingHistory history) : base(history)
        {
            Key       = history.Key;
            Options   = new List <KeyValuePair <string, string> >();
            Ports     = new List <int>();
            NodePorts = new List <KeyValuePair <string, string> >();
            GitModel  = new GitCommitOutputModel()
            {
                GitId      = history.ModelGitId,
                Repository = history.ModelRepository,
                Owner      = history.ModelRepositoryOwner,
                Branch     = history.ModelBranch,
                CommitId   = history.ModelCommitId
            };
            ContainerImage = new ContainerImageOutputModel()
            {
                RegistryId   = history.ContainerRegistryId.Value,
                RegistryName = history.ContainerRegistry.Name,
                Image        = history.ContainerImage,
                Tag          = history.ContainerTag
            };
            CompletedAt = history.CompletedAt?.ToFormatedString();
            StartedAt   = history.StartedAt?.ToFormatedString();
            LogSummary  = history.LogSummary;

            if (history.ParentMaps != null && history.ParentMaps.Count > 0)
            {
                List <IndexOutputModel> parents = new List <IndexOutputModel>();
                foreach (TrainingHistoryParentMap parentMap in history.ParentMaps)
                {
                    parents.Add(new IndexOutputModel(parentMap.Parent));
                }
                Parents = parents;
            }

            Node = history.Node;

            EntryPoint = history.EntryPoint;

            Cpu       = history.Cpu;
            Memory    = history.Memory;
            Gpu       = history.Gpu;
            Partition = history.Partition;

            Zip          = history.Zip;
            LocalDataSet = history.LocalDataSet;

            foreach (var option in history.GetOptionDic())
            {
                Options.Add(new KeyValuePair <string, string>(option.Key, option.Value));
            }

            foreach (var port in history.GetPortList())
            {
                Ports.Add(port);
            }

            // 待機時間と実行時間の設定
            SetWaitingAndExecutionTimes(history);
        }
        public DetailsOutputModel(NotebookHistory history) : base(history)
        {
            Key = history.Key;
            if (history.DataSet != null) {
                DataSet = new DataSetApiModels.IndexOutputModel(history.DataSet);
            }
            Options = new List<KeyValuePair<string, string>>();
            GitModel = new GitCommitOutputModel()
            {
                GitId = history.ModelGitId,
                Repository = history.ModelRepository,
                Owner = history.ModelRepositoryOwner,
                Branch = history.ModelBranch,
                CommitId = history.ModelCommitId
            };
            ContainerImage = new ContainerImageOutputModel()
            {
                Image = history.ContainerImage,
                Tag = history.ContainerTag
            };
            if (history.ContainerRegistryId.HasValue)
            {
                ContainerImage.RegistryId = history.ContainerRegistryId.Value;
                ContainerImage.RegistryName = history.ContainerRegistry.Name;
            }

            CompletedAt = history.CompletedAt?.ToFormatedString();
            StartedAt = history.StartedAt?.ToFormatedString();
            Node = history.Node;

            Cpu = history.Cpu;
            Memory = history.Memory;
            Gpu = history.Gpu;
            Partition = history.Partition;

            ExpiresIn = history.ExpiresIn;

            foreach (var option in history.GetOptionDic())
            {
                Options.Add(new KeyValuePair<string, string>(option.Key, option.Value));
            }

            // 待機時間と実行時間の設定
            SetWaitingAndExecutionTimes(history);
        }
        public DetailsOutputModel(TrainingHistory history) : base(history)
        {
            Key      = history.Key;
            Options  = new List <KeyValuePair <string, string> >();
            GitModel = new GitCommitOutputModel()
            {
                GitId      = history.ModelGitId,
                Repository = history.ModelRepository,
                Owner      = history.ModelRepositoryOwner,
                Branch     = history.ModelBranch,
                CommitId   = history.ModelCommitId
            };
            ContainerImage = new ContainerImageOutputModel()
            {
                RegistryId   = history.ContainerRegistryId.Value,
                RegistryName = history.ContainerRegistry.Name,
                Image        = history.ContainerImage,
                Tag          = history.ContainerTag
            };
            CompletedAt = history.CompletedAt?.ToFormatedString();
            StartedAt   = history.StartedAt?.ToFormatedString();
            LogSummary  = history.LogSummary;
            Parent      = history.Parent == null ? null : new SimpleOutputModel(history.Parent);
            Node        = history.Node;

            EntryPoint = history.EntryPoint;

            Cpu       = history.Cpu;
            Memory    = history.Memory;
            Gpu       = history.Gpu;
            Partition = history.Partition;

            Zip = history.Zip;

            foreach (var option in history.GetOptionDic())
            {
                Options.Add(new KeyValuePair <string, string>(option.Key, option.Value));
            }

            // 待機時間と実行時間の設定
            setWaitingAndExecutionTimes(history);
        }
示例#5
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="history">ノートブック履歴</param>
        public DetailsOutputModel(NotebookHistory history) : base(history)
        {
            Key = history.Key;
            if (history.DataSet != null)
            {
                DataSet = new DataSetApiModels.IndexOutputModel(history.DataSet);
            }

            if (history.ParentTrainingMaps != null)
            {
                Parents = new List <TrainingApiModels.IndexOutputModel>();
                foreach (var parentTrainingMaps in history.ParentTrainingMaps)
                {
                    var parent = new TrainingApiModels.IndexOutputModel(parentTrainingMaps.Parent);
                    Parents.Add(parent);
                }
                Parents.Sort(delegate(TrainingApiModels.IndexOutputModel parent1, TrainingApiModels.IndexOutputModel parent2)
                {
                    return(parent1.Id.CompareTo(parent2.Id));
                });
            }

            if (history.ParentInferenceMaps != null)
            {
                Inferences = new List <InferenceApiModels.InferenceIndexOutputModel>();
                foreach (var parentInferenceMap in history.ParentInferenceMaps)
                {
                    var parentInference = new InferenceApiModels.InferenceIndexOutputModel(parentInferenceMap.Parent);
                    Inferences.Add(parentInference);
                }
                Inferences.Sort(delegate(InferenceApiModels.InferenceIndexOutputModel parentInference1, InferenceApiModels.InferenceIndexOutputModel parentInference2)
                {
                    return(parentInference1.Id.CompareTo(parentInference2.Id));
                });
            }

            Options  = new List <KeyValuePair <string, string> >();
            GitModel = new GitCommitOutputModel()
            {
                GitId      = history.ModelGitId,
                Repository = history.ModelRepository,
                Owner      = history.ModelRepositoryOwner,
                Branch     = history.ModelBranch,
                CommitId   = history.ModelCommitId
            };
            ContainerImage = new ContainerImageOutputModel()
            {
                Image = history.ContainerImage,
                Tag   = history.ContainerTag
            };
            if (history.ContainerRegistryId.HasValue)
            {
                ContainerImage.RegistryId   = history.ContainerRegistryId.Value;
                ContainerImage.RegistryName = history.ContainerRegistry.Name;
            }

            CompletedAt = history.CompletedAt?.ToFormatedString();
            StartedAt   = history.StartedAt?.ToFormatedString();
            Node        = history.Node;

            Cpu       = history.Cpu;
            Memory    = history.Memory;
            Gpu       = history.Gpu;
            Partition = history.Partition;

            JupyterLabVersion = history.JupyterLabVersion;

            ExpiresIn    = history.ExpiresIn;
            LocalDataSet = history.LocalDataSet;

            foreach (var option in history.GetOptionDic())
            {
                Options.Add(new KeyValuePair <string, string>(option.Key, option.Value));
            }

            // 待機時間と実行時間の設定
            SetWaitingAndExecutionTimes(history);

            EntryPoint = history.EntryPoint;
        }