├── .dockerignore ├── .editorconfig ├── .github ├── .gitversion.yml ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── dependabot.yml ├── pull_request_template.md └── workflows │ ├── build.yml │ ├── codeql.yml │ ├── license-scanning.yml │ ├── nightly.yml │ ├── security.yml │ └── test.yml ├── .gitignore ├── .grype.yaml ├── .licenserc.yaml ├── .trivyignore ├── .vscode ├── launch.json └── tasks.json ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── CallbackApp.Dockerfile ├── GitReleaseManager.yaml ├── LICENSE ├── NuGetDefense.json ├── README.md ├── StyleCop.Analyzers.ruleset ├── TaskManager.Dockerfile ├── WorkflowManager.Dockerfile ├── codecov.yml ├── deploy ├── docker-compose │ └── docker-compose.yml └── helm │ ├── .helmignore │ ├── Chart.yaml │ ├── Gateway-local.yaml │ ├── Gateway.yaml │ ├── MTM.yaml │ ├── MWM.yaml │ ├── argo.yaml │ ├── minio-local.yaml │ ├── minio-serviceOnly.yaml │ ├── minio.yaml │ ├── mongo-local.yaml │ ├── mongo-serviceOnly.yaml │ ├── mongo.yaml │ ├── rabbitmq-local.yaml │ ├── rabbitmq.yaml │ └── templates │ ├── NOTES.txt │ ├── _helpers.tpl │ ├── clusterRole.yaml │ ├── clusterRoleBinding.yaml │ ├── deployment.yaml │ ├── hpa.yaml │ ├── ingress.yaml │ ├── role.yaml │ ├── roleBinding.yaml │ ├── service.yaml │ ├── serviceaccount.yaml │ ├── tests │ └── test-connection.yaml │ ├── volume.yml │ └── volumeclaim.yml ├── doc └── dependency_decisions.yml ├── docs ├── .gitignore ├── api │ ├── rest │ │ ├── task-manager │ │ │ ├── argo-template.md │ │ │ └── health.md │ │ ├── toc.yml │ │ └── workflow-manager │ │ │ ├── health.md │ │ │ ├── payload.md │ │ │ ├── task.md │ │ │ ├── workflow-instance.md │ │ │ └── workflow.md │ └── toc.yml ├── changelog.md ├── compliance │ ├── third-party-licenses.md │ └── toc.yml ├── docfx.json ├── filterConfig.yml ├── images │ ├── MONAI-logo_color.svg │ ├── favicon.ico │ └── workflow_examples │ │ ├── scenario1.json │ │ └── scenario1.png ├── index.md ├── setup │ ├── schema.md │ ├── setup.md │ └── toc.md ├── templates │ └── material │ │ ├── partials │ │ └── head.tmpl.partial │ │ └── styles │ │ └── main.css └── toc.yml ├── global.json ├── guidelines ├── mwm-auth.md ├── mwm-conditionals.md ├── mwm-developer-setup.md ├── mwm-input.md ├── mwm-sadd.md ├── mwm-srs.md ├── mwm-storage.md ├── mwm-workflow-spec.md └── static │ ├── VS-startup.png │ ├── keycloak-dev-example1.png │ ├── mwm-detailed.png │ ├── mwm-payload-listener.png │ ├── mwm-upload.png │ ├── mwm-workflows-delete.png │ ├── mwm-workflows-list.png │ ├── mwm-workflows-register.png │ ├── mwm-workflows-update.png │ ├── mwm.png │ ├── store-arch.png │ └── workflow_examples │ ├── scenario1copy.json │ └── scenario2.yml ├── src ├── .sonarlint │ ├── Monai.Deploy.WorkflowManager.slconfig │ ├── project-monai_monai-deploy-workflow-manager │ │ └── CSharp │ │ │ └── SonarLint.xml │ ├── project-monai_monai-deploy-workflow-managercsharp.ruleset │ └── sonar.settings.json ├── AssemblyInfo.cs ├── Common │ ├── Configuration │ │ ├── ArgoCallbackConfiguration.cs │ │ ├── ArgoParameters.cs │ │ ├── BackgroundServiceSettings.cs │ │ ├── ConfigurationValidator.cs │ │ ├── DicomAgentConfiguration.cs │ │ ├── Exceptions │ │ │ └── ConfigurationException.cs │ │ ├── InformaticsGatewayConfiguration.cs │ │ ├── MessageBrokerConfiguration.cs │ │ ├── MessageBrokerConfigurationKeys.cs │ │ ├── Monai.Deploy.WorkflowManager.Common.Configuration.csproj │ │ ├── PagedOptions.cs │ │ ├── PaginationSettings.cs │ │ ├── RetryConfiguration.cs │ │ ├── StorageConfiguration.cs │ │ ├── TaskManagerConfiguration.cs │ │ ├── WorkflowManagerOptions.cs │ │ └── packages.lock.json │ └── Miscellaneous │ │ ├── ApiControllerBase.cs │ │ ├── Filter │ │ ├── PaginationFilter.cs │ │ └── TimeFilter.cs │ │ ├── HttpLoggingExtensions.cs │ │ ├── IMonaiService.cs │ │ ├── IMonaiServiceLocator.cs │ │ ├── LoggingDataDictionary.cs │ │ ├── Monai.Deploy.WorkflowManager.Common.Miscellaneous.csproj │ │ ├── MonaiHealthCheck.cs │ │ ├── MonaiServiceLocator.cs │ │ ├── PatientKeys.cs │ │ ├── PlugInAttribute.cs │ │ ├── ServiceStatus.cs │ │ ├── Services │ │ ├── IUriService.cs │ │ └── UriService.cs │ │ ├── Utilities │ │ └── DicomTagUtilities.cs │ │ ├── ValidationConstants.cs │ │ ├── Wrappers │ │ ├── PagedResponse.cs │ │ ├── Response.cs │ │ └── StatsPagedResponse.cs │ │ └── packages.lock.json ├── Monai.Deploy.WorkflowManager.sln ├── Monai.Deploy.WorkflowManager.sln.DotSettings ├── TaskManager │ ├── API │ │ ├── ExecutionStatus.cs │ │ ├── Extensions │ │ │ ├── TaskDispatchEventExtension.cs │ │ │ └── TypeExtensions.cs │ │ ├── IMetadataRepository.cs │ │ ├── ITaskDispatchEventService.cs │ │ ├── ITaskPlugin.cs │ │ ├── InvalidTaskException.cs │ │ ├── MetadataRepositoryBase.cs │ │ ├── Migrations │ │ │ ├── DocumentVersionConvert.cs │ │ │ └── M001_TaskDispatchEventInfo_addVerion.cs │ │ ├── Models │ │ │ └── TaskDispatchEventInfo.cs │ │ ├── Monai.Deploy.WorkflowManager.TaskManager.API.csproj │ │ ├── ServiceNotFoundException.cs │ │ ├── TaskPluginBase.cs │ │ └── packages.lock.json │ ├── CallbackApp │ │ ├── .gitignore │ │ ├── app.py │ │ └── requirements.txt │ ├── Database │ │ ├── ITaskDispatchEventRepository.cs │ │ ├── Logging │ │ │ └── Log.1000.Database.cs │ │ ├── Monai.Deploy.WorkflowManager.TaskManager.Database.csproj │ │ ├── Options │ │ │ └── TaskManagerDatabaseSettings.cs │ │ ├── TaskDispatchEventRepository.cs │ │ └── packages.lock.json │ ├── Plug-ins │ │ ├── AideClinicalReview │ │ │ ├── AideClinicalReviewPlugin.cs │ │ │ ├── Events │ │ │ │ └── ClinicalReviewRequestEvent.cs │ │ │ ├── Keys.cs │ │ │ ├── Logging │ │ │ │ └── Log.cs │ │ │ ├── Models │ │ │ │ └── PatientMetadata.cs │ │ │ ├── Monai.Deploy.WorkflowManager.TaskManager.AideClinicalReview.csproj │ │ │ ├── Repositories │ │ │ │ └── AideClinicalReviewMetadataRepository.cs │ │ │ ├── Strings.cs │ │ │ └── packages.lock.json │ │ ├── Argo │ │ │ ├── ArgoClient.cs │ │ │ ├── ArgoPlugin.cs │ │ │ ├── ArgoProvider.cs │ │ │ ├── AssemblyInfo.cs │ │ │ ├── Controllers │ │ │ │ └── TemplateController.cs │ │ │ ├── Exceptions │ │ │ │ ├── ArgoWorkflowNotFoundException.cs │ │ │ │ ├── ArtifactMappingNotFoundException.cs │ │ │ │ └── TemplateNotFoundException.cs │ │ │ ├── ExitHookTemplate.cs │ │ │ ├── IArgoClient.cs │ │ │ ├── IArgoProvider.cs │ │ │ ├── IKubernetesProvider.cs │ │ │ ├── KubernetesProvider.cs │ │ │ ├── Logging │ │ │ │ └── Log.cs │ │ │ ├── Monai.Deploy.WorkflowManager.TaskManager.Argo.csproj │ │ │ ├── Repositories │ │ │ │ └── ArgoMetadataRepository.cs │ │ │ ├── Specs │ │ │ │ ├── Argo.nswag │ │ │ │ ├── ArgoGeneratedCode.cs │ │ │ │ └── ArgoWorkflowsAPI.json │ │ │ ├── Strings.cs │ │ │ └── packages.lock.json │ │ ├── Docker │ │ │ ├── AssemblyInfo.cs │ │ │ ├── ContainerMonitorException.cs │ │ │ ├── ContainerStatusMonitor.cs │ │ │ ├── ContainerVolumeMount.cs │ │ │ ├── DockerPlugin.cs │ │ │ ├── IDockerClientFactory.cs │ │ │ ├── Keys.cs │ │ │ ├── Logging │ │ │ │ └── Log.cs │ │ │ ├── Monai.Deploy.WorkflowManager.TaskManager.Docker.csproj │ │ │ ├── SetPermissionException.cs │ │ │ └── Strings.cs │ │ ├── Email │ │ │ ├── EmailPlugin.cs │ │ │ ├── Log.cs │ │ │ └── Monai.Deploy.WorkflowManager.TaskManager.Email.csproj │ │ └── TestPlugin │ │ │ ├── Keys.cs │ │ │ ├── Monai.Deploy.WorkflowManager.TaskManager.TestPlugin.csproj │ │ │ ├── Repositories │ │ │ └── TestPluginRepository.cs │ │ │ └── TestPlugin.cs │ └── TaskManager │ │ ├── ApplicationPartsLogger.cs │ │ ├── AssemblyInfo.cs │ │ ├── Extensions │ │ └── TaskManagerExtensions.cs │ │ ├── GlobalSuppressions.cs │ │ ├── Logging │ │ └── Log.cs │ │ ├── Monai.Deploy.WorkflowManager.TaskManager.csproj │ │ ├── PluginStrings.cs │ │ ├── Program.cs │ │ ├── Services │ │ ├── Http │ │ │ └── Startup.cs │ │ └── TaskDispatchEventService.cs │ │ ├── Strings.cs │ │ ├── TaskManager.cs │ │ ├── TaskManagerException.cs │ │ ├── appsettings.Development.json │ │ ├── appsettings.Local.json │ │ ├── appsettings.json │ │ ├── nlog.config │ │ ├── packages.lock.json │ │ └── stylecop.json ├── WorkflowManager │ ├── Common │ │ ├── Exceptions │ │ │ ├── BadRequestException.cs │ │ │ ├── InternalServerException.cs │ │ │ └── NotFoundException.cs │ │ ├── Extensions │ │ │ ├── ArrayExtensions.cs │ │ │ ├── CollectionExtensions.cs │ │ │ ├── FileExtensions.cs │ │ │ └── StorageListExtensions.cs │ │ ├── Interfaces │ │ │ ├── IPaginatedApi.cs │ │ │ ├── IPayloadService.cs │ │ │ ├── ITasksService.cs │ │ │ ├── IWorkflowInstanceService.cs │ │ │ └── IWorkflowService.cs │ │ ├── Monai.Deploy.WorkflowManager.Common.csproj │ │ └── Services │ │ │ ├── PayloadService.cs │ │ │ ├── TasksService.cs │ │ │ ├── WorkflowInstanceService.cs │ │ │ └── WorkflowService.cs │ ├── ConditionsResolver │ │ ├── Constants │ │ │ └── ParameterConstants.cs │ │ ├── Extensions │ │ │ ├── RegexExtensions.cs │ │ │ └── StringExtensions.cs │ │ ├── Monai.Deploy.WorkflowManager.ConditionsResolver.csproj │ │ ├── Parser │ │ │ ├── ConditionalParameterParser.cs │ │ │ └── IConditionalParameterParser.cs │ │ └── Resovler │ │ │ ├── Conditional.cs │ │ │ ├── ConditionalGroup.cs │ │ │ └── Keyword.cs │ ├── Contracts │ │ ├── Constants │ │ │ └── TaskTypeConstants.cs │ │ ├── Migrations │ │ │ ├── DocumentVersionConvert.cs │ │ │ ├── M001_ExecutionStats_addVersion.cs │ │ │ ├── M001_Payload_addVerion.cs │ │ │ ├── M001_WorkflowInstance_addVerion.cs │ │ │ ├── M002_ExecutionStats_addWorkflowId.cs │ │ │ ├── M002_Payload_addPayloadDeleted.cs │ │ │ ├── M002_WorkflowRevision_addVerion.cs │ │ │ ├── M003_ExecutionStats_addFailureReason.cs │ │ │ ├── M003_Payload_addDataTrigger.cs │ │ │ ├── M003_WorkflowRevision_addDataRetension.cs │ │ │ ├── M004_Payload_expires.cs │ │ │ ├── M004_WorkflowRevision_addConditions.cs │ │ │ ├── M005_Payload_seriesUid.cs │ │ │ ├── M006_Payload_triggeredWorkflows.cs │ │ │ └── M007_Payload_addAccessionId.cs │ │ ├── Models │ │ │ ├── ApplicationReviewStatus.cs │ │ │ ├── Artifact.cs │ │ │ ├── ArtifactMap.cs │ │ │ ├── DicomValue.cs │ │ │ ├── ExecutionStatDTO.cs │ │ │ ├── ExecutionStatDayOverview.cs │ │ │ ├── ExecutionStats.cs │ │ │ ├── ExportDestination.cs │ │ │ ├── ISoftDeleteable.cs │ │ │ ├── InformaticsGateway.cs │ │ │ ├── PatientDetails.cs │ │ │ ├── Payload.cs │ │ │ ├── PayloadDto.cs │ │ │ ├── Status.cs │ │ │ ├── TaskDestination.cs │ │ │ ├── TaskExecution.cs │ │ │ ├── TaskObject.cs │ │ │ ├── Workflow.cs │ │ │ ├── WorkflowInstance.cs │ │ │ ├── WorkflowRevision.cs │ │ │ └── WorkflowUpdateRequest.cs │ │ ├── Monai.Deploy.WorkflowManager.Contracts.csproj │ │ └── Responses │ │ │ └── CreateWorkflowResponse.cs │ ├── Database │ │ ├── Interfaces │ │ │ ├── IArtifactsRepository.cs │ │ │ ├── IPayloadRepository.cs │ │ │ ├── ITaskExecutionStatsRepository.cs │ │ │ ├── ITasksRepository.cs │ │ │ ├── IWorkflowInstanceRepository.cs │ │ │ └── IWorkflowRepository.cs │ │ ├── Monai.Deploy.WorkflowManager.Database.csproj │ │ ├── Options │ │ │ ├── ExecutionStatsDatabaseSettings.cs │ │ │ └── WorkloadManagerDatabaseSettings.cs │ │ ├── Repositories │ │ │ ├── ArtifactsRepository.cs │ │ │ ├── PayloadRepository.cs │ │ │ ├── RepositoryBase.cs │ │ │ ├── TaskExecutionStatsRepository.cs │ │ │ ├── TasksRepository.cs │ │ │ ├── WorkflowInstanceRepository.cs │ │ │ └── WorkflowRepository.cs │ │ └── packages.lock.json │ ├── Logging │ │ ├── Log.100000.Http.cs │ │ ├── Log.200000.Workflow.cs │ │ ├── Log.300000.Payload.cs │ │ ├── Log.500000.Messaging.cs │ │ ├── Log.600000.Dicom.cs │ │ ├── Log.700000.Artifact.cs │ │ ├── Log.800000.Database.cs │ │ ├── Log.900000.General.cs │ │ ├── Monai.Deploy.WorkflowManager.Logging.csproj │ │ └── packages.lock.json │ ├── MonaiBackgroundService │ │ ├── Logging │ │ │ └── Log.400000.cs │ │ ├── Monai.Deploy.WorkflowManager.MonaiBackgroundService.csproj │ │ └── Worker.cs │ ├── PayloadListener │ │ ├── Extensions │ │ │ └── ValidationExtensions.cs │ │ ├── Monai.Deploy.WorkflowManager.PayloadListener.csproj │ │ ├── Services │ │ │ ├── EventPayloadRecieverService.cs │ │ │ ├── IEventPayloadRecieverService.cs │ │ │ └── PayloadListenerService.cs │ │ ├── Validators │ │ │ ├── EventPayloadValidator.cs │ │ │ └── IEventPayloadValidator.cs │ │ └── packages.lock.json │ ├── Services │ │ ├── InformaticsGateway │ │ │ ├── IInformaticsGatewayService.cs │ │ │ └── InformaticsGatewayService.cs │ │ ├── Monai.Deploy.WorkflowManager.Services.csproj │ │ └── packages.lock.json │ ├── Storage │ │ ├── Constants │ │ │ └── DicomTagConstants.cs │ │ ├── Monai.Deploy.WorkflowManager.Storage.csproj │ │ ├── Services │ │ │ ├── DicomService.cs │ │ │ └── IDicomService.cs │ │ └── packages.lock.json │ ├── WorkflowExecuter │ │ ├── Common │ │ │ ├── ArtifactMapper.cs │ │ │ ├── EventMapper.cs │ │ │ ├── IArtifactMapper.cs │ │ │ └── TaskExecutionStatusExtensions.cs │ │ ├── Extensions │ │ │ └── TaskExecutionExtension.cs │ │ ├── Monai.Deploy.WorkloadManager.WorkflowExecuter.csproj │ │ ├── Services │ │ │ ├── IWorkflowExecuterService.cs │ │ │ └── WorkflowExecuterService.cs │ │ └── packages.lock.json │ └── WorkflowManager │ │ ├── AssemblyInfo.cs │ │ ├── Controllers │ │ ├── ArtifactsController.cs │ │ ├── AuthenticatedApiControllerBase.cs │ │ ├── PaginationApiControllerBase.cs │ │ ├── PayloadsController.cs │ │ ├── TaskStatsController.cs │ │ ├── TasksController.cs │ │ ├── WorkflowInstanceController.cs │ │ └── WorkflowsController.cs │ │ ├── Extentions │ │ └── WorkflowExecutorExtensions.cs │ │ ├── GlobalSuppressions.cs │ │ ├── Models │ │ └── TasksRequest.cs │ │ ├── Monai.Deploy.WorkflowManager.csproj │ │ ├── Program.cs │ │ ├── Services │ │ ├── DataRetentionService │ │ │ └── DataRetentionService.cs │ │ └── Http │ │ │ └── Startup.cs │ │ ├── Validators │ │ └── WorkflowValidator.cs │ │ ├── appsettings.Development.json │ │ ├── appsettings.Local.json │ │ ├── appsettings.json │ │ ├── nlog.config │ │ ├── packages.lock.json │ │ └── stylecop.json └── global.json ├── stylecop.json └── tests ├── IntegrationTests ├── README.md ├── TaskManager.IntegrationTests │ ├── DICOMs │ │ └── dcm │ │ │ ├── series1 │ │ │ ├── 07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm │ │ │ └── 07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm.json │ │ │ └── series2 │ │ │ ├── 07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm │ │ │ └── 07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm.json │ ├── Features │ │ ├── ClinicalReview.feature │ │ ├── EmialNotification.feature │ │ ├── ExecutionStats.feature │ │ ├── HealthApi.feature │ │ ├── TaskUpdate.feature │ │ └── __snapshots__ │ │ │ ├── ExecutionStatsFeature.ExecutionStatsAreNotReturnedIfWorkflowOrTaskIsNotFound_Workflow_1_Task_3_.snap │ │ │ ├── ExecutionStatsFeature.ExecutionStatsAreNotReturnedIfWorkflowOrTaskIsNotFound_Workflow_2_Task_1_.snap │ │ │ ├── ExecutionStatsFeature.ExecutionStatsForATaskAreReturned_Workflow_1_Task_2_.snap │ │ │ ├── ExecutionStatsFeature.ExecutionStatsForATaskAreReturned_workflow_1_task_1_.snap │ │ │ ├── ExecutionStatsFeature.SummaryOfExecutionStatsAreReturned_-31_.snap │ │ │ ├── ExecutionStatsFeature.SummaryOfExecutionStatsAreReturned_-61_.snap │ │ │ └── HealthApiFeature.GetHealthStatusOfTaskManager.snap │ ├── Hooks.cs │ ├── ImplicitUsings.cs │ ├── Monai.Deploy.WorkflowManager.TaskManager.IntegrationTests.csproj │ ├── POCO │ │ ├── HealthCheckResponse.cs │ │ └── TestExecutionConfig.cs │ ├── README.md │ ├── StepDefinitions │ │ ├── ClinicalReviewStepDefinitions.cs │ │ ├── CommonApiDefinitions.cs │ │ ├── CommonStepDefinitions.cs │ │ ├── EmailStepDefinitions.cs │ │ └── TaskUpdateStepDefinitions.cs │ ├── Support │ │ ├── ApiHelper.cs │ │ ├── Assertions.cs │ │ ├── DataHelper.cs │ │ ├── HttpRequestMessageExtensions.cs │ │ ├── MinioClientUtil.cs │ │ ├── MongoClientUtil.cs │ │ ├── RabbitConnectionFactory.cs │ │ ├── RabbitConsumer.cs │ │ ├── RabbitPublisher.cs │ │ └── WebAppFactory.cs │ ├── TestData │ │ ├── Helper.cs │ │ ├── TaskCallbackTestData.cs │ │ └── TaskDispatchTestData.cs │ ├── appsettings.Test.json │ └── nginx.conf ├── WorkflowExecutor.IntegrationTests │ ├── DICOMs │ │ ├── full_patient_metadata │ │ │ └── dcm │ │ │ │ ├── 07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm │ │ │ │ └── 07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm.json │ │ ├── no_patient_metadata │ │ │ └── dcm │ │ │ │ └── 07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm │ │ ├── null_patient_metadata │ │ │ └── dcm │ │ │ │ ├── 07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm │ │ │ │ └── 07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm.json │ │ ├── output_metadata │ │ │ └── dcm │ │ │ │ └── output.dcm │ │ ├── output_metadata_multiple_files │ │ │ └── dcm │ │ │ │ ├── output1.dcm │ │ │ │ ├── output2.dcm │ │ │ │ ├── output3.DCM │ │ │ │ ├── output3.json │ │ │ │ └── output4 │ │ ├── partial_patient_metadata │ │ │ └── dcm │ │ │ │ ├── 07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm │ │ │ │ └── 07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm.json │ │ └── patient_1_lordge │ │ │ └── dcm │ │ │ ├── 07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm │ │ │ └── 07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm.json │ ├── Features │ │ ├── ArtifactReceivedEvent.feature │ │ ├── HealthApi.feature │ │ ├── PayloadApi.feature │ │ ├── PayloadCollection.feature │ │ ├── RouterTasks.feature │ │ ├── TaskDestinations.feature │ │ ├── TaskStatusUpdate.feature │ │ ├── TasksApi.feature │ │ ├── WorkflowApi.feature │ │ ├── WorkflowInstancesApi.feature │ │ ├── WorkflowRequest.feature │ │ └── WorkflowTaskArtifacts.feature │ ├── Hooks.cs │ ├── ImplicitUsings.cs │ ├── Models │ │ ├── InformaticsGateway │ │ │ └── WorkflowRequestMessage.cs │ │ └── Storage │ │ │ └── VirtuaFileInfo.cs │ ├── Monai.Deploy.WorkflowManager.WorkflowExecutor.IntegrationTests.csproj │ ├── POCO │ │ ├── HealthCheckResponse.cs │ │ └── TestExecutionConfig.cs │ ├── README.md │ ├── StepDefinitions │ │ ├── ArtifactReceivedEventStepDefinitions.cs │ │ ├── CommonApiStepDefinitions.cs │ │ ├── ExecutionStatsStepDefinitions.cs │ │ ├── PayloadApiStepDefinitions.cs │ │ ├── PayloadCollectionStepDefinitions.cs │ │ ├── TaskDestinationsStepDefinitions.cs │ │ ├── TaskStatusUpdateStepDefinitions.cs │ │ ├── TasksApiStepDefinitions.cs │ │ ├── WorkflowApiStepDefinitions.cs │ │ ├── WorkflowInstanceStepDefintions.cs │ │ ├── WorkflowInstancesApiStepDefinitions.cs │ │ ├── WorkflowRequestStepDefinitions.cs │ │ └── WorkflowTaskArtifactStepDefinitions.cs │ ├── Support │ │ ├── ApiHelper.cs │ │ ├── Assertions.cs │ │ ├── DataHelper.cs │ │ ├── HttpRequestMessageExtensions.cs │ │ ├── JsonFormatter.cs │ │ ├── MessageReceiver.cs │ │ ├── MinioClientUtil.cs │ │ ├── MinioDataSeeding.cs │ │ ├── MongoClientUtil.cs │ │ ├── RabbitConnectionFactory.cs │ │ ├── RabbitConsumer.cs │ │ ├── RabbitPublisher.cs │ │ └── WorkflowExecutorStartup.cs │ ├── TestData │ │ ├── ExecutionStatsTestData.cs │ │ ├── ExportCompleteTestData.cs │ │ ├── Helper.cs │ │ ├── PatientTestData.cs │ │ ├── PayloadTestData.cs │ │ ├── TaskRequestTestData.cs │ │ ├── TaskUpdateTestData.cs │ │ ├── WorkflowInstanceTestData.cs │ │ ├── WorkflowObjectTestData.cs │ │ ├── WorkflowRequestTestData.cs │ │ └── WorkflowRevisionTestData.cs │ ├── appsettings.Test.json │ └── nginx.conf └── static │ ├── Task_Manager_Int_Test_Architecture.png │ └── Workflow_Executor_Int_Test_Architecture.png ├── Shared └── VerifyLogExtension.cs ├── UnitTests ├── Common.Tests │ ├── Extensions │ │ ├── CollectionExtensionsTests.cs │ │ ├── FileExtensionsTests.cs │ │ └── StorageListExtensionsTests.cs │ ├── Monai.Deploy.WorkflowManager.Common.Tests.csproj │ └── Services │ │ ├── PayloadServiceTests.cs │ │ ├── TasksServiceTests.cs │ │ ├── WorkflowInstanceServiceTests.cs │ │ └── WorkflowServiceTests.cs ├── ConditionsResolver.Tests │ ├── Monai.Deploy.WorkflowManager.ConditionsResolver.Tests.csproj │ └── Resolver │ │ ├── ConditionalGroupTests.cs │ │ ├── ConditionalTests.cs │ │ ├── RegexExtensionsTests.cs │ │ └── StringExtensionsTests.cs ├── Configuration.Tests │ ├── ConfigurationValidatorTest.cs │ ├── Monai.Deploy.WorkflowManager.Configuration.Tests.csproj │ └── VerifyLogExtension.cs ├── Database.Tests │ ├── Monai.Deploy.WorkflowManager.Database.Tests.csproj │ └── TaskExecutionStatsRepositoryTests.cs ├── Monai.Deploy.WorkflowManager.Shared.Tests │ ├── DicomTagUtilitiesTests.cs │ ├── HttpLoggingExtensionsTests.cs │ ├── Monai.Deploy.WorkflowManager.Shared.Tests.csproj │ ├── MonaiHealthCheckTests.cs │ ├── MonaiServiceLocatorTests.cs │ ├── UriServiceTests.cs │ └── Usings.cs ├── MonaiBackgroundService.Tests │ ├── Monai.Deploy.WorkflowManager.MonaiBackgroundService.Tests.csproj │ ├── Usings.cs │ └── WorkerTests.cs ├── PayloadListener.Tests │ ├── Monai.Deploy.WorkflowManager.PayloadListener.Tests.csproj │ ├── Services │ │ └── EventPayloadRecieverServiceTests.cs │ └── Validators │ │ └── EventPayloadValidatorTests.cs ├── Storage.Tests │ ├── Monai.Deploy.WorkflowManager.Storage.Tests.csproj │ └── Services │ │ └── DicomServiceTests.cs ├── TaskManager.AideClinicalReview.Tests │ ├── AideClinicalReviewPluginTests.cs │ ├── Monai.Deploy.WorkflowManager.TaskManager.AideClinicalReview.Tests.csproj │ └── Repositories │ │ └── AideClinicalReviewRepositoryTests.cs ├── TaskManager.Argo.Tests │ ├── ArgoClientTest.cs │ ├── ArgoPluginTest.cs │ ├── ArgoPluginTestBase.cs │ ├── ArgoProviderTest.cs │ ├── Controller │ │ └── TemplateControllerTests.cs │ ├── Monai.Deploy.WorkflowManager.TaskManager.Argo.Tests.csproj │ ├── Repositories │ │ └── ArgoMetadataRepositoryTests.cs │ └── Templates │ │ ├── DagWithIntermediateArtifacts.yml │ │ └── SimpleTemplate.yml ├── TaskManager.Docker.Tests │ ├── ContainerStatusMonitorTest.cs │ ├── DockerPluginTest.cs │ ├── Monai.Deploy.WorkflowManager.TaskManager.Docker.Tests.csproj │ └── Usings.cs ├── TaskManager.Email.Tests │ ├── EmailPluginTests.cs │ └── Monai.Deploy.WorkflowManager.TaskManager.Email.Tests.csproj ├── TaskManager.Tests │ ├── Monai.Deploy.WorkflowManager.TaskManager.Tests.csproj │ ├── Services │ │ └── TaskDispatchEventServiceTests.cs │ └── TaskManagerTest.cs ├── WorkflowExecuter.Tests │ ├── Common │ │ ├── ArtifactMapperTests.cs │ │ ├── EventMapperTests.cs │ │ └── TaskExecutionStatusExtensionsTests.cs │ ├── Monai.Deploy.WorkflowManager.WorkflowExecuter.Tests.csproj │ └── Services │ │ ├── ConditionalParameterParserTests.cs │ │ └── WorkflowExecuterServiceTests.cs ├── WorkflowManager.Services.Tests │ ├── InformaticsGateway │ │ └── InformaticsGatewayServiceTests.cs │ └── Monai.Deploy.WorkflowManager.Services.Tests.csproj └── WorkflowManager.Tests │ ├── Controllers │ ├── ArtifactsControllerTests.cs │ ├── PayloadControllerTests.cs │ ├── TaskExecutionStatsControllerTests.cs │ ├── TasksControllerTests.cs │ ├── WorkflowInstanceControllerTests.cs │ └── WorkflowsControllerTests.cs │ ├── DummyMessagingService.cs │ ├── DummyStorageService.cs │ ├── Monai.Deploy.WorkflowManager.Tests.csproj │ ├── ProgramTest.cs │ ├── Services │ └── DataRetentionService │ │ └── DataRetentionServiceTest.cs │ ├── Shared │ └── VerifyLogExtension.cs │ ├── Validators │ └── WorkflowValidatorTests.cs │ ├── appsettings.json │ └── packages.lock.json ├── coverlet.runsettings └── run-tests.sh /.github/.gitversion.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | workflow: GitHubFlow/v1 16 | assembly-versioning-scheme: MajorMinorPatchTag 17 | assembly-file-versioning-scheme: MajorMinorPatchTag 18 | mode: ContinuousDelivery 19 | branches: 20 | main: 21 | label: '' 22 | regex: ^main$ 23 | release: 24 | label: rc 25 | regex: ^releases?[/-](?.+) 26 | develop: 27 | label: beta 28 | increment: Patch 29 | regex: ^develop$ 30 | feature: 31 | label: alpha.{BranchName} 32 | regex: ^features?[/-](?.+) 33 | pull-request: 34 | label: pr 35 | increment: Patch 36 | regex: ^(pull|pull\-requests|pr)[/-] 37 | 38 | ignore: 39 | sha: [] 40 | merge-message-formats: {} 41 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | ### Description 11 | A clear and concise description of what the bug is. 12 | 13 | ### Steps to reproduce 14 | Please share a clear and concise description of the problem. 15 | 1. Go to '...' 16 | 2. Install '....' 17 | 3. Run commands '....' 18 | ... 19 | 20 | ### Expected behavior 21 | A clear and concise description of what you expected to happen. 22 | 23 | ### Actual behavior 24 | A clear and concise description of what actually happened. 25 | 26 | ### Configuration 27 | 28 | * Workflow Manager version/commit: 29 | * OS and version (distro if applicable): 30 | * Kubernetes version (if applicable): 31 | * Docker version (if applicable): 32 | * Installation source (NGC, Dockerhub, or something else): 33 | * Hardware configuration (CPU, GPU, memory, storage, etc...): 34 | 35 | ### Regression? 36 | Did this work in the previous build or release of the Workflow Manager? If you can try a previous release or build to find out, that can help us narrow down the problem. If you don't know, that's OK. 37 | 38 | ### Other information 39 | (Please attach any logs available and remember to anonymize any PHI before sharing). 40 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: 2 16 | updates: 17 | - package-ecosystem: "nuget" 18 | directory: "/" 19 | schedule: 20 | interval: "weekly" 21 | open-pull-requests-limit: 5 22 | - package-ecosystem: "docker" 23 | directory: "/" 24 | schedule: 25 | interval: "weekly" 26 | open-pull-requests-limit: 5 27 | - package-ecosystem: "github-actions" 28 | directory: "/" 29 | schedule: 30 | interval: "weekly" 31 | open-pull-requests-limit: 5 32 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ### Description 2 | 3 | Fixes # . 4 | 5 | A few sentences describing the changes proposed in this pull request. 6 | 7 | ### Status 8 | **Ready/Work in progress/Hold** 9 | 10 | ### Types of changes 11 | 12 | - [ ] Non-breaking change (fix or new feature that would not break existing functionality). 13 | - [ ] Breaking change (fix or new feature that would cause existing functionality to change). 14 | - [ ] New tests added to cover the changes. 15 | - [ ] All tests passed locally. 16 | - [ ] [Documentation comments](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/xmldoc/) included/updated. 17 | - [ ] [User guide updated](../docs). 18 | - [ ] I have updated the [changelog](../docs/changelog.md) 19 | -------------------------------------------------------------------------------- /.grype.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | ignore: 16 | - vulnerability: CVE-2015-5237 # https://github.com/Project-MONAI/monai-deploy-workflow-manager/issues/515 CLOSED 17 | - vulnerability: CVE-2016-20013 # https://github.com/Project-MONAI/monai-deploy-workflow-manager/issues/516 CLOSED 18 | - vulnerability: CVE-2017-11164 # https://github.com/Project-MONAI/monai-deploy-workflow-manager/issues/517 CLOSED 19 | - vulnerability: CVE-2022-29458 # https://github.com/Project-MONAI/monai-deploy-workflow-manager/issues/519 CLOSED 20 | - vulnerability: CVE-2018-1000538 # https://github.com/Project-MONAI/monai-deploy-workflow-manager/issues/552 CLOSED 21 | - vulnerability: CVE-2020-11012 # https://github.com/Project-MONAI/monai-deploy-workflow-manager/issues/553 CLOSED 22 | - vulnerability: CVE-2021-21287 # https://github.com/Project-MONAI/monai-deploy-workflow-manager/issues/554 CLOSED 23 | - vulnerability: CVE-2021-43858 # https://github.com/Project-MONAI/monai-deploy-workflow-manager/issues/555 CLOSED 24 | - vulnerability: CVE-1999-1278 # https://github.com/Project-MONAI/monai-deploy-workflow-manager/issues/556 CLOSED 25 | -------------------------------------------------------------------------------- /.trivyignore: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # CVE-2022-27664 16 | # CVE-2022-32149 17 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": ".NET Core Launch (console)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | "program": "${workspaceFolder}/src/TaskManager/Runner/bin/Debug/net6.0/Monai.Deploy.WorkflowManager.TaskManager.Runner", 13 | "args": ["http://10.97.150.146"], 14 | "cwd": "${workspaceFolder}/src/TaskManager/Runner/", 15 | "stopAtEntry": false, 16 | "console": "internalConsole" 17 | } 18 | 19 | ] 20 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "label": "build", 8 | "command": "dotnet", 9 | "type": "shell", 10 | "args": [ 11 | "build", 12 | // Ask dotnet build to generate full paths for file names. 13 | "/property:GenerateFullPaths=true", 14 | // Do not generate summary otherwise it leads to duplicate errors in Problems panel 15 | "/consoleloggerparameters:NoSummary", 16 | "src/TaskManager/Runner/" 17 | ], 18 | "group": "build", 19 | "presentation": { 20 | "reveal": "silent" 21 | }, 22 | "problemMatcher": "$msCompile" 23 | } 24 | ] 25 | } -------------------------------------------------------------------------------- /CallbackApp.Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright 2023 MONAI Consortium 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | 12 | FROM python:3.10-alpine 13 | 14 | RUN apk update && \ 15 | apk upgrade && \ 16 | apk add libcom_err=1.47.1-r1 && \ 17 | rm -rf /var/cache/apk/* 18 | WORKDIR /app 19 | COPY src/TaskManager/CallbackApp/app.py ./ 20 | COPY src/TaskManager/CallbackApp/requirements.txt ./ 21 | 22 | RUN pip install -r requirements.txt 23 | 24 | CMD ["/usr/local/bin/python3", "/app/app.py"] 25 | -------------------------------------------------------------------------------- /NuGetDefense.json: -------------------------------------------------------------------------------- 1 | { 2 | "WarnOnly": false, 3 | "VulnerabilityReports": { 4 | "OutputTextReport": true 5 | }, 6 | "CheckTransitiveDependencies": true, 7 | "CheckReferencedProjects": false, 8 | "ErrorSettings": { 9 | "ErrorSeverityThreshold": "any", 10 | "Cvss3Threshold": -1, 11 | "IgnoredPackages": [ 12 | { 13 | "Id": "NugetDefense" 14 | } 15 | ], 16 | "IgnoredCvEs": [], 17 | "AllowedPackages": [], 18 | "WhiteListedPackages": [], 19 | "BlockedPackages": [], 20 | "BlacklistedPackages": [] 21 | }, 22 | "OssIndex": { 23 | "ApiToken": "OSSINDEXAPI_TOKEN", 24 | "Username": "OSSINDEXAPI_USERNAME", 25 | "Enabled": true, 26 | "BreakIfCannotRun": false 27 | }, 28 | "GitHubAdvisoryDatabase": { 29 | "ApiToken": "", 30 | "Username": "", 31 | "Enabled": false, 32 | "BreakIfCannotRun": false 33 | }, 34 | "NVD": { 35 | "SelfUpdate": false, 36 | "TimeoutInSeconds": 30, 37 | "Enabled": false, 38 | "BreakIfCannotRun": false 39 | }, 40 | "SensitivePackages": [] 41 | } -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | codecov: 16 | require_ci_to_pass: true 17 | max_report_age: off 18 | notify: 19 | wait_for_ci: false 20 | 21 | coverage: 22 | precision: 5 23 | round: down 24 | range: "70...100" 25 | status: 26 | project: 27 | default: 28 | target: auto 29 | threshold: 1% 30 | base: auto 31 | if_not_found: success 32 | informational: false 33 | only_pulls: false 34 | 35 | parsers: 36 | gcov: 37 | branch_detection: 38 | conditional: yes 39 | loop: yes 40 | method: no 41 | macro: no 42 | 43 | comment: 44 | layout: "reach,diff,flags,files,footer" 45 | behavior: default 46 | require_changes: false 47 | require_base: no 48 | require_head: yes 49 | 50 | fixes: 51 | - "/home/runner/work/monai-deploy-workflow-manager/monai-deploy-workflow-manager/src/::src/" 52 | -------------------------------------------------------------------------------- /deploy/helm/.helmignore: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Patterns to ignore when building packages. 16 | # This supports shell glob matching, relative path matching, and 17 | # negation (prefixed with !). Only one pattern per line. 18 | .DS_Store 19 | # Common VCS dirs 20 | .git/ 21 | .gitignore 22 | .bzr/ 23 | .bzrignore 24 | .hg/ 25 | .hgignore 26 | .svn/ 27 | # Common backup files 28 | *.swp 29 | *.bak 30 | *.tmp 31 | *.orig 32 | *~ 33 | # Various IDEs 34 | .project 35 | .idea/ 36 | *.tmproj 37 | .vscode/ 38 | -------------------------------------------------------------------------------- /deploy/helm/Gateway-local.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | replicaCount: 1 15 | 16 | image: 17 | repository: registry.gitlab.com/answerdigital/londonai/aide/workflow-manager-images/infomatics-gateway 18 | pullPolicy: IfNotPresent 19 | tag: 2022-08-01 20 | 21 | enviromentVariables: 22 | InformaticsGateway__messaging__publisherSettings__endpoint: "rabbitmq-monai" 23 | InformaticsGateway__messaging__publisherSettings__username: "admin" 24 | InformaticsGateway__messaging__publisherSettings__password: "admin" 25 | InformaticsGateway__messaging__subscriberSettings__endpoint: "rabbitmq-monai" 26 | InformaticsGateway__messaging__subscriberSettings__username: "admin" 27 | InformaticsGateway__messaging__subscriberSettings__password: "admin" 28 | InformaticsGateway__storage__settings__endpoint: "minio.monai:9000" 29 | InformaticsGateway__storage__settings__accessKey: "admin" 30 | InformaticsGateway__storage__settings__accessToken: "password" 31 | InformaticsGateway__dicom__scp__rejectUnknownSources: false 32 | 33 | 34 | service: 35 | type: ClusterIP 36 | port: 5000 37 | port2: 104 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /deploy/helm/argo.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | replicaCount: 1 15 | 16 | 17 | service: 18 | type: NodePort 19 | port: 2746 20 | nodeport: 30046 21 | selector: 22 | app: argo-server 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /deploy/helm/minio-local.yaml: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2022 MONAI Consortium 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | replicaCount: 1 17 | 18 | image: 19 | repository: minio/minio 20 | pullPolicy: IfNotPresent 21 | tag: latest 22 | #command: 23 | # - server /data --console-address ":9001" 24 | args: 25 | - server 26 | - /data 27 | - --console-address 28 | - ":9001" 29 | enviromentVariables: 30 | MINIO_ROOT_USER: minioadmin 31 | MINIO_ROOT_PASSWORD: minioadmin 32 | 33 | service: 34 | type: NodePort 35 | port: 9000 36 | nodeport: 30090 37 | port2: 9001 38 | nodeport2: 30091 39 | selector: 40 | app.kubernetes.io/instance: minio 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /deploy/helm/minio-serviceOnly.yaml: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2022 MONAI Consortium 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | replicaCount: 1 17 | 18 | # image: 19 | # repository: minio/minio 20 | # pullPolicy: IfNotPresent 21 | # tag: latest 22 | # command: 23 | # - "/bin/sh" 24 | # - "-ce" 25 | # - "/usr/bin/docker-entrypoint.sh minio server /data" 26 | 27 | enviromentVariables: 28 | MINIO_ROOT_USER: minioadmin 29 | MINIO_ROOT_PASSWORD: minioadmin 30 | 31 | service: 32 | type: NodePort 33 | port: 9000 34 | nodeport: 30090 35 | port2: 9001 36 | nodeport2: 30091 37 | selector: 38 | app: minio 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /deploy/helm/minio.yaml: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2022 MONAI Consortium 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | replicaCount: 1 17 | 18 | # image: 19 | # repository: minio/minio 20 | # pullPolicy: IfNotPresent 21 | # tag: latest 22 | # command: 23 | # - "/bin/sh" 24 | # - "-ce" 25 | # - "/usr/bin/docker-entrypoint.sh minio server /data" 26 | 27 | enviromentVariables: 28 | MINIO_ROOT_USER: minioadmin 29 | MINIO_ROOT_PASSWORD: minioadmin 30 | 31 | service: 32 | type: NodePort 33 | port: 9000 34 | nodeport: 30090 35 | port2: 9001 36 | nodeport2: 30091 37 | selector: 38 | app: minio 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /deploy/helm/mongo-local.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | replicaCount: 1 16 | 17 | image: 18 | repository: mongo 19 | pullPolicy: IfNotPresent 20 | # Overrides the image tag whose default is the chart appVersion. 21 | tag: "5.0" 22 | 23 | enviromentVariables: 24 | MONGO_INITDB_ROOT_USERNAME: root 25 | MONGO_INITDB_ROOT_PASSWORD: rootpassword 26 | 27 | service: 28 | type: NodePort 29 | port: 27017 30 | nodeport: 30017 31 | 32 | 33 | affinity: {} -------------------------------------------------------------------------------- /deploy/helm/mongo-serviceOnly.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | replicaCount: 1 16 | 17 | service: 18 | type: NodePort 19 | port: 27017 20 | nodeport: 30017 21 | selector: 22 | app.kubernetes.io/instance: mongo 23 | app.kubernetes.io/name: monai 24 | 25 | 26 | affinity: {} -------------------------------------------------------------------------------- /deploy/helm/mongo.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | replicaCount: 1 16 | 17 | image: 18 | repository: mongo 19 | pullPolicy: IfNotPresent 20 | # Overrides the image tag whose default is the chart appVersion. 21 | tag: "5.0" 22 | 23 | enviromentVariables: 24 | MONGO_INITDB_ROOT_USERNAME: root 25 | MONGO_INITDB_ROOT_PASSWORD: rootpassword 26 | 27 | service: 28 | type: ClusterIP 29 | port: 27017 30 | 31 | volumes: 32 | name: mongo-storage 33 | claimName: mongo-storage-claim 34 | namespace: monai 35 | storage: 5Gi 36 | path: /efs_data/monai/mongodata # path on the host 37 | 38 | volumeMounts: 39 | mountPath: "/data/db" 40 | name: mongo-storage 41 | 42 | 43 | affinity: {} -------------------------------------------------------------------------------- /deploy/helm/rabbitmq-local.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | replicaCount: 1 16 | 17 | image: 18 | repository: rabbitmq 19 | pullPolicy: IfNotPresent 20 | tag: 3.8.18-management 21 | 22 | enviromentVariables: 23 | RABBITMQ_ERLANG_COOKIE: "SWQOKODSQALRPCLNMEQG" 24 | RABBITMQ_DEFAULT_USER: "admin" 25 | RABBITMQ_DEFAULT_PASS: "admin" 26 | RABBITMQ_DEFAULT_VHOST: "monaideploy" 27 | 28 | 29 | service: 30 | type: NodePort 31 | port: 5672 32 | nodeport: 30072 33 | port2: 15672 34 | nodeport2: 30672 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /deploy/helm/rabbitmq.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | replicaCount: 1 16 | 17 | image: 18 | repository: rabbitmq 19 | pullPolicy: IfNotPresent 20 | tag: 3.8.18-management 21 | 22 | enviromentVariables: 23 | RABBITMQ_ERLANG_COOKIE: "SWQOKODSQALRPCLNMEQG" 24 | RABBITMQ_DEFAULT_USER: "monaideploy" 25 | RABBITMQ_DEFAULT_PASS: "monaideploy" 26 | RABBITMQ_DEFAULT_VHOST: "monaideploy" 27 | 28 | 29 | service: 30 | type: NodePort 31 | port: 5672 32 | nodeport: 30072 33 | port2: 15672 34 | nodeport2: 30672 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /deploy/helm/templates/clusterRole.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | {{ if (.Values.serviceAccount) -}} 15 | {{ if (.Values.serviceAccount.clusterrole) -}} 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: {{.Values.serviceAccount.clusterrole.name}} 20 | rules: 21 | - apiGroups: [""] 22 | resources: 23 | - {{ range .Values.serviceAccount.clusterrole.rules.resources }}{{- . | quote }}{{- end }} 24 | verbs: {{- range .Values.serviceAccount.clusterrole.rules.verbs }} 25 | - {{. | quote }}{{- end }} 26 | {{- end }} 27 | {{- end }} -------------------------------------------------------------------------------- /deploy/helm/templates/clusterRoleBinding.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | {{ if (.Values.serviceAccount) -}} 15 | {{ if (.Values.serviceAccount.clusterrole) -}} 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRoleBinding 18 | metadata: 19 | name: {{.Values.serviceAccount.clusterrole.name}}-binding 20 | namespace: {{.Values.serviceAccount.namespace}} 21 | subjects: 22 | - kind: ServiceAccount 23 | name: {{.Values.serviceAccount.name}} 24 | namespace: {{.Values.serviceAccount.namespace}} 25 | roleRef: 26 | kind: ClusterRole 27 | name: {{.Values.serviceAccount.clusterrole.name}} 28 | apiGroup: rbac.authorization.k8s.io 29 | 30 | 31 | {{- end }} 32 | {{- end }} -------------------------------------------------------------------------------- /deploy/helm/templates/hpa.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | {{- if ((.Values.autoscaling).enabled) }} 15 | apiVersion: autoscaling/v2beta1 16 | kind: HorizontalPodAutoscaler 17 | metadata: 18 | name: {{ include "deploy.fullname" . }} 19 | labels: 20 | {{- include "deploy.labels" . | nindent 4 }} 21 | spec: 22 | scaleTargetRef: 23 | apiVersion: apps/v1 24 | kind: Deployment 25 | name: {{ include "deploy.fullname" . }} 26 | minReplicas: {{ .Values.autoscaling.minReplicas }} 27 | maxReplicas: {{ .Values.autoscaling.maxReplicas }} 28 | metrics: 29 | {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} 30 | - type: Resource 31 | resource: 32 | name: cpu 33 | targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} 34 | {{- end }} 35 | {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} 36 | - type: Resource 37 | resource: 38 | name: memory 39 | targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} 40 | {{- end }} 41 | {{- end }} 42 | -------------------------------------------------------------------------------- /deploy/helm/templates/role.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | {{ if (.Values.serviceAccount) -}} 15 | {{ if (.Values.serviceAccount.role) -}} 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: Role 18 | metadata: 19 | namespace: {{.Values.serviceAccount.namespace}} 20 | name: {{.Values.serviceAccount.role.name}} 21 | rules: 22 | - apiGroups: [""] 23 | resources: 24 | - {{ range .Values.serviceAccount.role.rules.resources }}{{- . | quote }}{{- end }} 25 | verbs: {{- range .Values.serviceAccount.role.rules.verbs }} 26 | - {{. | quote }}{{- end }} 27 | {{- end }} 28 | {{- end }} -------------------------------------------------------------------------------- /deploy/helm/templates/roleBinding.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | {{ if (.Values.serviceAccount) -}} 15 | {{ if (.Values.serviceAccount.role) -}} 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: RoleBinding 18 | metadata: 19 | name: {{.Values.serviceAccount.role.name}}-binding 20 | namespace: {{.Values.serviceAccount.namespace}} 21 | subjects: 22 | - kind: ServiceAccount 23 | name: {{.Values.serviceAccount.name}} 24 | namespace: {{.Values.serviceAccount.namespace}} 25 | roleRef: 26 | kind: Role 27 | name: {{.Values.serviceAccount.role.name}} 28 | apiGroup: rbac.authorization.k8s.io 29 | {{- end }} 30 | {{- end }} -------------------------------------------------------------------------------- /deploy/helm/templates/service.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | apiVersion: v1 15 | kind: Service 16 | metadata: 17 | name: {{ include "deploy.fullname" . }} 18 | labels: 19 | {{- include "deploy.labels" . | nindent 4 }} 20 | spec: 21 | type: {{ .Values.service.type }} 22 | ports: 23 | - port: {{ .Values.service.port }} 24 | targetPort: {{ .Values.service.port }} 25 | {{- if .Values.service.nodeport}} 26 | nodePort: {{.Values.service.nodeport}} 27 | {{- end}} 28 | protocol: TCP 29 | name: http 30 | {{- if .Values.service.port2}} 31 | - name: service-console 32 | port: {{ .Values.service.port2 }} 33 | {{- if .Values.service.nodeport2}} 34 | nodePort: {{.Values.service.nodeport2}} 35 | {{- end}} 36 | {{- end}} 37 | selector: 38 | {{- if .Values.service.selector }} {{ range $name, $value := .Values.service.selector }} 39 | {{ $name }}: {{ $value }} 40 | {{- end }} 41 | {{- else}} 42 | {{- include "deploy.selectorLabels" . | nindent 4 }} 43 | {{- end}} 44 | -------------------------------------------------------------------------------- /deploy/helm/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | {{ if ((.Values.serviceAccount).create) -}} 15 | apiVersion: v1 16 | kind: ServiceAccount 17 | metadata: 18 | name: {{ include "deploy.serviceAccountName" . }} 19 | labels: 20 | {{- include "deploy.labels" . | nindent 4 }} 21 | {{- with .Values.serviceAccount.annotations }} 22 | annotations: 23 | {{- toYaml . | nindent 4 }} 24 | {{- end }} 25 | {{- end }} 26 | -------------------------------------------------------------------------------- /deploy/helm/templates/tests/test-connection.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | apiVersion: v1 15 | kind: Pod 16 | metadata: 17 | name: "{{ include "deploy.fullname" . }}-test-connection" 18 | labels: 19 | {{- include "deploy.labels" . | nindent 4 }} 20 | annotations: 21 | "helm.sh/hook": test 22 | spec: 23 | containers: 24 | - name: wget 25 | image: busybox 26 | command: ['wget'] 27 | args: ['{{ include "deploy.fullname" . }}:{{ .Values.service.port }}'] 28 | restartPolicy: Never 29 | -------------------------------------------------------------------------------- /deploy/helm/templates/volume.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | {{- if .Values.volumeMounts }} 15 | apiVersion: v1 16 | kind: PersistentVolume 17 | metadata: 18 | name: {{ $.Values.volumes.name }} 19 | namespace: {{ $.Values.volumes.namespace }} 20 | spec: 21 | storageClassName: "local-storage" 22 | volumeMode: Filesystem 23 | capacity: 24 | storage: {{$.Values.volumes.storage}} 25 | accessModes: 26 | - ReadWriteOnce 27 | local: 28 | path: {{$.Values.volumes.path}} 29 | nodeAffinity: # nodeAffinity is required when using local volumes. 30 | required: 31 | nodeSelectorTerms: 32 | - matchExpressions: 33 | - key: localstorage 34 | operator: In 35 | values: 36 | - "true" 37 | {{- end }} 38 | 39 | 40 | -------------------------------------------------------------------------------- /deploy/helm/templates/volumeclaim.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | {{- if .Values.volumeMounts }} 15 | apiVersion: v1 16 | kind: PersistentVolumeClaim 17 | metadata: 18 | name: {{ $.Values.volumes.claimName }} 19 | namespace: {{ $.Values.volumes.namespace }} 20 | spec: 21 | storageClassName: "local-storage" 22 | accessModes: 23 | - ReadWriteOnce 24 | resources: 25 | requests: 26 | storage: {{$.Values.volumes.storage}} 27 | {{- end }} 28 | 29 | 30 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | _site/ 16 | obj/ -------------------------------------------------------------------------------- /docs/api/rest/toc.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | - name: Task Manager 16 | items: 17 | - name: Health API 18 | href: task-manager/health.md 19 | - name: Workflow Manager 20 | items: 21 | - name: Health API 22 | href: workflow-manager/health.md 23 | - name: Payload API 24 | href: workflow-manager/payload.md 25 | - name: Task API 26 | href: workflow-manager/task.md 27 | - name: Workflow API 28 | href: workflow-manager/workflow.md 29 | - name: Workflow Instance API 30 | href: workflow-manager/workflow-instance.md 31 | -------------------------------------------------------------------------------- /docs/api/toc.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | - name: REST API 16 | href: rest/toc.yml 17 | - name: .NET 18 | href: ../obj/api/dotnet/toc.yml 19 | -------------------------------------------------------------------------------- /docs/changelog.md: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | # Changelog 19 | 20 | 21 | ## 0.2.1 22 | 23 | - gh-1022 Address vulnerabilities in .NET (CVE-2024-38229, CVE-2024-35264) 24 | 25 | ## 0.2.0 26 | 27 | Added a new Email plugin, this pulls together information and sends a Message (rabbitmq) to a queue for processing via an external application (for the actual sending) 28 | 29 | Renamed the (Generated) Argo client to ArgoGeneratedClient, added a new ArgoClient using just the methods used by this codebase. 30 | 31 | Enhanced the ArgoClient -> Argo_Get_WorkflowLogsAsync method to decode the json better and make the logs extracted from Argo more readable. 32 | 33 | Added Mongo Migraions, to allow changes without breaking current stored entries 34 | 35 | Added resource constraints to the generated ARGO templates, so these can operate within a Kubernetes cluster with a Resource Quota in the ARGO namespace. 36 | 37 | Added ability for plugins (currently Argo) to have controllers, any dll marked with the new Monai.Deploy.WorkflowManager.Shared.PlugInAttribute will have any controllers added to TaskManager 38 | -------------------------------------------------------------------------------- /docs/compliance/toc.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | - name: Third Party Licenses 16 | href: third-party-licenses.md -------------------------------------------------------------------------------- /docs/filterConfig.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | apiRules: 16 | - exclude: 17 | hasAttribute: 18 | uid: Newtonsoft.Json.JsonIgnoreAttribute 19 | - exclude: 20 | uidRegex: ^FellowOakDicom\.Serialization\..*$ 21 | type: Type 22 | - exclude: 23 | # inherited Object methods 24 | uidRegex: ^System\.Object\..*$ 25 | type: Method 26 | -------------------------------------------------------------------------------- /docs/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/docs/images/favicon.ico -------------------------------------------------------------------------------- /docs/images/workflow_examples/scenario1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/docs/images/workflow_examples/scenario1.png -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | 16 | 17 | # MONAI Deploy Workflow v0.0.0 18 | 19 | ![MONAI](./images/MONAI-logo_color.svg) 20 | 21 | ## Introduction 22 | 23 | 24 | ## Workflow Manager 25 | 26 | ## Task Manager 27 | 28 | 29 | 30 | 31 | > [!Note] 32 | > Note 33 | 34 | > [!Warning] 35 | > Warning 36 | 37 | > [!Tip] 38 | > Tip 39 | 40 | > [!Important] 41 | > Important 42 | -------------------------------------------------------------------------------- /docs/setup/schema.md: -------------------------------------------------------------------------------- 1 | 16 | 17 | # Configuration 18 | 19 | ## Workflow/Task Manager Configuration File 20 | 21 | ### Configuration Sections 22 | 23 | --- 24 | 25 | ### Default Configuration 26 | 27 | 28 | ### Configuration Validation 29 | 30 | ### Logging 31 | -------------------------------------------------------------------------------- /docs/setup/setup.md: -------------------------------------------------------------------------------- 1 | 16 | # Setup 17 | 18 | This section outlines the steps to download and install the Workflow Manger ... 19 | 20 | ## Runtime Requirements 21 | 22 | * Docker 20.10.12 or higher 23 | 24 | ## Installation 25 | 26 | #### On Linux 27 | 28 | #### On Windows 29 | 30 | ## Configure Workflow Manager 31 | ## Configure Task Manager 32 | ## Storage Consideration & Configuration 33 | 34 | ### Storage Service 35 | #### Install the Storage Plug-in 36 | 37 | 38 | ### Message broker 39 | #### Install the Messaging Plug-in 40 | 41 | ## Logging 42 | 43 | See [schema](./schema.md#logging) page for additional information on logging. 44 | 45 | -------------------------------------------------------------------------------- /docs/setup/toc.md: -------------------------------------------------------------------------------- 1 | 16 | 17 | # [Setup](setup.md) 18 | # [Configuration](schema.md) 19 | # [Workflow Specs](mwm-workflow-spec.md) -------------------------------------------------------------------------------- /docs/templates/material/partials/head.tmpl.partial: -------------------------------------------------------------------------------- 1 | {{!Copyright (c) Oscar Vasquez. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}} 2 | 3 | 4 | 5 | 6 | {{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}} 7 | 8 | 9 | 10 | {{#_description}}{{/_description}} 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | {{#_noindex}}{{/_noindex}} 19 | {{#_enableSearch}}{{/_enableSearch}} 20 | {{#_enableNewTab}}{{/_enableNewTab}} 21 | -------------------------------------------------------------------------------- /docs/toc.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | - name: MONAI Deploy Workflow Manager 16 | href: index.md 17 | - name: Get Started 18 | href: setup/ 19 | - name: API Documentation 20 | href: api/ 21 | - name: Compliance 22 | href: compliance/ 23 | - name: Changelog 24 | href: changelog.md 25 | -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "8.0.100", 4 | "rollForward": "latestFeature" 5 | } 6 | } -------------------------------------------------------------------------------- /guidelines/static/VS-startup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/guidelines/static/VS-startup.png -------------------------------------------------------------------------------- /guidelines/static/keycloak-dev-example1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/guidelines/static/keycloak-dev-example1.png -------------------------------------------------------------------------------- /guidelines/static/mwm-detailed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/guidelines/static/mwm-detailed.png -------------------------------------------------------------------------------- /guidelines/static/mwm-payload-listener.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/guidelines/static/mwm-payload-listener.png -------------------------------------------------------------------------------- /guidelines/static/mwm-upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/guidelines/static/mwm-upload.png -------------------------------------------------------------------------------- /guidelines/static/mwm-workflows-delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/guidelines/static/mwm-workflows-delete.png -------------------------------------------------------------------------------- /guidelines/static/mwm-workflows-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/guidelines/static/mwm-workflows-list.png -------------------------------------------------------------------------------- /guidelines/static/mwm-workflows-register.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/guidelines/static/mwm-workflows-register.png -------------------------------------------------------------------------------- /guidelines/static/mwm-workflows-update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/guidelines/static/mwm-workflows-update.png -------------------------------------------------------------------------------- /guidelines/static/mwm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/guidelines/static/mwm.png -------------------------------------------------------------------------------- /guidelines/static/store-arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/guidelines/static/store-arch.png -------------------------------------------------------------------------------- /src/.sonarlint/Monai.Deploy.WorkflowManager.slconfig: -------------------------------------------------------------------------------- 1 | { 2 | "ServerUri": "https://sonarcloud.io/", 3 | "Organization": { 4 | "Key": "project-monai", 5 | "Name": "Project MONAI" 6 | }, 7 | "ProjectKey": "Project-MONAI_monai-deploy-workflow-manager", 8 | "ProjectName": "monai-deploy-workflow-manager", 9 | "Profiles": { 10 | "CSharp": { 11 | "ProfileKey": "AX96ONQSnTk2GEVJ9ILJ", 12 | "ProfileTimestamp": "2022-07-05T10:19:10Z" 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /src/.sonarlint/sonar.settings.json: -------------------------------------------------------------------------------- 1 | {"sonar.exclusions":[],"sonar.global.exclusions":["**/build-wrapper-dump.json","**/Migrations/*.cs"],"sonar.inclusions":[]} 2 | -------------------------------------------------------------------------------- /src/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using System.Reflection; 18 | 19 | [assembly: AssemblyFileVersion("0.0.0.0")] 20 | [assembly: AssemblyVersion("0.0.0.0")] 21 | [assembly: AssemblyInformationalVersion("0.0.0-development")] 22 | -------------------------------------------------------------------------------- /src/Common/Configuration/ArgoCallbackConfiguration.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Microsoft.Extensions.Configuration; 18 | 19 | namespace Monai.Deploy.WorkflowManager.Common.Configuration 20 | { 21 | public class ArgoCallbackConfiguration 22 | { 23 | /// 24 | /// Gets or sets the rabbit override for agro callback. 25 | /// Defaults to `false`. 26 | /// 27 | [ConfigurationKeyName("argoRabbitOverrideEnabled")] 28 | public bool ArgoCallbackOverrideEnabled { get; set; } = false; 29 | 30 | /// 31 | /// Gets or sets the rabbit override endpoint for agro callback. 32 | /// 33 | [ConfigurationKeyName("argoRabbitOverrideEndpoint")] 34 | public string ArgoRabbitOverrideEndpoint { get; set; } = string.Empty; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Common/Configuration/BackgroundServiceSettings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Microsoft.Extensions.Configuration; 18 | 19 | namespace Monai.Deploy.WorkflowManager.Common.Configuration 20 | { 21 | public class BackgroundServiceSettings 22 | { 23 | [ConfigurationKeyName("backgroundServiceDelay")] 24 | public int BackgroundServiceDelay { get; set; } = 10_000; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Common/Configuration/DicomAgentConfiguration.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Microsoft.Extensions.Configuration; 18 | 19 | namespace Monai.Deploy.WorkflowManager.Common.Configuration 20 | { 21 | public class DicomAgentConfiguration 22 | { 23 | /// 24 | /// Gets or sets the agent name for the dicom web protocol. 25 | /// Defaults to `monaidicomweb`. 26 | /// 27 | [ConfigurationKeyName("dicomWebAgentName")] 28 | public string DicomWebAgentName { get; set; } = "monaidicomweb"; 29 | 30 | /// 31 | /// Gets or sets the agent name for monaiscu. 32 | /// Defaults to `monaiscu`. 33 | /// 34 | [ConfigurationKeyName("scuAgentName")] 35 | public string ScuAgentName { get; set; } = "monaiscu"; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Common/Configuration/Exceptions/ConfigurationException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using System; 18 | 19 | namespace Monai.Deploy.WorkflowManager.Common.Configuration.Exceptions 20 | { 21 | /// 22 | /// Represnets an exception based upon invalid configuration. 23 | /// 24 | public class ConfigurationException : Exception 25 | { 26 | public ConfigurationException() 27 | { 28 | } 29 | 30 | public ConfigurationException(string message) : base(message) 31 | { 32 | } 33 | 34 | public ConfigurationException(string message, Exception innerException) : base(message, innerException) 35 | { 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Common/Configuration/InformaticsGatewayConfiguration.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Microsoft.Extensions.Configuration; 18 | 19 | namespace Monai.Deploy.WorkflowManager.Common.Configuration 20 | { 21 | public class InformaticsGatewayConfiguration 22 | { 23 | [ConfigurationKeyName("apiHost")] 24 | public string ApiHost { get; set; } 25 | 26 | [ConfigurationKeyName("username")] 27 | public string Username { get; set; } 28 | 29 | [ConfigurationKeyName("password")] 30 | public string Password { get; set; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Common/Configuration/PagedOptions.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | using Microsoft.Extensions.Configuration; 17 | 18 | namespace Monai.Deploy.WorkflowManager.Common.Configuration 19 | { 20 | public class PagedOptions 21 | { 22 | /// 23 | /// Represents the endpointSettings section of the configuration file. 24 | /// 25 | [ConfigurationKeyName("endpointSettings")] 26 | public EndpointSettings EndpointSettings { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Common/Configuration/PaginationSettings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Microsoft.Extensions.Configuration; 18 | 19 | namespace Monai.Deploy.WorkflowManager.Common.Configuration 20 | { 21 | public class EndpointSettings 22 | { 23 | [ConfigurationKeyName("defaultPageSize")] 24 | public int DefaultPageSize { get; set; } = 10; 25 | 26 | [ConfigurationKeyName("maxPageSize")] 27 | public int MaxPageSize { get; set; } = 10; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Common/Configuration/RetryConfiguration.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using System; 18 | using System.Collections.Generic; 19 | using Microsoft.Extensions.Configuration; 20 | 21 | namespace Monai.Deploy.WorkflowManager.Common.Configuration 22 | { 23 | public class RetryConfiguration 24 | { 25 | /// 26 | /// Gets or sets delays, in milliseconds, between each retry. 27 | /// Number of items specified is the number of times the call would be retried. 28 | /// Values can be separated by commas. 29 | /// Default is 250, 500, 1000. 30 | /// 31 | [ConfigurationKeyName("delays")] 32 | public int[] DelaysMilliseconds { get; set; } = new[] { 250, 500, 1000 }; 33 | 34 | // Gets the delays in TimeSpan objects 35 | public IEnumerable RetryDelays 36 | { 37 | get 38 | { 39 | foreach (var retry in DelaysMilliseconds) 40 | { 41 | yield return TimeSpan.FromMilliseconds(retry); 42 | } 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Common/Miscellaneous/Filter/TimeFilter.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.Common.Miscellaneous.Filter 18 | { 19 | public class TimeFilter : PaginationFilter 20 | { 21 | public DateTime StartTime { get; set; } 22 | 23 | public DateTime EndTime { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Common/Miscellaneous/IMonaiService.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.Common.Miscellaneous 18 | { 19 | public interface IMonaiService 20 | { 21 | ServiceStatus Status { get; set; } 22 | string ServiceName { get; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Common/Miscellaneous/IMonaiServiceLocator.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.Common.Miscellaneous 18 | { 19 | public interface IMonaiServiceLocator 20 | { 21 | IEnumerable GetMonaiServices(); 22 | 23 | Dictionary GetServiceStatus(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Common/Miscellaneous/LoggingDataDictionary.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2023 MONAI Consortium 3 | * Copyright 2021 NVIDIA Corporation 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | using System.Globalization; 19 | 20 | namespace Monai.Deploy.WorkflowManager.Common.Miscellaneous 21 | { 22 | public class LoggingDataDictionary : Dictionary where TKey : notnull 23 | { 24 | public LoggingDataDictionary() 25 | { 26 | } 27 | 28 | public override string ToString() 29 | { 30 | var pairs = this.Select(x => string.Format(CultureInfo.InvariantCulture, "{0}={1}", x.Key, x.Value)); 31 | return string.Join(", ", pairs); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Common/Miscellaneous/PlugInAttribute.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.Common.Miscellaneous 18 | { 19 | [AttributeUsage(AttributeTargets.Assembly)] 20 | public class PlugInAttribute : Attribute 21 | { 22 | public PlugInAttribute() { } 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Common/Miscellaneous/ServiceStatus.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.Common.Miscellaneous 18 | { 19 | /// 20 | /// Defines the state of a running service. 21 | /// 22 | public enum ServiceStatus 23 | { 24 | /// 25 | /// Unknown - default, during start up. 26 | /// 27 | Unknown, 28 | 29 | /// 30 | /// Service is stopped. 31 | /// 32 | Stopped, 33 | 34 | /// 35 | /// Service is running. 36 | /// 37 | Running, 38 | 39 | /// 40 | /// Service has been cancelled by a cancellation token. 41 | /// 42 | Cancelled, 43 | 44 | /// 45 | /// Service has been disposed by the host container. 46 | /// 47 | Disposed, 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/Common/Miscellaneous/Services/IUriService.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Monai.Deploy.WorkflowManager.Common.Miscellaneous.Filter; 18 | 19 | namespace Monai.Deploy.WorkflowManager.Common.Miscellaneous.Services 20 | { 21 | /// 22 | /// Uri Serivce. 23 | /// 24 | public interface IUriService 25 | { 26 | /// 27 | /// Gets Relative Uri path with filters as a string. 28 | /// 29 | /// Filters. 30 | /// Route. 31 | /// Relative Uri string. 32 | public string GetPageUriString(PaginationFilter filter, string route); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Common/Miscellaneous/Utilities/DicomTagUtilities.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using System.Text.RegularExpressions; 18 | using FellowOakDicom; 19 | 20 | namespace Monai.Deploy.WorkflowManager.Common.Miscellaneous.Utilities 21 | { 22 | public static class DicomTagUtilities 23 | { 24 | public static DicomTag GetDicomTagByName(string tag) 25 | { 26 | return DicomDictionary.Default[tag] ?? DicomDictionary.Default[Regex.Replace(tag, @"\s+", "", RegexOptions.None, TimeSpan.FromSeconds(1))]; 27 | } 28 | 29 | public static (bool valid, IList invalidTags) DicomTagsValid(IEnumerable dicomTags) 30 | { 31 | var invalidTags = new List(); 32 | 33 | foreach (var t in dicomTags) 34 | { 35 | var tag = GetDicomTagByName(t); 36 | if (tag == null) 37 | { 38 | invalidTags.Add(t); 39 | } 40 | } 41 | 42 | return (!invalidTags.Any(), invalidTags); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/Common/Miscellaneous/Wrappers/StatsPagedResponse.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | namespace Monai.Deploy.WorkflowManager.Common.Miscellaneous.Wrappers 17 | { 18 | public class StatsPagedResponse : PagedResponse 19 | { 20 | public DateTime PeriodStart { get; set; } 21 | public DateTime PeriodEnd { get; set; } 22 | public long TotalExecutions { get; set; } 23 | public long TotalSucceeded { get; set; } 24 | public long TotalFailures { get; set; } 25 | public long TotalInprogress { get; set; } 26 | public double AverageTotalExecutionSeconds { get; set; } 27 | public double AverageArgoExecutionSeconds { get; set; } 28 | 29 | public StatsPagedResponse(T data, int pageNumber, int pageSize) : base(data, pageNumber, pageSize) 30 | { 31 | 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/TaskManager/API/ExecutionStatus.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Monai.Deploy.Messaging.Events; 18 | 19 | namespace Monai.Deploy.WorkflowManager.TaskManager.API 20 | { 21 | public class ExecutionStatus 22 | { 23 | /// 24 | /// Gets or sets the status of the execution. 25 | /// 26 | public TaskExecutionStatus Status { get; set; } = TaskExecutionStatus.Created; 27 | 28 | /// 29 | /// Gets or sets the reason of a failure. 30 | /// 31 | public FailureReason FailureReason { get; set; } = FailureReason.None; 32 | 33 | /// 34 | /// Gets or sets any errors of the execution. 35 | /// 36 | public string Errors { get; set; } = string.Empty; 37 | 38 | /// 39 | /// Contains various stats 40 | /// 41 | public Dictionary Stats { get; set; } = new(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/TaskManager/API/Extensions/TaskDispatchEventExtension.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Monai.Deploy.Messaging.Events; 18 | using Newtonsoft.Json; 19 | 20 | namespace Monai.Deploy.WorkflowManager.TaskManager.API.Extensions 21 | { 22 | public static class TaskDispatchEventExtension 23 | { 24 | public static string? GetTaskPluginArgumentsParameter(this TaskDispatchEvent taskDispatchEvent, string key) 25 | { 26 | if (!taskDispatchEvent.TaskPluginArguments.TryGetValue(key, out var value)) 27 | { 28 | return null; 29 | } 30 | 31 | return value; 32 | } 33 | 34 | public static T? GetTaskPluginArgumentsParameter(this TaskDispatchEvent taskDispatchEvent, string key) 35 | { 36 | taskDispatchEvent.TaskPluginArguments.TryGetValue(key, out var value); 37 | if (string.IsNullOrWhiteSpace(value)) 38 | { 39 | return default; 40 | } 41 | return JsonConvert.DeserializeObject(value); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/TaskManager/API/IMetadataRepository.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.TaskManager.API 18 | { 19 | public interface IMetadataRepository : IDisposable 20 | { 21 | /// 22 | /// Retrieves metadata for the current plugin. 23 | /// 24 | /// Cancellation token. 25 | /// metadata dictionary 26 | Task> RetrieveMetadata(CancellationToken cancellationToken = default); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/TaskManager/API/InvalidTaskException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using System.Diagnostics; 18 | 19 | namespace Monai.Deploy.WorkflowManager.TaskManager.API 20 | { 21 | [DebuggerDisplay($"{{{nameof(GetDebuggerDisplay)}(),nq}}")] 22 | public class InvalidTaskException : Exception 23 | { 24 | public InvalidTaskException() 25 | { 26 | } 27 | 28 | public InvalidTaskException(string message) : base(message) 29 | { 30 | } 31 | 32 | public InvalidTaskException(string message, Exception innerException) : base(message, innerException) 33 | { 34 | } 35 | 36 | private string GetDebuggerDisplay() 37 | { 38 | return ToString(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/TaskManager/API/Migrations/M001_TaskDispatchEventInfo_addVerion.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | using Monai.Deploy.WorkflowManager.TaskManager.API.Models; 17 | using Mongo.Migration.Migrations.Document; 18 | using MongoDB.Bson; 19 | 20 | namespace Monai.Deploy.WorkflowManager.TaskManager.Migrations 21 | { 22 | public class M001_TaskDispatchEventInfo_addVerion : DocumentMigration 23 | { 24 | public M001_TaskDispatchEventInfo_addVerion() : base("1.0.0") { } 25 | 26 | public override void Up(BsonDocument document) 27 | { 28 | // empty, but this will make all objects re-saved with a version 29 | } 30 | public override void Down(BsonDocument document) 31 | { 32 | try 33 | { 34 | document.Remove("Version"); 35 | } 36 | catch (Exception) 37 | { 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/TaskManager/CallbackApp/.gitignore: -------------------------------------------------------------------------------- 1 | # Copyright 2023 MONAI Consortium 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # Unless required by applicable law or agreed to in writing, software 7 | # distributed under the License is distributed on an "AS IS" BASIS, 8 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and 10 | # limitations under the License. 11 | 12 | .env/ 13 | -------------------------------------------------------------------------------- /src/TaskManager/CallbackApp/requirements.txt: -------------------------------------------------------------------------------- 1 | pika==1.3.1 2 | -------------------------------------------------------------------------------- /src/TaskManager/Database/Logging/Log.1000.Database.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Microsoft.Extensions.Logging; 18 | 19 | namespace Monai.Deploy.WorkflowManager.TaskManager.Logging 20 | { 21 | public static partial class Log 22 | { 23 | [LoggerMessage(EventId = 1000, Level = LogLevel.Error, Message = "Database call failed in {methodName}.")] 24 | public static partial void DatabaseException(this ILogger logger, string methodName, Exception ex); 25 | 26 | [LoggerMessage(EventId = 1001, Level = LogLevel.Information, Message = "Task dispatch event saved {executionId}.")] 27 | public static partial void TaskDispatchEventSaved(this ILogger logger, string executionId); 28 | 29 | [LoggerMessage(EventId = 1002, Level = LogLevel.Information, Message = "Task dispatch event deleted {executionId}.")] 30 | public static partial void TaskDispatchEventDeleted(this ILogger logger, string executionId); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/TaskManager/Database/Options/TaskManagerDatabaseSettings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Microsoft.Extensions.Configuration; 18 | 19 | namespace Monai.Deploy.WorkflowManager.TaskManager.Database.Options 20 | { 21 | public class TaskManagerDatabaseSettings 22 | { 23 | [ConfigurationKeyName("ConnectionString")] 24 | public string ConnectionString { get; set; } = null!; 25 | 26 | [ConfigurationKeyName("DatabaseName")] 27 | public string DatabaseName { get; set; } = null!; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/TaskManager/Plug-ins/AideClinicalReview/Models/PatientMetadata.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Newtonsoft.Json; 18 | 19 | namespace Monai.Deploy.WorkflowManager.TaskManager.AideClinicalReview.Models 20 | { 21 | public class PatientMetadata 22 | { 23 | [JsonProperty(PropertyName = "patient_name")] 24 | public string? PatientName { get; set; } 25 | 26 | [JsonProperty(PropertyName = "patient_id")] 27 | public string? PatientId { get; set; } 28 | 29 | [JsonProperty(PropertyName = "patient_dob")] 30 | public string? PatientDob { get; set; } 31 | 32 | [JsonProperty(PropertyName = "patient_sex")] 33 | public string? PatientSex { get; set; } 34 | 35 | [JsonProperty(PropertyName = "patient_age")] 36 | public string? PatientAge { get; set; } 37 | 38 | [JsonProperty(PropertyName = "patient_hospital_id")] 39 | public string? PatientHospitalId { get; set; } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/TaskManager/Plug-ins/AideClinicalReview/Strings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.TaskManager.AideClinicalReview 18 | { 19 | public static class Strings 20 | { 21 | public const string IdentityKey = "IdentityKey"; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/TaskManager/Plug-ins/Argo/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using System.Runtime.CompilerServices; 18 | 19 | [assembly: InternalsVisibleTo("Monai.Deploy.WorkflowManager.TaskManager.Argo.Tests")] 20 | -------------------------------------------------------------------------------- /src/TaskManager/Plug-ins/Argo/Exceptions/ArgoWorkflowNotFoundException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.TaskManager.Argo.Exceptions 18 | { 19 | public class ArgoWorkflowNotFoundException : Exception 20 | { 21 | public ArgoWorkflowNotFoundException(string argoWorkflowName) 22 | : base($"Argo workflow '{argoWorkflowName}' not found.") 23 | { 24 | } 25 | 26 | public ArgoWorkflowNotFoundException(string? message, Exception? innerException) : base(message, innerException) 27 | { 28 | } 29 | 30 | public ArgoWorkflowNotFoundException() 31 | { 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/TaskManager/Plug-ins/Argo/Exceptions/ArtifactMappingNotFoundException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.TaskManager.Argo.Exceptions 18 | { 19 | public class ArtifactMappingNotFoundException : Exception 20 | { 21 | public ArtifactMappingNotFoundException() 22 | { 23 | } 24 | 25 | public ArtifactMappingNotFoundException(string? artifactName) : base($"Storage information cannot be found for artifact '{artifactName}'.") 26 | { 27 | } 28 | 29 | public ArtifactMappingNotFoundException(string? message, Exception? innerException) : base(message, innerException) 30 | { 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/TaskManager/Plug-ins/Argo/Exceptions/TemplateNotFoundException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.TaskManager.Argo.Exceptions 18 | { 19 | public class TemplateNotFoundException : Exception 20 | { 21 | public TemplateNotFoundException(string workflowTemplateName) 22 | : base($"WorkflowTmplate '{workflowTemplateName}' cannot be found.") 23 | { 24 | } 25 | 26 | public TemplateNotFoundException(string workflowTemplateName, string templateName) 27 | : base($"Template '{templateName}' cannot be found in the referenced WorkflowTmplate '{workflowTemplateName}'.") 28 | { 29 | } 30 | 31 | public TemplateNotFoundException(string? message, Exception? innerException) : base(message, innerException) 32 | { 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/TaskManager/Plug-ins/Argo/IArgoProvider.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Argo; 18 | 19 | namespace Monai.Deploy.WorkflowManager.TaskManager.Argo 20 | { 21 | public interface IArgoProvider 22 | { 23 | /// 24 | /// Creates an instance of the 25 | /// 26 | /// The base URL of the Argo service. 27 | /// Token for accessing Argo API. 28 | /// 29 | #pragma warning disable CA1054 // URI-like parameters should not be strings 30 | 31 | IArgoClient CreateClient(string baseUrl, string? apiToken, bool allowInsecure = true); 32 | 33 | #pragma warning restore CA1054 // URI-like parameters should not be strings 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/TaskManager/Plug-ins/Argo/IKubernetesProvider.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using k8s; 18 | 19 | namespace Monai.Deploy.WorkflowManager.TaskManager.Argo 20 | { 21 | public interface IKubernetesProvider 22 | { 23 | IKubernetes CreateClient(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/TaskManager/Plug-ins/Argo/KubernetesProvider.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using k8s; 18 | using Microsoft.Extensions.Logging; 19 | using Monai.Deploy.WorkflowManager.TaskManager.Argo.Logging; 20 | 21 | namespace Monai.Deploy.WorkflowManager.TaskManager.Argo 22 | { 23 | public class KubernetesProvider : IKubernetesProvider 24 | { 25 | private readonly ILogger _logger; 26 | 27 | public KubernetesProvider(ILogger logger) 28 | { 29 | _logger = logger ?? throw new ArgumentNullException(nameof(logger)); 30 | } 31 | 32 | public IKubernetes CreateClient() 33 | { 34 | var configuration = KubernetesClientConfiguration.BuildDefaultConfig(); 35 | _logger.CreatingKubernetesClient(configuration.Host, configuration.Namespace); 36 | 37 | return new Kubernetes(configuration); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/TaskManager/Plug-ins/Docker/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using System.Runtime.CompilerServices; 18 | 19 | [assembly: InternalsVisibleTo("Monai.Deploy.WorkflowManager.TaskManager.Docker.Tests")] 20 | -------------------------------------------------------------------------------- /src/TaskManager/Plug-ins/Docker/ContainerMonitorException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.TaskManager.Docker 18 | { 19 | internal class ContainerMonitorException : Exception 20 | { 21 | public ContainerMonitorException() 22 | { 23 | } 24 | 25 | public ContainerMonitorException(string? message) : base(message) 26 | { 27 | } 28 | 29 | public ContainerMonitorException(string? message, Exception? innerException) : base(message, innerException) 30 | { 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/TaskManager/Plug-ins/Docker/IDockerClientFactory.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Docker.DotNet; 18 | 19 | namespace Monai.Deploy.WorkflowManager.TaskManager.Docker 20 | { 21 | public interface IDockerClientFactory 22 | { 23 | IDockerClient CreateClient(Uri dockerEndpoint); 24 | } 25 | 26 | public class DockerClientFactory : IDockerClientFactory 27 | { 28 | public IDockerClient CreateClient(Uri dockerEndpoint) 29 | { 30 | return new DockerClientConfiguration(dockerEndpoint).CreateClient(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/TaskManager/Plug-ins/Docker/SetPermissionException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.TaskManager.Docker 18 | { 19 | internal class SetPermissionException : Exception 20 | { 21 | public SetPermissionException() 22 | { 23 | } 24 | 25 | public SetPermissionException(string? message) : base(message) 26 | { 27 | } 28 | 29 | public SetPermissionException(string? message, Exception? innerException) : base(message, innerException) 30 | { 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/TaskManager/Plug-ins/Email/Monai.Deploy.WorkflowManager.TaskManager.Email.csproj: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | net8.0 19 | enable 20 | enable 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/TaskManager/Plug-ins/TestPlugin/Keys.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.TaskManager.TestPlugin 18 | { 19 | internal static class Keys 20 | { 21 | /// 22 | /// Key for the status to return. 23 | /// 24 | public static readonly string ExecuteTaskStatus = "executetaskstatus"; 25 | 26 | /// 27 | /// Key for the status to return. 28 | /// 29 | public static readonly string GetStatusStatus = "getstatusstatus"; 30 | 31 | /// 32 | /// Required arguments to run the Argo workflow. 33 | /// 34 | public static readonly IReadOnlyList RequiredParameters = 35 | new List { 36 | ExecuteTaskStatus 37 | }; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/TaskManager/Plug-ins/TestPlugin/Monai.Deploy.WorkflowManager.TaskManager.TestPlugin.csproj: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | net8.0 19 | enable 20 | false 21 | enable 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/TaskManager/TaskManager/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using System.Runtime.CompilerServices; 18 | 19 | [assembly: InternalsVisibleTo("Monai.Deploy.WorkflowManager.TaskManager.Runner")] 20 | [assembly: InternalsVisibleTo("Monai.Deploy.WorkflowManager.TaskManager.Tests")] 21 | -------------------------------------------------------------------------------- /src/TaskManager/TaskManager/PluginStrings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.TaskManager 18 | { 19 | #pragma warning disable SA1600 // Elements should be documented 20 | public static class PluginStrings 21 | { 22 | // note not to be confused with the ApplicationId Monai.Deploy.WorkflowManager.TaskManager.Argo 23 | public const string Argo = "argo"; 24 | 25 | public const string Docker = "docker"; 26 | 27 | public static readonly IReadOnlyList PlugsRequiresPermanentAccounts = new List() { Argo, Docker }; 28 | } 29 | } 30 | #pragma warning restore SA1600 // Elements should be documented 31 | -------------------------------------------------------------------------------- /src/TaskManager/TaskManager/Strings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.TaskManager 18 | { 19 | internal static class Strings 20 | { 21 | public const string NoMatchingExecutorId = "No matching active task runner with specified execution ID."; 22 | public const string JobIdentity = "JobIdentity"; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/TaskManager/TaskManager/TaskManagerException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.TaskManager 18 | { 19 | internal class TaskManagerException : Exception 20 | { 21 | public TaskManagerException() 22 | { 23 | } 24 | 25 | public TaskManagerException(string? message) 26 | : base(message) 27 | { 28 | } 29 | 30 | public TaskManagerException(string? message, Exception? innerException) 31 | : base(message, innerException) 32 | { 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/TaskManager/TaskManager/stylecop.json: -------------------------------------------------------------------------------- 1 | { 2 | // ACTION REQUIRED: This file was automatically added to your project, but it 3 | // will not take effect until additional steps are taken to enable it. See the 4 | // following page for additional information: 5 | // 6 | // https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/EnableConfiguration.md 7 | 8 | "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", 9 | "settings": { 10 | "documentationRules": { 11 | "companyName": "PlaceholderCompany" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/WorkflowManager/Common/Exceptions/BadRequestException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.Common.Miscellaneous.Exceptions 18 | { 19 | public class MonaiBadRequestException : Exception 20 | { 21 | public MonaiBadRequestException() 22 | { 23 | } 24 | 25 | public MonaiBadRequestException(string message) 26 | : base(message) 27 | { 28 | } 29 | 30 | public MonaiBadRequestException(string message, Exception innerException) 31 | : base(message, innerException) 32 | { 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/WorkflowManager/Common/Exceptions/InternalServerException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.Common.Miscellaneous.Exceptions 18 | { 19 | public class MonaiInternalServerException : Exception 20 | { 21 | public MonaiInternalServerException() 22 | { 23 | } 24 | 25 | public MonaiInternalServerException(string message) 26 | : base(message) 27 | { 28 | } 29 | 30 | public MonaiInternalServerException(string message, Exception innerException) 31 | : base(message, innerException) 32 | { 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/WorkflowManager/Common/Exceptions/NotFoundException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.Common.Miscellaneous.Exceptions 18 | { 19 | public class MonaiNotFoundException : Exception 20 | { 21 | public MonaiNotFoundException() 22 | { 23 | } 24 | 25 | public MonaiNotFoundException(string message) 26 | : base(message) 27 | { 28 | } 29 | 30 | public MonaiNotFoundException(string message, Exception innerException) 31 | : base(message, innerException) 32 | { 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/WorkflowManager/Common/Extensions/ArrayExtensions.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.Common.Miscellaneous.Extensions 18 | { 19 | public static class ArrayExtensions 20 | { 21 | public static bool IsNullOrEmpty(this T[] array) 22 | { 23 | return array == null || array.Length == 0; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/WorkflowManager/Common/Extensions/FileExtensions.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Monai.Deploy.Storage.API; 18 | 19 | namespace Monai.Deploy.WorkflowManager.Common.Miscellaneous.Extensions 20 | { 21 | public static class FileExtensions 22 | { 23 | public static bool IsValidDicomFile(this VirtualFileInfo file) 24 | { 25 | if (string.IsNullOrWhiteSpace(file.FilePath)) 26 | { 27 | return false; 28 | } 29 | 30 | var extension = Path.GetExtension(file.FilePath); 31 | 32 | return extension.ToLower() == ".dcm"; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/WorkflowManager/Common/Extensions/StorageListExtensions.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Ardalis.GuardClauses; 18 | 19 | namespace Monai.Deploy.WorkflowManager.Common.Miscellaneous.Extensions 20 | { 21 | public static class StorageListExtensions 22 | { 23 | public static Dictionary ToArtifactDictionary(this List storageList) 24 | { 25 | ArgumentNullException.ThrowIfNull(storageList, nameof(storageList)); 26 | 27 | var artifactDict = new Dictionary(); 28 | 29 | foreach (var storage in storageList) 30 | { 31 | if (string.IsNullOrWhiteSpace(storage.Name) || string.IsNullOrWhiteSpace(storage.RelativeRootPath)) 32 | { 33 | continue; 34 | } 35 | 36 | artifactDict.Add(storage.Name, storage.RelativeRootPath); 37 | } 38 | 39 | return artifactDict; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/WorkflowManager/Common/Interfaces/IPaginatedApi.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using MongoDB.Driver; 18 | 19 | namespace Monai.Deploy.WorkflowManager.Common.Miscellaneous.Interfaces 20 | { 21 | public interface IPaginatedApi 22 | { 23 | Task CountAsync(FilterDefinition? filter = null); 24 | 25 | Task> GetAllAsync(int? skip = null, int? limit = null); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/WorkflowManager/Common/Interfaces/ITasksService.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Monai.Deploy.WorkflowManager.Common.Contracts.Models; 18 | 19 | namespace Monai.Deploy.WorkflowManager.Common.Miscellaneous.Interfaces 20 | { 21 | public interface ITasksService 22 | { 23 | Task<(IList Tasks, long Count)> GetAllAsync(int? skip = null, int? limit = null); 24 | 25 | Task GetTaskAsync(string workflowInstanceId, string taskId, string executionId); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/WorkflowManager/ConditionsResolver/Extensions/RegexExtensions.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using System.Text.RegularExpressions; 18 | 19 | namespace Monai.Deploy.WorkflowManager.Common.ConditionsResolver.Extensions 20 | { 21 | public static class RegexExtensions 22 | { 23 | public static string[] SplitOnce(this Regex regex, string input) 24 | { 25 | if (input is null) 26 | { 27 | throw new ArgumentNullException(nameof(input)); 28 | } 29 | var inputArr = regex.Split(input); 30 | return new string[] { inputArr.First(), string.Join(string.Empty, inputArr.Skip(1)) }; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/WorkflowManager/ConditionsResolver/Resovler/Keyword.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.ConditionsResolver.Resovler 18 | { 19 | /// 20 | /// Group Keywords or Operators 21 | /// 22 | public enum Keyword 23 | { 24 | Singular, 25 | And, 26 | Or, 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/WorkflowManager/Contracts/Constants/TaskTypeConstants.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.Common.Contracts.Constants 18 | { 19 | public static class TaskTypeConstants 20 | { 21 | public const string RouterTask = "router"; 22 | 23 | public const string DicomExportTask = "export"; 24 | 25 | public const string ExternalAppTask = "remote_app_execution"; 26 | 27 | public const string HL7ExportTask = "export_hl7"; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/WorkflowManager/Contracts/Migrations/M001_ExecutionStats_addVersion.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Monai.Deploy.WorkflowManager.Common.Contracts.Models; 18 | using Mongo.Migration.Migrations.Document; 19 | using MongoDB.Bson; 20 | 21 | namespace Monai.Deploy.WorkflowManager.Common.Contracts.Migrations 22 | { 23 | public class M001_ExecutionStats_addVersion : DocumentMigration 24 | { 25 | public M001_ExecutionStats_addVersion() : base("1.0.1") { } 26 | 27 | public override void Up(BsonDocument document) 28 | { 29 | // empty, but this will make all objects re-saved with a version 30 | } 31 | public override void Down(BsonDocument document) 32 | { 33 | try 34 | { 35 | document.Remove("Version"); 36 | } 37 | catch 38 | { // can ignore we dont want failures stopping startup ! 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/WorkflowManager/Contracts/Migrations/M001_Payload_addVerion.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023 Guy’s and St Thomas’ NHS Foundation Trust 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Monai.Deploy.WorkflowManager.Common.Contracts.Models; 17 | using Mongo.Migration.Migrations.Document; 18 | using MongoDB.Bson; 19 | 20 | namespace Monai.Deploy.WorkflowManager.Common.Contracts.Migrations 21 | { 22 | public class M001_Payload_addVerion : DocumentMigration 23 | { 24 | public M001_Payload_addVerion() : base("1.0.1") { } 25 | 26 | public override void Up(BsonDocument document) 27 | { 28 | // empty, but this will make all objects re-saved with a version 29 | } 30 | public override void Down(BsonDocument document) 31 | { 32 | try 33 | { 34 | document.Remove("Version"); 35 | } 36 | catch 37 | { // can ignore we dont want failures stopping startup ! 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/WorkflowManager/Contracts/Migrations/M001_WorkflowInstance_addVerion.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023 Guy’s and St Thomas’ NHS Foundation Trust 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Monai.Deploy.WorkflowManager.Common.Contracts.Models; 17 | using Mongo.Migration.Migrations.Document; 18 | using MongoDB.Bson; 19 | 20 | namespace Monai.Deploy.WorkflowManager.Common.Contracts.Migrations 21 | { 22 | public class M001_WorkflowInstance_addVerion : DocumentMigration 23 | { 24 | public M001_WorkflowInstance_addVerion() : base("1.0.0") { } 25 | 26 | public override void Up(BsonDocument document) 27 | { 28 | // empty, but this will make all objects re-saved with a version 29 | } 30 | public override void Down(BsonDocument document) 31 | { 32 | try 33 | { 34 | document.Remove("Version"); 35 | } 36 | catch 37 | { // can ignore we dont want failures stopping startup ! 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/WorkflowManager/Contracts/Migrations/M002_ExecutionStats_addWorkflowId.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Monai.Deploy.WorkflowManager.Common.Contracts.Models; 18 | using Mongo.Migration.Migrations.Document; 19 | using MongoDB.Bson; 20 | 21 | namespace Monai.Deploy.WorkflowManager.Common.Contracts.Migrations 22 | { 23 | public class M002_ExecutionStats_addWorkflowId : DocumentMigration 24 | { 25 | public M002_ExecutionStats_addWorkflowId() : base("1.0.2") { } 26 | 27 | public override void Up(BsonDocument document) 28 | { 29 | // empty, but this will make all objects re-saved with a workflowId 30 | } 31 | public override void Down(BsonDocument document) 32 | { 33 | try 34 | { 35 | document.Remove("WorkflowId"); 36 | } 37 | catch 38 | { // can ignore we dont want failures stopping startup ! 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/WorkflowManager/Contracts/Migrations/M002_Payload_addPayloadDeleted.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023 Guy’s and St Thomas’ NHS Foundation Trust 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Monai.Deploy.WorkflowManager.Common.Contracts.Models; 17 | using Mongo.Migration.Migrations.Document; 18 | using MongoDB.Bson; 19 | 20 | namespace Monai.Deploy.WorkflowManager.Common.Contracts.Migrations 21 | { 22 | public class M002_Payload_addPayloadDeleted : DocumentMigration 23 | { 24 | public M002_Payload_addPayloadDeleted() : base("1.0.2") { } 25 | 26 | public override void Up(BsonDocument document) 27 | { 28 | document.Add("PayloadDeleted", PayloadDeleted.No); 29 | } 30 | 31 | public override void Down(BsonDocument document) 32 | { 33 | try 34 | { 35 | document.Remove("PayloadDeleted"); 36 | } 37 | catch 38 | { // can ignore we dont want failures stopping startup ! 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/WorkflowManager/Contracts/Migrations/M002_WorkflowRevision_addVerion.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023 Guy’s and St Thomas’ NHS Foundation Trust 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Monai.Deploy.WorkflowManager.Common.Contracts.Models; 17 | using Mongo.Migration.Migrations.Document; 18 | using MongoDB.Bson; 19 | 20 | namespace Monai.Deploy.WorkflowManager.Common.Contracts.Migrations 21 | { 22 | public class M002_WorkflowRevision_addVerion : DocumentMigration 23 | { 24 | public M002_WorkflowRevision_addVerion() : base("1.0.2") { } 25 | 26 | public override void Up(BsonDocument document) 27 | { 28 | // empty, but this will make all objects re-saved with a version 29 | } 30 | public override void Down(BsonDocument document) 31 | { 32 | try 33 | { 34 | document.Remove("Version"); 35 | } 36 | catch 37 | { // can ignore we dont want failures stopping startup ! 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/WorkflowManager/Contracts/Migrations/M003_ExecutionStats_addFailureReason.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Monai.Deploy.WorkflowManager.Common.Contracts.Models; 18 | using Mongo.Migration.Migrations.Document; 19 | using MongoDB.Bson; 20 | 21 | namespace Monai.Deploy.WorkflowManager.Common.Contracts.Migrations 22 | { 23 | public class M003_ExecutionStats_addFailureReason : DocumentMigration 24 | { 25 | public M003_ExecutionStats_addFailureReason() : base("1.0.3") { } 26 | 27 | public override void Up(BsonDocument document) 28 | { 29 | // empty, but this will make all objects re-saved with a reason 30 | } 31 | public override void Down(BsonDocument document) 32 | { 33 | try 34 | { 35 | document.Remove("Reason"); 36 | } 37 | catch 38 | { // can ignore we dont want failures stopping startup ! 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/WorkflowManager/Contracts/Migrations/M004_Payload_expires.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023 Guy’s and St Thomas’ NHS Foundation Trust 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Monai.Deploy.WorkflowManager.Common.Contracts.Models; 17 | using Mongo.Migration.Migrations.Document; 18 | using MongoDB.Bson; 19 | 20 | namespace Monai.Deploy.WorkflowManager.Common.Contracts.Migrations 21 | { 22 | public class M004_Payload_Expires : DocumentMigration 23 | { 24 | public M004_Payload_Expires() : base("1.0.4") { } 25 | 26 | public override void Up(BsonDocument document) 27 | { 28 | document.Add("Expires", BsonNull.Create(null).ToJson(), true); //null = never expires 29 | } 30 | 31 | public override void Down(BsonDocument document) 32 | { 33 | try 34 | { 35 | document.Remove("DataTrigger"); 36 | } 37 | catch 38 | { // can ignore we dont want failures stopping startup ! 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/WorkflowManager/Contracts/Migrations/M005_Payload_seriesUid.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023 Guy’s and St Thomas’ NHS Foundation Trust 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Monai.Deploy.WorkflowManager.Common.Contracts.Models; 17 | using Mongo.Migration.Migrations.Document; 18 | using MongoDB.Bson; 19 | 20 | namespace Monai.Deploy.WorkflowManager.Common.Contracts.Migrations 21 | { 22 | public class M005_Payload_seriesUid : DocumentMigration 23 | { 24 | public M005_Payload_seriesUid() : base("1.0.5") { } 25 | 26 | public override void Up(BsonDocument document) 27 | { 28 | try 29 | { 30 | document.Add("SeriesInstanceUid", new BsonString(""), true); 31 | } 32 | catch 33 | { 34 | } 35 | } 36 | 37 | public override void Down(BsonDocument document) 38 | { 39 | try 40 | { 41 | document.Remove("SeriesInstanceUid"); 42 | } 43 | catch 44 | { // can ignore we dont want failures stopping startup ! 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/WorkflowManager/Contracts/Migrations/M007_Payload_addAccessionId.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2023 Guy’s and St Thomas’ NHS Foundation Trust 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | using Monai.Deploy.WorkflowManager.Common.Contracts.Models; 17 | using Mongo.Migration.Migrations.Document; 18 | using MongoDB.Bson; 19 | 20 | namespace Monai.Deploy.WorkflowManager.Common.Contracts.Migrations 21 | { 22 | public class M007_Payload_addAccessionId : DocumentMigration 23 | { 24 | public M007_Payload_addAccessionId() : base("1.0.7") { } 25 | 26 | public override void Up(BsonDocument document) 27 | { 28 | try 29 | { 30 | document.Add("AccessionId", new BsonString(""), true); 31 | } 32 | catch 33 | { 34 | } 35 | } 36 | 37 | public override void Down(BsonDocument document) 38 | { 39 | try 40 | { 41 | document.Remove("AccessionId"); 42 | } 43 | catch 44 | { // can ignore we dont want failures stopping startup ! 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/WorkflowManager/Contracts/Models/ApplicationReviewStatus.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.Common.Contracts.Models 18 | { 19 | public enum ApplicationReviewStatus 20 | { 21 | Approved, 22 | Rejected, 23 | Cancelled, 24 | AwaitingReview 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/WorkflowManager/Contracts/Models/Artifact.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using System; 18 | using System.Collections.Generic; 19 | using System.Linq; 20 | using Monai.Deploy.Messaging.Common; 21 | using Newtonsoft.Json; 22 | 23 | namespace Monai.Deploy.WorkflowManager.Common.Contracts.Models 24 | { 25 | public class OutputArtifact : Artifact 26 | { 27 | [JsonProperty(PropertyName = "type", DefaultValueHandling = DefaultValueHandling.Ignore)] 28 | public ArtifactType Type { get; set; } = ArtifactType.Unset; 29 | } 30 | 31 | public class Artifact 32 | { 33 | [JsonProperty(PropertyName = "name")] 34 | public string Name { get; set; } = string.Empty; 35 | 36 | [JsonProperty(PropertyName = "value")] 37 | public string Value { get; set; } = string.Empty; 38 | 39 | [JsonProperty(PropertyName = "mandatory")] 40 | public bool Mandatory { get; set; } = true; 41 | 42 | public override string ToString() 43 | { 44 | return JsonConvert.SerializeObject(this); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/WorkflowManager/Contracts/Models/ArtifactMap.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Newtonsoft.Json; 18 | 19 | namespace Monai.Deploy.WorkflowManager.Common.Contracts.Models 20 | { 21 | public class ArtifactMap 22 | { 23 | [JsonProperty(PropertyName = "input")] 24 | public Artifact[] Input { get; set; } = System.Array.Empty(); 25 | 26 | [JsonProperty(PropertyName = "output")] 27 | public OutputArtifact[] Output { get; set; } = System.Array.Empty(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/WorkflowManager/Contracts/Models/DicomValue.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Newtonsoft.Json; 18 | 19 | namespace Monai.Deploy.WorkflowManager.Common.Contracts.Models 20 | { 21 | public class DicomValue 22 | { 23 | [JsonProperty(PropertyName = "vr")] 24 | public string Vr { get; set; } = string.Empty; 25 | 26 | [JsonProperty(PropertyName = "Value")] 27 | public object[] Value { get; set; } = System.Array.Empty(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/WorkflowManager/Contracts/Models/ExecutionStatDTO.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using System; 18 | 19 | namespace Monai.Deploy.WorkflowManager.Common.Contracts.Models 20 | { 21 | 22 | public class ExecutionStatDTO 23 | { 24 | public ExecutionStatDTO(ExecutionStats stats) 25 | { 26 | ExecutionId = stats.ExecutionId; 27 | StartedAt = stats.StartedUTC; 28 | FinishedAt = stats.CompletedAtUTC; 29 | Status = stats.Status; 30 | ExecutionDurationSeconds = stats.ExecutionTimeSeconds; 31 | } 32 | 33 | public string ExecutionId { get; set; } = string.Empty; 34 | public DateTime StartedAt { get; set; } 35 | public DateTime FinishedAt { get; set; } 36 | public double ExecutionDurationSeconds { get; set; } 37 | public string Status { get; set; } = "Created"; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/WorkflowManager/Contracts/Models/ExecutionStatDayOverview.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using System; 18 | using Newtonsoft.Json; 19 | 20 | namespace Monai.Deploy.WorkflowManager.Common.Contracts.Models 21 | { 22 | public class ExecutionStatDayOverview 23 | { 24 | [JsonProperty("date")] 25 | public DateOnly Date { get; set; } 26 | [JsonProperty("total_executions")] 27 | public int TotalExecutions { get; set; } 28 | [JsonProperty("total_failures")] 29 | public int TotalFailures { get; set; } 30 | [JsonProperty("total_approvals")] 31 | public int TotalApprovals { get; set; } 32 | [JsonProperty("total_rejections")] 33 | public int TotalRejections { get; set; } 34 | [JsonProperty("total_cancelled")] 35 | public int TotalCancelled { get; set; } 36 | [JsonProperty("total_awaiting_review")] 37 | public int TotalAwaitingReview { get; set; } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/WorkflowManager/Contracts/Models/ExportDestination.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Newtonsoft.Json; 18 | 19 | namespace Monai.Deploy.WorkflowManager.Common.Contracts.Models 20 | { 21 | public class ExportDestination 22 | { 23 | [JsonProperty(PropertyName = "name")] 24 | public string Name { get; set; } = string.Empty; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/WorkflowManager/Contracts/Models/ISoftDeleteable.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using System; 18 | 19 | namespace Monai.Deploy.WorkflowManager.Common.Contracts.Models 20 | { 21 | public interface ISoftDeleteable 22 | { 23 | DateTime? Deleted { get; set; } 24 | 25 | bool IsDeleted { get => Deleted is not null; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/WorkflowManager/Contracts/Models/InformaticsGateway.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Newtonsoft.Json; 18 | 19 | namespace Monai.Deploy.WorkflowManager.Common.Contracts.Models 20 | { 21 | public class InformaticsGateway 22 | { 23 | [JsonProperty(PropertyName = "ae_title")] 24 | public string AeTitle { get; set; } = string.Empty; 25 | 26 | [JsonProperty(PropertyName = "data_origins")] 27 | public string[] DataOrigins { get; set; } = System.Array.Empty(); 28 | 29 | [JsonProperty(PropertyName = "export_destinations")] 30 | public string[] ExportDestinations { get; set; } = System.Array.Empty(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/WorkflowManager/Contracts/Models/PatientDetails.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using System; 18 | using Newtonsoft.Json; 19 | 20 | namespace Monai.Deploy.WorkflowManager.Common.Contracts.Models 21 | { 22 | public class PatientDetails 23 | { 24 | [JsonProperty(PropertyName = "patient_id")] 25 | public string? PatientId { get; set; } 26 | 27 | [JsonProperty(PropertyName = "patient_name")] 28 | public string? PatientName { get; set; } 29 | 30 | [JsonProperty(PropertyName = "patient_sex")] 31 | public string? PatientSex { get; set; } 32 | 33 | [JsonProperty(PropertyName = "patient_dob")] 34 | public DateTime? PatientDob { get; set; } 35 | 36 | [JsonProperty(PropertyName = "patient_age")] 37 | public string? PatientAge { get; set; } 38 | 39 | [JsonProperty(PropertyName = "patient_hospital_id")] 40 | public string? PatientHospitalId { get; set; } 41 | 42 | public override string ToString() 43 | { 44 | return JsonConvert.SerializeObject(this); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/WorkflowManager/Contracts/Models/Status.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.Common.Contracts.Models 18 | { 19 | public enum Status 20 | { 21 | Created, 22 | Succeeded, 23 | Failed, 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/WorkflowManager/Contracts/Models/TaskDestination.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using System; 18 | using Newtonsoft.Json; 19 | 20 | namespace Monai.Deploy.WorkflowManager.Common.Contracts.Models 21 | { 22 | public class TaskDestination 23 | { 24 | [JsonProperty(PropertyName = "name")] 25 | public string Name { get; set; } = string.Empty; 26 | 27 | [JsonProperty(PropertyName = "conditions")] 28 | public string[] Conditions { get; set; } = Array.Empty(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/WorkflowManager/Contracts/Models/WorkflowUpdateRequest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Newtonsoft.Json; 18 | 19 | namespace Monai.Deploy.WorkflowManager.Common.Contracts.Models 20 | { 21 | public class WorkflowUpdateRequest 22 | { 23 | [JsonProperty(PropertyName = "original_workflow_name")] 24 | public string OriginalWorkflowName { get; set; } = ""; 25 | 26 | [JsonProperty(PropertyName = "workflow")] 27 | public Workflow Workflow { get; set; } = new(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/WorkflowManager/Contracts/Responses/CreateWorkflowResponse.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Newtonsoft.Json; 18 | 19 | namespace Monai.Deploy.WorkflowManager.Common.Contracts.Responses 20 | { 21 | public class CreateWorkflowResponse 22 | { 23 | public CreateWorkflowResponse(string workflowId) 24 | { 25 | WorkflowId = workflowId; 26 | } 27 | 28 | [JsonProperty("workflow_id")] 29 | public string WorkflowId { get; set; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/WorkflowManager/Database/Interfaces/IWorkflowRepository.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/src/WorkflowManager/Database/Interfaces/IWorkflowRepository.cs -------------------------------------------------------------------------------- /src/WorkflowManager/Database/Options/ExecutionStatsDatabaseSettings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Microsoft.Extensions.Configuration; 18 | 19 | namespace Monai.Deploy.WorkflowManager.Common.Database.Options 20 | { 21 | public class ExecutionStatsDatabaseSettings 22 | { 23 | [ConfigurationKeyName("ConnectionString")] 24 | public string ConnectionString { get; set; } = null!; 25 | 26 | [ConfigurationKeyName("DatabaseName")] 27 | public string DatabaseName { get; set; } = null!; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/WorkflowManager/Database/Options/WorkloadManagerDatabaseSettings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Microsoft.Extensions.Configuration; 18 | 19 | namespace Monai.Deploy.WorkflowManager.Common.Database.Options 20 | { 21 | public class WorkloadManagerDatabaseSettings 22 | { 23 | [ConfigurationKeyName("ConnectionString")] 24 | public string ConnectionString { get; set; } = null!; 25 | 26 | [ConfigurationKeyName("DatabaseName")] 27 | public string DatabaseName { get; set; } = null!; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/WorkflowManager/Logging/Monai.Deploy.WorkflowManager.Logging.csproj: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | net8.0 19 | enable 20 | false 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | true 33 | true 34 | ..\..\.sonarlint\project-monai_monai-deploy-workflow-managercsharp.ruleset 35 | 36 | -------------------------------------------------------------------------------- /src/WorkflowManager/Services/InformaticsGateway/IInformaticsGatewayService.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.Common.Services.InformaticsGateway 18 | { 19 | public interface IInformaticsGatewayService 20 | { 21 | /// 22 | /// Checks if a data origin exists with the informatics gateway. 23 | /// 24 | /// Name of the source. 25 | /// bool based on success status on the informatics gateway request. 26 | Task OriginExists(string name); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/WorkflowManager/Storage/Constants/DicomTagConstants.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.Common.Storage.Constants 18 | { 19 | public static class DicomTagConstants 20 | { 21 | public const string PatientIdTag = "00100020"; 22 | 23 | public const string PatientNameTag = "00100010"; 24 | 25 | public const string PatientSexTag = "00100040"; 26 | 27 | public const string PatientDateOfBirthTag = "00100030"; 28 | 29 | public const string PatientAgeTag = "00101010"; 30 | 31 | public const string PatientHospitalIdTag = "00100021"; 32 | 33 | public const string SeriesInstanceUIDTag = "0020000E"; 34 | 35 | public const string AccessionNumberTag = "00080050"; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/WorkflowManager/WorkflowManager/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using System.Runtime.CompilerServices; 18 | 19 | [assembly: InternalsVisibleTo("Monai.Deploy.WorkflowManager.Tests")] 20 | [assembly: InternalsVisibleTo("Monai.Deploy.WorkflowManager.IntegrationTests")] 21 | 22 | // ILogger 23 | [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] 24 | -------------------------------------------------------------------------------- /src/WorkflowManager/WorkflowManager/Controllers/AuthenticatedApiControllerBase.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Microsoft.AspNetCore.Authorization; 18 | using Microsoft.Extensions.Options; 19 | using Monai.Deploy.WorkflowManager.Common.Configuration; 20 | 21 | namespace Monai.Deploy.WorkflowManager.Common.ControllersShared 22 | { 23 | /// 24 | /// Base authenticated api controller base. 25 | /// 26 | [Authorize] 27 | public class AuthenticatedApiControllerBase : PaginationApiControllerBase 28 | { 29 | /// 30 | /// Initializes a new instance of the class. 31 | /// 32 | /// Options. 33 | public AuthenticatedApiControllerBase(IOptions options) 34 | : base(options) 35 | { 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/WorkflowManager/WorkflowManager/Models/TasksRequest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Newtonsoft.Json; 18 | 19 | namespace Monai.Deploy.WorkflowManager.Common.Models 20 | { 21 | /// 22 | /// TasksRequest model. 23 | /// 24 | public class TasksRequest 25 | { 26 | /// 27 | /// Gets or sets WorkflowInstanceId. 28 | /// 29 | [JsonProperty(PropertyName = "workflowInstanceId")] 30 | public string WorkflowInstanceId { get; set; } 31 | 32 | /// 33 | /// Gets or sets TaskId. 34 | /// 35 | [JsonProperty(PropertyName = "taskId")] 36 | public string TaskId { get; set; } 37 | 38 | /// 39 | /// Gets or sets ExecutionId. 40 | /// 41 | [JsonProperty(PropertyName = "executionId")] 42 | public string ExecutionId { get; set; } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/WorkflowManager/WorkflowManager/stylecop.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", 3 | "settings": { 4 | "orderingRules": { 5 | "usingDirectivesPlacement": "outsideNamespace" 6 | }, 7 | "documentationRules": { 8 | "copyrightText": "Copyright YYYY MONAI Consortium\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the at\n\n http:\nwww.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.", 9 | "companyName": "MONAI Consortium", 10 | "xmlHeader": false 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /src/global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "5.0" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /stylecop.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", 3 | "settings": { 4 | "orderingRules": { 5 | "usingDirectivesPlacement": "outsideNamespace" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /tests/IntegrationTests/TaskManager.IntegrationTests/DICOMs/dcm/series1/07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/tests/IntegrationTests/TaskManager.IntegrationTests/DICOMs/dcm/series1/07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm -------------------------------------------------------------------------------- /tests/IntegrationTests/TaskManager.IntegrationTests/DICOMs/dcm/series2/07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/tests/IntegrationTests/TaskManager.IntegrationTests/DICOMs/dcm/series2/07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm -------------------------------------------------------------------------------- /tests/IntegrationTests/TaskManager.IntegrationTests/Features/HealthApi.feature: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | @IntergrationTests 16 | Feature: HealthApi 17 | 18 | Health check API for Task Manager. 19 | 20 | @HealthChecksTaskManager 21 | Scenario: Get Health status of Task Manager 22 | Given I have a TaskManager endpoint /health 23 | When I send a GET request 24 | Then I will get a 503 response 25 | And I will get a health check response message 26 | -------------------------------------------------------------------------------- /tests/IntegrationTests/TaskManager.IntegrationTests/Features/__snapshots__/ExecutionStatsFeature.ExecutionStatsAreNotReturnedIfWorkflowOrTaskIsNotFound_Workflow_1_Task_3_.snap: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | { 17 | "periodStart": "2023-01-01T00:00:00", 18 | "periodEnd": "2023-04-26T15:01:00.9582693+01:00", 19 | "totalExecutions": 0, 20 | "totalFailures": 0, 21 | "totalInprogress": 1, 22 | "averageTotalExecutionSeconds": 0.0, 23 | "averageArgoExecutionSeconds": 0.0, 24 | "pageNumber": 1, 25 | "pageSize": 10, 26 | "firstPage": "/tasks/stats?pageNumber=1&pageSize=10", 27 | "lastPage": "/tasks/stats?pageNumber=1&pageSize=10", 28 | "totalPages": 0, 29 | "totalRecords": 0, 30 | "nextPage": null, 31 | "previousPage": null, 32 | "data": [], 33 | "succeeded": true, 34 | "errors": null, 35 | "message": null 36 | } 37 | -------------------------------------------------------------------------------- /tests/IntegrationTests/TaskManager.IntegrationTests/Features/__snapshots__/ExecutionStatsFeature.ExecutionStatsAreNotReturnedIfWorkflowOrTaskIsNotFound_Workflow_2_Task_1_.snap: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | { 17 | "periodStart": "2023-01-01T00:00:00", 18 | "periodEnd": "2023-04-26T15:01:00.678874+01:00", 19 | "totalExecutions": 0, 20 | "totalFailures": 0, 21 | "totalInprogress": 1, 22 | "averageTotalExecutionSeconds": 0.0, 23 | "averageArgoExecutionSeconds": 0.0, 24 | "pageNumber": 1, 25 | "pageSize": 10, 26 | "firstPage": "/tasks/stats?pageNumber=1&pageSize=10", 27 | "lastPage": "/tasks/stats?pageNumber=1&pageSize=10", 28 | "totalPages": 0, 29 | "totalRecords": 0, 30 | "nextPage": null, 31 | "previousPage": null, 32 | "data": [], 33 | "succeeded": true, 34 | "errors": null, 35 | "message": null 36 | } 37 | -------------------------------------------------------------------------------- /tests/IntegrationTests/TaskManager.IntegrationTests/Features/__snapshots__/ExecutionStatsFeature.SummaryOfExecutionStatsAreReturned_-31_.snap: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | { 17 | "periodStart": "2023-03-26T14:00:13Z", 18 | "periodEnd": "2023-04-05T14:00:13Z", 19 | "totalExecutions": 1, 20 | "totalFailures": 0, 21 | "totalInprogress": 0, 22 | "averageTotalExecutionSeconds": 30.0, 23 | "averageArgoExecutionSeconds": 30.0 24 | } 25 | -------------------------------------------------------------------------------- /tests/IntegrationTests/TaskManager.IntegrationTests/Features/__snapshots__/ExecutionStatsFeature.SummaryOfExecutionStatsAreReturned_-61_.snap: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | { 17 | "periodStart": "2023-02-24T14:00:21Z", 18 | "periodEnd": "2023-03-06T14:00:21Z", 19 | "totalExecutions": 4, 20 | "totalFailures": 1, 21 | "totalInprogress": 0, 22 | "averageTotalExecutionSeconds": 30.0, 23 | "averageArgoExecutionSeconds": 30.0 24 | } 25 | -------------------------------------------------------------------------------- /tests/IntegrationTests/TaskManager.IntegrationTests/Features/__snapshots__/HealthApiFeature.GetHealthStatusOfTaskManager.snap: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | { 18 | "status": "Unhealthy", 19 | "checks": [ 20 | { 21 | "check": "Task Manager Services", 22 | "result": "Healthy" 23 | }, 24 | { 25 | "check": "mongodb", 26 | "result": "Healthy" 27 | }, 28 | { 29 | "check": "minio", 30 | "result": "Healthy" 31 | }, 32 | { 33 | "check": "minio-admin", 34 | "result": "Unhealthy" 35 | }, 36 | { 37 | "check": "Rabbit MQ Publisher", 38 | "result": "Healthy" 39 | }, 40 | { 41 | "check": "Rabbit MQ Subscriber", 42 | "result": "Healthy" 43 | } 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /tests/IntegrationTests/TaskManager.IntegrationTests/ImplicitUsings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | global using BoDi; 18 | global using TechTalk.SpecFlow; 19 | global using TechTalk.SpecFlow.Infrastructure; 20 | -------------------------------------------------------------------------------- /tests/IntegrationTests/TaskManager.IntegrationTests/POCO/HealthCheckResponse.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.TaskManager.IntegrationTests.POCO 18 | { 19 | internal class HealthCheckResponse 20 | { 21 | public string Status { get; set; } = string.Empty; 22 | public List Checks { get; set; } = new List(); 23 | } 24 | 25 | internal class Component 26 | { 27 | public string Check { get; set; } = string.Empty; 28 | public string Result { get; set; } = string.Empty; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /tests/IntegrationTests/TaskManager.IntegrationTests/TestData/Helper.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.TaskManager.IntegrationTests 18 | { 19 | public static class Helper 20 | { 21 | public static TaskDispatchTestData GetTaskDispatchByName(string name) 22 | { 23 | var taskDispatchTestData = TaskDispatchesTestData.TestData.FirstOrDefault(c => c.Name!.Contains(name)); 24 | 25 | if (taskDispatchTestData != null) 26 | { 27 | return taskDispatchTestData; 28 | } 29 | 30 | throw new Exception($"Task Dispatch {name} does not exist. Please check and try again!"); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /tests/IntegrationTests/WorkflowExecutor.IntegrationTests/DICOMs/full_patient_metadata/dcm/07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/DICOMs/full_patient_metadata/dcm/07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm -------------------------------------------------------------------------------- /tests/IntegrationTests/WorkflowExecutor.IntegrationTests/DICOMs/no_patient_metadata/dcm/07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/DICOMs/no_patient_metadata/dcm/07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm -------------------------------------------------------------------------------- /tests/IntegrationTests/WorkflowExecutor.IntegrationTests/DICOMs/null_patient_metadata/dcm/07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/DICOMs/null_patient_metadata/dcm/07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm -------------------------------------------------------------------------------- /tests/IntegrationTests/WorkflowExecutor.IntegrationTests/DICOMs/output_metadata/dcm/output.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/DICOMs/output_metadata/dcm/output.dcm -------------------------------------------------------------------------------- /tests/IntegrationTests/WorkflowExecutor.IntegrationTests/DICOMs/output_metadata_multiple_files/dcm/output1.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/DICOMs/output_metadata_multiple_files/dcm/output1.dcm -------------------------------------------------------------------------------- /tests/IntegrationTests/WorkflowExecutor.IntegrationTests/DICOMs/output_metadata_multiple_files/dcm/output2.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/DICOMs/output_metadata_multiple_files/dcm/output2.dcm -------------------------------------------------------------------------------- /tests/IntegrationTests/WorkflowExecutor.IntegrationTests/DICOMs/output_metadata_multiple_files/dcm/output3.DCM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/DICOMs/output_metadata_multiple_files/dcm/output3.DCM -------------------------------------------------------------------------------- /tests/IntegrationTests/WorkflowExecutor.IntegrationTests/DICOMs/output_metadata_multiple_files/dcm/output4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/DICOMs/output_metadata_multiple_files/dcm/output4 -------------------------------------------------------------------------------- /tests/IntegrationTests/WorkflowExecutor.IntegrationTests/DICOMs/partial_patient_metadata/dcm/07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/DICOMs/partial_patient_metadata/dcm/07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm -------------------------------------------------------------------------------- /tests/IntegrationTests/WorkflowExecutor.IntegrationTests/DICOMs/patient_1_lordge/dcm/07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/DICOMs/patient_1_lordge/dcm/07051db3-3c1d-4bf2-8764-ba45dc918e74.dcm -------------------------------------------------------------------------------- /tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/ArtifactReceivedEvent.feature: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | @IntergrationTests 16 | Feature: ArtifactReceivedEvent 17 | 18 | Publishing a artifact received event is consumed by the Workflow Manager. 19 | 20 | @ArtifactReceivedEvent 21 | Scenario Outline: Publish a valid Artifact Received Event which creates an entry. 22 | Given I have a clinical workflow I have a Workflow Instance 23 | When I publish a Artifact Received Event 24 | Then I can see 2 Artifact Received Items is created 25 | Examples: 26 | | clinicalWorkflow | workflowInstance | artifactReceivedEvent | 27 | | Workflow_Revision_For_Artifact_ReceivedEvent_1 | Workflow_Instance_For_Artifact_ReceivedEvent_1 | Test1 | 28 | -------------------------------------------------------------------------------- /tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/HealthApi.feature: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | @IntergrationTests 16 | Feature: HealthApi 17 | 18 | Health check API for Workflow Manager. 19 | 20 | @HealthChecksWorkflowManager 21 | Scenario: Get Health status of Workflow Manager 22 | Given I have an endpoint /health 23 | When I send a GET request 24 | Then I will get a 200 response 25 | And I will get a health check response status message Healthy -------------------------------------------------------------------------------- /tests/IntegrationTests/WorkflowExecutor.IntegrationTests/ImplicitUsings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | global using FluentAssertions; 18 | global using TechTalk.SpecFlow; 19 | -------------------------------------------------------------------------------- /tests/IntegrationTests/WorkflowExecutor.IntegrationTests/POCO/HealthCheckResponse.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | namespace Monai.Deploy.WorkflowManager.Common.IntegrationTests.POCO 18 | { 19 | internal class HealthCheckResponse 20 | { 21 | public string Status { get; set; } = string.Empty; 22 | public List Checks { get; set; } = new List(); 23 | } 24 | 25 | internal class Component 26 | { 27 | public string Check { get; set; } = string.Empty; 28 | public string Result { get; set; } = string.Empty; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/JsonFormatter.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using Newtonsoft.Json; 18 | using Newtonsoft.Json.Linq; 19 | 20 | namespace Monai.Deploy.WorkflowManager.Common.IntegrationTests.Support 21 | { 22 | internal static class JsonFormatter 23 | { 24 | public static string FormatJson(string json) 25 | { 26 | return JToken.Parse(json).ToString(Formatting.Indented); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/MessageReceiver.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using RabbitMQ.Client; 18 | 19 | namespace Monai.Deploy.WorkflowManager.Common.IntegrationTests.Support 20 | { 21 | [Binding] 22 | public class MessageReceiver : DefaultBasicConsumer 23 | { 24 | private readonly IModel _channel; 25 | 26 | public MessageReceiver(IModel channel) 27 | { 28 | _channel = channel; 29 | } 30 | 31 | public override void HandleBasicDeliver(string consumerTag, ulong deliveryTag, bool redelivered, string exchange, string routingKey, IBasicProperties properties, ReadOnlyMemory body) 32 | { 33 | // TO DO Assertions 34 | _channel.BasicAck(deliveryTag, false); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /tests/IntegrationTests/static/Task_Manager_Int_Test_Architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/tests/IntegrationTests/static/Task_Manager_Int_Test_Architecture.png -------------------------------------------------------------------------------- /tests/IntegrationTests/static/Workflow_Executor_Int_Test_Architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-MONAI/monai-deploy-workflow-manager/9e10e9506619ce810a3c47f82ec031fcf8e1f480/tests/IntegrationTests/static/Workflow_Executor_Int_Test_Architecture.png -------------------------------------------------------------------------------- /tests/UnitTests/Monai.Deploy.WorkflowManager.Shared.Tests/Usings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | global using Xunit; -------------------------------------------------------------------------------- /tests/UnitTests/MonaiBackgroundService.Tests/Usings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | global using Xunit; 18 | -------------------------------------------------------------------------------- /tests/UnitTests/PayloadListener.Tests/Monai.Deploy.WorkflowManager.PayloadListener.Tests.csproj: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | net8.0 19 | enable 20 | false 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | all 29 | runtime; build; native; contentfiles; analyzers; buildtransitive 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /tests/UnitTests/TaskManager.Argo.Tests/Templates/SimpleTemplate.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Template contains a single template with two inputs expected 16 | # to be provided by the Task Manager. 17 | # S3 connection information is injected into both `input-dicom` 18 | # and `input-ehr` if a matching name exists in the 19 | # TaskDispatchEvent.Inputs (md.tasks.dispatch). 20 | --- 21 | apiVersion: argoproj.io/v1alpha1 22 | kind: WorkflowTemplate 23 | metadata: 24 | name: simple-template-with-single-container 25 | spec: 26 | entrypoint: my-entrypoint 27 | templates: 28 | - name: my-entrypoint 29 | inputs: 30 | artifacts: 31 | - name: input-dicom 32 | - name: input-ehr 33 | container: 34 | image: debian:latest 35 | command: [sh, -c] 36 | args: ["ls -lR /input"] 37 | -------------------------------------------------------------------------------- /tests/UnitTests/TaskManager.Docker.Tests/Usings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | global using Xunit; -------------------------------------------------------------------------------- /tests/UnitTests/WorkflowManager.Tests/Controllers/ArtifactsControllerTests.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | using FluentAssertions; 19 | using Microsoft.AspNetCore.Mvc; 20 | using Monai.Deploy.Messaging.Common; 21 | using Monai.Deploy.WorkflowManager.Common.ControllersShared; 22 | using Newtonsoft.Json; 23 | using Xunit; 24 | 25 | namespace Monai.Deploy.WorkflowManager.Common.Test.Controllers 26 | { 27 | public class ArtifactsControllerTests 28 | { 29 | private ArtifactsController ArtifactsController { get; } 30 | 31 | public ArtifactsControllerTests() 32 | { 33 | ArtifactsController = new ArtifactsController(); 34 | } 35 | 36 | [Fact] 37 | public void GetArtifactTypesTest() 38 | { 39 | var result = ArtifactsController.GetArtifactTypes(); 40 | Assert.NotNull(result); 41 | var ok = Assert.IsType(result); 42 | var json = JsonConvert.SerializeObject(ok.Value); 43 | 44 | ok.Value.Should().BeEquivalentTo(ArtifactTypes.ListOfModularity); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tests/UnitTests/WorkflowManager.Tests/ProgramTest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 MONAI Consortium 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | using System; 18 | using System.IO; 19 | using System.Reflection; 20 | using Xunit; 21 | 22 | namespace Monai.Deploy.WorkflowManager.Common.Tests 23 | { 24 | public class ProgramTest 25 | { 26 | private const string PlugInDirectoryName = "plug-ins"; 27 | 28 | [Fact(DisplayName = "Program - runs properly")] 29 | public void Startup_RunsProperly() 30 | { 31 | var workingDirectory = Environment.CurrentDirectory; 32 | var plugInDirectory = Path.Combine(workingDirectory, PlugInDirectoryName); 33 | Directory.CreateDirectory(plugInDirectory); 34 | var file = Assembly.GetExecutingAssembly().Location; 35 | File.Copy(file, Path.Combine(plugInDirectory, Path.GetFileName(file)), true); 36 | var host = Program.CreateHostBuilder(System.Array.Empty()).Build(); 37 | 38 | Assert.NotNull(host); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tests/coverlet.runsettings: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | opencover 23 | [coverlet.*.tests?]*,[*]Coverlet.Core*,[xunit.*]*,[Grpc.Core*]*,[System.*]*,[Microsoft.*]* 24 | 25 | 26 | src/TaskManager/Plug-ins/Argo/Specs/*.cs 27 | 28 | false 29 | true 30 | true 31 | true 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /tests/run-tests.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2022 MONAI Consortium 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | #!/bin/bash 16 | 17 | SCRIPT_DIR=$(dirname "$(readlink -f "$0")") 18 | TOP="$(git rev-parse --show-toplevel 2>/dev/null || readlink -f ${SCRIPT_DIR}/..)" 19 | RESULTS_DIR=$SCRIPT_DIR/results 20 | VERBOSITY=normal 21 | 22 | if [ "$CI" = "true" ]; then 23 | VERBOSITY=minimal 24 | fi 25 | 26 | if [ -f /.dockerenv ]; then 27 | echo "##### Installing apt packages..." 28 | apt-get update 29 | apt-get install -y dcmtk sudo 30 | fi 31 | 32 | if [ ! -z ${CI} ]; then 33 | echo "##### Installing apt packages..." 34 | sudo apt-get update 35 | sudo apt-get install -y dcmtk 36 | fi 37 | 38 | if [ -d "$RESULTS_DIR" ]; then 39 | rm -r "$RESULTS_DIR" 40 | fi 41 | 42 | mkdir -p "$RESULTS_DIR" 43 | 44 | echo "##### Building MONAI Deploy Workflow Manager..." 45 | cd $TOP/src 46 | dotnet build Monai.Deploy.WorkflowManager.sln 47 | 48 | echo "Executing all tests" 49 | dotnet test -v=$VERBOSITY --results-directory "$RESULTS_DIR" --collect:"XPlat Code Coverage" --settings "$SCRIPT_DIR/coverlet.runsettings" Monai.Deploy.WorkflowManager.sln 50 | exit $? 51 | --------------------------------------------------------------------------------