You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by bh...@apache.org on 2019/08/01 11:55:06 UTC
[incubator-dlab] 01/01: DLAB-000 merge conflicts fixed
This is an automated email from the ASF dual-hosted git repository.
bhliva pushed a commit to branch dlab_refactored
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
commit a4a4bb0979f75f0d2c4847b5fd38d5ccfc36ef4e
Merge: 6b19f86 80bd68d
Author: bhliva <bo...@epam.com>
AuthorDate: Thu Aug 1 13:45:26 2019 +0300
DLAB-000 merge conflicts fixed
README.md | 583 ++--
infrastructure-provisioning/scripts/deploy_dlab.py | 19 +-
.../src/base/scripts/install_user_key.py | 5 +-
.../scripts/configure_deep_learning_node.py | 3 +-
infrastructure-provisioning/src/edge/fabfile.py | 145 +-
.../edge/scripts/configure_nginx_reverse_proxy.py | 3 +-
.../{dataengine-service.conf => emr.conf} | 0
.../src/edge/templates/nginx.conf | 8 +-
.../src/general/api/check_inactivity.py | 4 +-
.../src/general/api/configure.py | 4 +-
.../src/general/api/create.py | 4 +-
.../src/general/api/create_image.py | 4 +-
.../src/general/api/git_creds.py | 4 +-
.../src/general/api/install_libs.py | 4 +-
.../src/general/api/list_libs.py | 8 +-
.../src/general/api/reconfigure_spark.py | 4 +-
.../src/general/api/recreate.py | 4 +-
.../src/general/api/reupload_key.py | 4 +-
.../src/general/api/start.py | 4 +-
.../src/general/api/stop.py | 4 +-
.../src/general/api/terminate.py | 4 +-
.../src/general/api/terminate_image.py | 4 +-
.../src/general/conf/dlab.ini | 2 +-
.../src/general/files/aws/base_Dockerfile | 3 +-
.../src/general/files/aws/edge_description.json | 4 +-
.../project_Dockerfile} | 16 +-
.../src/general/files/aws/project_description.json | 4 +
...ensor-rstudio_Dockerfile => project_Dockerfile} | 17 +-
.../src/general/files/gcp/project_description.json | 4 +
.../general/files/gcp/tensor-rstudio_Dockerfile | 3 +
.../src/general/lib/aws/actions_lib.py | 15 +-
.../src/general/lib/gcp/actions_lib.py | 29 +
.../src/general/lib/gcp/meta_lib.py | 20 +
.../src/general/lib/os/debian/edge_lib.py | 6 +-
.../src/general/lib/os/debian/ssn_lib.py | 4 +-
.../src/general/lib/os/fab.py | 8 +-
.../src/general/lib/os/redhat/common_lib.py | 2 +-
.../src/general/lib/os/redhat/edge_lib.py | 6 +-
.../src/general/lib/os/redhat/notebook_lib.py | 2 +-
.../src/general/lib/os/redhat/ssn_lib.py | 4 +-
.../scripts/aws/common_create_notebook_image.py | 13 +-
...common_notebook_configure_dataengine-service.py | 8 +-
.../aws/common_notebook_configure_dataengine.py | 6 +-
.../general/scripts/aws/common_prepare_notebook.py | 32 +-
.../general/scripts/aws/common_start_notebook.py | 2 +-
.../general/scripts/aws/common_stop_notebook.py | 4 +-
.../scripts/aws/common_terminate_notebook.py | 4 +-
.../scripts/aws/dataengine-service_configure.py | 16 +-
.../scripts/aws/dataengine-service_create.py | 23 +-
.../scripts/aws/dataengine-service_install_libs.py | 2 +-
.../scripts/aws/dataengine-service_list_libs.py | 2 +-
.../scripts/aws/dataengine-service_prepare.py | 18 +-
.../scripts/aws/dataengine-service_terminate.py | 4 +-
.../general/scripts/aws/dataengine_configure.py | 16 +-
.../src/general/scripts/aws/dataengine_prepare.py | 20 +-
.../src/general/scripts/aws/dataengine_start.py | 6 +-
.../src/general/scripts/aws/dataengine_stop.py | 6 +-
.../general/scripts/aws/dataengine_terminate.py | 6 +-
.../general/scripts/aws/deeplearning_configure.py | 27 +-
.../scripts/aws/edge_associate_elastic_ip.py | 2 +-
.../src/general/scripts/aws/edge_configure.py | 65 +-
.../src/general/scripts/aws/edge_prepare.py | 573 ----
.../src/general/scripts/aws/edge_start.py | 4 +-
.../src/general/scripts/aws/edge_stop.py | 4 +-
.../src/general/scripts/aws/jupyter_configure.py | 29 +-
.../jupyter_dataengine-service_create_configs.py | 4 +-
.../jupyter_install_dataengine-service_kernels.py | 4 +-
.../src/general/scripts/aws/project_prepare.py | 609 ++++
.../{edge_terminate.py => project_terminate.py} | 60 +-
.../src/general/scripts/aws/rstudio_configure.py | 27 +-
.../rstudio_dataengine-service_create_configs.py | 2 +-
.../rstudio_install_dataengine-service_kernels.py | 4 +-
.../src/general/scripts/aws/ssn_configure.py | 3 +
.../scripts/aws/tensor-rstudio_configure.py | 29 +-
.../src/general/scripts/aws/tensor_configure.py | 29 +-
.../src/general/scripts/aws/zeppelin_configure.py | 27 +-
.../zeppelin_dataengine-service_create_configs.py | 6 +-
.../zeppelin_install_dataengine-service_kernels.py | 6 +-
.../scripts/azure/deeplearning_configure.py | 6 +-
.../src/general/scripts/azure/edge_prepare.py | 2 +-
.../src/general/scripts/azure/jupyter_configure.py | 6 +-
.../src/general/scripts/azure/rstudio_configure.py | 6 +-
.../src/general/scripts/azure/tensor_configure.py | 6 +-
.../general/scripts/azure/zeppelin_configure.py | 6 +-
.../scripts/gcp/common_create_service_account.py | 6 +-
...common_notebook_configure_dataengine-service.py | 11 +-
.../gcp/common_notebook_configure_dataengine.py | 5 +-
.../general/scripts/gcp/common_prepare_notebook.py | 21 +-
.../general/scripts/gcp/common_start_notebook.py | 2 +-
.../general/scripts/gcp/common_stop_notebook.py | 11 +-
.../scripts/gcp/common_terminate_notebook.py | 7 +-
.../scripts/gcp/dataengine-service_configure.py | 15 +-
.../scripts/gcp/dataengine-service_create.py | 2 +-
.../scripts/gcp/dataengine-service_install_libs.py | 2 +-
.../scripts/gcp/dataengine-service_list_libs.py | 2 +-
.../scripts/gcp/dataengine-service_prepare.py | 17 +-
.../scripts/gcp/dataengine-service_terminate.py | 6 +-
.../general/scripts/gcp/dataengine_configure.py | 17 +-
.../src/general/scripts/gcp/dataengine_prepare.py | 13 +-
.../src/general/scripts/gcp/dataengine_start.py | 5 +-
.../src/general/scripts/gcp/dataengine_stop.py | 5 +-
.../general/scripts/gcp/dataengine_terminate.py | 5 +-
.../general/scripts/gcp/deeplearning_configure.py | 16 +-
.../src/general/scripts/gcp/edge_configure.py | 30 +-
.../general/scripts/gcp/edge_create_static_ip.py | 2 +-
.../src/general/scripts/gcp/edge_prepare.py | 467 ---
.../src/general/scripts/gcp/edge_start.py | 8 +-
.../src/general/scripts/gcp/edge_stop.py | 6 +-
.../src/general/scripts/gcp/jupyter_configure.py | 16 +-
.../jupyter_install_dataengine-service_kernels.py | 9 +-
.../src/general/scripts/gcp/project_prepare.py | 474 +++
.../src/general/scripts/gcp/project_terminate.py | 160 +
.../src/general/scripts/gcp/rstudio_configure.py | 15 +-
.../rstudio_install_dataengine-service_kernels.py | 7 +-
.../src/general/scripts/gcp/ssn_configure.py | 1 +
.../scripts/gcp/tensor-rstudio_configure.py | 15 +-
.../src/general/scripts/gcp/tensor_configure.py | 15 +-
.../src/general/scripts/gcp/zeppelin_configure.py | 16 +-
.../zeppelin_install_dataengine-service_kernels.py | 7 +-
.../general/scripts/os/common_clean_instance.py | 4 +-
.../general/scripts/os/dataengine_install_libs.py | 2 +-
.../src/general/scripts/os/dataengine_list_libs.py | 2 +-
.../scripts/os/dataengine_reconfigure_spark.py | 2 +-
.../src/general/scripts/os/notebook_git_creds.py | 2 +-
.../scripts/os/notebook_inactivity_check.py | 4 +-
.../general/scripts/os/notebook_install_libs.py | 2 +-
.../src/general/scripts/os/notebook_list_libs.py | 2 +-
.../scripts/os/notebook_reconfigure_spark.py | 2 +-
.../src/jupyter/scripts/configure_jupyter_node.py | 3 +-
.../fabfile.py} | 59 +-
.../scripts/configure_http_proxy.py} | 36 +-
.../scripts/configure_nginx_reverse_proxy.py | 5 +-
.../scripts/reupload_ssh_key.py} | 44 +-
.../templates/conf.d/proxy.conf} | 24 +-
.../templates/locations/dataengine-service.conf | 0
.../templates/locations/jupyter.conf} | 27 +-
.../templates/locations/rstudio.conf} | 26 +-
.../src/project/templates/locations/spark.conf | 123 +
.../templates/locations/tensor.conf} | 29 +-
.../templates/locations/ungit.conf} | 27 +-
.../templates/locations/zeppelin.conf} | 26 +-
.../src/{edge => project}/templates/nginx.conf | 2 +-
.../src/project/templates/nginx_debian | 216 ++
.../src/project/templates/nginx_redhat | 128 +
.../src/project/templates/squid.conf | 62 +
.../src/rstudio/scripts/configure_rstudio_node.py | 3 +-
.../src/ssn/files/aws/mongo_roles.json | 4 +-
.../src/ssn/files/azure/mongo_roles.json | 4 +-
.../src/ssn/files/gcp/mongo_roles.json | 4 +-
.../src/ssn/scripts/configure_billing.py | 5 +-
.../src/ssn/scripts/configure_ui.py | 3 +-
.../src/ssn/templates/nginx_proxy.conf | 3 +-
.../src/ssn/templates/ssn_nginx.conf | 1 +
.../scripts/configure_tensor-rstudio_node.py | 3 +-
infrastructure-provisioning/src/tensor/fabfile.py | 24 +-
.../src/tensor/scripts/configure_tensor_node.py | 3 +-
.../zeppelin/scripts/configure_zeppelin_node.py | 3 +-
integration-tests-cucumber/pom.xml | 114 +
.../main/java/org/apache/dlab/dto/EndpointDTO.java | 19 +
.../java/org/apache/dlab/mongo/MongoDBHelper.java | 14 +
.../java/org/apache/dlab/util/JacksonMapper.java | 16 +
.../java/org/apache/dlab/util/PropertyHelper.java | 23 +
.../src/test/java/dlab/Constants.java | 5 +
.../src/test/java/dlab/RunCucumberTest.java | 10 +
.../src/test/java/dlab/endpoint/EndpointSteps.java | 97 +
.../src/test/java/dlab/login/LoginSteps.java | 44 +
.../src/test/resources/config.properties | 2 +
.../src/test/resources/dlab/endpoint.feature | 57 +
.../src/test/resources/dlab/login.feature | 12 +
services/billing-aws/billing.yml | 2 +-
.../com/epam/dlab/module/aws/AdapterS3File.java | 93 +-
.../java/com/epam/dlab/module/aws/S3FileList.java | 2 +-
.../com/epam/dlab/mongo/DlabResourceTypeDAO.java | 24 +-
.../com/epam/dlab/module/aws/S3FileListTest.java | 18 +-
.../java/com/epam/dlab/dto/UserInstanceDTO.java | 26 +-
.../computational/AwsComputationalResource.java | 5 +-
.../dto/base/computational/ComputationalBase.java | 22 +
.../java/com/epam/dlab/dto/base/edge/EdgeInfo.java | 32 +-
.../epam/dlab/dto/base/project/ProjectResult.java | 16 +
.../SparkStandaloneClusterResource.java | 5 +-
.../computational/UserComputationalResource.java | 5 +-
.../dlab/dto/exploratory/ExploratoryBaseDTO.java | 71 +-
.../dlab/dto/exploratory/ExploratoryCreateDTO.java | 23 +
.../dlab/dto/exploratory/ExploratoryImageDTO.java | 17 +
.../computational/GcpComputationalResource.java | 6 +-
.../epam/dlab/dto/project/ProjectActionDTO.java | 13 +
.../epam/dlab/dto/project/ProjectCreateDTO.java | 18 +
.../java/com/epam/dlab/dto/status/EnvResource.java | 5 +-
.../epam/dlab/model/exploratory/Exploratory.java | 3 +
.../src/main/java/com/epam/dlab/auth/UserInfo.java | 6 +-
.../rest/mappers/ValidationExceptionMapper.java | 2 +-
services/provisioning-service/provisioning.yml | 2 +-
.../backendapi/ProvisioningServiceApplication.java | 1 +
.../core/commands/CommandExecutorMockAsync.java | 4 +-
.../backendapi/core/commands/DockerCommands.java | 1 +
.../response/handlers/ProjectCallbackHandler.java | 49 +
.../dlab/backendapi/modules/ProductionModule.java | 4 +
.../backendapi/modules/ProvisioningDevModule.java | 4 +
.../dlab/backendapi/resources/ProjectResource.java | 57 +
.../dlab/backendapi/service/ProjectService.java | 16 +
.../service/impl/ProjectServiceImpl.java | 97 +
.../resources/mock_response/aws/edge_create.json | 75 +-
.../mock_response/aws/project_create.json | 57 +
.../mock_response/aws/project_terminate.json | 12 +
.../mock_response/gcp/notebook_create.json | 1 +
.../mock_response/gcp/project_create.json | 57 +
.../mock_response/gcp/project_terminate.json | 12 +
services/self-service/pom.xml | 16 +
services/self-service/self-service.yml | 7 +-
.../dlab/backendapi/SelfServiceApplication.java | 38 +-
.../epam/dlab/backendapi/annotation/Project.java | 12 +
.../auth/SelfServiceSecurityAuthorizer.java | 2 +-
.../epam/dlab/backendapi/dao/BaseBillingDAO.java | 18 +
.../java/com/epam/dlab/backendapi/dao/BaseDAO.java | 4 +-
.../com/epam/dlab/backendapi/dao/BillingDAO.java | 4 +
.../com/epam/dlab/backendapi/dao/EndpointDAO.java | 15 +
.../epam/dlab/backendapi/dao/EndpointDAOImpl.java | 38 +
.../java/com/epam/dlab/backendapi/dao/EnvDAO.java | 39 +-
.../epam/dlab/backendapi/dao/ExploratoryDAO.java | 30 +
.../com/epam/dlab/backendapi/dao/ProjectDAO.java | 36 +
.../epam/dlab/backendapi/dao/ProjectDAOImpl.java | 110 +
.../epam/dlab/backendapi/dao/SchedulerJobDAO.java | 18 +-
.../com/epam/dlab/backendapi/dao/UserGroupDao.java | 2 +
.../epam/dlab/backendapi/dao/UserGroupDaoImpl.java | 9 +
.../dlab/backendapi/dao/aws/AwsBillingDAO.java | 303 +-
.../dlab/backendapi/dao/azure/AzureBillingDAO.java | 2 +-
.../dlab/backendapi/dao/gcp/GcpBillingDao.java | 10 +
.../epam/dlab/backendapi/domain/EndpointDTO.java | 16 +
.../epam/dlab/backendapi/domain/ProjectDTO.java | 75 +
.../backendapi/domain/UpdateProjectBudgetDTO.java | 15 +
.../dlab/backendapi/domain/UpdateProjectDTO.java | 19 +
.../interceptor/BudgetLimitInterceptor.java | 17 +-
.../epam/dlab/backendapi/modules/DevModule.java | 7 +-
.../dlab/backendapi/modules/ProductionModule.java | 5 +
.../backendapi/resources/EndpointResource.java | 108 +
.../backendapi/resources/ExploratoryResource.java | 12 +-
.../resources/InfrastructureInfoResource.java | 7 +-
.../resources/InfrastructureTemplateResource.java | 19 +-
.../dlab/backendapi/resources/ProjectResource.java | 217 ++
.../resources/aws/ComputationalResourceAws.java | 38 +-
.../azure/ComputationalResourceAzure.java | 14 +-
.../resources/callback/ProjectCallback.java | 57 +
.../resources/dto/ComputationalCreateFormDTO.java | 6 +
.../resources/dto/ExploratoryCreateFormDTO.java | 30 +
.../resources/dto/HealthStatusPageDTO.java | 11 +
.../resources/dto/ProjectActionFormDTO.java | 10 +
...ureInfo.java => ProjectInfrastructureInfo.java} | 4 +-
.../backendapi/resources/dto/UserResourceInfo.java | 7 +
.../resources/gcp/ComputationalResourceGcp.java | 18 +-
.../com/epam/dlab/backendapi/roles/UserRoles.java | 33 +-
.../schedulers/CheckProjectQuoteScheduler.java | 52 +
.../backendapi/service/ComputationalService.java | 6 +-
.../epam/dlab/backendapi/service/EdgeService.java | 2 +
.../dlab/backendapi/service/EndpointService.java | 14 +
.../backendapi/service/EnvironmentService.java | 2 +
.../backendapi/service/ExploratoryService.java | 5 +-
.../service/InfrastructureInfoService.java | 9 +-
.../service/InfrastructureTemplateService.java | 4 +-
.../dlab/backendapi/service/ProjectService.java | 33 +
.../epam/dlab/backendapi/service/TagService.java | 9 +
.../dlab/backendapi/service/TagServiceImpl.java | 23 +
.../service/impl/ComputationalServiceImpl.java | 38 +-
.../backendapi/service/impl/EdgeServiceImpl.java | 8 +
.../service/impl/EndpointServiceImpl.java | 44 +
.../service/impl/EnvironmentServiceImpl.java | 53 +-
.../service/impl/ExploratoryServiceImpl.java | 28 +-
.../impl/InfrastructureInfoServiceBase.java | 28 +-
.../impl/InfrastructureTemplateServiceBase.java | 35 +-
.../service/impl/ProjectServiceImpl.java | 162 +
.../service/impl/SchedulerJobServiceImpl.java | 5 +-
.../epam/dlab/backendapi/util/RequestBuilder.java | 57 +-
.../src/main/resources/webapp/angular.json | 16 +-
.../src/main/resources/webapp/package-lock.json | 3202 +++++---------------
.../src/main/resources/webapp/package.json | 28 +-
.../app/access-denied/access-denied.component.scss | 5 -
.../administration.module.ts} | 15 +-
.../backup-dilog/backup-dilog.component.html | 17 +-
.../backup-dilog/backup-dilog.component.scss | 0
.../backup-dilog/backup-dilog.component.ts | 55 +-
.../management/endpoints/endpoints.component.html | 137 +
.../management/endpoints/endpoints.component.scss | 71 +
.../management/endpoints/endpoints.component.ts | 88 +
.../app/{ => administration}/management/index.ts | 56 +-
.../manage-environment-dilog.component.html | 56 +-
.../manage-environment-dilog.component.scss | 0
.../manage-environment-dilog.component.ts | 49 +-
.../management/management-data.service.ts} | 25 +-
.../management-grid/management-grid.component.html | 130 +
.../management-grid/management-grid.component.scss | 13 +
.../management-grid/management-grid.component.ts | 96 +-
.../management/management.component.html | 45 +
.../management/management.component.scss | 0
.../management/management.component.ts | 167 +
.../management/management.model.ts | 25 +-
.../ssn-monitor/ssn-monitor.component.html | 53 +-
.../ssn-monitor/ssn-monitor.component.scss | 1 +
.../ssn-monitor/ssn-monitor.component.ts | 33 +-
.../scheduler => administration/project}/index.ts | 25 +-
.../project/project-data.service.ts} | 26 +-
.../project-form/project-form.component.html | 171 ++
.../project-form/project-form.component.scss} | 48 +-
.../project/project-form/project-form.component.ts | 183 ++
.../project-list/project-list.component.html | 83 +
.../project-list/project-list.component.scss} | 52 +-
.../project/project-list/project-list.component.ts | 72 +
.../project/project.component.html} | 35 +-
.../administration/project/project.component.ts | 143 +
.../roles}/group-name-validarion.directive.ts | 0
.../scheduler => administration/roles}/index.ts | 20 +-
.../app/administration/roles/roles.component.html | 172 ++
.../roles/roles.component.scss} | 96 +-
.../roles/roles.component.ts} | 146 +-
.../resources/webapp/src/app/app.component.html | 1 -
.../main/resources/webapp/src/app/app.module.ts | 25 +-
.../resources/webapp/src/app/app.routing.module.ts | 97 +-
.../resources/webapp/src/app/core/core.module.ts | 15 +-
.../models/computationalResourceImage.model.ts | 6 +-
.../{cloudProvider.guard.ts => admin.quard.ts} | 4 +-
.../services/applicationServiceFacade.service.ts | 136 +-
.../src/app/core/services/cloudProvider.guard.ts | 2 +-
.../src/app/core/services/endpoint.service.ts | 59 +
.../src/app/core/services/healthStatus.service.ts | 66 +-
.../webapp/src/app/core/services/index.ts | 3 +
.../src/app/core/services/project.service.ts | 89 +
.../src/app/core/services/userResource.service.ts | 14 +-
.../webapp/src/app/core/util/checkUtils.ts | 6 +
.../resources/webapp/src/app/core/util/index.ts | 3 +-
.../util/patterns.ts} | 13 +-
.../app/core/util/{sortUtil.ts => sortUtils.ts} | 2 +-
.../layout.component.html} | 1 -
.../layout.component.ts} | 14 +-
.../index.ts => layout/layout.module.ts} | 15 +-
.../webapp/src/app/login/login.component.ts | 10 +-
.../manage-roles-groups.component.html | 154 -
.../management-grid/management-grid.component.html | 161 -
.../src/app/management/management.component.html | 55 -
.../src/app/management/management.component.ts | 275 --
.../reporting-grid/reporting-grid.component.html | 190 +-
.../reporting-grid/reporting-grid.component.scss | 45 +-
.../reporting-grid/reporting-grid.component.ts | 24 +-
.../src/app/reporting/reporting.component.ts | 37 +-
.../webapp/src/app/reporting/reporting.module.ts | 6 -
.../app/reporting/toolbar/toolbar.component.css | 1 -
.../app/reporting/toolbar/toolbar.component.html | 3 +-
.../cluster-details/cluster-details.component.html | 14 +-
.../cluster-details/cluster-details.component.scss | 10 +
.../cluster-details/cluster-details.component.ts | 35 +-
.../computational/cluster-details/index.ts | 4 +-
...utational-resource-create-dialog.component.html | 234 +-
...utational-resource-create-dialog.component.scss | 10 +-
...mputational-resource-create-dialog.component.ts | 299 +-
.../computational-resource-create.model.ts | 208 +-
.../computational-resource-create-dialog/index.ts | 8 +-
.../computational-resources-list.component.html | 69 +-
.../computational-resources-list.component.ts | 45 +-
.../computational-resources-list/index.ts | 2 -
.../ami-create-dialog.component.html | 17 +-
.../ami-create-dialog.component.ts | 28 +-
.../exploratory/ami-create-dialog/index.ts | 3 +-
.../cost-details-dialog.component.html | 12 +-
.../cost-details-dialog.component.scss | 0
.../cost-details-dialog.component.ts | 26 +-
.../cost-details-dialog/index.ts | 4 +-
.../create-environment.component.html | 177 ++
.../create-environment.component.scss | 13 +
.../create-environment.component.ts | 142 +
.../index.ts | 18 +-
.../detail-dialog/detail-dialog.component.html | 16 +-
.../detail-dialog/detail-dialog.component.ts | 39 +-
.../resources/exploratory/detail-dialog/index.ts | 3 +-
...ratory-environment-create-dialog.component.html | 93 -
...loratory-environment-create-dialog.component.ts | 195 --
.../exploratory-environment-create.model.ts | 157 -
.../exploratory/install-libraries/index.ts | 6 +-
.../install-libraries.component.html | 18 +-
.../install-libraries.component.ts | 104 +-
.../manage-ungit/manage-ungit.component.html | 49 +-
.../manage-ungit/manage-ungit.component.scss | 21 +-
.../manage-ungit/manage-ungit.component.ts | 40 +-
.../src/app/resources/resources-grid/index.ts | 5 +-
.../resources-grid/resources-grid.component.html | 481 ++-
...component.css => resources-grid.component.scss} | 151 +-
.../resources-grid/resources-grid.component.ts | 286 +-
.../resources-grid/resources-grid.model.ts | 56 +-
.../src/app/resources/resources.component.html | 57 +-
.../src/app/resources/resources.component.scss | 8 -
.../src/app/resources/resources.component.ts | 61 +-
.../webapp/src/app/resources/resources.module.ts | 14 +-
.../webapp/src/app/resources/scheduler/index.ts | 4 +-
.../resources/scheduler/scheduler.component.html | 15 +-
.../resources/scheduler/scheduler.component.scss | 3 +
.../app/resources/scheduler/scheduler.component.ts | 45 +-
.../main/resources/webapp/src/app/shared/index.ts | 1 -
.../confirmation-dialog.component.html | 26 +-
.../confirmation-dialog.component.ts | 45 +-
.../confirmation-dialog.model.ts | 4 +-
.../modal-dialog/confirmation-dialog/index.ts | 4 +-
.../webapp/src/app/shared/modal-dialog/index.ts | 61 -
.../shared/modal-dialog/key-upload-dialog/index.ts | 4 +-
.../key-upload-dialog.component.html | 13 +-
.../key-upload-dialog.component.ts | 38 +-
.../app/shared/modal-dialog/modal.component.html | 42 -
.../app/shared/modal-dialog/modal.component.scss | 399 ---
.../src/app/shared/modal-dialog/modal.component.ts | 111 -
.../modal-dialog/notification-dialog/index.ts | 3 +-
.../notification-dialog.component.ts | 63 +-
.../shared/modal-dialog/progress-dialog/index.ts | 5 +-
.../progress-dialog/progress-dialog.component.html | 13 +-
.../progress-dialog/progress-dialog.component.ts | 18 +-
.../webapp/src/app/shared/navbar/index.ts | 3 +-
.../src/app/shared/navbar/navbar.component.html | 100 +-
.../src/app/shared/navbar/navbar.component.scss | 64 +-
.../src/app/shared/navbar/navbar.component.ts | 117 +-
.../webapp/src/assets/styles/_dialogs.scss | 294 ++
.../webapp/src/assets/styles/_general.scss | 16 +-
.../resources/webapp/src/assets/styles/_reset.scss | 32 +-
.../resources/webapp/src/assets/styles/_theme.scss | 318 +-
.../styles/_variables.scss} | 12 +-
.../src/main/resources/webapp/src/styles.scss | 93 +-
.../resources/ExploratoryResourceTest.java | 36 +-
.../resources/InfrastructureInfoResourceTest.java | 62 +-
.../InfrastructureTemplateResourceTest.java | 36 +-
.../backendapi/resources/SecurityResourceTest.java | 220 --
.../epam/dlab/backendapi/roles/UserRolesTest.java | 16 +-
.../service/impl/ComputationalServiceImplTest.java | 67 +-
.../service/impl/EnvironmentServiceImplTest.java | 45 +-
.../service/impl/ExploratoryServiceImplTest.java | 28 +-
.../impl/InfrastructureInfoServiceBaseTest.java | 150 -
.../InfrastructureTemplateServiceBaseTest.java | 27 +-
.../service/impl/SchedulerJobServiceImplTest.java | 14 +-
.../dlab/backendapi/util/RequestBuilderTest.java | 12 +-
431 files changed, 12116 insertions(+), 9383 deletions(-)
diff --cc services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/response/handlers/ProjectCallbackHandler.java
index 0000000,d6b1f71..2fe573c
mode 000000,100644..100644
--- a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/response/handlers/ProjectCallbackHandler.java
+++ b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/response/handlers/ProjectCallbackHandler.java
@@@ -1,0 -1,50 +1,49 @@@
+ package com.epam.dlab.backendapi.core.response.handlers;
+
-import com.epam.dlab.auth.SystemUserInfoService;
+ import com.epam.dlab.backendapi.core.commands.DockerAction;
+ import com.epam.dlab.dto.UserInstanceStatus;
+ import com.epam.dlab.dto.base.edge.EdgeInfo;
+ import com.epam.dlab.dto.base.project.ProjectResult;
+ import com.epam.dlab.exceptions.DlabException;
+ import com.epam.dlab.rest.client.RESTService;
+ import com.fasterxml.jackson.databind.JsonNode;
+
+ import java.io.IOException;
+
+ public class ProjectCallbackHandler extends ResourceCallbackHandler<ProjectResult> {
+
+
+ private final String callbackUri;
+ private final String projectName;
+ private final Class<? extends EdgeInfo> clazz;
+
- public ProjectCallbackHandler(SystemUserInfoService systemUserInfoService, RESTService selfService, String user,
++ public ProjectCallbackHandler(RESTService selfService, String user,
+ String uuid, DockerAction action, String callbackUri, String projectName,
+ Class<? extends EdgeInfo> clazz) {
- super(systemUserInfoService, selfService, user, uuid, action);
++ super(selfService, user, uuid, action);
+ this.callbackUri = callbackUri;
+ this.projectName = projectName;
+ this.clazz = clazz;
+ }
+
+ @Override
+ protected String getCallbackURI() {
+ return callbackUri;
+ }
+
+ @Override
+ protected ProjectResult parseOutResponse(JsonNode resultNode, ProjectResult baseStatus) {
+ baseStatus.setProjectName(projectName);
+ if (resultNode != null && getAction() == DockerAction.CREATE
+ && UserInstanceStatus.of(baseStatus.getStatus()) != UserInstanceStatus.FAILED) {
+ try {
+ final EdgeInfo projectEdgeInfo = mapper.readValue(resultNode.toString(), clazz);
+ baseStatus.setEdgeInfo(projectEdgeInfo);
+ } catch (IOException e) {
+ throw new DlabException("Cannot parse the EDGE info in JSON: " + e.getLocalizedMessage(), e);
+ }
+ }
+
+ return baseStatus;
+ }
+ }
diff --cc services/provisioning-service/src/main/java/com/epam/dlab/backendapi/modules/ProductionModule.java
index e7dc88a,bfaac79..94d8229
--- a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/modules/ProductionModule.java
+++ b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/modules/ProductionModule.java
@@@ -28,8 -30,10 +28,11 @@@ import com.epam.dlab.backendapi.core.co
import com.epam.dlab.backendapi.core.response.handlers.dao.CallbackHandlerDao;
import com.epam.dlab.backendapi.core.response.handlers.dao.FileSystemCallbackHandlerDao;
import com.epam.dlab.backendapi.service.CheckInactivityService;
+import com.epam.dlab.backendapi.service.RestoreCallbackHandlerService;
+ import com.epam.dlab.backendapi.service.ProjectService;
+ import com.epam.dlab.backendapi.service.RestoreCallbackHandlerService;
import com.epam.dlab.backendapi.service.impl.CheckInactivityServiceImpl;
+ import com.epam.dlab.backendapi.service.impl.ProjectServiceImpl;
import com.epam.dlab.backendapi.service.impl.RestoreCallbackHandlerServiceImpl;
import com.epam.dlab.constants.ServiceConsts;
import com.epam.dlab.mongo.MongoService;
diff --cc services/provisioning-service/src/main/java/com/epam/dlab/backendapi/modules/ProvisioningDevModule.java
index 04f03f6,9817a65..73d333f
--- a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/modules/ProvisioningDevModule.java
+++ b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/modules/ProvisioningDevModule.java
@@@ -30,11 -31,14 +30,14 @@@ import com.epam.dlab.backendapi.core.co
import com.epam.dlab.backendapi.core.commands.ICommandExecutor;
import com.epam.dlab.backendapi.core.response.handlers.dao.CallbackHandlerDao;
import com.epam.dlab.backendapi.core.response.handlers.dao.FileSystemCallbackHandlerDao;
+ import com.epam.dlab.backendapi.service.ProjectService;
+ import com.epam.dlab.backendapi.service.RestoreCallbackHandlerService;
import com.epam.dlab.backendapi.service.CheckInactivityService;
+import com.epam.dlab.backendapi.service.RestoreCallbackHandlerService;
import com.epam.dlab.backendapi.service.impl.CheckInactivityServiceImpl;
+ import com.epam.dlab.backendapi.service.impl.ProjectServiceImpl;
import com.epam.dlab.backendapi.service.impl.RestoreCallbackHandlerServiceImpl;
import com.epam.dlab.constants.ServiceConsts;
-import com.epam.dlab.mongo.MongoService;
import com.epam.dlab.rest.client.RESTService;
import com.epam.dlab.rest.contracts.DockerAPI;
import com.fasterxml.jackson.core.JsonParser;
diff --cc services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/ProjectServiceImpl.java
index 0000000,670cadc..174f119
mode 000000,100644..100644
--- a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/ProjectServiceImpl.java
+++ b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/ProjectServiceImpl.java
@@@ -1,0 -1,100 +1,97 @@@
+ package com.epam.dlab.backendapi.service.impl;
+
-import com.epam.dlab.auth.SystemUserInfoService;
+ import com.epam.dlab.auth.UserInfo;
+ import com.epam.dlab.backendapi.ProvisioningServiceApplicationConfiguration;
+ import com.epam.dlab.backendapi.core.commands.*;
+ import com.epam.dlab.backendapi.core.response.folderlistener.FolderListenerExecutor;
+ import com.epam.dlab.backendapi.core.response.handlers.ProjectCallbackHandler;
+ import com.epam.dlab.backendapi.service.ProjectService;
+ import com.epam.dlab.cloud.CloudProvider;
+ import com.epam.dlab.dto.ResourceBaseDTO;
+ import com.epam.dlab.dto.aws.edge.EdgeInfoAws;
+ import com.epam.dlab.dto.azure.edge.EdgeInfoAzure;
+ import com.epam.dlab.dto.gcp.edge.EdgeInfoGcp;
+ import com.epam.dlab.dto.project.ProjectActionDTO;
+ import com.epam.dlab.dto.project.ProjectCreateDTO;
+ import com.epam.dlab.rest.client.RESTService;
+ import com.fasterxml.jackson.core.JsonProcessingException;
+ import com.google.inject.Inject;
+ import lombok.extern.slf4j.Slf4j;
+
+ @Slf4j
+ public class ProjectServiceImpl implements ProjectService {
+ private static final String PROJECT_IMAGE = "docker.dlab-project";
+ private static final String EDGE_IMAGE = "docker.dlab-edge";
+ private static final String CALLBACK_URI = "/api/project/status";
+ @Inject
+ protected RESTService selfService;
+ @Inject
- protected SystemUserInfoService systemUserInfoService;
- @Inject
+ private ProvisioningServiceApplicationConfiguration configuration;
+ @Inject
+ private FolderListenerExecutor folderListenerExecutor;
+ @Inject
+ private ICommandExecutor commandExecutor;
+ @Inject
+ private CommandBuilder commandBuilder;
+
+ @Override
+ public String create(UserInfo userInfo, ProjectCreateDTO dto) {
+ return executeDocker(userInfo, dto, DockerAction.CREATE, dto.getName(), "project", PROJECT_IMAGE);
+ }
+
+ @Override
+ public String terminate(UserInfo userInfo, ProjectActionDTO dto) {
+ return executeDocker(userInfo, dto, DockerAction.TERMINATE, dto.getName(), "project", PROJECT_IMAGE);
+ }
+
+ @Override
+ public String start(UserInfo userInfo, ProjectActionDTO dto) {
+ return executeDocker(userInfo, dto, DockerAction.START, dto.getName(), "edge", EDGE_IMAGE);
+ }
+
+ @Override
+ public String stop(UserInfo userInfo, ProjectActionDTO dto) {
+ return executeDocker(userInfo, dto, DockerAction.STOP, dto.getName(), "edge", EDGE_IMAGE);
+ }
+
+ private String executeDocker(UserInfo userInfo, ResourceBaseDTO dto, DockerAction action, String projectName,
+ String resourceType, String image) {
+ String uuid = DockerCommands.generateUUID();
+
+ folderListenerExecutor.start(configuration.getKeyLoaderDirectory(),
+ configuration.getKeyLoaderPollTimeout(),
- new ProjectCallbackHandler(systemUserInfoService, selfService, userInfo.getName(), uuid,
++ new ProjectCallbackHandler(selfService, userInfo.getName(), uuid,
+ action, CALLBACK_URI, projectName, getEdgeClass()));
+
+ RunDockerCommand runDockerCommand = new RunDockerCommand()
+ .withInteractive()
+ .withName(String.join("_", userInfo.getSimpleName(), projectName, resourceType, action.toString(),
+ Long.toString(System.currentTimeMillis())))
+ .withVolumeForRootKeys(configuration.getKeyDirectory())
+ .withVolumeForResponse(configuration.getKeyLoaderDirectory())
+ .withVolumeForLog(configuration.getDockerLogDirectory(), resourceType)
+ .withResource(resourceType)
+ .withRequestId(uuid)
+ .withConfKeyName(configuration.getAdminKey())
+ .withImage(image)
+ .withAction(action);
+
+ try {
+ commandExecutor.executeAsync(userInfo.getName(), uuid, commandBuilder.buildCommand(runDockerCommand, dto));
+ } catch (JsonProcessingException e) {
+ e.printStackTrace();
+ }
+ return uuid;
+ }
+
+ private <T> Class<T> getEdgeClass() {
+ if (configuration.getCloudProvider() == CloudProvider.AWS) {
+ return (Class<T>) EdgeInfoAws.class;
+ } else if (configuration.getCloudProvider() == CloudProvider.AZURE) {
+ return (Class<T>) EdgeInfoAzure.class;
+ } else if (configuration.getCloudProvider() == CloudProvider.GCP) {
+ return (Class<T>) EdgeInfoGcp.class;
+ }
+ throw new IllegalArgumentException();
+ }
+ }
diff --cc services/self-service/self-service.yml
index 5e7290d,0f2dcc1..1da59b3
--- a/services/self-service/self-service.yml
+++ b/services/self-service/self-service.yml
@@@ -105,9 -103,9 +105,10 @@@ mongoMigrationEnabled: fals
logging:
level: INFO
loggers:
- com.epam: TRACE
+ com.epam: INFO
+ org.apache.guacamole: DEBUG
com.novemberain: ERROR
+ io.swagger.v3: DEBUG
appenders:
<#if DEV_MODE == "true">
- type: console
diff --cc services/self-service/src/main/java/com/epam/dlab/backendapi/SelfServiceApplication.java
index dc4b800,8cc143e..73455f1
--- a/services/self-service/src/main/java/com/epam/dlab/backendapi/SelfServiceApplication.java
+++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/SelfServiceApplication.java
@@@ -62,13 -60,11 +65,15 @@@ import lombok.extern.slf4j.Slf4j
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.HandlerWrapper;
+import org.keycloak.KeycloakSecurityContext;
+import org.keycloak.representations.AccessToken;
import javax.servlet.DispatcherType;
+import javax.servlet.http.HttpServletRequest;
+import java.security.Principal;
import java.util.EnumSet;
+ import java.util.stream.Collectors;
+ import java.util.stream.Stream;
/**
* Self Service based on Dropwizard application.
@@@ -101,51 -97,14 +106,53 @@@ public class SelfServiceApplication ext
bootstrap.addBundle(new TemplateConfigBundle(
new TemplateConfigBundleConfiguration().fileIncludePath(ServiceUtils.getConfPath())
));
- bootstrap.addBundle(new SwaggerBundle<SelfServiceApplicationConfiguration>() {
+
+ /*bootstrap.addBundle(new SwaggerBundle<SelfServiceApplicationConfiguration>() {
@Override
- protected SwaggerBundleConfiguration getSwaggerBundleConfiguration(SelfServiceApplicationConfiguration configuration) {
+ protected SwaggerBundleConfiguration getSwaggerBundleConfiguration(SelfServiceApplicationConfiguration
+ configuration) {
return configuration.getSwaggerConfiguration();
}
- });
+ });*/
+
+ bootstrap.addBundle(new KeycloakBundle<SelfServiceApplicationConfiguration>() {
+ @Override
+ protected KeycloakConfiguration getKeycloakConfiguration(SelfServiceApplicationConfiguration configuration) {
+ return configuration.getKeycloakConfiguration();
+ }
+
+ @Override
+ protected Class<? extends Principal> getUserClass() {
+ return UserInfo.class;
+ }
+
+ @Override
+ protected Authorizer createAuthorizer() {
+ return (Authorizer<UserInfo>) (principal, role) -> principal.getRoles().contains(role);
+ }
+
+ @Override
+ protected Authenticator createAuthenticator(KeycloakConfiguration configuration) {
+ class KeycloakAuthenticator extends AbstractKeycloakAuthenticator<UserInfo> {
+
+ private KeycloakAuthenticator(KeycloakConfiguration keycloakConfiguration) {
+ super(keycloakConfiguration);
+ }
+
+ @Override
+ protected UserInfo prepareAuthentication(KeycloakSecurityContext keycloakSecurityContext,
+ HttpServletRequest httpServletRequest,
+ KeycloakConfiguration keycloakConfiguration) {
+ final AccessToken token = keycloakSecurityContext.getToken();
+ final UserInfo userInfo = new UserInfo(token.getPreferredUsername(),
+ keycloakSecurityContext.getTokenString());
+ userInfo.addRoles(token.getResourceAccess(keycloakConfiguration.getResource()).getRoles());
+ return userInfo;
+ }
+ }
+ return new KeycloakAuthenticator(configuration);
+ }
+ });
}
@Override
@@@ -220,7 -180,27 +227,28 @@@
jersey.register(injector.getInstance(UserGroupResource.class));
jersey.register(injector.getInstance(UserRoleResource.class));
jersey.register(injector.getInstance(ApplicationSettingResource.class));
+ jersey.register(injector.getInstance(KeycloakResource.class));
+ jersey.register(injector.getInstance(EndpointResource.class));
+ jersey.register(injector.getInstance(ProjectResource.class));
+ jersey.register(injector.getInstance(ProjectCallback.class));
+ OpenAPI oas = new OpenAPI();
+ Info info = new Info()
+ .title("Hello World API")
+ .version("2.1")
+ .description("RESTful greetings for you.")
+ .termsOfService("http://example.com/terms")
+ .contact(new Contact().email("john@example.com"));
+
+ oas.info(info);
+ SwaggerConfiguration oasConfig = new SwaggerConfiguration()
+ .openAPI(oas)
+ //.readAllResources(false)
+ .prettyPrint(true)
+ .resourceClasses(Stream.of(ProjectResource.class.getName(),
+ EndpointResource.class.getName())
+ .collect(Collectors.toSet()));
+ environment.jersey().register(new OpenApiResource()
+ .openApiConfiguration(oasConfig));
}
private void disableGzipHandlerForGuacamoleServlet(Server server) {
diff --cc services/self-service/src/main/java/com/epam/dlab/backendapi/modules/DevModule.java
index adff398,dc24362..cd1aabf
--- a/services/self-service/src/main/java/com/epam/dlab/backendapi/modules/DevModule.java
+++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/modules/DevModule.java
@@@ -84,6 -76,19 +83,8 @@@ public class DevModule extends ModuleBa
bind(BackupService.class).to(BackupServiceImpl.class);
bind(BackupDao.class).to(BackupDaoImpl.class);
bind(ExploratoryService.class).to(ExploratoryServiceImpl.class);
+ bind(TagService.class).to(TagServiceImpl.class);
+ bind(InactivityService.class).to(InactivityServiceImpl.class);
- bind(SystemUserInfoService.class).toInstance(new SystemUserInfoService() {
- @Override
- public Optional<UserInfo> getUser(String token) {
- return Optional.of(getUserInfo());
- }
-
- @Override
- public UserInfo create(String name) {
- return getUserInfo();
- }
- });
bind(Authorizer.class).to(SelfServiceSecurityAuthorizer.class);
bind(AccessKeyService.class).to(AccessKeyServiceImpl.class);
bind(GitCredentialService.class).to(GitCredentialServiceImpl.class);
diff --cc services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EnvironmentServiceImpl.java
index efcb2c7,0678ae5..0ea8be5
--- a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EnvironmentServiceImpl.java
+++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EnvironmentServiceImpl.java
@@@ -115,9 -120,17 +119,17 @@@ public class EnvironmentServiceImpl imp
}
@Override
+ public void stopProjectEnvironment(String project) {
+ log.debug("Stopping environment for project {}", project);
+ checkProjectResourceConditions(project, "stop");
+ exploratoryDAO.fetchRunningExploratoryFieldsForProject(project)
+ .forEach(this::stopNotebook);
+ }
+
+ @Override
public void stopEdge(String user) {
if (UserInstanceStatus.RUNNING.toString().equals(keyDAO.getEdgeStatus(user))) {
- edgeService.stop(systemUserInfoService.create(user));
+ edgeService.stop(securityService.getUserInfoOffline(user));
}
}
diff --cc services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/SchedulerJobServiceImpl.java
index b9cabb1,ebe9bcd..c83dbff
--- a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/SchedulerJobServiceImpl.java
+++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/SchedulerJobServiceImpl.java
@@@ -243,7 -243,7 +243,7 @@@ public class SchedulerJobServiceImpl im
final String user = schedulerJobData.getUser();
final String exploratoryName = schedulerJobData.getExploratoryName();
log.debug("Starting exploratory {} for user {} by scheduler", exploratoryName, user);
- exploratoryService.start(securityService.getUserInfoOffline(user), exploratoryName);
- exploratoryService.start(systemUserService.create(user), exploratoryName, "");
++ exploratoryService.start(securityService.getUserInfoOffline(user), exploratoryName, ""); //TODO chagne empty
if (schedulerJobData.getJobDTO().isSyncStartRequired()) {
log.trace("Starting computational for exploratory {} for user {} by scheduler", exploratoryName, user);
final DataEngineType sparkCluster = DataEngineType.SPARK_STANDALONE;
@@@ -266,7 -266,7 +266,8 @@@
private void startSpark(String user, String expName, String compName) {
log.debug("Starting exploratory {} computational {} for user {} by scheduler", expName, compName, user);
- computationalService.startSparkCluster(securityService.getUserInfoOffline(user), expName, compName);
- computationalService.startSparkCluster(systemUserService.create(user), expName, compName,"");
++ computationalService.startSparkCluster(securityService.getUserInfoOffline(user), expName, compName, "");
++ //TODO change empty string
}
private boolean shouldClusterBeStarted(DataEngineType sparkCluster, UserComputationalResource compResource) {
diff --cc services/self-service/src/test/java/com/epam/dlab/backendapi/resources/ExploratoryResourceTest.java
index 2fa4c45,25cc0b7..0999019
--- a/services/self-service/src/test/java/com/epam/dlab/backendapi/resources/ExploratoryResourceTest.java
+++ b/services/self-service/src/test/java/com/epam/dlab/backendapi/resources/ExploratoryResourceTest.java
@@@ -79,25 -81,26 +81,9 @@@ public class ExploratoryResourceTest ex
}
@Test
-- public void createWithFailedAuth() throws AuthenticationException {
-- authFailSetup();
- when(exploratoryService.create(any(UserInfo.class), any(Exploratory.class))).thenReturn("someUuid");
- when(exploratoryService.create(any(UserInfo.class), any(Exploratory.class), anyString())).thenReturn(
- "someUuid");
-- final Response response = resources.getJerseyTest()
-- .target("/infrastructure_provision/exploratory_environment")
-- .request()
-- .header("Authorization", "Bearer " + TOKEN)
-- .put(Entity.json(getExploratoryCreateFormDTO()));
--
-- assertEquals(HttpStatus.SC_FORBIDDEN, response.getStatus());
-- assertEquals(MediaType.APPLICATION_JSON, response.getHeaderString(HttpHeaders.CONTENT_TYPE));
--
-- verifyZeroInteractions(exploratoryService);
-- }
--
-- @Test
public void createWithException() {
doThrow(new DlabException("Could not create exploratory environment"))
- .when(exploratoryService).create(any(UserInfo.class), any(Exploratory.class));
+ .when(exploratoryService).create(any(UserInfo.class), any(Exploratory.class), anyString());
final Response response = resources.getJerseyTest()
.target("/infrastructure_provision/exploratory_environment")
.request()
diff --cc services/self-service/src/test/java/com/epam/dlab/backendapi/resources/SecurityResourceTest.java
index 2663bcf,967c05e..0000000
deleted file mode 100644,100644
--- a/services/self-service/src/test/java/com/epam/dlab/backendapi/resources/SecurityResourceTest.java
+++ /dev/null
@@@ -1,220 -1,220 +1,0 @@@
--/*
-- * Licensed to the Apache Software Foundation (ASF) under one
-- * or more contributor license agreements. See the NOTICE file
-- * distributed with this work for additional information
-- * regarding copyright ownership. The ASF licenses this file
-- * to you under the Apache License, Version 2.0 (the
-- * "License"); you may not use this file except in compliance
-- * with the License. You may obtain a copy of the License at
-- *
-- * http://www.apache.org/licenses/LICENSE-2.0
-- *
-- * Unless required by applicable law or agreed to in writing,
-- * software distributed under the License is distributed on an
-- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- * KIND, either express or implied. See the License for the
-- * specific language governing permissions and limitations
-- * under the License.
-- */
--
--package com.epam.dlab.backendapi.resources;
--
--import com.epam.dlab.auth.UserInfo;
--import com.epam.dlab.auth.dto.UserCredentialDTO;
--import com.epam.dlab.backendapi.SelfServiceApplicationConfiguration;
--import com.epam.dlab.backendapi.dao.SecurityDAO;
--import com.epam.dlab.backendapi.domain.EnvStatusListener;
--import com.epam.dlab.rest.client.RESTService;
--import io.dropwizard.auth.AuthenticationException;
--import io.dropwizard.testing.junit.ResourceTestRule;
--import org.apache.http.HttpHeaders;
--import org.apache.http.HttpStatus;
--import org.bson.Document;
--import org.junit.Before;
--import org.junit.Rule;
--import org.junit.Test;
--
--import javax.ws.rs.client.Entity;
--import javax.ws.rs.core.MediaType;
--import javax.ws.rs.core.Response;
--import java.util.ArrayList;
--
--import static org.junit.Assert.assertEquals;
--import static org.junit.Assert.assertNull;
--import static org.mockito.Matchers.any;
--import static org.mockito.Matchers.anyString;
--import static org.mockito.Mockito.*;
--
--public class SecurityResourceTest extends TestBase {
--
-- private SecurityDAO securityDAO = mock(SecurityDAO.class);
-- private RESTService securityService = mock(RESTService.class);
-- private EnvStatusListener envStatusListener = mock(EnvStatusListener.class);
-- private SelfServiceApplicationConfiguration configuration = mock(SelfServiceApplicationConfiguration.class);
--
-- @Rule
-- public final ResourceTestRule resources = getResourceTestRuleInstance(
- new SecurityResource(securityDAO, envStatusListener, configuration));
- new SecurityResource(securityDAO, securityService, envStatusListener, configuration));
--
-- @Before
-- public void setup() throws AuthenticationException {
-- authSetup();
-- }
--
-- @Test
-- public void userLoginWithFailedAuth() throws AuthenticationException {
-- authFailSetup();
-- doNothing().when(securityDAO).writeLoginAttempt(any(UserCredentialDTO.class));
-- when(securityService.post(anyString(), any(UserCredentialDTO.class), any())).thenReturn(mock(Response.class));
-- final Response response = resources.getJerseyTest()
-- .target("/user/login")
-- .request()
-- .header("Authorization", "Bearer " + TOKEN)
-- .post(Entity.json(getUserCredentialDTO()));
--
-- assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, response.getStatus());
-- assertEquals(MediaType.valueOf("text/html;charset=ISO-8859-1"), response.getMediaType());
--
-- verify(securityDAO).writeLoginAttempt(refEq(getUserCredentialDTO()));
-- verify(securityService).post(eq("login"), refEq(getUserCredentialDTO()), eq(Response.class));
-- verifyNoMoreInteractions(securityDAO, securityService);
-- }
--
-- @Test
-- public void userLoginWithException() {
-- doNothing().when(securityDAO).writeLoginAttempt(any(UserCredentialDTO.class));
-- when(securityService.post(anyString(), any(UserCredentialDTO.class), any())).thenReturn(mock(Response.class));
-- final Response response = resources.getJerseyTest()
-- .target("/user/login")
-- .request()
-- .header("Authorization", "Bearer " + TOKEN)
-- .post(Entity.json(getUserCredentialDTO()));
--
-- assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, response.getStatus());
-- assertEquals(MediaType.valueOf("text/html;charset=ISO-8859-1"), response.getMediaType());
--
-- verify(securityDAO).writeLoginAttempt(refEq(getUserCredentialDTO()));
-- verify(securityService).post(eq("login"), refEq(getUserCredentialDTO()), eq(Response.class));
-- verifyNoMoreInteractions(securityDAO, securityService);
-- }
--
-- @Test
-- public void authorizeWhenRolePolicyNotEnabled() {
-- doNothing().when(envStatusListener).registerSession(any(UserInfo.class));
-- when(configuration.isRolePolicyEnabled()).thenReturn(false);
-- final Response response = resources.getJerseyTest()
-- .target("/user/authorize")
-- .request()
-- .header("Authorization", "Bearer " + TOKEN)
-- .post(Entity.entity(USER, MediaType.TEXT_PLAIN));
--
-- assertEquals(HttpStatus.SC_OK, response.getStatus());
-- assertNull(response.getHeaderString(HttpHeaders.CONTENT_TYPE));
--
-- verify(envStatusListener).registerSession(refEq(getUserInfo()));
-- verify(configuration).isRolePolicyEnabled();
-- verifyNoMoreInteractions(envStatusListener, configuration);
-- }
--
-- @Test
-- public void authorizeWithFailedAuth() throws AuthenticationException {
-- authFailSetup();
-- doNothing().when(envStatusListener).registerSession(any(UserInfo.class));
-- when(configuration.isRolePolicyEnabled()).thenReturn(false);
-- final Response response = resources.getJerseyTest()
-- .target("/user/authorize")
-- .request()
-- .header("Authorization", "Bearer " + TOKEN)
-- .post(Entity.entity(USER, MediaType.TEXT_PLAIN));
--
-- assertEquals(HttpStatus.SC_OK, response.getStatus());
-- assertNull(response.getHeaderString(HttpHeaders.CONTENT_TYPE));
--
-- verify(envStatusListener).registerSession(refEq(getUserInfo()));
-- verify(configuration).isRolePolicyEnabled();
-- verifyNoMoreInteractions(envStatusListener, configuration);
-- }
--
-- @Test
-- public void authorizeWhenRolePolicyEnabled() {
-- doNothing().when(envStatusListener).registerSession(any(UserInfo.class));
-- when(configuration.isRolePolicyEnabled()).thenReturn(true);
-- when(configuration.getRoleDefaultAccess()).thenReturn(true);
-- final Response response = resources.getJerseyTest()
-- .target("/user/authorize")
-- .request()
-- .header("Authorization", "Bearer " + TOKEN)
-- .post(Entity.entity(USER, MediaType.TEXT_PLAIN));
--
-- assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, response.getStatus());
-- assertEquals(MediaType.APPLICATION_JSON, response.getHeaderString(HttpHeaders.CONTENT_TYPE));
--
-- verify(envStatusListener).registerSession(refEq(getUserInfo()));
-- verify(configuration).isRolePolicyEnabled();
-- verify(configuration).getRoleDefaultAccess();
-- verifyNoMoreInteractions(envStatusListener, configuration);
-- }
--
-- @Test
-- public void authorizeWithException() {
-- doThrow(new RuntimeException()).when(envStatusListener).registerSession(any(UserInfo.class));
-- when(configuration.isRolePolicyEnabled()).thenReturn(true);
-- final Response response = resources.getJerseyTest()
-- .target("/user/authorize")
-- .request()
-- .header("Authorization", "Bearer " + TOKEN)
-- .post(Entity.entity(USER, MediaType.TEXT_PLAIN));
--
-- assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, response.getStatus());
-- assertEquals(MediaType.APPLICATION_JSON, response.getHeaderString(HttpHeaders.CONTENT_TYPE));
--
-- verify(envStatusListener).registerSession(refEq(getUserInfo()));
-- verifyNoMoreInteractions(envStatusListener);
-- verifyZeroInteractions(configuration);
-- }
--
-- @Test
-- public void userLogoutWithFailedAuth() throws AuthenticationException {
-- authFailSetup();
-- doNothing().when(envStatusListener).unregisterSession(any(UserInfo.class));
-- when(securityService.post(anyString(), anyString(), any())).thenReturn(mock(Response.class));
-- final Response response = resources.getJerseyTest()
-- .target("/user/logout")
-- .request()
-- .header("Authorization", "Bearer " + TOKEN)
-- .post(Entity.json(""));
--
-- assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, response.getStatus());
-- assertEquals(MediaType.valueOf("text/html;charset=ISO-8859-1"), response.getMediaType());
--
-- verify(envStatusListener).unregisterSession(refEq(getUserInfo()));
-- verify(securityService).post(eq("logout"), eq(TOKEN), eq(Response.class));
-- verifyNoMoreInteractions(envStatusListener, securityService);
-- }
--
-- @Test
-- public void userLogoutWithException() {
-- doNothing().when(envStatusListener).unregisterSession(any(UserInfo.class));
-- when(securityService.post(anyString(), anyString(), any())).thenReturn(mock(Response.class));
-- final Response response = resources.getJerseyTest()
-- .target("/user/logout")
-- .request()
-- .header("Authorization", "Bearer " + TOKEN)
-- .post(Entity.json(""));
--
-- assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, response.getStatus());
-- assertEquals(MediaType.valueOf("text/html;charset=ISO-8859-1"), response.getMediaType());
--
-- verify(envStatusListener).unregisterSession(refEq(getUserInfo()));
-- verify(securityService).post(eq("logout"), eq(TOKEN), eq(Response.class));
-- verifyNoMoreInteractions(envStatusListener, securityService);
-- }
--
-- private UserCredentialDTO getUserCredentialDTO() {
-- UserCredentialDTO userCredentialDTO = new UserCredentialDTO();
-- userCredentialDTO.setUsername(USER);
-- userCredentialDTO.setPassword("somePass");
-- userCredentialDTO.setAccessToken(TOKEN);
-- return userCredentialDTO;
-- }
--}
diff --cc services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/EnvironmentServiceImplTest.java
index aa1755c,f651c92..6008392
--- a/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/EnvironmentServiceImplTest.java
+++ b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/EnvironmentServiceImplTest.java
@@@ -28,14 -29,11 +28,12 @@@ import com.epam.dlab.backendapi.resourc
import com.epam.dlab.backendapi.service.ComputationalService;
import com.epam.dlab.backendapi.service.EdgeService;
import com.epam.dlab.backendapi.service.ExploratoryService;
+import com.epam.dlab.backendapi.service.SecurityService;
+ import com.epam.dlab.backendapi.service.ProjectService;
import com.epam.dlab.dto.UserInstanceDTO;
import com.epam.dlab.dto.UserInstanceStatus;
- import com.epam.dlab.dto.base.edge.EdgeInfo;
import com.epam.dlab.exceptions.DlabException;
import com.epam.dlab.exceptions.ResourceConflictException;
- import com.epam.dlab.model.ResourceEnum;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
diff --cc services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/SchedulerJobServiceImplTest.java
index 79e2603,55bfcbc..bb03cf4
--- a/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/SchedulerJobServiceImplTest.java
+++ b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/SchedulerJobServiceImplTest.java
@@@ -399,8 -399,8 +399,8 @@@ public class SchedulerJobServiceImplTes
verify(schedulerJobDAO)
.getComputationalSchedulerDataWithOneOfStatus(RUNNING, DataEngineType.SPARK_STANDALONE, STOPPED);
verify(computationalService).startSparkCluster(refEq(getUserInfo()), eq(EXPLORATORY_NAME),
- eq(COMPUTATIONAL_NAME));
+ eq(COMPUTATIONAL_NAME), eq(""));
- verifyNoMoreInteractions(systemUserService, schedulerJobDAO, computationalService);
+ verifyNoMoreInteractions(securityService, schedulerJobDAO, computationalService);
}
@Test
@@@ -689,10 -689,10 +689,12 @@@
schedulerJobService.startExploratoryByScheduler();
- verify(systemUserService).create(USER);
+ verify(securityService).getUserInfoOffline(USER);
verify(schedulerJobDAO).getExploratorySchedulerDataWithStatus(STOPPED);
- verify(exploratoryService).start(refEq(getUserInfo()), eq(EXPLORATORY_NAME));
- verify(exploratoryService).start(refEq(getUserInfo()), eq(EXPLORATORY_NAME), eq(""));
- verifyNoMoreInteractions(systemUserService, schedulerJobDAO, exploratoryService);
++ verify(exploratoryService).start(refEq(getUserInfo()), eq(EXPLORATORY_NAME), eq(""));
+ verifyNoMoreInteractions(securityService, schedulerJobDAO, exploratoryService);
++ verify(exploratoryService).start(refEq(getUserInfo()), eq(EXPLORATORY_NAME), eq(""));
++ verifyNoMoreInteractions(schedulerJobDAO, exploratoryService);
verifyZeroInteractions(computationalService, computationalDAO);
}
@@@ -713,13 -713,13 +715,13 @@@
schedulerJobService.startExploratoryByScheduler();
- verify(systemUserService, times(2)).create(USER);
+ verify(securityService, times(2)).getUserInfoOffline(USER);
verify(schedulerJobDAO).getExploratorySchedulerDataWithStatus(STOPPED);
- verify(exploratoryService).start(refEq(getUserInfo()), eq(EXPLORATORY_NAME));
+ verify(exploratoryService).start(refEq(getUserInfo()), eq(EXPLORATORY_NAME), eq(""));
verify(computationalDAO).findComputationalResourcesWithStatus(USER, EXPLORATORY_NAME, STOPPED);
verify(computationalService).startSparkCluster(refEq(getUserInfo()), eq(EXPLORATORY_NAME),
- eq(COMPUTATIONAL_NAME));
- eq(COMPUTATIONAL_NAME), eq(""));
- verifyNoMoreInteractions(systemUserService, schedulerJobDAO, exploratoryService, computationalService,
++ eq(COMPUTATIONAL_NAME), eq(""));
+ verifyNoMoreInteractions(securityService, schedulerJobDAO, exploratoryService, computationalService,
computationalDAO);
}
@@@ -740,11 -740,11 +742,11 @@@
schedulerJobService.startExploratoryByScheduler();
- verify(systemUserService).create(USER);
+ verify(securityService).getUserInfoOffline(USER);
verify(schedulerJobDAO).getExploratorySchedulerDataWithStatus(STOPPED);
- verify(exploratoryService).start(refEq(getUserInfo()), eq(EXPLORATORY_NAME));
- verify(exploratoryService).start(refEq(getUserInfo()), eq(EXPLORATORY_NAME), eq(""));
++ verify(exploratoryService).start(refEq(getUserInfo()), eq(EXPLORATORY_NAME), eq(""));
verify(computationalDAO).findComputationalResourcesWithStatus(USER, EXPLORATORY_NAME, STOPPED);
- verifyNoMoreInteractions(systemUserService, schedulerJobDAO, exploratoryService, computationalDAO);
+ verifyNoMoreInteractions(securityService, schedulerJobDAO, exploratoryService, computationalDAO);
verifyZeroInteractions(computationalService);
}
@@@ -765,11 -765,11 +767,11 @@@
schedulerJobService.startExploratoryByScheduler();
- verify(systemUserService).create(USER);
+ verify(securityService).getUserInfoOffline(USER);
verify(schedulerJobDAO).getExploratorySchedulerDataWithStatus(STOPPED);
- verify(exploratoryService).start(refEq(getUserInfo()), eq(EXPLORATORY_NAME));
- verify(exploratoryService).start(refEq(getUserInfo()), eq(EXPLORATORY_NAME), eq(""));
++ verify(exploratoryService).start(refEq(getUserInfo()), eq(EXPLORATORY_NAME), eq(""));
verify(computationalDAO).findComputationalResourcesWithStatus(USER, EXPLORATORY_NAME, STOPPED);
- verifyNoMoreInteractions(systemUserService, schedulerJobDAO, exploratoryService, computationalDAO);
+ verifyNoMoreInteractions(securityService, schedulerJobDAO, exploratoryService, computationalDAO);
verifyZeroInteractions(computationalService);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org