[incubator-dlab] branch new-datalab-name updated: [DLAB-2066] Replaced old name with new one in GuacamoleServlet
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch new-datalab-name in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/new-datalab-name by this push: new c571929 [DLAB-2066] Replaced old name with new one in GuacamoleServlet c571929 is described below commit c571929371767a666ec61ba7c1eb33f14f7d4132 Author: Oleh Fuks AuthorDate: Tue Sep 29 17:31:41 2020 +0300 [DLAB-2066] Replaced old name with new one in GuacamoleServlet --- .../com/epam/datalab/backendapi/servlet/guacamole/GuacamoleServlet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/self-service/src/main/java/com/epam/datalab/backendapi/servlet/guacamole/GuacamoleServlet.java b/services/self-service/src/main/java/com/epam/datalab/backendapi/servlet/guacamole/GuacamoleServlet.java index 74c772a..3ca5557 100644 --- a/services/self-service/src/main/java/com/epam/datalab/backendapi/servlet/guacamole/GuacamoleServlet.java +++ b/services/self-service/src/main/java/com/epam/datalab/backendapi/servlet/guacamole/GuacamoleServlet.java @@ -42,7 +42,7 @@ import java.io.IOException; @Slf4j public class GuacamoleServlet extends GuacamoleHTTPTunnelServlet { private static final String UNAUTHORIZED_MSG = "User is not authenticated"; - private static final String DATALAB_PREFIX = "DLab-"; + private static final String DATALAB_PREFIX = "DataLab-"; private final GuacamoleService guacamoleService; private final ObjectMapper mapper; private final SecurityDAO securityDAO; - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
svn commit: r41611 - in /release/incubator/dlab/2.4-incubating: ./ apache-dlab-2.4.0-incubating.tar.gz apache-dlab-2.4.0-incubating.tar.gz.asc apache-dlab-2.4.0-incubating.tar.gz.sha512
Author: ofuks Date: Mon Sep 28 07:58:54 2020 New Revision: 41611 Log: DLab 2.4.0 release Added: release/incubator/dlab/2.4-incubating/ release/incubator/dlab/2.4-incubating/apache-dlab-2.4.0-incubating.tar.gz (with props) release/incubator/dlab/2.4-incubating/apache-dlab-2.4.0-incubating.tar.gz.asc release/incubator/dlab/2.4-incubating/apache-dlab-2.4.0-incubating.tar.gz.sha512 Added: release/incubator/dlab/2.4-incubating/apache-dlab-2.4.0-incubating.tar.gz == Binary file - no diff available. Propchange: release/incubator/dlab/2.4-incubating/apache-dlab-2.4.0-incubating.tar.gz -- svn:mime-type = application/octet-stream Added: release/incubator/dlab/2.4-incubating/apache-dlab-2.4.0-incubating.tar.gz.asc == --- release/incubator/dlab/2.4-incubating/apache-dlab-2.4.0-incubating.tar.gz.asc (added) +++ release/incubator/dlab/2.4-incubating/apache-dlab-2.4.0-incubating.tar.gz.asc Mon Sep 28 07:58:54 2020 @@ -0,0 +1,16 @@ +-BEGIN PGP SIGNATURE- + +iQIzBAABCAAdFiEErZFJiVV29w/QhFgmOeCfJZBfoakFAl9jNB8ACgkQOeCfJZBf +oakYTA/9GU7fl42UcfViRZ2hw8mv3UzuU6kHPlrZy6yfg/axf/wBDI+EClLvbszY +nSYr+kJnq4QbXE+hnwmPbvOPHTX/21oLbP4rtzXE+oaET3Mu9uRhSO7lw4b5CK3v +2e5yIyfcKkxrWyi+7K7qMMAIqALT+QHtdgd1N+PTujvHr2UmP1vRv/Um2ck4gEk6 +Ljzzwqdtq4r1EM89mfC/fE2Jq4vgzntPX+XsOn4m/YsJ7dCa1tDfTO9bcHzcSd+d +qgncgsAS/9KzhAMR1p0Z+5YgTSwXZsWqhH3S+eXn2sjSXmOsgzFUNyZEVx7C44xf +fhYz+gzAqb4a45CjhuY57Hxk/eMKVYFpuCr0koweSr4jGFc43yJOzmLrsjNITRQZ +2QDV0MgpqiQ3hxuW2R0duy/hBjO7dMhwh/p5QpuIKh3NffnCr7Bvgdzi1r7DGfCU +32hEg6tzOLEl7Ur9f+QphSiWU/lnQmU8vOrAgQeJq04I+l1lsGrYcV4Vsg+rLCoZ +9UdDolBxB7aHCaaLaAw7bULzyFMvxgcViOlmYYs267zxjgeq0ceJSIuwDGe1cGyq +8K9vwe59T3LycSraCbkMuDSRHwpms/kFjFW/uoZ9Cv4duS1sirYlYNMdYTs7iHhb +YEM7G1U68B0evFgHCQitiD0X0SPxIxGwq8eFrZ+mPRyjZ7nLjC4= +=JXTZ +-END PGP SIGNATURE- Added: release/incubator/dlab/2.4-incubating/apache-dlab-2.4.0-incubating.tar.gz.sha512 == --- release/incubator/dlab/2.4-incubating/apache-dlab-2.4.0-incubating.tar.gz.sha512 (added) +++ release/incubator/dlab/2.4-incubating/apache-dlab-2.4.0-incubating.tar.gz.sha512 Mon Sep 28 07:58:54 2020 @@ -0,0 +1,3 @@ +/Users/ofuks/work/release/apache-dlab-2.4.0-incubating.tar.gz: +B9CF91D8 19F447E1 2AC60D5F 8D013CC6 779C1712 2BC23308 B9AED229 46772DAC 6ECC8559 + 11B7B363 5601F089 B3590852 F0BEC894 236C08CC 916ECF0A 442FE3B7 - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch new-datalab-name created (now f74c104)
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a change to branch new-datalab-name in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git. at f74c104 Merge remote-tracking branch 'remotes/origin/DLAB-2067' into new-datalab-name This branch includes the following new commits: new f74c104 Merge remote-tracking branch 'remotes/origin/DLAB-2067' into new-datalab-name The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] 01/01: Merge remote-tracking branch 'remotes/origin/DLAB-2067' into new-datalab-name
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch new-datalab-name in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git commit f74c104e51615f22b36ed727083270e273713dc2 Merge: 34a0f0b a30e375 Author: Oleh Fuks AuthorDate: Thu Sep 24 17:48:02 2020 +0300 Merge remote-tracking branch 'remotes/origin/DLAB-2067' into new-datalab-name CONTRIBUTING.md| 6 +- README.md | 380 ++--- RELEASE_NOTES.md | 16 +- USER_GUIDE.md | 58 ++-- doc/{dlab_aws.png => datalab_aws.png} | Bin doc/{dlab_azure.png => datalab_azure.png} | Bin doc/{dlab_gcp.png => datalab_gcp.png} | Bin .../scripts/POST_DEPLOYMENT.md | 10 +- .../scripts/{deploy_dlab.py => deploy_datalab.py} | 48 +-- .../scripts/deploy_repository/deploy_repository.py | 24 +- .../scripts/post-deployment_configuration.py | 110 +++--- .../src/base/scripts/install_prerequisites.py | 4 +- .../src/base/scripts/install_user_key.py | 2 +- .../src/dataengine-service/fabfile.py | 6 +- .../src/dataengine/fabfile.py | 6 +- .../src/dataengine/scripts/configure_dataengine.py | 6 +- .../src/deeplearning/fabfile.py| 6 +- .../scripts/configure_deep_learning_node.py| 8 +- infrastructure-provisioning/src/edge/fabfile.py| 2 +- .../src/edge/scripts/configure_http_proxy.py | 2 +- .../edge/scripts/configure_nginx_reverse_proxy.py | 2 +- .../src/edge/scripts/reupload_ssh_key.py | 6 +- .../src/edge/templates/squid.conf | 4 +- .../src/general/api/check_inactivity.py| 2 +- .../src/general/api/configure.py | 2 +- .../src/general/api/create.py | 2 +- .../src/general/api/create_image.py| 2 +- .../src/general/api/git_creds.py | 2 +- .../src/general/api/install_libs.py| 2 +- .../src/general/api/list_libs.py | 4 +- .../src/general/api/reconfigure_spark.py | 2 +- .../src/general/api/recreate.py| 2 +- .../src/general/api/reupload_key.py| 2 +- .../src/general/api/start.py | 2 +- .../src/general/api/status.py | 2 +- .../src/general/api/stop.py| 2 +- .../src/general/api/terminate.py | 2 +- .../src/general/api/terminate_image.py | 2 +- .../src/general/conf/{dlab.ini => datalab.ini} | 42 +-- .../src/general/files/aws/base_Dockerfile | 8 +- .../src/general/files/aws/base_description.json| 2 +- .../files/aws/dataengine-service_Dockerfile| 6 +- .../src/general/files/aws/dataengine_Dockerfile| 4 +- .../src/general/files/aws/deeplearning_Dockerfile | 4 +- .../src/general/files/aws/edge_Dockerfile | 4 +- .../src/general/files/aws/jupyter_Dockerfile | 4 +- .../src/general/files/aws/jupyterlab_Dockerfile| 4 +- .../src/general/files/aws/project_Dockerfile | 4 +- .../src/general/files/aws/rstudio_Dockerfile | 4 +- .../src/general/files/aws/ssn_Dockerfile | 4 +- .../src/general/files/aws/ssn_description.json | 2 +- .../general/files/aws/tensor-rstudio_Dockerfile| 4 +- .../src/general/files/aws/tensor_Dockerfile| 4 +- .../src/general/files/aws/zeppelin_Dockerfile | 4 +- .../src/general/files/azure/base_Dockerfile| 8 +- .../src/general/files/azure/base_description.json | 2 +- .../src/general/files/azure/dataengine_Dockerfile | 4 +- .../general/files/azure/deeplearning_Dockerfile| 4 +- .../src/general/files/azure/edge_Dockerfile| 4 +- .../src/general/files/azure/jupyter_Dockerfile | 4 +- .../src/general/files/azure/jupyterlab_Dockerfile | 4 +- .../src/general/files/azure/project_Dockerfile | 4 +- .../src/general/files/azure/rstudio_Dockerfile | 4 +- .../src/general/files/azure/ssn_Dockerfile | 4 +- .../src/general/files/azure/ssn_description.json | 2 +- .../src/general/files/azure/tensor_Dockerfile | 4 +- .../src/general/files/azure/zeppelin_Dockerfile| 4 +- .../src/general/files/gcp/base_Dockerfile | 8 +- .../src/general/files/gcp/base_description.json| 2 +- .../files/gcp/dataengine-service_Dockerfile| 4 +- .../src/general/files/gcp/dataengine_Dockerfile| 4 +- .../src/general/files/gcp/deeplearning_Dockerfile | 4 +- .../src/general/files/gcp/edge_Dockerfile | 4 +- .../src/general/files/gcp/jupyter_Dockerfile | 4 +- .../src/general/files/gcp/jupyterlab_Dock
[incubator-dlab] branch develop updated: Fixed issue with billing for azure
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 9196dc0 Fixed issue with billing for azure 9196dc0 is described below commit 9196dc03c9aa5b69f5620772106baad2ffae9df1 Author: Oleh Fuks AuthorDate: Fri Sep 25 13:51:03 2020 +0300 Fixed issue with billing for azure --- .../java/com/epam/dlab/billing/azure/CalculateBillingServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/billing-azure/src/main/java/com/epam/dlab/billing/azure/CalculateBillingServiceImpl.java b/services/billing-azure/src/main/java/com/epam/dlab/billing/azure/CalculateBillingServiceImpl.java index 7b29677..a4ba149 100644 --- a/services/billing-azure/src/main/java/com/epam/dlab/billing/azure/CalculateBillingServiceImpl.java +++ b/services/billing-azure/src/main/java/com/epam/dlab/billing/azure/CalculateBillingServiceImpl.java @@ -48,6 +48,7 @@ import java.nio.file.Paths; import java.time.LocalDate; import java.util.Collections; import java.util.List; +import java.util.Objects; import java.util.Optional; import java.util.stream.Collectors; @@ -155,6 +156,7 @@ public class CalculateBillingServiceImpl implements CalculateBillingService { if (!dailyInvoices.isEmpty()) { return dailyInvoices .stream() +.filter(Objects::nonNull) .map(this::toBillingData) .collect(Collectors.toList()); } else { - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch DLAB-1344 created (now 457de16)
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a change to branch DLAB-1344 in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git. at 457de16 [DLAB-1344] Added localization support This branch includes the following new commits: new 457de16 [DLAB-1344] Added localization support The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] 01/01: [DLAB-1344] Added localization support
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch DLAB-1344 in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git commit 457de160b49a7f37d3a63dc4f6f0db94cc7977ef Author: Oleh Fuks AuthorDate: Wed Sep 23 11:16:29 2020 +0300 [DLAB-1344] Added localization support --- .../src/main/java/com/epam/dlab/dto/bucket/BucketDTO.java| 2 +- .../java/com/epam/dlab/backendapi/service/BucketService.java | 1 - .../backendapi/service/impl/aws/BucketServiceAwsImpl.java| 12 .../service/impl/azure/BucketServiceAzureImpl.java | 5 ++--- .../backendapi/service/impl/gcp/BucketServiceGcpImpl.java| 6 +- .../dlab/backendapi/service/impl/BucketServiceImplTest.java | 4 +++- 6 files changed, 11 insertions(+), 19 deletions(-) diff --git a/services/dlab-model/src/main/java/com/epam/dlab/dto/bucket/BucketDTO.java b/services/dlab-model/src/main/java/com/epam/dlab/dto/bucket/BucketDTO.java index 369c866..74e0a8b 100644 --- a/services/dlab-model/src/main/java/com/epam/dlab/dto/bucket/BucketDTO.java +++ b/services/dlab-model/src/main/java/com/epam/dlab/dto/bucket/BucketDTO.java @@ -30,5 +30,5 @@ public class BucketDTO { private final String bucket; private final String object; private final String size; -private final String lastModifiedDate; +private final long lastModifiedDate; } diff --git a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/BucketService.java b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/BucketService.java index 47b001b..de77e93 100644 --- a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/BucketService.java +++ b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/BucketService.java @@ -27,7 +27,6 @@ import java.io.InputStream; import java.util.List; public interface BucketService { -String DATE_FORMAT = "-MM-dd'T'HH:mm:ss"; List getObjects(String bucket); diff --git a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/aws/BucketServiceAwsImpl.java b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/aws/BucketServiceAwsImpl.java index 6c5673d..1657677 100644 --- a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/aws/BucketServiceAwsImpl.java +++ b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/aws/BucketServiceAwsImpl.java @@ -38,8 +38,6 @@ import software.amazon.awssdk.services.s3.model.S3Object; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import java.io.InputStream; -import java.text.SimpleDateFormat; -import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -141,13 +139,11 @@ public class BucketServiceAwsImpl implements BucketService { } private BucketDTO toBucketDTO(String bucket, S3Object s3Object) { -Date date = Date.from(s3Object.lastModified()); -SimpleDateFormat formatter = new SimpleDateFormat(DATE_FORMAT); return BucketDTO.builder() -.bucket(bucket) -.object(s3Object.key()) -.size(String.valueOf(s3Object.size())) -.lastModifiedDate(formatter.format(date)) + .bucket(bucket) + .object(s3Object.key()) + .size(String.valueOf(s3Object.size())) + .lastModifiedDate(s3Object.lastModified().toEpochMilli()) .build(); } } diff --git a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/azure/BucketServiceAzureImpl.java b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/azure/BucketServiceAzureImpl.java index 073aca2..6ee1089 100644 --- a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/azure/BucketServiceAzureImpl.java +++ b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/azure/BucketServiceAzureImpl.java @@ -44,12 +44,12 @@ import java.io.IOException; import java.io.InputStream; import java.nio.file.Path; import java.nio.file.Paths; -import java.time.format.DateTimeFormatter; import java.util.List; import java.util.stream.Collectors; @Slf4j public class BucketServiceAzureImpl implements BucketService { + private final AzureAuthFile azureAuthFile; @Inject @@ -124,12 +124,11 @@ public class BucketServiceAzureImpl implements BucketService { } private BucketDTO toBucketDTO(String bucket, BlobItem blob) { -String lastModifiedDate = blob.getProperties().getLastModified().format(DateTimeFormatter.ofPattern(DATE_FORMAT)); return BucketDTO.builder() .bucket(bucket) .object(bl
[incubator-dlab] branch DLAB-1344 created (now 457de16)
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a change to branch DLAB-1344 in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git. at 457de16 [DLAB-1344] Added localization support This branch includes the following new commits: new 457de16 [DLAB-1344] Added localization support The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] 01/01: [DLAB-1344] Added localization support
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch DLAB-1344 in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git commit 457de160b49a7f37d3a63dc4f6f0db94cc7977ef Author: Oleh Fuks AuthorDate: Wed Sep 23 11:16:29 2020 +0300 [DLAB-1344] Added localization support --- .../src/main/java/com/epam/dlab/dto/bucket/BucketDTO.java| 2 +- .../java/com/epam/dlab/backendapi/service/BucketService.java | 1 - .../backendapi/service/impl/aws/BucketServiceAwsImpl.java| 12 .../service/impl/azure/BucketServiceAzureImpl.java | 5 ++--- .../backendapi/service/impl/gcp/BucketServiceGcpImpl.java| 6 +- .../dlab/backendapi/service/impl/BucketServiceImplTest.java | 4 +++- 6 files changed, 11 insertions(+), 19 deletions(-) diff --git a/services/dlab-model/src/main/java/com/epam/dlab/dto/bucket/BucketDTO.java b/services/dlab-model/src/main/java/com/epam/dlab/dto/bucket/BucketDTO.java index 369c866..74e0a8b 100644 --- a/services/dlab-model/src/main/java/com/epam/dlab/dto/bucket/BucketDTO.java +++ b/services/dlab-model/src/main/java/com/epam/dlab/dto/bucket/BucketDTO.java @@ -30,5 +30,5 @@ public class BucketDTO { private final String bucket; private final String object; private final String size; -private final String lastModifiedDate; +private final long lastModifiedDate; } diff --git a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/BucketService.java b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/BucketService.java index 47b001b..de77e93 100644 --- a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/BucketService.java +++ b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/BucketService.java @@ -27,7 +27,6 @@ import java.io.InputStream; import java.util.List; public interface BucketService { -String DATE_FORMAT = "-MM-dd'T'HH:mm:ss"; List getObjects(String bucket); diff --git a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/aws/BucketServiceAwsImpl.java b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/aws/BucketServiceAwsImpl.java index 6c5673d..1657677 100644 --- a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/aws/BucketServiceAwsImpl.java +++ b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/aws/BucketServiceAwsImpl.java @@ -38,8 +38,6 @@ import software.amazon.awssdk.services.s3.model.S3Object; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import java.io.InputStream; -import java.text.SimpleDateFormat; -import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -141,13 +139,11 @@ public class BucketServiceAwsImpl implements BucketService { } private BucketDTO toBucketDTO(String bucket, S3Object s3Object) { -Date date = Date.from(s3Object.lastModified()); -SimpleDateFormat formatter = new SimpleDateFormat(DATE_FORMAT); return BucketDTO.builder() -.bucket(bucket) -.object(s3Object.key()) -.size(String.valueOf(s3Object.size())) -.lastModifiedDate(formatter.format(date)) + .bucket(bucket) + .object(s3Object.key()) + .size(String.valueOf(s3Object.size())) + .lastModifiedDate(s3Object.lastModified().toEpochMilli()) .build(); } } diff --git a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/azure/BucketServiceAzureImpl.java b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/azure/BucketServiceAzureImpl.java index 073aca2..6ee1089 100644 --- a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/azure/BucketServiceAzureImpl.java +++ b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/azure/BucketServiceAzureImpl.java @@ -44,12 +44,12 @@ import java.io.IOException; import java.io.InputStream; import java.nio.file.Path; import java.nio.file.Paths; -import java.time.format.DateTimeFormatter; import java.util.List; import java.util.stream.Collectors; @Slf4j public class BucketServiceAzureImpl implements BucketService { + private final AzureAuthFile azureAuthFile; @Inject @@ -124,12 +124,11 @@ public class BucketServiceAzureImpl implements BucketService { } private BucketDTO toBucketDTO(String bucket, BlobItem blob) { -String lastModifiedDate = blob.getProperties().getLastModified().format(DateTimeFormatter.ofPattern(DATE_FORMAT)); return BucketDTO.builder() .bucket(bucket) .object(bl
[incubator-dlab] 01/01: [DLAB-1344] Added localization support
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch DLAB-1344 in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git commit 457de160b49a7f37d3a63dc4f6f0db94cc7977ef Author: Oleh Fuks AuthorDate: Wed Sep 23 11:16:29 2020 +0300 [DLAB-1344] Added localization support --- .../src/main/java/com/epam/dlab/dto/bucket/BucketDTO.java| 2 +- .../java/com/epam/dlab/backendapi/service/BucketService.java | 1 - .../backendapi/service/impl/aws/BucketServiceAwsImpl.java| 12 .../service/impl/azure/BucketServiceAzureImpl.java | 5 ++--- .../backendapi/service/impl/gcp/BucketServiceGcpImpl.java| 6 +- .../dlab/backendapi/service/impl/BucketServiceImplTest.java | 4 +++- 6 files changed, 11 insertions(+), 19 deletions(-) diff --git a/services/dlab-model/src/main/java/com/epam/dlab/dto/bucket/BucketDTO.java b/services/dlab-model/src/main/java/com/epam/dlab/dto/bucket/BucketDTO.java index 369c866..74e0a8b 100644 --- a/services/dlab-model/src/main/java/com/epam/dlab/dto/bucket/BucketDTO.java +++ b/services/dlab-model/src/main/java/com/epam/dlab/dto/bucket/BucketDTO.java @@ -30,5 +30,5 @@ public class BucketDTO { private final String bucket; private final String object; private final String size; -private final String lastModifiedDate; +private final long lastModifiedDate; } diff --git a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/BucketService.java b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/BucketService.java index 47b001b..de77e93 100644 --- a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/BucketService.java +++ b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/BucketService.java @@ -27,7 +27,6 @@ import java.io.InputStream; import java.util.List; public interface BucketService { -String DATE_FORMAT = "-MM-dd'T'HH:mm:ss"; List getObjects(String bucket); diff --git a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/aws/BucketServiceAwsImpl.java b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/aws/BucketServiceAwsImpl.java index 6c5673d..1657677 100644 --- a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/aws/BucketServiceAwsImpl.java +++ b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/aws/BucketServiceAwsImpl.java @@ -38,8 +38,6 @@ import software.amazon.awssdk.services.s3.model.S3Object; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import java.io.InputStream; -import java.text.SimpleDateFormat; -import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -141,13 +139,11 @@ public class BucketServiceAwsImpl implements BucketService { } private BucketDTO toBucketDTO(String bucket, S3Object s3Object) { -Date date = Date.from(s3Object.lastModified()); -SimpleDateFormat formatter = new SimpleDateFormat(DATE_FORMAT); return BucketDTO.builder() -.bucket(bucket) -.object(s3Object.key()) -.size(String.valueOf(s3Object.size())) -.lastModifiedDate(formatter.format(date)) + .bucket(bucket) + .object(s3Object.key()) + .size(String.valueOf(s3Object.size())) + .lastModifiedDate(s3Object.lastModified().toEpochMilli()) .build(); } } diff --git a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/azure/BucketServiceAzureImpl.java b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/azure/BucketServiceAzureImpl.java index 073aca2..6ee1089 100644 --- a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/azure/BucketServiceAzureImpl.java +++ b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/service/impl/azure/BucketServiceAzureImpl.java @@ -44,12 +44,12 @@ import java.io.IOException; import java.io.InputStream; import java.nio.file.Path; import java.nio.file.Paths; -import java.time.format.DateTimeFormatter; import java.util.List; import java.util.stream.Collectors; @Slf4j public class BucketServiceAzureImpl implements BucketService { + private final AzureAuthFile azureAuthFile; @Inject @@ -124,12 +124,11 @@ public class BucketServiceAzureImpl implements BucketService { } private BucketDTO toBucketDTO(String bucket, BlobItem blob) { -String lastModifiedDate = blob.getProperties().getLastModified().format(DateTimeFormatter.ofPattern(DATE_FORMAT)); return BucketDTO.builder() .bucket(bucket) .object(bl
[incubator-dlab] branch DLAB-1344 created (now 457de16)
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a change to branch DLAB-1344 in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git. at 457de16 [DLAB-1344] Added localization support This branch includes the following new commits: new 457de16 [DLAB-1344] Added localization support The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: [DLAB-2038] Added 'endpoint' field to response on the 'Environment management' page
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 020 [DLAB-2038] Added 'endpoint' field to response on the 'Environment management' page 020 is described below commit 020758af8571c234c62bae5296244378586d Author: Oleh Fuks AuthorDate: Fri Sep 18 17:53:42 2020 +0300 [DLAB-2038] Added 'endpoint' field to response on the 'Environment management' page --- .../epam/dlab/backendapi/resources/dto/UserResourceInfo.java | 2 ++ .../dlab/backendapi/service/impl/EnvironmentServiceImpl.java | 2 ++ .../backendapi/service/impl/EnvironmentServiceImplTest.java| 10 ++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/dto/UserResourceInfo.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/dto/UserResourceInfo.java index 5958411..aebe2b1 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/dto/UserResourceInfo.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/dto/UserResourceInfo.java @@ -36,6 +36,8 @@ public class UserResourceInfo { private String user; @JsonProperty private String project; + @JsonProperty + private String endpoint; @JsonProperty("resource_type") private ResourceEnum resourceType; @JsonProperty("resource_name") diff --git 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 index 2ae828c..95681de 100644 --- 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 @@ -197,6 +197,7 @@ public class EnvironmentServiceImpl implements EnvironmentService { .resourceType(ResourceEnum.EDGE_NODE) .resourceStatus(e.getStatus().toString()) .project(projectDTO.getName()) + .endpoint(e.getName()) .ip(e.getEdgeInfo() != null ? e.getEdgeInfo().getPublicIp() : null) .build()); return Stream.concat(edges, userResources).collect(toList()); @@ -214,6 +215,7 @@ public class EnvironmentServiceImpl implements EnvironmentService { .computationalResources(userInstance.getResources()) .user(userInstance.getUser()) .project(userInstance.getProject()) + .endpoint(userInstance.getEndpoint()) .cloudProvider(userInstance.getCloudProvider()) .exploratoryUrls(userInstance.getResourceUrl()) .build(); diff --git 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 index d9b97ef..2f2c7c7 100644 --- 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 @@ -317,6 +317,7 @@ public class EnvironmentServiceImplTest { .resourceType(ResourceEnum.EDGE_NODE) .resourceStatus("running") .project(PROJECT_NAME) + .endpoint(ENDPOINT_NAME) .ip(null) .build(); } @@ -330,6 +331,7 @@ public class EnvironmentServiceImplTest { .computationalResources(Collections.emptyList()) .user(USER) .project(PROJECT_NAME) + .endpoint(ENDPOINT_NAME) .cloudProvider("aws") .exploratoryUrls(null) .build(); @@ -345,10 +347,10 @@ public class EnvironmentServiceImplTest { private List getUserInstances() { return Arrays.asList( - new UserInstanceDTO().withExploratoryName(EXPLOR
svn commit: r41485 - in /dev/incubator/dlab/2.4: apache-dlab-2.4.0-incubating.tar.gz apache-dlab-2.4.0-incubating.tar.gz.asc apache-dlab-2.4.0-incubating.tar.gz.sha512
Author: ofuks Date: Thu Sep 17 10:04:38 2020 New Revision: 41485 Log: DLab 2.4.0 release Added: dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz (with props) dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.asc dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.sha512 Added: dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz == Binary file - no diff available. Propchange: dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz -- svn:mime-type = application/octet-stream Added: dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.asc == --- dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.asc (added) +++ dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.asc Thu Sep 17 10:04:38 2020 @@ -0,0 +1,16 @@ +-BEGIN PGP SIGNATURE- + +iQIzBAABCAAdFiEErZFJiVV29w/QhFgmOeCfJZBfoakFAl9jNB8ACgkQOeCfJZBf +oakYTA/9GU7fl42UcfViRZ2hw8mv3UzuU6kHPlrZy6yfg/axf/wBDI+EClLvbszY +nSYr+kJnq4QbXE+hnwmPbvOPHTX/21oLbP4rtzXE+oaET3Mu9uRhSO7lw4b5CK3v +2e5yIyfcKkxrWyi+7K7qMMAIqALT+QHtdgd1N+PTujvHr2UmP1vRv/Um2ck4gEk6 +Ljzzwqdtq4r1EM89mfC/fE2Jq4vgzntPX+XsOn4m/YsJ7dCa1tDfTO9bcHzcSd+d +qgncgsAS/9KzhAMR1p0Z+5YgTSwXZsWqhH3S+eXn2sjSXmOsgzFUNyZEVx7C44xf +fhYz+gzAqb4a45CjhuY57Hxk/eMKVYFpuCr0koweSr4jGFc43yJOzmLrsjNITRQZ +2QDV0MgpqiQ3hxuW2R0duy/hBjO7dMhwh/p5QpuIKh3NffnCr7Bvgdzi1r7DGfCU +32hEg6tzOLEl7Ur9f+QphSiWU/lnQmU8vOrAgQeJq04I+l1lsGrYcV4Vsg+rLCoZ +9UdDolBxB7aHCaaLaAw7bULzyFMvxgcViOlmYYs267zxjgeq0ceJSIuwDGe1cGyq +8K9vwe59T3LycSraCbkMuDSRHwpms/kFjFW/uoZ9Cv4duS1sirYlYNMdYTs7iHhb +YEM7G1U68B0evFgHCQitiD0X0SPxIxGwq8eFrZ+mPRyjZ7nLjC4= +=JXTZ +-END PGP SIGNATURE- Added: dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.sha512 == --- dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.sha512 (added) +++ dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.sha512 Thu Sep 17 10:04:38 2020 @@ -0,0 +1,3 @@ +/Users/ofuks/work/release/apache-dlab-2.4.0-incubating.tar.gz: +B9CF91D8 19F447E1 2AC60D5F 8D013CC6 779C1712 2BC23308 B9AED229 46772DAC 6ECC8559 + 11B7B363 5601F089 B3590852 F0BEC894 236C08CC 916ECF0A 442FE3B7 - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
svn commit: r41484 - in /dev/incubator/dlab/2.4: apache-dlab-2.4.0-incubating.tar.gz apache-dlab-2.4.0-incubating.tar.gz.asc apache-dlab-2.4.0-incubating.tar.gz.sha512
Author: ofuks Date: Thu Sep 17 10:03:24 2020 New Revision: 41484 Log: Deleted 2.4 artifacts Removed: dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.asc dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.sha512 - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] annotated tag 2.4.0 updated (78e5247 -> a584fda)
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a change to annotated tag 2.4.0 in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git. *** WARNING: tag 2.4.0 was modified! *** from 78e5247 (commit) to a584fda (tag) tagging 78e52472b183a676e9b42f5141e54ff713bb6b5d (commit) by Oleh Fuks on Thu Sep 17 13:00:07 2020 +0300 - Log - DLab 2.4.0 release --- No new revisions were added by this update. Summary of changes: - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: [DLAB-1922] Fixed bug with reminder about notebook stopping continues to show up after scheduler triggering (#917)
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 839dab7 [DLAB-1922] Fixed bug with reminder about notebook stopping continues to show up after scheduler triggering (#917) 839dab7 is described below commit 839dab7a0df654cbc3371e42861351d1f442590d Author: ofuks <54886119+of...@users.noreply.github.com> AuthorDate: Thu Sep 17 11:52:56 2020 +0300 [DLAB-1922] Fixed bug with reminder about notebook stopping continues to show up after scheduler triggering (#917) [DLAB-1922] Fixed bug with reminder about notebook stopping continues to show up after scheduler triggering --- .../dlab/backendapi/service/impl/SchedulerJobServiceImpl.java | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git 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 index 4b64e0b..a929698 100644 --- 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 @@ -469,15 +469,16 @@ public class SchedulerJobServiceImpl implements SchedulerJobService { } private boolean shouldSchedulerBeExecuted(SchedulerJobDTO dto, OffsetDateTime dateTime, List daysRepeat, - LocalTime time, boolean usingOffset) { - LocalDateTime convertedDateTime = localDateTimeAtZone(dateTime, dto.getTimeZoneOffset()); + LocalTime time, boolean usingOffset) { + ZoneOffset timeZoneOffset = dto.getTimeZoneOffset(); + LocalDateTime convertedDateTime = localDateTimeAtZone(dateTime, timeZoneOffset); return isSchedulerActive(dto, convertedDateTime) && daysRepeat.contains(convertedDateTime.toLocalDate().getDayOfWeek()) - && timeFilter(time, convertedDateTime.toLocalTime(), usingOffset); + && timeFilter(time, convertedDateTime.toLocalTime(), timeZoneOffset, usingOffset); } - private boolean timeFilter(LocalTime time, LocalTime convertedDateTime, boolean usingOffset) { - return usingOffset ? (time.isBefore(convertedDateTime) && time.isAfter(LocalDateTime.now().toLocalTime())) : + private boolean timeFilter(LocalTime time, LocalTime convertedDateTime, ZoneOffset timeZoneOffset, boolean usingOffset) { + return usingOffset ? (time.isBefore(convertedDateTime) && time.isAfter(LocalDateTime.now(timeZoneOffset).toLocalTime())) : convertedDateTime.equals(time); } - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch DLAB-1922 created (now 7026fd3)
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a change to branch DLAB-1922 in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git. at 7026fd3 [DLAB-1922] Fixed bug with reminder about notebook stopping continues to show up after scheduler triggering This branch includes the following new commits: new 7026fd3 [DLAB-1922] Fixed bug with reminder about notebook stopping continues to show up after scheduler triggering The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] 01/01: [DLAB-1922] Fixed bug with reminder about notebook stopping continues to show up after scheduler triggering
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch DLAB-1922 in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git commit 7026fd3a74582ced64f92dd199c002384c580ccd Author: Oleh Fuks AuthorDate: Wed Sep 16 17:11:02 2020 +0300 [DLAB-1922] Fixed bug with reminder about notebook stopping continues to show up after scheduler triggering --- .../dlab/backendapi/service/impl/SchedulerJobServiceImpl.java | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git 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 index 4b64e0b..a929698 100644 --- 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 @@ -469,15 +469,16 @@ public class SchedulerJobServiceImpl implements SchedulerJobService { } private boolean shouldSchedulerBeExecuted(SchedulerJobDTO dto, OffsetDateTime dateTime, List daysRepeat, - LocalTime time, boolean usingOffset) { - LocalDateTime convertedDateTime = localDateTimeAtZone(dateTime, dto.getTimeZoneOffset()); + LocalTime time, boolean usingOffset) { + ZoneOffset timeZoneOffset = dto.getTimeZoneOffset(); + LocalDateTime convertedDateTime = localDateTimeAtZone(dateTime, timeZoneOffset); return isSchedulerActive(dto, convertedDateTime) && daysRepeat.contains(convertedDateTime.toLocalDate().getDayOfWeek()) - && timeFilter(time, convertedDateTime.toLocalTime(), usingOffset); + && timeFilter(time, convertedDateTime.toLocalTime(), timeZoneOffset, usingOffset); } - private boolean timeFilter(LocalTime time, LocalTime convertedDateTime, boolean usingOffset) { - return usingOffset ? (time.isBefore(convertedDateTime) && time.isAfter(LocalDateTime.now().toLocalTime())) : + private boolean timeFilter(LocalTime time, LocalTime convertedDateTime, ZoneOffset timeZoneOffset, boolean usingOffset) { + return usingOffset ? (time.isBefore(convertedDateTime) && time.isAfter(LocalDateTime.now(timeZoneOffset).toLocalTime())) : convertedDateTime.equals(time); } - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
svn commit: r41477 - in /dev/incubator/dlab/2.4: apache-dlab-2.4.0-incubating.tar.gz apache-dlab-2.4.0-incubating.tar.gz.asc apache-dlab-2.4.0-incubating.tar.gz.sha512
Author: ofuks Date: Wed Sep 16 11:12:43 2020 New Revision: 41477 Log: DLab 2.4.0 release Added: dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz (with props) dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.asc dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.sha512 Added: dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz == Binary file - no diff available. Propchange: dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz -- svn:mime-type = application/octet-stream Added: dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.asc == --- dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.asc (added) +++ dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.asc Wed Sep 16 11:12:43 2020 @@ -0,0 +1,16 @@ +-BEGIN PGP SIGNATURE- + +iQIzBAABCAAdFiEErZFJiVV29w/QhFgmOeCfJZBfoakFAl9h8tQACgkQOeCfJZBf +oam8iRAAllXcBFPTBHRGA1Cmzwf0s2vV630i8yMWg8LpGD/u9ETgmWozlYhcMcGq +4F2KiVgf+qRgwlsldmhFYNNRSWBN5xDhwoa/dCm74PJqdgJx0JmniT/6E+YW4jxm +nJwD14oR2n03FNrVVOGJnH0Z9eQTIdJXj40ipCJ/1mBwPoQCQKIm3N5wjzf9f1zm +FvldRqjtzkhCcrwcisDSZk3asH06N4nWpAO/yJIaEH9Av615B/A9OT36YU1YgaoI +k/oiy/AUPK9V1KoZhNncXmpB0mgEa9cbcH0YkHslDZqdpNzR4L3ARgd6pbiFzJ94 +Hru2UIPbA1nuC9y8h6STzyJABl6UR2uUKVXJ2pOxcHvknwVsWRF29WdQdodgxnAN +/qgSVJaXntS5f+Xr6E/Cagej1ynnKPf3qVDWN/MpAU6HpmHNhHJ3ktd+rgMGQehB +ytHb/iWMphpy3qgiLOPxiRe5SuRY1zp0Vw14N1DkMj0+BsmKgCDYUlzkvgRJyz3u +RTPlsxeHheymAowJNrYDl5atcOqyKugrHEft56wlcEvFYgUc5O6xCEosq6SgI02m +mBxDie1k+Llj0WovjzM54xnRm/Z/eDKZqbM1twWbaVA74MCAKj6ARwE80RQiMi6M +aj8ctYHkyiznJW6zIkcAN2zU829t04qJK0DoZgWaTUsV6bFywlc= +=PAML +-END PGP SIGNATURE- Added: dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.sha512 == --- dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.sha512 (added) +++ dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.sha512 Wed Sep 16 11:12:43 2020 @@ -0,0 +1,3 @@ +/Users/ofuks/work/release/apache-dlab-2.4.0-incubating.tar.gz: +426ACACE A238DAED AAAF2730 6D0F218D 932A4763 9D29702B F799BF63 41F6D3EA 951F883A + 9404C903 F8EC38F0 A7E32608 A05B85D4 12A223A0 07BA3ED9 633A3E00 - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
svn commit: r41476 - in /dev/incubator/dlab/2.4: apache-dlab-2.4.0-incubating.tar.gz apache-dlab-2.4.0-incubating.tar.gz.asc apache-dlab-2.4.0-incubating.tar.gz.sha512
Author: ofuks Date: Wed Sep 16 11:10:01 2020 New Revision: 41476 Log: Deleted 2.4 artifacts Removed: dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.asc dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.sha512 - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] annotated tag 2.4.0 updated (7332a1c -> c7008e4)
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a change to annotated tag 2.4.0 in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git. *** WARNING: tag 2.4.0 was modified! *** from 7332a1c (commit) to c7008e4 (tag) tagging 7332a1c887be9d1a3388f9dc3e171a444e2515d8 (commit) by Oleh Fuks on Wed Sep 16 14:06:18 2020 +0300 - Log - DLab 2.4.0 release --- No new revisions were added by this update. Summary of changes: - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch v2.4.0 updated: Updated license
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch v2.4.0 in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/v2.4.0 by this push: new 7332a1c Updated license 7332a1c is described below commit 7332a1c887be9d1a3388f9dc3e171a444e2515d8 Author: Oleh Fuks AuthorDate: Wed Sep 16 14:04:39 2020 +0300 Updated license --- .../src/project/templates/nftables.conf | 20 1 file changed, 20 insertions(+) diff --git a/infrastructure-provisioning/src/project/templates/nftables.conf b/infrastructure-provisioning/src/project/templates/nftables.conf index f5d4404..3304b90 100644 --- a/infrastructure-provisioning/src/project/templates/nftables.conf +++ b/infrastructure-provisioning/src/project/templates/nftables.conf @@ -1,5 +1,25 @@ #!/usr/sbin/nft -f +# * +# +# 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. +# +# ** flush ruleset table inet filter { - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
svn commit: r41475 - in /dev/incubator/dlab/2.4: ./ apache-dlab-2.4.0-incubating.tar.gz apache-dlab-2.4.0-incubating.tar.gz.asc apache-dlab-2.4.0-incubating.tar.gz.sha512
Author: ofuks Date: Wed Sep 16 09:13:54 2020 New Revision: 41475 Log: DLab 2.4.0 release Added: dev/incubator/dlab/2.4/ dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz (with props) dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.asc dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.sha512 Added: dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz == Binary file - no diff available. Propchange: dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz -- svn:mime-type = application/octet-stream Added: dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.asc == --- dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.asc (added) +++ dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.asc Wed Sep 16 09:13:54 2020 @@ -0,0 +1,16 @@ +-BEGIN PGP SIGNATURE- + +iQIzBAABCAAdFiEErZFJiVV29w/QhFgmOeCfJZBfoakFAl9h1ZMACgkQOeCfJZBf +oan5eQ//TD+tuo5ULvnv6OY4WyVtXddE5S6M2XyOQAQ5JFFPXcj9xrIcjPnLSmM/ +8X5EZytuRMm2sMQ+20C5YD/Pxfr5Po8/C8RSoRzGB+5L27s4dnkJ+E42G4p6JJp+ +ERDYPkwAKTJE1brRQGk7zVSLyepEjZPvgN5PvUMHvKJx5TkECGtItPrGZIwG6NPE +uA9fKvzk8wQIBrEcEYSY+zM+btItWzFVFrx2uLw/85GDcBYP4Rxl69S0vIDojfwl +/3kdNO+fXSLnxojOEJ7snIkfSVI4WBS/8sv5YEFRqbyTLYh1F7wS1utk9bGBEK0H +vPpFYT3txiHYXjOxG19I/RDvjnPu2+crbh6e1uDdb+T2Y+mrHLv8LJIsANSz847F +E9aizksBD2sG4LYOrM745JE3PzXEtEirv5N3QzdN7lrKZ64HQgyL5Iyi/NclX221 +wj+VO/Ao0rKK+T+ozE+js48dOeeKIXv6L/4UXCEu7nnRgpA5Mgmc/D4aTm0T0Lc3 +GwWBjmZpB/P0h50aA5gCqIAH7VZ4UB+KlfdcUvWpPd64vpIKDbg9x1wvjVuAGr/e +PzhETnbD3UNS9GLIh4zfOJWqUS+M7UsJjW/C9kRC7OSBg+/yTThVVow+4j6jMiNO +qAjpbV9KF876H4DLI5j5z85PYrjgzN4iNfLaSsg58HusFRkFn/M= +=gOL5 +-END PGP SIGNATURE- Added: dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.sha512 == --- dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.sha512 (added) +++ dev/incubator/dlab/2.4/apache-dlab-2.4.0-incubating.tar.gz.sha512 Wed Sep 16 09:13:54 2020 @@ -0,0 +1,3 @@ +/Users/ofuks/work/release/apache-dlab-2.4.0-incubating.tar.gz: +80322CC2 CE63EA01 B2DC59F5 E3D25BCA AABC6F67 5CEA609B 6DE1D7E4 6E686707 BC689412 + 26782C91 71CC3CD4 A1058F93 103F48B7 E41BBBAB B4C5CC35 8748749F - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] annotated tag 2.4.0 updated (176ed39 -> 7cff73d)
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a change to annotated tag 2.4.0 in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git. *** WARNING: tag 2.4.0 was modified! *** from 176ed39 (commit) to 7cff73d (tag) tagging 176ed399263276f24532ee269020cae33607e95a (commit) by Oleh Fuks on Wed Sep 16 12:03:17 2020 +0300 - Log - DLab 2.4.0 release --- No new revisions were added by this update. Summary of changes: - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] annotated tag 2.4.0 updated (c595c09 -> 4ff7684)
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a change to annotated tag 2.4.0 in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git. *** WARNING: tag 2.4.0 was modified! *** from c595c09 (commit) to 4ff7684 (tag) tagging c595c09eb4a307b1d28e8fa8dd387f6ad80db136 (commit) by Oleh Fuks on Wed Sep 16 11:21:42 2020 +0300 - Log - DLab 2.4.0 release --- No new revisions were added by this update. Summary of changes: - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: Created test for TagServiceImpl
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 04b14a0 Created test for TagServiceImpl 04b14a0 is described below commit 04b14a0746d99812391ef833c11f8bfdbc245db8 Author: Oleh Fuks AuthorDate: Tue Sep 15 13:21:43 2020 +0300 Created test for TagServiceImpl --- .../dlab/backendapi/service/TagServiceImpl.java| 3 +- .../backendapi/service/TagServiceImplTest.java | 70 ++ 2 files changed, 71 insertions(+), 2 deletions(-) diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/TagServiceImpl.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/TagServiceImpl.java index 3b281fd..5238a2f 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/TagServiceImpl.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/TagServiceImpl.java @@ -30,8 +30,7 @@ import java.util.Optional; public class TagServiceImpl implements TagService { @Override - public Map getResourceTags(UserInfo userInfo, String endpoint, String project, - String customTag) { + public Map getResourceTags(UserInfo userInfo, String endpoint, String project, String customTag) { Map tags = new HashMap<>(); tags.put("user_tag", userInfo.getName()); tags.put("endpoint_tag", endpoint); diff --git a/services/self-service/src/test/java/com/epam/dlab/backendapi/service/TagServiceImplTest.java b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/TagServiceImplTest.java new file mode 100644 index 000..ea6739c --- /dev/null +++ b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/TagServiceImplTest.java @@ -0,0 +1,70 @@ +/* + * 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.service; + +import com.epam.dlab.backendapi.resources.TestBase; +import org.junit.Test; + +import java.util.HashMap; +import java.util.Map; + +import static org.junit.Assert.assertEquals; + +public class TagServiceImplTest extends TestBase { + + private static final String PROJECT = "project"; + private static final String ENDPOINT = "endpoint"; + private static final String CUSTOM_TAG = "customTag"; + + TagService tagService = new TagServiceImpl(); + + @Test + public void getResourceTags() { + Map actualResourceTags = tagService.getResourceTags(getUserInfo(), ENDPOINT, PROJECT, CUSTOM_TAG); + + assertEquals("maps of tags are not equals", getExpectedResourceTags(), actualResourceTags); + } + + @Test + public void getResourceTagsWithNullCustomTag() { + Map actualResourceTags = tagService.getResourceTags(getUserInfo(), ENDPOINT, PROJECT, null); + + assertEquals("maps of tags are not equals", getExpectedResourceTagsWithNullCustomTag(), actualResourceTags); + } + + private Map getExpectedResourceTags() { + Map resourceTags = new HashMap<>(); + resourceTags.put("user_tag", USER.toLowerCase()); + resourceTags.put("endpoint_tag", ENDPOINT); + resourceTags.put("project_tag", PROJECT); + resourceTags.put("custom_tag", CUSTOM_TAG); + + return resourceTags; + } + + private Map getExpectedResourceTagsWithNullCustomTag() { + Map resourceTags = new HashMap<>(); + resourceTags.put("user_tag", USER.toLowerCase()); + resourceTags.put("endpoint_tag", ENDPOINT); + resourceTags.put("project_tag", PROJECT); + + return resourceTags; + } +} \ No newline at end of file - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch v2.4.0 updated: Fixed the broken link for opening new issue in the CONTRIBUTING.md
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch v2.4.0 in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/v2.4.0 by this push: new 2e03892 Fixed the broken link for opening new issue in the CONTRIBUTING.md 2e03892 is described below commit 2e03892dc834c73483243a4fdea6738159f740c1 Author: Oleh Fuks AuthorDate: Tue Sep 15 11:30:58 2020 +0300 Fixed the broken link for opening new issue in the CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 06d3258..0c72bbe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,7 +21,7 @@ If you are not familiar with the [Github Pages](pages.github.io) - check it out, it's pretty simple yet powerful! * __giving feedback__ : Tell us how you use DLab, what was great and what was not so much. Also, what are you expecting from it and what would you like to see in -the future? Opening [an issue](https://github.com/epam/DLab/issues) will grab our +the future? Opening [an issue](https://github.com/apache/incubator-dlab/issues) will grab our attention. Seriously, this is the great way to contribute! Roles - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: Fixed the broken link for opening new issue in the CONTRIBUTING.md
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 2fd150d Fixed the broken link for opening new issue in the CONTRIBUTING.md 2fd150d is described below commit 2fd150d089e9fa1c31d0dd370d2f535d53514dbe Author: Oleh Fuks AuthorDate: Tue Sep 15 11:30:58 2020 +0300 Fixed the broken link for opening new issue in the CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 06d3258..0c72bbe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,7 +21,7 @@ If you are not familiar with the [Github Pages](pages.github.io) - check it out, it's pretty simple yet powerful! * __giving feedback__ : Tell us how you use DLab, what was great and what was not so much. Also, what are you expecting from it and what would you like to see in -the future? Opening [an issue](https://github.com/epam/DLab/issues) will grab our +the future? Opening [an issue](https://github.com/apache/incubator-dlab/issues) will grab our attention. Seriously, this is the great way to contribute! Roles - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: Sonar code smell changes
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 626b9c7 Sonar code smell changes 626b9c7 is described below commit 626b9c7b5176b009d260b5fdad218dcfb7f650b3 Author: Oleh Fuks AuthorDate: Fri Sep 11 15:22:04 2020 +0300 Sonar code smell changes --- .../java/com/epam/dlab/backendapi/dao/BaseDAO.java | 49 + .../com/epam/dlab/backendapi/dao/IndexCreator.java | 1 - .../backendapi/resources/EndpointResource.java | 69 + .../dlab/backendapi/resources/ProjectResource.java | 115 + 4 files changed, 98 insertions(+), 136 deletions(-) diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/BaseDAO.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/BaseDAO.java index 96532a5..253fc7b 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/BaseDAO.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/BaseDAO.java @@ -66,27 +66,27 @@ import static com.mongodb.client.model.Filters.ne; * Implements the base API for Mongo database. */ public class BaseDAO { - private static final Logger LOGGER = LoggerFactory.getLogger(BaseDAO.class); - - private static final ObjectMapper MAPPER = new ObjectMapper() - .configure(JsonParser.Feature.AUTO_CLOSE_SOURCE, true) - .configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false) - .registerModule(new IsoDateModule()) - .registerModule(new JavaPrimitiveModule()) - .registerModule(new MongoModule()); - static final String FIELD_SET_DELIMETER = ".$."; public static final String ID = "_id"; - static final String SET = "$set"; public static final String USER = "user"; - protected static final String INSTANCE_ID = "instance_id"; - protected static final String EDGE_STATUS = "edge_status"; public static final String STATUS = "status"; public static final String ERROR_MESSAGE = "error_message"; - static final String TIMESTAMP = "timestamp"; - static final String REUPLOAD_KEY_REQUIRED = "reupload_key_required"; + protected static final String INSTANCE_ID = "instance_id"; + protected static final String EDGE_STATUS = "edge_status"; protected static final String ADD_TO_SET = "$addToSet"; protected static final String UNSET_OPERATOR = "$unset"; + static final String FIELD_SET_DELIMETER = ".$."; + static final String SET = "$set"; + static final String TIMESTAMP = "timestamp"; + static final String REUPLOAD_KEY_REQUIRED = "reupload_key_required"; + private static final Logger LOGGER = LoggerFactory.getLogger(BaseDAO.class); + private static final String INSERT_ERROR_MESSAGE = "Insert to Mongo DB fails: "; + private static final ObjectMapper MAPPER = new ObjectMapper() + .configure(JsonParser.Feature.AUTO_CLOSE_SOURCE, true) + .configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false) + .registerModule(new IsoDateModule()) + .registerModule(new JavaPrimitiveModule()) + .registerModule(new MongoModule()); private static final String PULL = "$pull"; private static final String PULL_ALL = "$pullAll"; private static final String EACH = "$each"; @@ -137,7 +137,7 @@ public class BaseDAO { .append(ID, uuid) .append(TIMESTAMP, new Date())); } catch (MongoException e) { - LOGGER.warn("Insert to Mongo DB fails: {}", e.getLocalizedMessage(), e); + LOGGER.warn(INSERT_ERROR_MESSAGE + "{}", e.getLocalizedMessage(), e); throw new DlabException("Insert to Mongo DB failed: " + e.getLocalizedMessage(), e); } } @@ -166,8 +166,8 @@ public class BaseDAO { .append(ID, uuid) .append(TIMESTAMP, new Date())); } catch (MongoException e) { - LOGGER.warn("Insert to Mongo DB fails: {}", e.getLocalizedMessage(), e); - throw new DlabException("Insert to Mongo DB fails: " + e.getLocalizedMessage(),
[incubator-dlab] branch develop updated: Sonar code smell changes
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new a4d4b23 Sonar code smell changes a4d4b23 is described below commit a4d4b237c13a96d9959a02b247cb0d4036e63ef3 Author: Oleh Fuks AuthorDate: Thu Sep 10 15:15:20 2020 +0300 Sonar code smell changes --- .../azure/config/LoggingConfigurationFactory.java | 2 +- .../dlab/billing/azure/logging/AppenderFile.java | 22 +++--- .../backendapi/core/commands/DockerCommands.java | 63 --- .../response/folderlistener/FolderListener.java| 66 +++- .../backendapi/modules/GcpProvisioningModule.java | 1 - .../service/RestoreCallbackHandlerService.java | 1 + .../com/epam/dlab/process/ProcessConveyor.java | 53 ++--- .../dlab/process/builder/ProcessInfoBuilder.java | 76 +- .../com/epam/dlab/process/model/DlabProcess.java | 91 -- .../com/epam/dlab/process/model/ProcessId.java | 16 ++-- 10 files changed, 199 insertions(+), 192 deletions(-) diff --git a/services/billing-azure/src/main/java/com/epam/dlab/billing/azure/config/LoggingConfigurationFactory.java b/services/billing-azure/src/main/java/com/epam/dlab/billing/azure/config/LoggingConfigurationFactory.java index 2bd185e..0c34a0d 100644 --- a/services/billing-azure/src/main/java/com/epam/dlab/billing/azure/config/LoggingConfigurationFactory.java +++ b/services/billing-azure/src/main/java/com/epam/dlab/billing/azure/config/LoggingConfigurationFactory.java @@ -83,7 +83,7 @@ public class LoggingConfigurationFactory { */ @JsonProperty public void setLoggers(ImmutableMap loggers) throws InitializationException { - ImmutableMap.Builder levels = new ImmutableMap.Builder(); + ImmutableMap.Builder levels = new ImmutableMap.Builder<>(); for (String key : loggers.keySet()) { JsonNode node = loggers.get(key); levels.put(key, toLevel(node.asText())); diff --git a/services/billing-azure/src/main/java/com/epam/dlab/billing/azure/logging/AppenderFile.java b/services/billing-azure/src/main/java/com/epam/dlab/billing/azure/logging/AppenderFile.java index 34a11b3..28c14f8 100644 --- a/services/billing-azure/src/main/java/com/epam/dlab/billing/azure/logging/AppenderFile.java +++ b/services/billing-azure/src/main/java/com/epam/dlab/billing/azure/logging/AppenderFile.java @@ -129,7 +129,7 @@ public class AppenderFile extends AppenderBase { /** Create and return synchronous the file appender. */ private FileAppender getFileAppender() { - FileAppender appender = new FileAppender(); + FileAppender appender = new FileAppender<>(); appender.setFile(currentLogFilename); appender.setAppend(true); return appender; @@ -142,17 +142,17 @@ public class AppenderFile extends AppenderBase { if (archivedLogFilenamePattern == null || archivedLogFilenamePattern.trim().isEmpty()) { throw new InitializationException("Configuration property logging.appenders.archivedLogFilenamePattern cannot be null."); } - RollingFileAppender appender = new RollingFileAppender(); -appender.setFile(currentLogFilename); -appender.setAppend(true); + RollingFileAppender appender = new RollingFileAppender<>(); + appender.setFile(currentLogFilename); + appender.setAppend(true); -TimeBasedFileNamingAndTriggeringPolicy triggerPolicy = new DefaultTimeBasedFileNamingAndTriggeringPolicy(); -triggerPolicy.setContext(context); - -TimeBasedRollingPolicy rollPolicy = new TimeBasedRollingPolicy(); -rollPolicy.setContext(context); -rollPolicy.setParent(appender); -rollPolicy.setFileNamePattern(archivedLogFilenamePattern); + TimeBasedFileNamingAndTriggeringPolicy triggerPolicy = new DefaultTimeBasedFileNamingAndTriggeringPolicy<>(); + triggerPolicy.setContext(context); + + TimeBasedRollingPolicy rollPolicy = new TimeBasedRollingPolicy<>(); + rollPolicy.setContext(context); + rollPolicy.setParent(appender); + rollPolicy.setFileNamePattern(archivedLogFilenamePattern); rollPolicy.setMaxHistory(archivedFileCount); rollPolicy.setTimeBasedFileNamingAndTriggeringPolicy(triggerPolicy); rollPolicy.start(); diff --git a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/commands/DockerCommands.java b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/commands/DockerCommands.java index
[incubator-dlab] branch develop updated: [DLAB-2024] Fixed bug with AWS billing
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new bf1a5db [DLAB-2024] Fixed bug with AWS billing bf1a5db is described below commit bf1a5db0676c9579b764590953e1c7c6b5ebc215 Author: Oleh Fuks AuthorDate: Thu Sep 10 14:08:16 2020 +0300 [DLAB-2024] Fixed bug with AWS billing --- .../java/com/epam/dlab/BillingServiceImpl.java | 1 - .../main/java/com/epam/dlab/core/ModuleData.java | 3 +- .../com/epam/dlab/core/parser/ParserByLine.java| 100 + .../java/com/epam/dlab/module/AdapterConsole.java | 4 +- .../com/epam/dlab/module/aws/AdapterS3File.java| 2 - .../java/com/epam/dlab/module/aws/FilterAWS.java | 8 +- .../java/com/epam/dlab/mongo/AdapterMongoDb.java | 3 +- 7 files changed, 49 insertions(+), 72 deletions(-) diff --git a/services/billing-aws/src/main/java/com/epam/dlab/BillingServiceImpl.java b/services/billing-aws/src/main/java/com/epam/dlab/BillingServiceImpl.java index 8ac6c48..393a1be 100644 --- a/services/billing-aws/src/main/java/com/epam/dlab/BillingServiceImpl.java +++ b/services/billing-aws/src/main/java/com/epam/dlab/BillingServiceImpl.java @@ -54,7 +54,6 @@ public class BillingServiceImpl implements BillingService { try { ParserBase parser = configuration.build(); - LOGGER.info("Try to load billing report for configuration: {}", configuration); List billingData = parser.parse() .stream() .map(this::toBillingData) diff --git a/services/billing-aws/src/main/java/com/epam/dlab/core/ModuleData.java b/services/billing-aws/src/main/java/com/epam/dlab/core/ModuleData.java index cc60bd3..256ab1b 100644 --- a/services/billing-aws/src/main/java/com/epam/dlab/core/ModuleData.java +++ b/services/billing-aws/src/main/java/com/epam/dlab/core/ModuleData.java @@ -143,8 +143,7 @@ public class ModuleData { } public void store() { - final Document document = new Document().append(ID_FIELD, id).append(MODIFICATION_DATE, - modificationDate).append(ENTRIES_FIELD, entries); + final Document document = new Document().append(ID_FIELD, id).append(MODIFICATION_DATE, modificationDate).append(ENTRIES_FIELD, entries); connection.getCollection(MongoConstants.BILLING_DATA_COLLECTION) .updateOne(eq(ID_FIELD, id), new Document("$set", document), new UpdateOptions().upsert(true)); modified = false; diff --git a/services/billing-aws/src/main/java/com/epam/dlab/core/parser/ParserByLine.java b/services/billing-aws/src/main/java/com/epam/dlab/core/parser/ParserByLine.java index 6ebac03..0fbdc5f 100644 --- a/services/billing-aws/src/main/java/com/epam/dlab/core/parser/ParserByLine.java +++ b/services/billing-aws/src/main/java/com/epam/dlab/core/parser/ParserByLine.java @@ -171,76 +171,60 @@ public abstract class ParserByLine extends ParserBase { String line; List row; ReportLine reportLine; - do { - while ((line = getNextRow()) != null) { - if (getFilter() != null && (line = getFilter().canParse(line)) == null) { - getCurrentStatistics().incrRowFiltered(); - continue; - } + LOGGER.info("Parsing {}", getAdapterIn().getEntryName()); - row = parseRow(line); - if ((getFilter() != null && (row = getFilter().canTransform(row)) == null)) { - getCurrentStatistics().incrRowFiltered(); - continue; - } - try { - if (getCondition() != null && !getCondition().evaluate(row)) { - getCurrentStatistics().incrRowFiltered(); - continue; - } - } catch (ParseException e) { - throw new ParseException(e.get
[incubator-dlab] branch develop updated: [DLAB-2024] Fixed bug with AWS billing
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new bf1a5db [DLAB-2024] Fixed bug with AWS billing bf1a5db is described below commit bf1a5db0676c9579b764590953e1c7c6b5ebc215 Author: Oleh Fuks AuthorDate: Thu Sep 10 14:08:16 2020 +0300 [DLAB-2024] Fixed bug with AWS billing --- .../java/com/epam/dlab/BillingServiceImpl.java | 1 - .../main/java/com/epam/dlab/core/ModuleData.java | 3 +- .../com/epam/dlab/core/parser/ParserByLine.java| 100 + .../java/com/epam/dlab/module/AdapterConsole.java | 4 +- .../com/epam/dlab/module/aws/AdapterS3File.java| 2 - .../java/com/epam/dlab/module/aws/FilterAWS.java | 8 +- .../java/com/epam/dlab/mongo/AdapterMongoDb.java | 3 +- 7 files changed, 49 insertions(+), 72 deletions(-) diff --git a/services/billing-aws/src/main/java/com/epam/dlab/BillingServiceImpl.java b/services/billing-aws/src/main/java/com/epam/dlab/BillingServiceImpl.java index 8ac6c48..393a1be 100644 --- a/services/billing-aws/src/main/java/com/epam/dlab/BillingServiceImpl.java +++ b/services/billing-aws/src/main/java/com/epam/dlab/BillingServiceImpl.java @@ -54,7 +54,6 @@ public class BillingServiceImpl implements BillingService { try { ParserBase parser = configuration.build(); - LOGGER.info("Try to load billing report for configuration: {}", configuration); List billingData = parser.parse() .stream() .map(this::toBillingData) diff --git a/services/billing-aws/src/main/java/com/epam/dlab/core/ModuleData.java b/services/billing-aws/src/main/java/com/epam/dlab/core/ModuleData.java index cc60bd3..256ab1b 100644 --- a/services/billing-aws/src/main/java/com/epam/dlab/core/ModuleData.java +++ b/services/billing-aws/src/main/java/com/epam/dlab/core/ModuleData.java @@ -143,8 +143,7 @@ public class ModuleData { } public void store() { - final Document document = new Document().append(ID_FIELD, id).append(MODIFICATION_DATE, - modificationDate).append(ENTRIES_FIELD, entries); + final Document document = new Document().append(ID_FIELD, id).append(MODIFICATION_DATE, modificationDate).append(ENTRIES_FIELD, entries); connection.getCollection(MongoConstants.BILLING_DATA_COLLECTION) .updateOne(eq(ID_FIELD, id), new Document("$set", document), new UpdateOptions().upsert(true)); modified = false; diff --git a/services/billing-aws/src/main/java/com/epam/dlab/core/parser/ParserByLine.java b/services/billing-aws/src/main/java/com/epam/dlab/core/parser/ParserByLine.java index 6ebac03..0fbdc5f 100644 --- a/services/billing-aws/src/main/java/com/epam/dlab/core/parser/ParserByLine.java +++ b/services/billing-aws/src/main/java/com/epam/dlab/core/parser/ParserByLine.java @@ -171,76 +171,60 @@ public abstract class ParserByLine extends ParserBase { String line; List row; ReportLine reportLine; - do { - while ((line = getNextRow()) != null) { - if (getFilter() != null && (line = getFilter().canParse(line)) == null) { - getCurrentStatistics().incrRowFiltered(); - continue; - } + LOGGER.info("Parsing {}", getAdapterIn().getEntryName()); - row = parseRow(line); - if ((getFilter() != null && (row = getFilter().canTransform(row)) == null)) { - getCurrentStatistics().incrRowFiltered(); - continue; - } - try { - if (getCondition() != null && !getCondition().evaluate(row)) { - getCurrentStatistics().incrRowFiltered(); - continue; - } - } catch (ParseException e) { - throw new ParseException(e.get
[incubator-dlab] branch develop updated: [DLAB-2032] Turn off autocomplete if receiving available lib list fails
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 0106748 [DLAB-2032] Turn off autocomplete if receiving available lib list fails 0106748 is described below commit 010674823568f239d2402ac741ebdbee62c1fcf2 Author: Oleh Fuks AuthorDate: Tue Sep 8 14:58:37 2020 +0300 [DLAB-2032] Turn off autocomplete if receiving available lib list fails --- .../epam/dlab/backendapi/domain/ExploratoryLibCache.java | 12 +++- .../epam/dlab/backendapi/domain/ExploratoryLibList.java | 15 +-- .../backendapi/resources/callback/LibraryCallback.java| 4 ++-- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/ExploratoryLibCache.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/ExploratoryLibCache.java index 3c768ad..a33756f 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/ExploratoryLibCache.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/ExploratoryLibCache.java @@ -137,6 +137,7 @@ public class ExploratoryLibCache implements Managed, Runnable { libs = cache.get(cacheKey); if (libs.isUpdateNeeded() && !libs.isUpdating()) { libs.setUpdating(); + libs.setExpiredTime(); requestLibList(userInfo, userInstance, cacheKey); } } @@ -158,13 +159,14 @@ public class ExploratoryLibCache implements Managed, Runnable { } /** -* Remove the list of libraries for docker image from cache. +* Set updating library list to false * -* @param imageName docker image name +* @param groupName group name */ - public void removeLibList(String imageName) { + public void updateLibListStatus(String groupName) { synchronized (cache) { - cache.remove(imageName); + ExploratoryLibList exploratoryLibList = cache.get(groupName); + exploratoryLibList.setNotUpdating(); } } @@ -178,7 +180,7 @@ public class ExploratoryLibCache implements Managed, Runnable { private void requestLibList(UserInfo userInfo, UserInstanceDTO userInstance, String group) { try { - LOGGER.debug("Ask docker for the list of libraries for user {} and exploratory {} computational {}", + LOGGER.info("Ask docker for the list of libraries for user {} and exploratory {} computational {}", userInfo.getName(), userInstance.getExploratoryId(), userInstance.getResources()); diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/ExploratoryLibList.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/ExploratoryLibList.java index b5a8d95..f264c78 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/ExploratoryLibList.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/ExploratoryLibList.java @@ -145,8 +145,7 @@ public class ExploratoryLibList { log.info("Update {} group with lib group {} with {} libraries", this.group, groupName, (group != null) ? group.size() : null); libs.put(groupName, new TreeMap<>(group)); } - expiredTimeMillis = System.currentTimeMillis() + EXPIRED_TIMEOUT_MILLIS; - accessTimeMillis = System.currentTimeMillis(); + setExpiredTime(); updating = false; } } catch (IOException e) { @@ -154,6 +153,11 @@ public class ExploratoryLibList { } } + public void setExpiredTime() { + expiredTimeMillis = System.currentTimeMillis() + EXPIRED_TIMEOUT_MILLIS; + accessTimeMillis = System.currentTimeMillis(); + } + /** * Search and return the list of libraries for name's prefix startWith. * @@ -214,6 +218,13 @@ public class ExploratoryLibList { } /** +* Set updating to false. +*/ + public void setNotUpdating() { + updating = Boolean.FALSE; + } + + /** * Return true if the update in progress. */ public boolean isUpdating() { diff --git a/services/self-service/src/
[incubator-dlab] branch develop updated: [DLAB-2032] Turn off autocomplete if receiving available lib list fails
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 0106748 [DLAB-2032] Turn off autocomplete if receiving available lib list fails 0106748 is described below commit 010674823568f239d2402ac741ebdbee62c1fcf2 Author: Oleh Fuks AuthorDate: Tue Sep 8 14:58:37 2020 +0300 [DLAB-2032] Turn off autocomplete if receiving available lib list fails --- .../epam/dlab/backendapi/domain/ExploratoryLibCache.java | 12 +++- .../epam/dlab/backendapi/domain/ExploratoryLibList.java | 15 +-- .../backendapi/resources/callback/LibraryCallback.java| 4 ++-- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/ExploratoryLibCache.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/ExploratoryLibCache.java index 3c768ad..a33756f 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/ExploratoryLibCache.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/ExploratoryLibCache.java @@ -137,6 +137,7 @@ public class ExploratoryLibCache implements Managed, Runnable { libs = cache.get(cacheKey); if (libs.isUpdateNeeded() && !libs.isUpdating()) { libs.setUpdating(); + libs.setExpiredTime(); requestLibList(userInfo, userInstance, cacheKey); } } @@ -158,13 +159,14 @@ public class ExploratoryLibCache implements Managed, Runnable { } /** -* Remove the list of libraries for docker image from cache. +* Set updating library list to false * -* @param imageName docker image name +* @param groupName group name */ - public void removeLibList(String imageName) { + public void updateLibListStatus(String groupName) { synchronized (cache) { - cache.remove(imageName); + ExploratoryLibList exploratoryLibList = cache.get(groupName); + exploratoryLibList.setNotUpdating(); } } @@ -178,7 +180,7 @@ public class ExploratoryLibCache implements Managed, Runnable { private void requestLibList(UserInfo userInfo, UserInstanceDTO userInstance, String group) { try { - LOGGER.debug("Ask docker for the list of libraries for user {} and exploratory {} computational {}", + LOGGER.info("Ask docker for the list of libraries for user {} and exploratory {} computational {}", userInfo.getName(), userInstance.getExploratoryId(), userInstance.getResources()); diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/ExploratoryLibList.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/ExploratoryLibList.java index b5a8d95..f264c78 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/ExploratoryLibList.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/ExploratoryLibList.java @@ -145,8 +145,7 @@ public class ExploratoryLibList { log.info("Update {} group with lib group {} with {} libraries", this.group, groupName, (group != null) ? group.size() : null); libs.put(groupName, new TreeMap<>(group)); } - expiredTimeMillis = System.currentTimeMillis() + EXPIRED_TIMEOUT_MILLIS; - accessTimeMillis = System.currentTimeMillis(); + setExpiredTime(); updating = false; } } catch (IOException e) { @@ -154,6 +153,11 @@ public class ExploratoryLibList { } } + public void setExpiredTime() { + expiredTimeMillis = System.currentTimeMillis() + EXPIRED_TIMEOUT_MILLIS; + accessTimeMillis = System.currentTimeMillis(); + } + /** * Search and return the list of libraries for name's prefix startWith. * @@ -214,6 +218,13 @@ public class ExploratoryLibList { } /** +* Set updating to false. +*/ + public void setNotUpdating() { + updating = Boolean.FALSE; + } + + /** * Return true if the update in progress. */ public boolean isUpdating() { diff --git a/services/self-service/src/
[incubator-dlab] branch develop updated: Unit test fix (#894)
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new bbf34a5 Unit test fix (#894) bbf34a5 is described below commit bbf34a5d191fd710ddbd2b94feead852eb6b6be4 Author: Pavel Papou AuthorDate: Mon Sep 7 10:08:04 2020 -0400 Unit test fix (#894) Unit test fix --- .../backendapi/resources/ProjectResourceTest.java | 31 -- 1 file changed, 31 deletions(-) diff --git a/services/self-service/src/test/java/com/epam/dlab/backendapi/resources/ProjectResourceTest.java b/services/self-service/src/test/java/com/epam/dlab/backendapi/resources/ProjectResourceTest.java index 67475d6..43551ca 100644 --- a/services/self-service/src/test/java/com/epam/dlab/backendapi/resources/ProjectResourceTest.java +++ b/services/self-service/src/test/java/com/epam/dlab/backendapi/resources/ProjectResourceTest.java @@ -131,7 +131,6 @@ public class ProjectResourceTest extends TestBase { verifyNoMoreInteractions(projectService); } - @Test public void getProject() { when(projectService.get(anyString())).thenReturn(ProjectDTO.builder().name(PROJECT_NAME).build()); @@ -227,36 +226,6 @@ public class ProjectResourceTest extends TestBase { } @Test -public void getProject() { - when(projectService.get(anyString())).thenReturn(ProjectDTO.builder().name(PROJECT_NAME).build()); - -final Response response = resources.getJerseyTest() -.target("project/" + PROJECT_NAME) -.request() -.header("Authorization", "Bearer " + TOKEN) -.get(); - -assertEquals(HttpStatus.SC_OK, response.getStatus()); -verify(projectService).get(PROJECT_NAME); -verifyNoMoreInteractions(projectService); -} - -@Test -public void getProjects() { - when(projectService.getProjects(any(UserInfo.class))).thenReturn(Collections.singletonList(ProjectDTO.builder().name(PROJECT_NAME).build())); - -final Response response = resources.getJerseyTest() -.target("project") -.request() -.header("Authorization", "Bearer " + TOKEN) -.get(); - -assertEquals(HttpStatus.SC_OK, response.getStatus()); -verify(projectService).getProjects(getUserInfo()); -verifyNoMoreInteractions(projectService); -} - -@Test public void generate() { when(keyService.generateKeys(any(UserInfo.class))).thenReturn(new KeysDTO("somePublicKey", "somePrivateKey", "user")); - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: [DLAB ] Project resource UT (#893)
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 68c7bbb [DLAB ] Project resource UT (#893) 68c7bbb is described below commit 68c7bbb6aec2ae42255a611a5a65ceb3351a82a1 Author: Pavel Papou AuthorDate: Mon Sep 7 09:44:15 2020 -0400 [DLAB ] Project resource UT (#893) [DLAB ] Project resource UT --- .../backendapi/resources/ProjectResourceTest.java | 131 +++-- 1 file changed, 120 insertions(+), 11 deletions(-) diff --git a/services/self-service/src/test/java/com/epam/dlab/backendapi/resources/ProjectResourceTest.java b/services/self-service/src/test/java/com/epam/dlab/backendapi/resources/ProjectResourceTest.java index d581fa5..67475d6 100644 --- a/services/self-service/src/test/java/com/epam/dlab/backendapi/resources/ProjectResourceTest.java +++ b/services/self-service/src/test/java/com/epam/dlab/backendapi/resources/ProjectResourceTest.java @@ -24,6 +24,8 @@ import com.epam.dlab.backendapi.domain.BudgetDTO; import com.epam.dlab.backendapi.domain.CreateProjectDTO; import com.epam.dlab.backendapi.domain.ProjectDTO; import com.epam.dlab.backendapi.domain.ProjectEndpointDTO; +import com.epam.dlab.backendapi.domain.UpdateProjectDTO; +import com.epam.dlab.backendapi.domain.UpdateProjectBudgetDTO; import com.epam.dlab.backendapi.resources.dto.KeysDTO; import com.epam.dlab.backendapi.resources.dto.ProjectActionFormDTO; import com.epam.dlab.backendapi.service.AccessKeyService; @@ -55,6 +57,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; +import static org.mockito.Mockito.doNothing; public class ProjectResourceTest extends TestBase { @@ -82,7 +85,7 @@ public class ProjectResourceTest extends TestBase { .post(Entity.json(createProjectDTO)); assertEquals(HttpStatus.SC_OK, response.getStatus()); -verify(projectService).create(getUserInfo(), returnProjectDTO(createProjectDTO), createProjectDTO.getName()); +verify(projectService).create(getUserInfo(), prepareProjectDTO(createProjectDTO), createProjectDTO.getName()); verifyNoMoreInteractions(projectService); } @@ -98,33 +101,128 @@ public class ProjectResourceTest extends TestBase { .post(Entity.json(createProjectDTO)); assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, response.getStatus()); -verify(projectService).create(getUserInfo(), returnProjectDTO(createProjectDTO), createProjectDTO.getName()); +verify(projectService).create(getUserInfo(), prepareProjectDTO(createProjectDTO), createProjectDTO.getName()); verifyNoMoreInteractions(projectService); } @Test -public void stopProject() { +public void startProject() { final Response response = resources.getJerseyTest() -.target("project/stop") +.target("project/start") .request() .header("Authorization", "Bearer " + TOKEN) .post(Entity.json(getProjectActionDTO())); assertEquals(HttpStatus.SC_ACCEPTED, response.getStatus()); -verify(projectService).stopWithResources(any(UserInfo.class), anyList(), anyString()); +verify(projectService).start(getUserInfo(), Collections.singletonList("https://localhost:8083/;), PROJECT_NAME); verifyNoMoreInteractions(projectService); } @Test -public void startProject() { +public void stopProject() { final Response response = resources.getJerseyTest() -.target("project/start") +.target("project/stop") .request() .header("Authorization", "Bearer " + TOKEN) .post(Entity.json(getProjectActionDTO())); assertEquals(HttpStatus.SC_ACCEPTED, response.getStatus()); -verify(projectService).start(any(UserInfo.class), anyList(), anyString()); +verify(projectService).stopWithResources(getUserInfo(), Collections.singletonList("https://localhost:8083/;), PROJECT_NAME); +verifyNoMoreInteractions(projectService); +} + + +@Test +public void getProject() { + when(projectService.get(anyString())).thenReturn(ProjectDTO.builder().name(PROJECT_NAME).build()); + +final Response response = resources.getJerseyTest() +.target("project/" + PROJECT_NAME) +.request() +.header("Authorization", "Bearer " + TOKEN) +.get(); + +assertEquals(HttpStatus.SC_OK, response.getStatus()); +assertEqua
[incubator-dlab] branch develop updated: [DLAB] Project resource UT (#888)
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 6070425 [DLAB] Project resource UT (#888) 6070425 is described below commit 6070425b2e980395d8f1245326d2fd6984cb81a3 Author: Pavel Papou AuthorDate: Fri Sep 4 09:48:12 2020 -0400 [DLAB] Project resource UT (#888) [DLAB] ProjectResource unit test --- .../backendapi/resources/ProjectResourceTest.java | 30 ++ 1 file changed, 30 insertions(+) diff --git a/services/self-service/src/test/java/com/epam/dlab/backendapi/resources/ProjectResourceTest.java b/services/self-service/src/test/java/com/epam/dlab/backendapi/resources/ProjectResourceTest.java index 43800cb..d581fa5 100644 --- a/services/self-service/src/test/java/com/epam/dlab/backendapi/resources/ProjectResourceTest.java +++ b/services/self-service/src/test/java/com/epam/dlab/backendapi/resources/ProjectResourceTest.java @@ -129,6 +129,36 @@ public class ProjectResourceTest extends TestBase { } @Test +public void getProject() { + when(projectService.get(anyString())).thenReturn(ProjectDTO.builder().name(PROJECT_NAME).build()); + +final Response response = resources.getJerseyTest() +.target("project/" + PROJECT_NAME) +.request() +.header("Authorization", "Bearer " + TOKEN) +.get(); + +assertEquals(HttpStatus.SC_OK, response.getStatus()); +verify(projectService).get(PROJECT_NAME); +verifyNoMoreInteractions(projectService); +} + +@Test +public void getProjects() { + when(projectService.getProjects(any(UserInfo.class))).thenReturn(Collections.singletonList(ProjectDTO.builder().name(PROJECT_NAME).build())); + +final Response response = resources.getJerseyTest() +.target("project") +.request() +.header("Authorization", "Bearer " + TOKEN) +.get(); + +assertEquals(HttpStatus.SC_OK, response.getStatus()); +verify(projectService).getProjects(getUserInfo()); +verifyNoMoreInteractions(projectService); +} + +@Test public void generate() { when(keyService.generateKeys(any(UserInfo.class))).thenReturn(new KeysDTO("somePublicKey", "somePrivateKey", "user")); - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: Created test for EnvironmentServiceImpl
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new e0aa7b3 Created test for EnvironmentServiceImpl e0aa7b3 is described below commit e0aa7b3653fac544f85d89a3d779f696f916a124 Author: Oleh Fuks AuthorDate: Fri Sep 4 13:17:19 2020 +0300 Created test for EnvironmentServiceImpl --- .../service/impl/EnvironmentServiceImpl.java | 25 ++- .../service/impl/EnvironmentServiceImplTest.java | 195 ++--- 2 files changed, 185 insertions(+), 35 deletions(-) diff --git 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 index dff0a0b..2ae828c 100644 --- 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 @@ -35,7 +35,6 @@ import com.epam.dlab.backendapi.service.ExploratoryService; import com.epam.dlab.backendapi.service.ProjectService; import com.epam.dlab.backendapi.service.SecurityService; import com.epam.dlab.dto.UserInstanceDTO; -import com.epam.dlab.dto.UserInstanceStatus; import com.epam.dlab.exceptions.ResourceConflictException; import com.epam.dlab.model.ResourceEnum; import com.google.inject.Inject; @@ -50,6 +49,10 @@ import java.util.stream.Stream; import static com.epam.dlab.backendapi.resources.dto.UserDTO.Status.ACTIVE; import static com.epam.dlab.backendapi.resources.dto.UserDTO.Status.NOT_ACTIVE; +import static com.epam.dlab.dto.UserInstanceStatus.CREATING; +import static com.epam.dlab.dto.UserInstanceStatus.CREATING_IMAGE; +import static com.epam.dlab.dto.UserInstanceStatus.RUNNING; +import static com.epam.dlab.dto.UserInstanceStatus.STARTING; import static com.epam.dlab.rest.contracts.ComputationalAPI.AUDIT_MESSAGE; import static java.util.stream.Collectors.toList; @@ -133,8 +136,8 @@ public class EnvironmentServiceImpl implements EnvironmentService { .forEach(this::stopNotebookWithServiceAccount); projectService.get(project).getEndpoints() -.stream() -.filter(e -> UserInstanceStatus.RUNNING == e.getStatus()) + .stream() + .filter(e -> RUNNING == e.getStatus()) .forEach(endpoint -> projectService.stop(securityService.getServiceAccountInfo(DLAB_SYSTEM_USER), endpoint.getName(), project, AUDIT_QUOTA_MESSAGE)); } @@ -169,12 +172,8 @@ public class EnvironmentServiceImpl implements EnvironmentService { } private void checkState(String user, String action) { - final List userInstances = exploratoryDAO - .fetchUserExploratoriesWhereStatusIn(user, - Arrays.asList(UserInstanceStatus.CREATING, - UserInstanceStatus.STARTING, UserInstanceStatus.CREATING_IMAGE), - UserInstanceStatus.CREATING, - UserInstanceStatus.STARTING, UserInstanceStatus.CREATING_IMAGE); + final List userInstances = exploratoryDAO.fetchUserExploratoriesWhereStatusIn(user, Arrays.asList(CREATING, STARTING, CREATING_IMAGE), + CREATING, STARTING, CREATING_IMAGE); if (!userInstances.isEmpty()) { log.error(String.format(ERROR_MSG_FORMAT, action)); throw new ResourceConflictException(String.format(ERROR_MSG_FORMAT, action)); @@ -221,11 +220,9 @@ public class EnvironmentServiceImpl implements EnvironmentService { } private void checkProjectResourceConditions(String project, String action) { - final List userInstances = exploratoryDAO - .fetchProjectExploratoriesWhereStatusIn(project, - Arrays.asList(UserInstanceStatus.CREATING, UserInstanceStatus.STARTING, - UserInstanceStatus.CREATING_IMAGE), - UserInstanceStatus.CREATING, UserInstanceStatus.STARTING, UserInstanceStatus.CREATING_IMAGE); + final List userInstances = exploratoryDAO.fetchProjectExploratoriesWhereStatusIn(project, + Arrays.asList(CREATING, STARTING, CREATING_IMAGE), CREATING, STARTING, CREATING_IMAGE); + if (!userInstances.isEmpty()) { log.error(Stri
[incubator-dlab] branch develop updated: SecurityServiceImpl
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 37883e3 SecurityServiceImpl 37883e3 is described below commit 37883e3f8b75065b3326e29a12bcb771f69de0b9 Author: Oleh Fuks AuthorDate: Wed Sep 2 13:41:24 2020 +0300 SecurityServiceImpl --- .../service/SecurityServiceImplTest.java | 134 + 1 file changed, 134 insertions(+) diff --git a/services/self-service/src/test/java/com/epam/dlab/backendapi/service/SecurityServiceImplTest.java b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/SecurityServiceImplTest.java new file mode 100644 index 000..85b78db --- /dev/null +++ b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/SecurityServiceImplTest.java @@ -0,0 +1,134 @@ +/* + * 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.service; + +import com.epam.dlab.auth.UserInfo; +import com.epam.dlab.backendapi.dao.SecurityDAO; +import com.epam.dlab.backendapi.domain.AuditActionEnum; +import com.epam.dlab.backendapi.domain.AuditDTO; +import com.epam.dlab.exceptions.DlabException; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.keycloak.representations.AccessTokenResponse; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import java.util.Optional; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Matchers.anyString; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoMoreInteractions; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class SecurityServiceImplTest { + + private static final String CODE = "code"; + private static final String TOKEN = "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJNUC15QVpENFdJRzloanp3R0RqQjdCeW9aNGpaV05QTjJ3X25uS1BkTnQ4In0.eyJqdGkiOiJkN2U0MDk3Yi1hNjdlLTQxYWUtYjBiNC05MzE1YWFmOGZkMDciLCJleHAiOjE1OTkwNDI1ODgsIm5iZiI6MCwiaWF0IjoxNTk5MDM4OTg4LCJpc3MiOiJodHRwOi8vNTIuMTEuNDUuMTE6ODA4MC9hdXRoL3JlYWxtcy9ETEFCX2JobGl2YSIsImF1ZCI6WyJwcm92aXNpb25pbmciLCJhY2NvdW50Il0sInN1YiI6ImRjNzczMThkLWYzN2UtNGNmOS1iMDgwLTU2ZTRjMWUwNDVhNSIsInR5cCI6IkJlYXJlciIsImF6cCI6InNzcyIsImF1dGhfdG [...] + private static final String REFRESH_TOKEN = "refreshToken"; + private static final String USERNAME = "test"; + + @Mock + private KeycloakService keycloakService; + @Mock + private SecurityDAO securityDAO; + @Mock + private AuditService auditService; + + @InjectMocks + private SecurityServiceImpl securityService; + + @Test + public void testGetUserInfo() { + AccessTokenResponse tokenResponse = mock(AccessTokenResponse.class); + when(tokenResponse.getToken()).thenReturn(TOKEN); + when(tokenResponse.getRefreshToken()).thenReturn(REFRESH_TOKEN); + when(keycloakService.getToken(anyString())).thenReturn(tokenResponse); + + UserInfo actualUserInfo = securityService.getUserInfo(CODE); + + assertEquals("UserInfo should be equal", getUserInfoWithRefreshToken(), actualUserInfo); + verify(keycloakService).getToken(CODE); + verify(securityDAO).saveUser(USERNAME, tokenResponse); + verify(auditService).save(getAuditDTO()); + verifyNoMoreInteractions(keycloakService, securityDAO, auditService); + } + + @Test + public void getUserInfoOffline() { + AccessTokenResponse tokenResponseFromDB = mock(AccessTokenResponse.class); + when(tokenResponseFromDB.getRefreshToken()).thenReturn(REFRESH_TOKEN); + when(securityDAO.getTokenResponse(anyString())).thenReturn(Optional.of(tokenResponseFromDB)); + AccessTokenResponse tokenResponse = mock(AccessTokenResponse.class)
[incubator-dlab] branch develop updated: [DLab-2015]: Changed info about available lib list in the user guide (#882)
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new c7dacbe [DLab-2015]: Changed info about available lib list in the user guide (#882) c7dacbe is described below commit c7dacbe39cc140efc13fe563133fb9d287b12e2a Author: viravit AuthorDate: Tue Sep 1 15:00:08 2020 +0300 [DLab-2015]: Changed info about available lib list in the user guide (#882) [DLab-2015]: Changed info about available lib list in the user guide --- USER_GUIDE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/USER_GUIDE.md b/USER_GUIDE.md index 8bff75c..46e5847 100644 --- a/USER_GUIDE.md +++ b/USER_GUIDE.md @@ -197,7 +197,7 @@ After clicking you see the window with 4 fields: ![Install libraries dialog](doc/install_libs_form.png) -You need to wait for a while after resource choosing till list of all available libraries is received. If available libraries list is not gained due to some reasons you are able to proceed to work without autocomplete feature. +You need to wait for a while after resource and group choosing till list of all available libraries is received for a particular group. If available libraries list is not gained due to some reasons you are able to proceed to work without autocomplete feature. ![Libraries list loading](doc/notebook_list_libs.png) - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] 01/01: [DLAB] Project Resource UT (#879)
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git commit b0dc3ee3e204e3955f77761a719cae16994b6812 Merge: 0fb6daa2e 54d76b1 Author: ofuks <54886119+of...@users.noreply.github.com> AuthorDate: Tue Sep 1 14:56:52 2020 +0300 [DLAB] Project Resource UT (#879) Project Resource unit test .../backendapi/resources/ProjectResourceTest.java | 210 + 1 file changed, 132 insertions(+), 78 deletions(-) - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated (0fb6daa2e -> b0dc3ee)
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git. from 0fb6daa2e [DLAB-2015]: Updated image for available group lib list receiving (#881) add eb920df Merging changes add 2182515 Merge branch 'develop' of https://github.com/apache/incubator-dlab into develop add 63e5111 Revert "Merging changes" add 269f8ae Merge branch 'develop' of https://github.com/apache/incubator-dlab into develop add 8aefa3c Merge changes add 0fdd137 WebInt modules merge add 1a3b145 Merge branch 'develop' of https://github.com/apache/incubator-dlab into develop add 62ced66 Bucket-browser merge add 90e47c6 Web components merge add e5bb6f6 Merge branch 'develop' of https://github.com/apache/incubator-dlab into develop add 65079a3 Merge branch 'develop' of https://github.com/apache/incubator-dlab into develop add 2ad3498 Merge branch 'develop' of https://github.com/apache/incubator-dlab into develop add 3fb8a57 Merge branch 'develop' of https://github.com/apache/incubator-dlab into develop add fffa044 Merge branch 'develop' of https://github.com/apache/incubator-dlab into develop add bf9655d Merge branch 'develop' of https://github.com/apache/incubator-dlab into develop add 8916551 Merge branch 'develop' of https://github.com/apache/incubator-dlab into develop add 970e201 Merge branch 'develop' of https://github.com/apache/incubator-dlab into develop add cd098cc Merge branch 'develop' of https://github.com/apache/incubator-dlab into develop add c772ce8 Merge branch 'develop' of https://github.com/apache/incubator-dlab into develop add df49cf2 Merge branch 'develop' of https://github.com/apache/incubator-dlab into develop add 5a6319c Merge branch 'develop' of https://github.com/apache/incubator-dlab into develop add 67dfdf8 Merge branch 'develop' of https://github.com/apache/incubator-dlab into develop add 157a49a Merge branch 'develop' of https://github.com/apache/incubator-dlab into develop add 8a88435 Merge branch 'develop' of https://github.com/apache/incubator-dlab into develop add 22a0df1 Merge branch 'develop' of https://github.com/apache/incubator-dlab into develop add 77a4f05 [DLAB] ProjectResource UT add dc226ae Import section fix add e79a679 Code review marks add bb61265 Constants Sections adjustment add 54d76b1 Constant fix new b0dc3ee [DLAB] Project Resource UT (#879) The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../backendapi/resources/ProjectResourceTest.java | 210 + 1 file changed, 132 insertions(+), 78 deletions(-) - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: [DLAB] AuditResource UT (#878)
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 6c19f17 [DLAB] AuditResource UT (#878) 6c19f17 is described below commit 6c19f1716c01fb32473f6e7002b09ebfcd3c53a2 Author: Pavel Papou AuthorDate: Tue Sep 1 06:26:28 2020 -0400 [DLAB] AuditResource UT (#878) AuditResource unit test --- .../backendapi/resources/AuditResourceTest.java| 88 ++ 1 file changed, 88 insertions(+) diff --git a/services/self-service/src/test/java/com/epam/dlab/backendapi/resources/AuditResourceTest.java b/services/self-service/src/test/java/com/epam/dlab/backendapi/resources/AuditResourceTest.java new file mode 100644 index 000..185b260 --- /dev/null +++ b/services/self-service/src/test/java/com/epam/dlab/backendapi/resources/AuditResourceTest.java @@ -0,0 +1,88 @@ +/* + * 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.backendapi.domain.AuditCreateDTO; +import com.epam.dlab.backendapi.domain.AuditResourceTypeEnum; +import com.epam.dlab.backendapi.service.AuditService; +import io.dropwizard.auth.AuthenticationException; +import io.dropwizard.testing.junit.ResourceTestRule; +import org.apache.http.HttpStatus; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + +import javax.ws.rs.client.Entity; +import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.refEq; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoMoreInteractions; +import static org.mockito.Mockito.eq; + +public class AuditResourceTest extends TestBase { + +private final static String USER = "testuser"; +private final static String INFO = "testInfo"; +private final static String RESOURCE = "testResource"; + +private final AuditService auditService = mock(AuditService.class); + +@Rule +public final ResourceTestRule resources = getResourceTestRuleInstance(new AuditResource(auditService)); + +@Before +public void setup() throws AuthenticationException { +authSetup(); +} + +@Test +public void saveAudit() { +final Response response = resources.getJerseyTest() +.target("/audit") +.request() +.header("Authorization", "Bearer " + TOKEN) +.post(Entity.json(prepareAuditCreateDTO())); + +assertEquals(HttpStatus.SC_OK, response.getStatus()); +verify(auditService).save(eq(USER), refEq(prepareAuditCreateDTO())); +verifyNoMoreInteractions(auditService); +} + +@Test +public void getAudit() { +final Response response = resources.getJerseyTest() +.target("/audit") +.request() +.header("Authorization", "Bearer " + TOKEN) +.get(); + +assertEquals(HttpStatus.SC_OK, response.getStatus()); +assertEquals(MediaType.APPLICATION_JSON, response.getHeaderString(HttpHeaders.CONTENT_TYPE)); +} + +private AuditCreateDTO prepareAuditCreateDTO() { +return new AuditCreateDTO(RESOURCE, INFO,AuditResourceTypeEnum.COMPUTE); +} +} - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: Updated exclusion for sonar coverage
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 4db591e Updated exclusion for sonar coverage new f91c779 Merge remote-tracking branch 'origin/develop' into develop 4db591e is described below commit 4db591e8c797a6f3a23a763cf544befc024ad2f8 Author: Oleh Fuks AuthorDate: Mon Aug 31 17:36:07 2020 +0300 Updated exclusion for sonar coverage --- pom.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pom.xml b/pom.xml index 7b2a114..95be206 100644 --- a/pom.xml +++ b/pom.xml @@ -63,6 +63,9 @@ **/*Exception.java, +**/BucketServiceAwsImpl.java, +**/BucketServiceAzureImpl.java, +**/BucketServiceGcpImpl.java, **/*DAO.java, **/*DAOImpl.java, **/*Configuration.java, - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: Created test for InfrastructureInfoService
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 9435ba9 Created test for InfrastructureInfoService 9435ba9 is described below commit 9435ba953e5c908bf8528e76307f516253343c9e Author: Oleh Fuks AuthorDate: Mon Aug 31 17:04:50 2020 +0300 Created test for InfrastructureInfoService --- .../resources/InfrastructureInfoResource.java | 2 +- .../resources/dto/ProjectInfrastructureInfo.java | 4 + .../service/InfrastructureInfoService.java | 2 +- .../service/impl/BillingServiceImpl.java | 17 +- .../impl/InfrastructureInfoServiceImpl.java| 86 +++-- .../resources/InfrastructureInfoResourceTest.java | 19 +- .../service/impl/BillingServiceImplTest.java | 8 +- .../impl/InfrastructureInfoServiceImplTest.java| 387 + 8 files changed, 452 insertions(+), 73 deletions(-) diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/InfrastructureInfoResource.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/InfrastructureInfoResource.java index c8952f3..deb9f96 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/InfrastructureInfoResource.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/InfrastructureInfoResource.java @@ -70,7 +70,7 @@ public class InfrastructureInfoResource { @Path("/status") public HealthStatusPageDTO status(@Auth UserInfo userInfo, @QueryParam("full") @DefaultValue("0") int fullReport) { - return infrastructureInfoService.getHeathStatus(userInfo, fullReport != 0); + return infrastructureInfoService.getHeathStatus(userInfo); } /** diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/dto/ProjectInfrastructureInfo.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/dto/ProjectInfrastructureInfo.java index e8585ac..ab3f7a8 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/dto/ProjectInfrastructureInfo.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/dto/ProjectInfrastructureInfo.java @@ -24,12 +24,16 @@ import com.epam.dlab.backendapi.domain.EndpointDTO; import com.epam.dlab.dto.UserInstanceDTO; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.EqualsAndHashCode; import lombok.ToString; import java.util.List; import java.util.Map; @AllArgsConstructor +@Builder +@EqualsAndHashCode @ToString public class ProjectInfrastructureInfo { @JsonProperty diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/InfrastructureInfoService.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/InfrastructureInfoService.java index ffb3531..b8fe079 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/InfrastructureInfoService.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/InfrastructureInfoService.java @@ -29,7 +29,7 @@ import java.util.List; public interface InfrastructureInfoService { List getUserResources(UserInfo user); - HealthStatusPageDTO getHeathStatus(UserInfo user, boolean fullReport); + HealthStatusPageDTO getHeathStatus(UserInfo user); InfrastructureMetaInfoDTO getInfrastructureMetaInfo(); } diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/BillingServiceImpl.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/BillingServiceImpl.java index ae47d27..d5675f0 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/BillingServiceImpl.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/BillingServiceImpl.java @@ -168,17 +168,12 @@ public class BillingServiceImpl implements BillingService { .stream() .collect(Collectors.toMap(e -> e, e -> getBillingData(userInfo, e))); -billingDataMap -.forEach((endpointDTO, billingData) -> { -log.info("Updating billing information for endpoint {}. Billing data {}", endpointDTO.getName(), billingData); -try { -if (!billingData.isEmpty()) { -updateBillingData(endpointDTO, billingData, endpoints); -} -} catch (Exception e) { -log.error(&quo
[incubator-dlab] branch develop updated: Updated test for BillingService
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 01b0ecb Updated test for BillingService 01b0ecb is described below commit 01b0ecbf05d11e4ed6f834008f27b0f07c1246f8 Author: Oleh Fuks AuthorDate: Thu Aug 27 18:22:38 2020 +0300 Updated test for BillingService --- .../service/impl/BillingServiceImpl.java | 62 +-- .../service/impl/BillingServiceImplTest.java | 619 - 2 files changed, 647 insertions(+), 34 deletions(-) diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/BillingServiceImpl.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/BillingServiceImpl.java index 2810a33..ae47d27 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/BillingServiceImpl.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/BillingServiceImpl.java @@ -85,7 +85,6 @@ public class BillingServiceImpl implements BillingService { private final RESTService provisioningService; private final ImageExploratoryDAO imageExploratoryDao; private final BillingDAO billingDAO; -private final String sbn; @Inject public BillingServiceImpl(ProjectService projectService, ProjectDAO projectDAO, EndpointService endpointService, @@ -100,7 +99,6 @@ public class BillingServiceImpl implements BillingService { this.provisioningService = provisioningService; this.imageExploratoryDao = imageExploratoryDao; this.billingDAO = billingDAO; -sbn = configuration.getServiceBaseName(); } @Override @@ -116,8 +114,8 @@ public class BillingServiceImpl implements BillingService { final double sum = billingReportLines.stream().mapToDouble(BillingReportLine::getCost).sum(); final String currency = billingReportLines.stream().map(BillingReportLine::getCurrency).distinct().count() == 1 ? billingReportLines.get(0).getCurrency() : null; return BillingReport.builder() - .name("Billing report") - .sbn(sbn) +.name("Billing report") +.sbn(configuration.getServiceBaseName()) .reportLines(billingReportLines) .usageDateFrom(min) .usageDateTo(max) @@ -130,20 +128,16 @@ public class BillingServiceImpl implements BillingService { @Override public String downloadReport(UserInfo user, BillingFilter filter) { BillingReport report = getBillingReport(user, filter); -boolean isReportComplete =report.isReportHeaderCompletable(); +boolean isReportComplete = report.isReportHeaderCompletable(); StringBuilder reportHead = new StringBuilder(BillingUtils.getFirstLine(report.getSbn(), report.getUsageDateFrom(), report.getUsageDateTo())); String stringOfAdjustedHeader = BillingUtils.getHeader(isReportComplete); reportHead.append(stringOfAdjustedHeader); -try { -report.getReportLines().forEach(r -> reportHead.append(BillingUtils.printLine(r, isReportComplete))); -reportHead.append(BillingUtils.getTotal(report.getTotalCost(), report.getCurrency(), stringOfAdjustedHeader)); -return reportHead.toString(); -} catch (Exception e) { -log.error("Cannot write billing data ", e); -throw new DlabException("Cannot write billing file ", e); -} +report.getReportLines().forEach(r -> reportHead.append(BillingUtils.printLine(r, isReportComplete))); +reportHead.append(BillingUtils.getTotal(report.getTotalCost(), report.getCurrency(), stringOfAdjustedHeader)); +return reportHead.toString(); } +@Override public BillingReport getExploratoryBillingData(String project, String endpoint, String exploratoryName, List compNames) { List resourceNames = new ArrayList<>(compNames); resourceNames.add(exploratoryName); @@ -155,13 +149,14 @@ public class BillingServiceImpl implements BillingService { .collect(Collectors.toList());; final String currency = billingData.stream().map(BillingReportLine::getCurrency).distinct().count() == 1 ? billingData.get(0).getCurrency() : null; return BillingReport.builder() - .name(exploratoryName) - .reportLines(billingData) - .totalCost(BigDecimal.valueOf(sum).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()) +.name(exploratoryName) +.reportLines(billingData) +.totalCost(BigDecimal.valueOf(sum).setScale(2, BigDecimal.ROUND_HALF_UP
[incubator-dlab] branch develop updated: Added statuses for auto complete feature
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 8dcb3f8 Added statuses for auto complete feature 8dcb3f8 is described below commit 8dcb3f8d4273647905cf9cc0704f1e007dd68ed9 Author: Oleh Fuks AuthorDate: Thu Aug 27 16:00:50 2020 +0300 Added statuses for auto complete feature --- .../AutoCompleteEnum.java} | 14 +++--- .../epam/dlab/backendapi/domain/ExploratoryLibList.java| 4 ++-- .../backendapi/resources/dto/LibraryAutoCompleteDTO.java | 3 ++- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/dto/LibraryAutoCompleteDTO.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/AutoCompleteEnum.java similarity index 77% copy from services/self-service/src/main/java/com/epam/dlab/backendapi/resources/dto/LibraryAutoCompleteDTO.java copy to services/self-service/src/main/java/com/epam/dlab/backendapi/domain/AutoCompleteEnum.java index 6c1d7b7..46a3402 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/dto/LibraryAutoCompleteDTO.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/AutoCompleteEnum.java @@ -17,16 +17,8 @@ * under the License. */ -package com.epam.dlab.backendapi.resources.dto; +package com.epam.dlab.backendapi.domain; -import lombok.Builder; -import lombok.Data; - -import java.util.List; - -@Data -@Builder -public class LibraryAutoCompleteDTO { - private boolean autoComplete; - private List libraries; +public enum AutoCompleteEnum { + NONE, UPDATING, ENABLED } diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/ExploratoryLibList.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/ExploratoryLibList.java index 19b5176..b5a8d95 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/ExploratoryLibList.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/ExploratoryLibList.java @@ -166,7 +166,7 @@ public class ExploratoryLibList { Map libMap = getLibs(group); if (libMap == null) { return LibraryAutoCompleteDTO.builder() - .autoComplete(Boolean.FALSE) + .autoComplete(isUpdating() ? AutoCompleteEnum.UPDATING : AutoCompleteEnum.NONE) .libraries(Collections.emptyList()) .build(); } @@ -177,7 +177,7 @@ public class ExploratoryLibList { .collect(Collectors.toList()); return LibraryAutoCompleteDTO.builder() - .autoComplete(Boolean.TRUE) + .autoComplete(AutoCompleteEnum.ENABLED) .libraries(libraries) .build(); } diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/dto/LibraryAutoCompleteDTO.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/dto/LibraryAutoCompleteDTO.java index 6c1d7b7..a74fdbc 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/dto/LibraryAutoCompleteDTO.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/dto/LibraryAutoCompleteDTO.java @@ -19,6 +19,7 @@ package com.epam.dlab.backendapi.resources.dto; +import com.epam.dlab.backendapi.domain.AutoCompleteEnum; import lombok.Builder; import lombok.Data; @@ -27,6 +28,6 @@ import java.util.List; @Data @Builder public class LibraryAutoCompleteDTO { - private boolean autoComplete; + private AutoCompleteEnum autoComplete; private List libraries; } - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated (d26be3e -> 176d861)
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git. from d26be3e [DLAB-2008]: Fixed filter by calendar issue on the audit page (#876) new c63c33f [DLAB-2013] Increased timeout for DL new 176d861 [DLAB-2013] Increased timeout for DL The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: infrastructure-provisioning/terraform/bin/deploy/provisioning.yml | 2 +- infrastructure-provisioning/terraform/gcp/endpoint/provisioning.yml | 2 +- services/provisioning-service/provisioning.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] 02/02: [DLAB-2013] Increased timeout for DL
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git commit 176d861af52b910c4396bd461110e318e8e0109d Author: Oleh Fuks AuthorDate: Thu Aug 27 13:52:07 2020 +0300 [DLAB-2013] Increased timeout for DL --- infrastructure-provisioning/terraform/bin/deploy/provisioning.yml | 2 +- infrastructure-provisioning/terraform/gcp/endpoint/provisioning.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/infrastructure-provisioning/terraform/bin/deploy/provisioning.yml b/infrastructure-provisioning/terraform/bin/deploy/provisioning.yml index 4813d4c..035a961 100644 --- a/infrastructure-provisioning/terraform/bin/deploy/provisioning.yml +++ b/infrastructure-provisioning/terraform/bin/deploy/provisioning.yml @@ -87,7 +87,7 @@ responseDirectory: /opt/dlab/tmp handlerDirectory: /opt/dlab/handlers dockerLogDirectory: ${LOG_ROOT_DIR} warmupPollTimeout: 2m -resourceStatusPollTimeout: 300m +resourceStatusPollTimeout: 400m keyLoaderPollTimeout: 30m requestEnvStatusTimeout: 50s adminKey: KEYNAME diff --git a/infrastructure-provisioning/terraform/gcp/endpoint/provisioning.yml b/infrastructure-provisioning/terraform/gcp/endpoint/provisioning.yml index 6edb057..6a71ac6 100644 --- a/infrastructure-provisioning/terraform/gcp/endpoint/provisioning.yml +++ b/infrastructure-provisioning/terraform/gcp/endpoint/provisioning.yml @@ -77,7 +77,7 @@ responseDirectory: /opt/dlab/tmp handlerDirectory: /opt/dlab/handlers dockerLogDirectory: ${LOG_ROOT_DIR} warmupPollTimeout: 2m -resourceStatusPollTimeout: 300m +resourceStatusPollTimeout: 400m keyLoaderPollTimeout: 30m requestEnvStatusTimeout: 50s adminKey: KEYNAME - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] 01/02: [DLAB-2013] Increased timeout for DL
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git commit c63c33f8493c4a87c2ae5c1ec853d1966ca89b75 Author: Oleh Fuks AuthorDate: Thu Aug 27 13:51:17 2020 +0300 [DLAB-2013] Increased timeout for DL --- services/provisioning-service/provisioning.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/provisioning-service/provisioning.yml b/services/provisioning-service/provisioning.yml index 53c303e..5ddbc62 100644 --- a/services/provisioning-service/provisioning.yml +++ b/services/provisioning-service/provisioning.yml @@ -28,7 +28,7 @@ responseDirectory: /opt/dlab/tmp handlerDirectory: /opt/dlab/handlers dockerLogDirectory: ${LOG_ROOT_DIR} warmupPollTimeout: 2m -resourceStatusPollTimeout: 300m +resourceStatusPollTimeout: 400m keyLoaderPollTimeout: 30m requestEnvStatusTimeout: 50s adminKey: KEYNAME - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: Fixed issue with date filter on Audit page (refactoring)
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 874619f Fixed issue with date filter on Audit page (refactoring) 874619f is described below commit 874619fdbb5bb497e7d98d2c9b80b430d74e5497 Author: Oleh Fuks AuthorDate: Wed Aug 26 15:59:57 2020 +0300 Fixed issue with date filter on Audit page (refactoring) --- .../src/main/java/com/epam/dlab/backendapi/dao/AuditDAOImpl.java | 9 - 1 file changed, 9 deletions(-) diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/AuditDAOImpl.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/AuditDAOImpl.java index 38dca13..a1db015 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/AuditDAOImpl.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/AuditDAOImpl.java @@ -169,13 +169,4 @@ public class AuditDAOImpl extends BaseDAO implements AuditDAO { searchCriteria.add(in(user, users)); } } - -public static void main(String[] args) throws ParseException { -Instant from; -SimpleDateFormat simpleDateFormat = new SimpleDateFormat("-MM-dd"); -simpleDateFormat.setTimeZone(TimeZone.getTimeZone(ZoneOffset.UTC)); -from = simpleDateFormat.parse("2020-01-01").toInstant(); - -System.out.println(from.toString().replace("T", " ")); -} } - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: [DLAB-1935] Audit message (#866)
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 3402cc8 [DLAB-1935] Audit message (#866) 3402cc8 is described below commit 3402cc8a12e9ca9d955c46b01acf90741066293a Author: Pavel Papou AuthorDate: Tue Aug 25 09:33:47 2020 -0400 [DLAB-1935] Audit message (#866) [DLAB-1935] Audit message --- .../com/epam/dlab/backendapi/resources/BucketResource.java | 14 -- .../dlab/backendapi/service/impl/ProjectServiceImpl.java | 11 +-- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/BucketResource.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/BucketResource.java index bbd1b02..a23e1cc 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/BucketResource.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/BucketResource.java @@ -52,8 +52,10 @@ import java.nio.file.Paths; @Path("/bucket") @Slf4j public class BucketResource { -private static final String AUDIT_UPLOAD_FOLDER_MESSAGE = "Folder: %s"; -private static final String AUDIT_MESSAGE = "File: %s"; +private static final String AUDIT_FOLDER_UPLOAD_MESSAGE = "Upload folder: %s"; +private static final String AUDIT_FILE_UPLOAD_MESSAGE = "Upload file: %s"; +private static final String AUDIT_FILE_DOWNLOAD_MESSAGE = "Download file: %s"; +private static final String AUDIT_FILE_DELETE_MESSAGE = "Delete file: %s"; private static final String OBJECT_FORM_FIELD = "object"; private static final String BUCKET_FORM_FIELD = "bucket"; private static final String ENDPOINT_FORM_FIELD = "endpoint"; @@ -93,7 +95,7 @@ public class BucketResource { @Produces(MediaType.APPLICATION_JSON) @RolesAllowed("/api/bucket/upload") public Response uploadFolder(@Auth UserInfo userInfo, @Valid FolderUploadDTO dto) { -bucketService.uploadFolder(userInfo, dto.getBucket(), dto.getFolder(), dto.getEndpoint(), String.format(AUDIT_UPLOAD_FOLDER_MESSAGE, dto.getFolder())); +bucketService.uploadFolder(userInfo, dto.getBucket(), dto.getFolder(), dto.getEndpoint(), String.format(AUDIT_FOLDER_UPLOAD_MESSAGE, dto.getFolder())); return Response.ok().build(); } @@ -106,7 +108,7 @@ public class BucketResource { @PathParam("bucket") String bucket, @PathParam("object") String object, @PathParam("endpoint") String endpoint) { -bucketService.downloadObject(userInfo, bucket, object, endpoint, resp, String.format(AUDIT_MESSAGE, object)); +bucketService.downloadObject(userInfo, bucket, object, endpoint, resp, String.format(AUDIT_FILE_DOWNLOAD_MESSAGE, object)); return Response.ok() .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + Paths.get(object).getFileName() + "\"") .build(); @@ -119,7 +121,7 @@ public class BucketResource { @RolesAllowed("/api/bucket/delete") public Response deleteObject(@Auth UserInfo userInfo, @Valid BucketDeleteDTO bucketDto) { final String listOfDeletedObject = String.join(", ", bucketDto.getObjects()); -bucketService.deleteObjects(userInfo, bucketDto.getBucket(), bucketDto.getObjects(), bucketDto.getEndpoint(), String.format(AUDIT_MESSAGE, listOfDeletedObject)); +bucketService.deleteObjects(userInfo, bucketDto.getBucket(), bucketDto.getObjects(), bucketDto.getEndpoint(), String.format(AUDIT_FILE_DELETE_MESSAGE, listOfDeletedObject)); return Response.ok().build(); } @@ -146,7 +148,7 @@ public class BucketResource { fileSize = Long.parseLong(Streams.asString(stream)); } } else { -bucketService.uploadObject(userInfo, bucket, object, endpoint, stream, item.getContentType(), fileSize, String.format(AUDIT_MESSAGE, object)); +bucketService.uploadObject(userInfo, bucket, object, endpoint, stream, item.getContentType(), fileSize, String.format(AUDIT_FILE_UPLOAD_MESSAGE, object)); } } catch (Exception e) { log.error("Cannot upload object {} to bucket {}. {}", object, bucket, e.getMessage(), e); diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/ProjectServiceImpl.java b/services/self-service/src/main/java/com/epam/dlab/bac
[incubator-dlab] branch develop updated: Created tests for BillingServiceImpl
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 6d69c44 Created tests for BillingServiceImpl 6d69c44 is described below commit 6d69c44bed8ba7b8e4beccd1ff154f10b0ade111 Author: Oleh Fuks AuthorDate: Thu Aug 20 17:25:17 2020 +0300 Created tests for BillingServiceImpl --- .../service/impl/BillingServiceImplTest.java | 124 + 1 file changed, 124 insertions(+) diff --git a/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/BillingServiceImplTest.java b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/BillingServiceImplTest.java new file mode 100644 index 000..2c329b2 --- /dev/null +++ b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/BillingServiceImplTest.java @@ -0,0 +1,124 @@ +/* + * 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.service.impl; + +import com.epam.dlab.backendapi.conf.SelfServiceApplicationConfiguration; +import com.epam.dlab.backendapi.dao.BillingDAO; +import com.epam.dlab.backendapi.dao.ProjectDAO; +import com.epam.dlab.backendapi.domain.BudgetDTO; +import com.epam.dlab.backendapi.domain.ProjectDTO; +import com.epam.dlab.backendapi.domain.ProjectEndpointDTO; +import com.epam.dlab.backendapi.resources.TestBase; +import com.epam.dlab.backendapi.service.ProjectService; +import com.epam.dlab.dto.UserInstanceStatus; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import java.time.LocalDate; +import java.util.Collections; +import java.util.Optional; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.anyString; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoMoreInteractions; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class BillingServiceImplTest extends TestBase { + + private static final String PROJECT = "project"; + + @Mock + private SelfServiceApplicationConfiguration configuration; + @Mock + private ProjectDAO projectDAO; + @Mock + private ProjectService projectService; + @Mock + private BillingDAO billingDAO; + + @InjectMocks + private BillingServiceImpl billingService; + + @Test + public void getBillingProjectQuoteUsed() { + when(projectDAO.getAllowedBudget(anyString())).thenReturn(Optional.of(10)); + when(projectService.get(anyString())).thenReturn(getProjectDTO(Boolean.FALSE)); + when(billingDAO.getOverallProjectCost(anyString())).thenReturn(5d); + + final int billingProjectQuoteUsed = billingService.getBillingProjectQuoteUsed(PROJECT); + + assertEquals("quotes should be equal", 50, billingProjectQuoteUsed); + verify(projectDAO).getAllowedBudget(PROJECT); + verify(projectService).get(PROJECT); + verify(billingDAO).getOverallProjectCost(PROJECT); + verifyNoMoreInteractions(projectDAO, projectService, billingDAO); + } + + @Test + public void getBillingProjectQuoteNullUsed() { + when(projectDAO.getAllowedBudget(anyString())).thenReturn(Optional.of(10)); + when(projectService.get(anyString())).thenReturn(getProjectQuoteNullDTO()); + when(billingDAO.getOverallProjectCost(anyString())).thenReturn(5d); + + final int billingProjectQuoteUsed = billingService.getBillingProjectQuoteUsed(PROJECT); + + assertEquals("quotes should be equal", 50, billingProjectQuoteUsed); + verify(projectDAO).getAllowedBudget(PROJECT); + verify(projectService).get(PROJECT); + verify(billingDAO).getOverallProjectCost(PROJECT); + v
[incubator-dlab] branch develop updated: Fixed test
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 3e2 Fixed test 3e2 is described below commit 3e2500f2dd16e8c4700e673e58c370b1648b Author: Oleh Fuks AuthorDate: Thu Aug 20 16:14:02 2020 +0300 Fixed test --- .../com/epam/dlab/backendapi/service/impl/LibraryServiceImplTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/LibraryServiceImplTest.java b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/LibraryServiceImplTest.java index dd61462..2528383 100644 --- a/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/LibraryServiceImplTest.java +++ b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/LibraryServiceImplTest.java @@ -366,7 +366,7 @@ public class LibraryServiceImplTest { @Test public void getExploratoryJupyterLibGroups() { - List exploratoryGroups = Arrays.asList(GROUP_PIP3, GROUP_OTHERS, GROUP_R_PKG, GROUP_OS_PKG, GROUP_PIP2, GROUP_JAVA); + List exploratoryGroups = Arrays.asList(GROUP_PIP2, GROUP_PIP3, GROUP_OTHERS, GROUP_OS_PKG, GROUP_R_PKG, GROUP_JAVA); when(exploratoryDAO.fetchExploratoryFields(anyString(), anyString(), anyString())).thenReturn(getJupyterUserInstanceDtoForLibGroups()); List exploratoryGroupsResult = libraryService.getExploratoryLibGroups(getUser(), PROJECT, EXPLORATORY_NAME); @@ -377,7 +377,7 @@ public class LibraryServiceImplTest { @Test public void getExploratoryRstudioLibGroups() { - List exploratoryGroups = Arrays.asList(GROUP_PIP3, GROUP_OTHERS, GROUP_R_PKG, GROUP_OS_PKG, GROUP_PIP2); + List exploratoryGroups = Arrays.asList(GROUP_PIP2, GROUP_PIP3, GROUP_OTHERS, GROUP_OS_PKG, GROUP_R_PKG); when(exploratoryDAO.fetchExploratoryFields(anyString(), anyString(), anyString())).thenReturn(getRstudioUserInstanceDtoForLibGroups()); List exploratoryGroupsResult = libraryService.getExploratoryLibGroups(getUser(), PROJECT, EXPLORATORY_NAME); - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: Fixed test
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 3e2 Fixed test 3e2 is described below commit 3e2500f2dd16e8c4700e673e58c370b1648b Author: Oleh Fuks AuthorDate: Thu Aug 20 16:14:02 2020 +0300 Fixed test --- .../com/epam/dlab/backendapi/service/impl/LibraryServiceImplTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/LibraryServiceImplTest.java b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/LibraryServiceImplTest.java index dd61462..2528383 100644 --- a/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/LibraryServiceImplTest.java +++ b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/LibraryServiceImplTest.java @@ -366,7 +366,7 @@ public class LibraryServiceImplTest { @Test public void getExploratoryJupyterLibGroups() { - List exploratoryGroups = Arrays.asList(GROUP_PIP3, GROUP_OTHERS, GROUP_R_PKG, GROUP_OS_PKG, GROUP_PIP2, GROUP_JAVA); + List exploratoryGroups = Arrays.asList(GROUP_PIP2, GROUP_PIP3, GROUP_OTHERS, GROUP_OS_PKG, GROUP_R_PKG, GROUP_JAVA); when(exploratoryDAO.fetchExploratoryFields(anyString(), anyString(), anyString())).thenReturn(getJupyterUserInstanceDtoForLibGroups()); List exploratoryGroupsResult = libraryService.getExploratoryLibGroups(getUser(), PROJECT, EXPLORATORY_NAME); @@ -377,7 +377,7 @@ public class LibraryServiceImplTest { @Test public void getExploratoryRstudioLibGroups() { - List exploratoryGroups = Arrays.asList(GROUP_PIP3, GROUP_OTHERS, GROUP_R_PKG, GROUP_OS_PKG, GROUP_PIP2); + List exploratoryGroups = Arrays.asList(GROUP_PIP2, GROUP_PIP3, GROUP_OTHERS, GROUP_OS_PKG, GROUP_R_PKG); when(exploratoryDAO.fetchExploratoryFields(anyString(), anyString(), anyString())).thenReturn(getRstudioUserInstanceDtoForLibGroups()); List exploratoryGroupsResult = libraryService.getExploratoryLibGroups(getUser(), PROJECT, EXPLORATORY_NAME); - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: [DLAB-2007] Get rid of r package for DeepLearning/TensorFlow with Jupyter
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 513a502 [DLAB-2007] Get rid of r package for DeepLearning/TensorFlow with Jupyter 513a502 is described below commit 513a502a71167062bc11c7657afc3cda12f7f1c3 Author: Oleh Fuks AuthorDate: Thu Aug 20 15:52:54 2020 +0300 [DLAB-2007] Get rid of r package for DeepLearning/TensorFlow with Jupyter --- .../epam/dlab/backendapi/service/impl/LibraryServiceImpl.java | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/LibraryServiceImpl.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/LibraryServiceImpl.java index 852ee74..797d58d 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/LibraryServiceImpl.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/LibraryServiceImpl.java @@ -179,13 +179,16 @@ public class LibraryServiceImpl implements LibraryService { public List getExploratoryLibGroups(UserInfo userInfo, String projectName, String exploratoryName) { UserInstanceDTO userInstanceDTO = exploratoryDAO.fetchExploratoryFields(userInfo.getName(), projectName, exploratoryName); final String templateName = userInstanceDTO.getTemplateName(); - List groups = new ArrayList<>(Arrays.asList(GROUP_PIP3, GROUP_OTHERS, GROUP_R_PKG, GROUP_OS_PKG)); + List groups = new ArrayList<>(Arrays.asList(GROUP_PIP2, GROUP_PIP3, GROUP_OTHERS, GROUP_OS_PKG)); - if (isTemplateGroup(templateName, Stream.of(JUPYTER, ZEPPELIN, DEEP_LEARNING, TENSOR))) { - groups.addAll(Arrays.asList(GROUP_PIP2, GROUP_JAVA)); + if (isTemplateGroup(templateName, Stream.of(JUPYTER, ZEPPELIN))) { + groups.addAll(Arrays.asList(GROUP_R_PKG, GROUP_JAVA)); + } + if (isTemplateGroup(templateName, Stream.of(DEEP_LEARNING, TENSOR))) { + groups.add(GROUP_JAVA); } if (isTemplateGroup(templateName, Stream.of(RSTUDIO, TENSOR_RSTUDIO))) { - groups.add(GROUP_PIP2); + groups.add(GROUP_R_PKG); } return groups - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: [DLAB-2001] Do not show libraries with invalid name while creating image
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new d1b931c [DLAB-2001] Do not show libraries with invalid name while creating image d1b931c is described below commit d1b931c0a951c8c59e76b5e38701f315a5f6b8b8 Author: Oleh Fuks AuthorDate: Thu Aug 20 10:15:13 2020 +0300 [DLAB-2001] Do not show libraries with invalid name while creating image --- .../src/main/java/com/epam/dlab/backendapi/dao/ExploratoryLibDAO.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/ExploratoryLibDAO.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/ExploratoryLibDAO.java index d96f069..626e275 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/ExploratoryLibDAO.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/ExploratoryLibDAO.java @@ -31,6 +31,7 @@ import org.apache.commons.lang3.StringUtils; import org.bson.Document; import org.bson.conversions.Bson; +import java.util.Arrays; import java.util.Collections; import java.util.Date; import java.util.List; @@ -395,7 +396,7 @@ public class ExploratoryLibDAO extends BaseDAO { return ((List) libsDocument.getOrDefault(libFieldName, Collections.emptyList())) .stream() .map(d -> convertFromDocument(d, Library.class)) - .filter(library -> LibStatus.INVALID_VERSION != library.getStatus()) + .filter(library -> !Arrays.asList(LibStatus.INVALID_VERSION, LibStatus.INVALID_NAME).contains(library.getStatus())) .peek(l -> l.withType(libType).withResourceName(resourceName)); } } \ No newline at end of file - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: [DLAB-2001] Do not show libraries with invalid name while creating image
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new d1b931c [DLAB-2001] Do not show libraries with invalid name while creating image d1b931c is described below commit d1b931c0a951c8c59e76b5e38701f315a5f6b8b8 Author: Oleh Fuks AuthorDate: Thu Aug 20 10:15:13 2020 +0300 [DLAB-2001] Do not show libraries with invalid name while creating image --- .../src/main/java/com/epam/dlab/backendapi/dao/ExploratoryLibDAO.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/ExploratoryLibDAO.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/ExploratoryLibDAO.java index d96f069..626e275 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/ExploratoryLibDAO.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/ExploratoryLibDAO.java @@ -31,6 +31,7 @@ import org.apache.commons.lang3.StringUtils; import org.bson.Document; import org.bson.conversions.Bson; +import java.util.Arrays; import java.util.Collections; import java.util.Date; import java.util.List; @@ -395,7 +396,7 @@ public class ExploratoryLibDAO extends BaseDAO { return ((List) libsDocument.getOrDefault(libFieldName, Collections.emptyList())) .stream() .map(d -> convertFromDocument(d, Library.class)) - .filter(library -> LibStatus.INVALID_VERSION != library.getStatus()) + .filter(library -> !Arrays.asList(LibStatus.INVALID_VERSION, LibStatus.INVALID_NAME).contains(library.getStatus())) .peek(l -> l.withType(libType).withResourceName(resourceName)); } } \ No newline at end of file - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: [DLAB-1995] Updated library groups for notebooks and compute
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new da179de [DLAB-1995] Updated library groups for notebooks and compute new b91a360 Merge remote-tracking branch 'origin/develop' into develop da179de is described below commit da179dee3f328f19563542eacd6c83fde8ea8db7 Author: Oleh Fuks AuthorDate: Wed Aug 19 12:57:21 2020 +0300 [DLAB-1995] Updated library groups for notebooks and compute --- .../service/impl/LibraryServiceImpl.java | 52 -- .../service/impl/LibraryServiceImplTest.java | 12 ++--- 2 files changed, 35 insertions(+), 29 deletions(-) diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/LibraryServiceImpl.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/LibraryServiceImpl.java index 9b53e47..852ee74 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/LibraryServiceImpl.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/LibraryServiceImpl.java @@ -29,6 +29,7 @@ import com.epam.dlab.backendapi.dao.BaseDAO; import com.epam.dlab.backendapi.dao.ExploratoryDAO; import com.epam.dlab.backendapi.dao.ExploratoryLibDAO; import com.epam.dlab.backendapi.domain.EndpointDTO; +import com.epam.dlab.backendapi.domain.NotebookTemplate; import com.epam.dlab.backendapi.domain.RequestId; import com.epam.dlab.backendapi.resources.dto.LibInfoRecord; import com.epam.dlab.backendapi.resources.dto.LibKey; @@ -67,9 +68,11 @@ import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; +import static com.epam.dlab.backendapi.domain.AuditActionEnum.INSTALL_LIBS; +import static com.epam.dlab.backendapi.domain.AuditResourceTypeEnum.COMPUTE; +import static com.epam.dlab.backendapi.domain.AuditResourceTypeEnum.NOTEBOOK; import static com.epam.dlab.backendapi.domain.NotebookTemplate.DEEP_LEARNING; import static com.epam.dlab.backendapi.domain.NotebookTemplate.JUPYTER; -import static com.epam.dlab.backendapi.domain.NotebookTemplate.JUPYTER_LAB; import static com.epam.dlab.backendapi.domain.NotebookTemplate.RSTUDIO; import static com.epam.dlab.backendapi.domain.NotebookTemplate.TENSOR; import static com.epam.dlab.backendapi.domain.NotebookTemplate.TENSOR_RSTUDIO; @@ -80,9 +83,6 @@ import static com.epam.dlab.dto.LibraryGroups.GROUP_OTHERS; import static com.epam.dlab.dto.LibraryGroups.GROUP_PIP2; import static com.epam.dlab.dto.LibraryGroups.GROUP_PIP3; import static com.epam.dlab.dto.LibraryGroups.GROUP_R_PKG; -import static com.epam.dlab.backendapi.domain.AuditActionEnum.INSTALL_LIBS; -import static com.epam.dlab.backendapi.domain.AuditResourceTypeEnum.NOTEBOOK; -import static com.epam.dlab.backendapi.domain.AuditResourceTypeEnum.COMPUTE; @Slf4j @@ -149,18 +149,19 @@ public class LibraryServiceImpl implements LibraryService { return libInfoRecords; } -@Audit(action = INSTALL_LIBS, type = COMPUTE) -@Override -public String installComputationalLibs(@User UserInfo ui, @Project String project, String expName, @ResourceName String compName, List libs, @Info String auditInfo) { -final UserInstanceDTO userInstance = exploratoryDAO.fetchExploratoryFields(ui.getName(), project, expName, compName); -EndpointDTO endpointDTO = endpointService.get(userInstance.getEndpoint()); -final String uuid = provisioningService.post(endpointDTO.getUrl() + ComputationalAPI.COMPUTATIONAL_LIB_INSTALL, -ui.getAccessToken(), -toComputationalLibraryInstallDto(ui, project, expName, compName, libs, userInstance, endpointDTO), -String.class); -requestId.put(ui.getName(), uuid); -return uuid; -} + @Audit(action = INSTALL_LIBS, type = COMPUTE) + @Override + public String installComputationalLibs(@User UserInfo ui, @Project String project, String expName, @ResourceName String compName, + List libs, @Info String auditInfo) { + final UserInstanceDTO userInstance = exploratoryDAO.fetchExploratoryFields(ui.getName(), project, expName, compName); + EndpointDTO endpointDTO = endpointService.get(userInstance.getEndpoint()); + final String uuid = provisioningService.post(endpointDTO.getUrl() + ComputationalAPI.COMPUTATIONAL_LIB_INSTALL, + ui.getAccessToken(), + toComputationalLibraryInstallDto(ui, project, expName, compName, libs, userInstance, endpointDTO), + String.class); + requestId.put(ui.getName(), uuid); + return uuid; + } @Audit(action = INSTALL_LIBS
[incubator-dlab] branch develop updated: [DLAB-1999]: Updated user guide according to release 2.4 (#868)
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 90a9835 [DLAB-1999]: Updated user guide according to release 2.4 (#868) 90a9835 is described below commit 90a983500e26bcaa9863aa2cbaa924bf81f48cbb Author: viravit AuthorDate: Tue Aug 18 13:28:44 2020 +0300 [DLAB-1999]: Updated user guide according to release 2.4 (#868) [DLAB-1999]: Updated user guide according to release 2.4 --- USER_GUIDE.md | 136 +++--- doc/audit_info.png| Bin 0 -> 6274 bytes doc/audit_page.png| Bin 0 -> 109629 bytes doc/billing_datepicker.png| Bin 27688 -> 34079 bytes doc/billing_page.png | Bin 264721 -> 53655 bytes doc/bin_icon.png | Bin 4379 -> 474 bytes doc/bucket_action.png | Bin 0 -> 55568 bytes doc/bucket_browser.png| Bin 0 -> 51360 bytes doc/bucket_button.png | Bin 0 -> 78545 bytes doc/bucket_upload.png | Bin 0 -> 56301 bytes doc/dataengine_creating_menu.png | Bin 18080 -> 0 bytes doc/emr_creating.png | Bin 43196 -> 63098 bytes doc/environment_management.png| Bin 90301 -> 66315 bytes doc/filter_icon.png | Bin 127 -> 220 bytes doc/icon_info.png | Bin 0 -> 788 bytes doc/install_libs_form.png | Bin 15510 -> 36704 bytes doc/jupiter.png | Bin 18395 -> 0 bytes doc/jupyter_kernel.png| Bin 0 -> 191741 bytes doc/main_page.png | Bin 35533 -> 42762 bytes doc/main_page2.png| Bin 49611 -> 72798 bytes doc/main_page3.png| Bin 48735 -> 71340 bytes doc/main_page_filter.png | Bin 79991 -> 90067 bytes doc/manage_environment.png| Bin 18263 -> 20835 bytes doc/managemanage_resource_actions.png | Bin 4976 -> 3162 bytes doc/notebook_info.png | Bin 42371 -> 31617 bytes doc/notebook_libs_status.png | Bin 59233 -> 76449 bytes doc/notebook_select_lib.png | Bin 31390 -> 0 bytes doc/notebook_selected_libs.png| Bin 51481 -> 53725 bytes doc/notebook_stop_confirm.png | Bin 25605 -> 19897 bytes doc/notebook_terminate_confirm.png| Bin 0 -> 20196 bytes doc/notebook_terminated.png | Bin 56038 -> 63664 bytes doc/notebook_terminating.png | Bin 56292 -> 64086 bytes doc/project_quota.png | Bin 0 -> 66333 bytes doc/roles.png | Bin 198223 -> 25864 bytes doc/rstudio.png | Bin 18879 -> 0 bytes doc/rstudio_kernel.png| Bin 0 -> 120656 bytes doc/scheduler reminder.png| Bin 45701 -> 11196 bytes doc/select_bucket.png | Bin 0 -> 36518 bytes doc/sort_icon.png | Bin 148 -> 275 bytes doc/spark_creating_menu.png | Bin 0 -> 18624 bytes doc/upload_or_generate_user_key.png | Bin 37302 -> 53928 bytes 41 files changed, 94 insertions(+), 42 deletions(-) diff --git a/USER_GUIDE.md b/USER_GUIDE.md index 78876fc..8bff75c 100644 --- a/USER_GUIDE.md +++ b/USER_GUIDE.md @@ -38,6 +38,8 @@ DLab is an essential toolset for analytics. It is a self-service Web Console, us [Git UI tool (ungit)](#git_ui) +[Bucket browser](#bucket) + [Administration](#administration) [Manage roles](#manage_roles) @@ -52,6 +54,8 @@ DLab is an essential toolset for analytics. It is a self-service Web Console, us [DLab billing report](#billing_page) +[DLab audit report](#audit_page) + [Web UI filters](#filter) @@ -93,7 +97,7 @@ After login user sees warning in case of exceeding quota or close to this limit. When you log into DLab Web interface, the first thing you need to do is to create a new project. -To do this click on “Upload” button on “Projects” page, select your personal public key (or click on "Generate" button), endpoint, group, 'Use shared image' select enable or disable and hit “Create” button. Do not forget to save your private key. +To do this click on “Upload” button on “Projects” page, select your personal public key (or click on "Generate" button), endpoint, group and hit “Create” button. Do not forget to save your private key. @@ -103,8 +107,6 @@ Please note, that you need to have a key pair combination (public and private ke Creation of Project starts after hitting "Create" button. This process is a one-time operation for each Data Scientist and it might take up-to 10 minutes for DLab to setup initial infras
[incubator-dlab] branch develop updated: [DLAB-1999]: Updated user guide according to release 2.4 (#868)
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 90a9835 [DLAB-1999]: Updated user guide according to release 2.4 (#868) 90a9835 is described below commit 90a983500e26bcaa9863aa2cbaa924bf81f48cbb Author: viravit AuthorDate: Tue Aug 18 13:28:44 2020 +0300 [DLAB-1999]: Updated user guide according to release 2.4 (#868) [DLAB-1999]: Updated user guide according to release 2.4 --- USER_GUIDE.md | 136 +++--- doc/audit_info.png| Bin 0 -> 6274 bytes doc/audit_page.png| Bin 0 -> 109629 bytes doc/billing_datepicker.png| Bin 27688 -> 34079 bytes doc/billing_page.png | Bin 264721 -> 53655 bytes doc/bin_icon.png | Bin 4379 -> 474 bytes doc/bucket_action.png | Bin 0 -> 55568 bytes doc/bucket_browser.png| Bin 0 -> 51360 bytes doc/bucket_button.png | Bin 0 -> 78545 bytes doc/bucket_upload.png | Bin 0 -> 56301 bytes doc/dataengine_creating_menu.png | Bin 18080 -> 0 bytes doc/emr_creating.png | Bin 43196 -> 63098 bytes doc/environment_management.png| Bin 90301 -> 66315 bytes doc/filter_icon.png | Bin 127 -> 220 bytes doc/icon_info.png | Bin 0 -> 788 bytes doc/install_libs_form.png | Bin 15510 -> 36704 bytes doc/jupiter.png | Bin 18395 -> 0 bytes doc/jupyter_kernel.png| Bin 0 -> 191741 bytes doc/main_page.png | Bin 35533 -> 42762 bytes doc/main_page2.png| Bin 49611 -> 72798 bytes doc/main_page3.png| Bin 48735 -> 71340 bytes doc/main_page_filter.png | Bin 79991 -> 90067 bytes doc/manage_environment.png| Bin 18263 -> 20835 bytes doc/managemanage_resource_actions.png | Bin 4976 -> 3162 bytes doc/notebook_info.png | Bin 42371 -> 31617 bytes doc/notebook_libs_status.png | Bin 59233 -> 76449 bytes doc/notebook_select_lib.png | Bin 31390 -> 0 bytes doc/notebook_selected_libs.png| Bin 51481 -> 53725 bytes doc/notebook_stop_confirm.png | Bin 25605 -> 19897 bytes doc/notebook_terminate_confirm.png| Bin 0 -> 20196 bytes doc/notebook_terminated.png | Bin 56038 -> 63664 bytes doc/notebook_terminating.png | Bin 56292 -> 64086 bytes doc/project_quota.png | Bin 0 -> 66333 bytes doc/roles.png | Bin 198223 -> 25864 bytes doc/rstudio.png | Bin 18879 -> 0 bytes doc/rstudio_kernel.png| Bin 0 -> 120656 bytes doc/scheduler reminder.png| Bin 45701 -> 11196 bytes doc/select_bucket.png | Bin 0 -> 36518 bytes doc/sort_icon.png | Bin 148 -> 275 bytes doc/spark_creating_menu.png | Bin 0 -> 18624 bytes doc/upload_or_generate_user_key.png | Bin 37302 -> 53928 bytes 41 files changed, 94 insertions(+), 42 deletions(-) diff --git a/USER_GUIDE.md b/USER_GUIDE.md index 78876fc..8bff75c 100644 --- a/USER_GUIDE.md +++ b/USER_GUIDE.md @@ -38,6 +38,8 @@ DLab is an essential toolset for analytics. It is a self-service Web Console, us [Git UI tool (ungit)](#git_ui) +[Bucket browser](#bucket) + [Administration](#administration) [Manage roles](#manage_roles) @@ -52,6 +54,8 @@ DLab is an essential toolset for analytics. It is a self-service Web Console, us [DLab billing report](#billing_page) +[DLab audit report](#audit_page) + [Web UI filters](#filter) @@ -93,7 +97,7 @@ After login user sees warning in case of exceeding quota or close to this limit. When you log into DLab Web interface, the first thing you need to do is to create a new project. -To do this click on “Upload” button on “Projects” page, select your personal public key (or click on "Generate" button), endpoint, group, 'Use shared image' select enable or disable and hit “Create” button. Do not forget to save your private key. +To do this click on “Upload” button on “Projects” page, select your personal public key (or click on "Generate" button), endpoint, group and hit “Create” button. Do not forget to save your private key. @@ -103,8 +107,6 @@ Please note, that you need to have a key pair combination (public and private ke Creation of Project starts after hitting "Create" button. This process is a one-time operation for each Data Scientist and it might take up-to 10 minutes for DLab to setup initial infras
[incubator-dlab] branch develop updated: Updated exclusion for sonar coverage
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 2ecf0de Updated exclusion for sonar coverage 2ecf0de is described below commit 2ecf0de55bce0e2312ebe7b8ca1437803763e075 Author: Oleh Fuks AuthorDate: Tue Aug 18 12:27:22 2020 +0300 Updated exclusion for sonar coverage --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 111cd7c..7b2a114 100644 --- a/pom.xml +++ b/pom.xml @@ -67,6 +67,7 @@ **/*DAOImpl.java, **/*Configuration.java, **/*ApplicationConfiguration.java, +**/*Application.java, src/main/java/com/epam/dlab/dto/**, src/main/java/com/epam/dlab/backendapi/interceptor/**, src/main/java/com/epam/dlab/backendapi/auth/**, - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: Updated test for EndpointServiceImpl
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new fd64dc2 Updated test for EndpointServiceImpl fd64dc2 is described below commit fd64dc237305888a7babde40148220043b66dc43 Author: Oleh Fuks AuthorDate: Tue Aug 18 12:21:12 2020 +0300 Updated test for EndpointServiceImpl --- .../com/epam/dlab/backendapi/service/impl/EndpointServiceImplTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImplTest.java b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImplTest.java index 4da05e9..6bf3f73 100644 --- a/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImplTest.java +++ b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImplTest.java @@ -64,7 +64,6 @@ public class EndpointServiceImplTest extends TestBase { private static final String EXPLORATORY_NAME_2 = "expName2"; private static final String PROJECT_NAME_1 = "projectName"; private static final String PROJECT_NAME_2 = "projectName_2"; - private static final String ENDPOINT_NAME_2 = "endpointName2"; @Mock private EndpointDAO endpointDAO; @@ -304,7 +303,7 @@ public class EndpointServiceImplTest extends TestBase { private List getCreatingProjectDTO() { ProjectDTO project = ProjectDTO.builder() .name(PROJECT_NAME_1) - .endpoints(Collections.singletonList(new ProjectEndpointDTO(ENDPOINT_NAME_2, UserInstanceStatus.CREATING, null))) + .endpoints(Collections.singletonList(new ProjectEndpointDTO(ENDPOINT_NAME, UserInstanceStatus.CREATING, null))) .build(); return Collections.singletonList(project); } - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: Updated test for EndpointServiceImpl
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 12efdce Updated test for EndpointServiceImpl 12efdce is described below commit 12efdce6fd26fa2ae8a196adadb58c9fcd9d1ae0 Author: Oleh Fuks AuthorDate: Tue Aug 18 12:20:04 2020 +0300 Updated test for EndpointServiceImpl --- .../com/epam/dlab/backendapi/service/impl/EndpointServiceImplTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImplTest.java b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImplTest.java index 6bf3f73..4da05e9 100644 --- a/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImplTest.java +++ b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImplTest.java @@ -64,6 +64,7 @@ public class EndpointServiceImplTest extends TestBase { private static final String EXPLORATORY_NAME_2 = "expName2"; private static final String PROJECT_NAME_1 = "projectName"; private static final String PROJECT_NAME_2 = "projectName_2"; + private static final String ENDPOINT_NAME_2 = "endpointName2"; @Mock private EndpointDAO endpointDAO; @@ -303,7 +304,7 @@ public class EndpointServiceImplTest extends TestBase { private List getCreatingProjectDTO() { ProjectDTO project = ProjectDTO.builder() .name(PROJECT_NAME_1) - .endpoints(Collections.singletonList(new ProjectEndpointDTO(ENDPOINT_NAME, UserInstanceStatus.CREATING, null))) + .endpoints(Collections.singletonList(new ProjectEndpointDTO(ENDPOINT_NAME_2, UserInstanceStatus.CREATING, null))) .build(); return Collections.singletonList(project); } - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: Created test for EndpointServiceImpl
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 4e29e88 Created test for EndpointServiceImpl 4e29e88 is described below commit 4e29e8831357126ab21dab350df3392ce414c3dd Author: Oleh Fuks AuthorDate: Tue Aug 18 11:52:00 2020 +0300 Created test for EndpointServiceImpl --- .../service/impl/EndpointServiceImpl.java | 11 +- .../service/impl/EndpointServiceImplTest.java | 310 + 2 files changed, 316 insertions(+), 5 deletions(-) diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImpl.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImpl.java index cbb7bd1..9c0b35e 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImpl.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImpl.java @@ -178,11 +178,12 @@ public class EndpointServiceImpl implements EndpointService { } private void checkProjectEndpointResourcesStatuses(List projects, String endpoint) { - boolean isTerminationEnabled = projects.stream().anyMatch(p -> - !projectService.checkExploratoriesAndComputationalProgress(p.getName(), Collections.singletonList(endpoint)) || - p.getEndpoints().stream().anyMatch(e -> e.getName().equals(endpoint) && - Arrays.asList(UserInstanceStatus.CREATING, UserInstanceStatus.STARTING, UserInstanceStatus.STOPPING, - UserInstanceStatus.TERMINATING).contains(e.getStatus(; + boolean isTerminationEnabled = projects.stream() + .anyMatch(p -> !projectService.checkExploratoriesAndComputationalProgress(p.getName(), Collections.singletonList(endpoint)) || + p.getEndpoints().stream() + .anyMatch(e -> e.getName().equals(endpoint) && + Arrays.asList(UserInstanceStatus.CREATING, UserInstanceStatus.STARTING, UserInstanceStatus.STOPPING, + UserInstanceStatus.TERMINATING).contains(e.getStatus(; if (isTerminationEnabled) { throw new ResourceConflictException(("Can not terminate resources of endpoint because one of project " + diff --git a/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImplTest.java b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImplTest.java new file mode 100644 index 000..6bf3f73 --- /dev/null +++ b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/EndpointServiceImplTest.java @@ -0,0 +1,310 @@ +/* + * 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.service.impl; + +import com.epam.dlab.backendapi.dao.EndpointDAO; +import com.epam.dlab.backendapi.dao.ExploratoryDAO; +import com.epam.dlab.backendapi.dao.UserRoleDAO; +import com.epam.dlab.backendapi.domain.EndpointDTO; +import com.epam.dlab.backendapi.domain.EndpointResourcesDTO; +import com.epam.dlab.backendapi.domain.ProjectDTO; +import com.epam.dlab.backendapi.domain.ProjectEndpointDTO; +import com.epam.dlab.backendapi.resources.TestBase; +import com.epam.dlab.backendapi.service.ProjectService; +import com.epam.dlab.cloud.CloudProvider; +import com.epam.dlab.dto.UserInstanceDTO; +import com.epam.dlab.dto.UserInstanceStatus; +import com.epam.dlab.exceptions.DlabException; +import com.epam.dlab.exceptions.ResourceConflictException; +import c
[incubator-dlab] branch develop updated: Sonar code smell changes
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 5c30c5c Sonar code smell changes 5c30c5c is described below commit 5c30c5c66785a5f1cad271fe8781335c39386bc7 Author: Oleh Fuks AuthorDate: Mon Aug 17 13:33:14 2020 +0300 Sonar code smell changes --- pom.xml| 1 + .../src/main/java/com/epam/dlab/BillingTool.java | 10 +-- .../src/main/java/com/epam/dlab/Help.java | 2 +- .../java/com/epam/dlab/conf/SecurityConfig.java| 2 +- .../configuration/BillingToolConfiguration.java| 6 +- .../dlab/configuration/ConfigurationValidator.java | 13 ++-- .../configuration/LoggingConfigurationFactory.java | 16 ++--- .../main/java/com/epam/dlab/core/ModuleData.java | 23 +++--- .../java/com/epam/dlab/core/parser/ColumnInfo.java | 2 +- .../java/com/epam/dlab/core/parser/ColumnMeta.java | 14 ++-- .../com/epam/dlab/core/parser/CommonFormat.java| 2 +- .../com/epam/dlab/core/parser/ParserByLine.java| 17 ++--- .../java/com/epam/dlab/logging/AppenderFile.java | 39 +- .../java/com/epam/dlab/module/AdapterFile.java | 56 --- .../main/java/com/epam/dlab/module/ParserCsv.java | 25 +++ .../com/epam/dlab/module/aws/AdapterS3File.java| 82 ++ .../java/com/epam/dlab/module/aws/FilterAWS.java | 7 +- .../java/com/epam/dlab/mongo/AdapterMongoDb.java | 61 ++-- .../com/epam/dlab/mongo/MongoDbConnection.java | 11 +-- 19 files changed, 179 insertions(+), 210 deletions(-) diff --git a/pom.xml b/pom.xml index 47645ff..111cd7c 100644 --- a/pom.xml +++ b/pom.xml @@ -80,6 +80,7 @@ src/main/java/com/epam/dlab/backendapi/servlet/guacamole/**, src/main/java/com/epam/dlab/backendapi/util/**, src/main/java/com/epam/dlab/backendapi/validation/**, +src/main/java/com/epam/dlab/backendapi/core/commands/**, src/main/java/com/epam/dlab/process/**, src/main/java/com/epam/dlab/backendapi/modules/**, src/main/java/com/epam/dlab/backendapi/validation/**, diff --git a/services/billing-aws/src/main/java/com/epam/dlab/BillingTool.java b/services/billing-aws/src/main/java/com/epam/dlab/BillingTool.java index cde9d4e..b7791ad 100644 --- a/services/billing-aws/src/main/java/com/epam/dlab/BillingTool.java +++ b/services/billing-aws/src/main/java/com/epam/dlab/BillingTool.java @@ -91,14 +91,14 @@ public class BillingTool { */ protected static void setLoggerLevel() { ch.qos.logback.classic.LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); - ch.qos.logback.classic.Logger logger = context.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME); - String [] loggers = { - "org.hibernate", - "org.jboss.logging" + ch.qos.logback.classic.Logger logger; + String[] loggers = { + "org.hibernate", + "org.jboss.logging" }; for (String name : loggers) { logger = context.getLogger(name); -logger.setLevel(Level.INFO); + logger.setLevel(Level.INFO); } } diff --git a/services/billing-aws/src/main/java/com/epam/dlab/Help.java b/services/billing-aws/src/main/java/com/epam/dlab/Help.java index c2fe5c2..579afc1 100644 --- a/services/billing-aws/src/main/java/com/epam/dlab/Help.java +++ b/services/billing-aws/src/main/java/com/epam/dlab/Help.java @@ -113,7 +113,7 @@ public class Help { public static void usage(String ... args) throws InitializationException { if (args == null || args.length == 0) { printHelp("usage", null); - } else if (args[0].equalsIgnoreCase("conf")) { + } else if ("conf".equalsIgnoreCase(args[0])) { printHelp("conf", findModules()); } else { ModuleType type = ModuleType.of(args[0]); diff --git a/services/billing-aws/src/main/java/com/epam/dlab/conf/SecurityConfig.java b/services/billing-aws/src/main/java/com/epam/dlab/conf/SecurityConfig.java index dba4086..2e10810 100644 --- a/services/billing-aws/src/main/java/com/epam/dlab/conf/SecurityConfig.java +++ b/services/billing-aws/src/main/java/com/epam/dlab/conf/SecurityConfig.java @@ -44,7 +44,7 @@ class SecurityConfig extends KeycloakWebSecurityConfigurerAdapter { } @Bean -public KeycloakConfigResolver KeycloakConfigResolver() { +
[incubator-dlab] branch develop updated: [DLAB-1981] Conveyed 'invalid name' status if it is tryout to install lib with wrong name
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 971843e [DLAB-1981] Conveyed 'invalid name' status if it is tryout to install lib with wrong name 971843e is described below commit 971843e7c483062261c0f26942904f8219a72851 Author: Oleh Fuks AuthorDate: Mon Aug 17 11:01:16 2020 +0300 [DLAB-1981] Conveyed 'invalid name' status if it is tryout to install lib with wrong name --- .../src/main/java/com/epam/dlab/dto/exploratory/LibStatus.java | 1 + 1 file changed, 1 insertion(+) diff --git a/services/dlab-model/src/main/java/com/epam/dlab/dto/exploratory/LibStatus.java b/services/dlab-model/src/main/java/com/epam/dlab/dto/exploratory/LibStatus.java index 7804b83..69197a1 100644 --- a/services/dlab-model/src/main/java/com/epam/dlab/dto/exploratory/LibStatus.java +++ b/services/dlab-model/src/main/java/com/epam/dlab/dto/exploratory/LibStatus.java @@ -27,6 +27,7 @@ public enum LibStatus { INSTALLING, INSTALLED, INVALID_VERSION, + INVALID_NAME, INSTALLATION_ERROR; @JsonCreator - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: [DLAB-1935] Audit adjustments (#842)
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 0565a1f [DLAB-1935] Audit adjustments (#842) 0565a1f is described below commit 0565a1f33d51a6463a5bf31c3d2f72e3173361e8 Author: Pavel Papou AuthorDate: Fri Aug 7 11:03:37 2020 -0400 [DLAB-1935] Audit adjustments (#842) [DLAB-1935] Audit adjustments --- .../com/epam/dlab/rest/contracts/ComputationalAPI.java | 1 + .../com/epam/dlab/backendapi/domain/AuditActionEnum.java | 2 +- .../epam/dlab/backendapi/domain/AuditResourceTypeEnum.java | 2 +- .../com/epam/dlab/backendapi/resources/BucketResource.java | 2 +- .../backendapi/resources/aws/ComputationalResourceAws.java | 3 ++- .../resources/azure/ComputationalResourceAzure.java| 5 +++-- .../backendapi/resources/gcp/ComputationalResourceGcp.java | 3 ++- .../epam/dlab/backendapi/service/ComputationalService.java | 2 +- .../backendapi/service/impl/ComputationalServiceImpl.java | 2 +- .../dlab/backendapi/service/impl/LibraryServiceImpl.java | 11 ++- .../dlab/backendapi/service/impl/ProjectServiceImpl.java | 14 +- .../service/impl/ComputationalServiceImplTest.java | 11 ++- 12 files changed, 34 insertions(+), 24 deletions(-) diff --git a/services/dlab-webapp-common/src/main/java/com/epam/dlab/rest/contracts/ComputationalAPI.java b/services/dlab-webapp-common/src/main/java/com/epam/dlab/rest/contracts/ComputationalAPI.java index 79d0279..251298f 100644 --- a/services/dlab-webapp-common/src/main/java/com/epam/dlab/rest/contracts/ComputationalAPI.java +++ b/services/dlab-webapp-common/src/main/java/com/epam/dlab/rest/contracts/ComputationalAPI.java @@ -21,6 +21,7 @@ package com.epam.dlab.rest.contracts; public interface ComputationalAPI { String AUDIT_MESSAGE = "Notebook name %s"; + String AUDIT_COMPUTATIONAL_RECONFIGURE_MESSAGE = "Reconfigure compute <%s>, requested for notebook <%s>"; String LIBRARY = "library/"; String COMPUTATIONAL = "computational"; String COMPUTATIONAL_CREATE = COMPUTATIONAL + "/create"; diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/AuditActionEnum.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/AuditActionEnum.java index ee3823f..c1f3c18 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/AuditActionEnum.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/AuditActionEnum.java @@ -20,5 +20,5 @@ package com.epam.dlab.backendapi.domain; public enum AuditActionEnum { -CREATE, SET_UP_SCHEDULER, START, STOP, TERMINATE, RECONFIGURE, UPDATE, CONNECT, DISCONNECT, UPLOAD, DOWNLOAD, DELETE, INSTALL, FOLLOW_LINK, LOG_IN +CREATE, SET_UP_SCHEDULER, START, STOP, TERMINATE, RECONFIGURE, UPDATE, CONNECT, DISCONNECT, UPLOAD, DOWNLOAD, DELETE, INSTALL_LIBS, FOLLOW_LINK, LOG_IN } diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/AuditResourceTypeEnum.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/AuditResourceTypeEnum.java index 6976114..e5425d2 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/AuditResourceTypeEnum.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/AuditResourceTypeEnum.java @@ -20,5 +20,5 @@ package com.epam.dlab.backendapi.domain; public enum AuditResourceTypeEnum { -PROJECT, EDGE_NODE, NOTEBOOK, COMPUTE, COMPUTATIONAL_LIBS, BUCKET, ENDPOINT, NOTEBOOK_LIBS, GROUP, IMAGE, GIT_ACCOUNT, LOG_IN, WEB_TERMINAL +PROJECT, EDGE_NODE, NOTEBOOK, COMPUTE, BUCKET, ENDPOINT, GROUP, IMAGE, GIT_ACCOUNT, LOG_IN, WEB_TERMINAL } diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/BucketResource.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/BucketResource.java index 2ba5a8d..bbd1b02 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/BucketResource.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/resources/BucketResource.java @@ -53,7 +53,7 @@ import java.nio.file.Paths; @Slf4j public class BucketResource { private static final String AUDIT_UPLOAD_FOLDER_MESSAGE = "Folder: %s"; -private static final String AUDIT_MESSAGE = "File(s): %s"; +private static final String AUDIT_MESSAGE = "File: %s"; private static final String OBJECT_FORM_FIELD = "object"; private static final String BUCKET_FORM_FIELD = "bucket"; private static final String ENDPOINT_FORM_FIELD = "endpoint"; diff --git a/services/self-service/src/main/java/com/epam/dl
[incubator-dlab] 03/03: [DLAB-1975] Updated logic for auto compete per library group
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git commit 020b912690314668127f877ee4e19dd03bdfd942 Author: Oleh Fuks AuthorDate: Fri Aug 7 15:13:36 2020 +0300 [DLAB-1975] Updated logic for auto compete per library group --- .../com/epam/dlab/dto/LibListExploratoryDTO.java | 40 + .../dlab/dto/exploratory/LibListStatusDTO.java | 12 ++-- .../response/handlers/LibListCallbackHandler.java | 10 ++-- .../dlab/backendapi/resources/LibraryResource.java | 10 ++-- .../backendapi/domain/ExploratoryLibCache.java | 67 +++--- .../dlab/backendapi/domain/ExploratoryLibList.java | 53 ++--- .../resources/LibExploratoryResource.java | 39 ++--- .../resources/callback/LibraryCallback.java| 7 +-- .../resources/dto/LibraryAutoCompleteDTO.java | 32 +++ .../epam/dlab/backendapi/util/RequestBuilder.java | 22 +++ .../backendapi/domain/ExploratoryLibListTest.java | 53 - .../service/impl/LibraryServiceImplTest.java | 2 +- 12 files changed, 200 insertions(+), 147 deletions(-) diff --git a/services/dlab-model/src/main/java/com/epam/dlab/dto/LibListExploratoryDTO.java b/services/dlab-model/src/main/java/com/epam/dlab/dto/LibListExploratoryDTO.java new file mode 100644 index 000..a4487b7 --- /dev/null +++ b/services/dlab-model/src/main/java/com/epam/dlab/dto/LibListExploratoryDTO.java @@ -0,0 +1,40 @@ +/* + * 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.dto; + +import com.epam.dlab.dto.exploratory.ExploratoryActionDTO; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +@Getter +@Setter +@ToString(callSuper = true) +public class LibListExploratoryDTO extends ExploratoryActionDTO { + + @JsonProperty + private String libCacheKey; + + public LibListExploratoryDTO withLibCacheKey(String libCacheKey) { + setLibCacheKey(libCacheKey); + return this; + } +} diff --git a/services/dlab-model/src/main/java/com/epam/dlab/dto/exploratory/LibListStatusDTO.java b/services/dlab-model/src/main/java/com/epam/dlab/dto/exploratory/LibListStatusDTO.java index 56f82af..17b5d3c 100644 --- a/services/dlab-model/src/main/java/com/epam/dlab/dto/exploratory/LibListStatusDTO.java +++ b/services/dlab-model/src/main/java/com/epam/dlab/dto/exploratory/LibListStatusDTO.java @@ -26,7 +26,7 @@ import lombok.Getter; import lombok.Setter; /** - * Stores the info about image libraries. + * Stores the info about group libraries. */ @Getter @Setter @@ -36,7 +36,7 @@ public class LibListStatusDTO extends StatusBaseDTO { private String libs; @JsonProperty -private String imageName; +private String group; /** * Set the list of libraries and return this object @@ -47,17 +47,17 @@ public class LibListStatusDTO extends StatusBaseDTO { } /** - * Set the name of image and return this object + * Set the name of group and return this object */ -public LibListStatusDTO withImageName(String imageName) { -setImageName(imageName); +public LibListStatusDTO withGroup(String group) { +setGroup(group); return this; } @Override public MoreObjects.ToStringHelper toStringHelper(Object self) { return MoreObjects.toStringHelper(self) -.add("imageName", imageName) +.add("group", group) .add("libs", (libs != null) ? "..." : null); } } diff --git a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/response/handlers/LibListCallbackHandler.java b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/response/handlers/LibListCallbackHandler.java index ca0268c..b1b302c 100644 --- a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/response/handlers/LibListCallbackHandler.java +++ b/services/provisioning-
[incubator-dlab] 01/03: [DLAB-1975] Added endpoints for retrieving library groups
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git commit fb8226b03109678776dcb776c5d44931fc04e0d2 Author: Oleh Fuks AuthorDate: Thu Aug 6 16:35:17 2020 +0300 [DLAB-1975] Added endpoints for retrieving library groups --- .../java/com/epam/dlab/dto/LibraryGroups.java} | 30 +++--- .../backendapi/domain/ExploratoryLibCache.java | 32 +-- .../NotebookTemplate.java} | 30 +++--- .../resources/LibExploratoryResource.java | 48 +++--- .../dlab/backendapi/service/LibraryService.java| 14 ++- .../service/impl/LibraryServiceImpl.java | 61 ++-- .../resources/LibExploratoryResourceTest.java | 97 ++-- .../service/impl/LibraryServiceImplTest.java | 102 - 8 files changed, 210 insertions(+), 204 deletions(-) diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/LibraryService.java b/services/dlab-model/src/main/java/com/epam/dlab/dto/LibraryGroups.java similarity index 50% copy from services/self-service/src/main/java/com/epam/dlab/backendapi/service/LibraryService.java copy to services/dlab-model/src/main/java/com/epam/dlab/dto/LibraryGroups.java index adf53e3..f6c5d93 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/LibraryService.java +++ b/services/dlab-model/src/main/java/com/epam/dlab/dto/LibraryGroups.java @@ -17,22 +17,24 @@ * under the License. */ -package com.epam.dlab.backendapi.service; +package com.epam.dlab.dto; -import com.epam.dlab.auth.UserInfo; -import com.epam.dlab.backendapi.resources.dto.LibInfoRecord; -import com.epam.dlab.dto.exploratory.LibInstallDTO; -import org.bson.Document; +public enum LibraryGroups { + GROUP_JAVA("java"), + GROUP_PIP2("pip2"), + GROUP_PIP3("pip3"), + GROUP_R_PKG("r_pkg"), + GROUP_OS_PKG("os_pkg"), + GROUP_OTHERS("others"); -import java.util.List; + private String name; -public interface LibraryService { -List getLibs(String user, String project, String exploratoryName, String computationalName); + LibraryGroups(String name) { + this.name = name; + } -List getLibInfo(String user, String project, String exploratoryName); - -String installComputationalLibs(UserInfo userInfo, String project, String exploratoryName, String computationalName, -List libs, String auditInfo); - -String installExploratoryLibs(UserInfo userInfo, String project, String exploratoryName, List libs, String auditInfo); + @Override + public String toString() { + return name; + } } diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/ExploratoryLibCache.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/ExploratoryLibCache.java index 41debbb..380a436 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/ExploratoryLibCache.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/domain/ExploratoryLibCache.java @@ -43,7 +43,6 @@ import org.slf4j.LoggerFactory; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; /** * Cache of libraries for exploratory. @@ -51,7 +50,6 @@ import java.util.stream.Collectors; @Singleton public class ExploratoryLibCache implements Managed, Runnable { private static final Logger LOGGER = LoggerFactory.getLogger(ExploratoryLibCache.class); - private static final String PIP2_GROUP = "pip2"; @Inject @Named(ServiceConsts.PROVISIONING_SERVICE_NAME) @@ -117,33 +115,6 @@ public class ExploratoryLibCache implements Managed, Runnable { } /** -* Return the list of libraries groups from cache for compute resource. -* -* @param userInfo the user info. -* @param userInstance the notebook info. -* @return list of libraries groups -*/ - public List getComputeLibGroupList(UserInfo userInfo, UserInstanceDTO userInstance) { - ExploratoryLibList libs = getLibs(userInfo, userInstance); - return libs.getGroupList() - .stream() - .filter(g -> !PIP2_GROUP.equals(g)) - .collect(Collectors.toList()); - } - - /** -* Return the list of libraries groups from cache for exploratory resource. -* -* @param userInfo the user info. -* @param userInstance the notebook info. -* @return list of libraries groups -*/ - public List getExploratoryLibGroupList(UserInfo userInfo, UserInstanceDTO u
[incubator-dlab] 02/03: Merge remote-tracking branch 'origin/develop' into develop
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git commit 0b7ef1cf361b086f71751ee02576d7995304f0ca Merge: fb8226b 7480fc8 Author: Oleh Fuks AuthorDate: Fri Aug 7 15:12:43 2020 +0300 Merge remote-tracking branch 'origin/develop' into develop infrastructure-provisioning/scripts/deploy_dlab.py | 7 ++ .../src/general/conf/dlab.ini | 6 ++ .../src/general/lib/os/debian/common_lib.py| 51 ++ .../src/general/lib/os/debian/edge_lib.py | 11 +++ .../src/general/lib/os/debian/ssn_lib.py | 1 - .../src/general/lib/os/redhat/common_lib.py| 26 .../src/general/lib/os/redhat/edge_lib.py | 2 + .../src/general/lib/os/redhat/ssn_lib.py | 2 + .../src/general/scripts/aws/ssn_configure.py | 71 .../src/general/scripts/azure/ssn_configure.py | 71 .../src/general/scripts/gcp/ssn_configure.py | 78 ++ .../src/ssn/scripts/configure_ssn_node.py | 10 ++- .../src/app/core/pipes/keys-pipe/keys.pipe.ts | 2 +- .../underscoreless-pipe/underscoreless.pipe.ts | 2 +- .../bucket-browser/bucket-browser.component.ts | 41 +--- .../buckets-tree/bucket-tree.component.scss| 2 +- .../folder-tree/folder-tree.component.ts | 2 +- ...utational-resource-create-dialog.component.html | 2 +- ...mputational-resource-create-dialog.component.ts | 38 ++- .../ami-create-dialog.component.ts | 2 +- .../create-environment.component.scss | 2 +- .../detail-dialog/detail-dialog.component.html | 40 ++- .../install-libraries.component.ts | 35 +++--- .../resources-grid/resources-grid.component.html | 12 ++-- .../resources-grid/resources-grid.component.ts | 43 +--- .../src/app/resources/resources.component.ts | 1 - .../confirmation-dialog.component.ts | 8 ++- .../webapp/src/assets/styles/_dialogs.scss | 3 +- 28 files changed, 454 insertions(+), 117 deletions(-) - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: Updated test for ProjectServiceImpl
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 223653d Updated test for ProjectServiceImpl 223653d is described below commit 223653d84387a03cb95a7717c691b277b81a5ca3 Author: Oleh Fuks AuthorDate: Tue Aug 4 14:57:54 2020 +0300 Updated test for ProjectServiceImpl --- .../java/com/epam/dlab/backendapi/service/ProjectServiceImplTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/services/self-service/src/test/java/com/epam/dlab/backendapi/service/ProjectServiceImplTest.java b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/ProjectServiceImplTest.java index e9367ff..a5c9ebf 100644 --- a/services/self-service/src/test/java/com/epam/dlab/backendapi/service/ProjectServiceImplTest.java +++ b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/ProjectServiceImplTest.java @@ -121,9 +121,8 @@ public class ProjectServiceImplTest extends TestBase { List projectsMock = getProjectDTOs(); when(projectDAO.getProjects()).thenReturn(projectsMock); - List projects = projectService.getProjects(getUserInfo()); + projectService.getProjects(getUserInfo()); - assertEquals(projects, projectsMock); verify(projectDAO).getProjects(); verifyNoMoreInteractions(projectDAO); } - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: Created test for ProjectServiceImpl
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new ab8eb5e Created test for ProjectServiceImpl ab8eb5e is described below commit ab8eb5ee4d0d90352b49ace455245015373d37c2 Author: Oleh Fuks AuthorDate: Tue Aug 4 14:43:29 2020 +0300 Created test for ProjectServiceImpl --- pom.xml| 5 +- ...rovisioningServiceApplicationConfiguration.java | 1 + .../backendapi/{ => conf}/CloudConfiguration.java | 2 +- .../backendapi/core/commands/CommandBuilder.java | 2 +- .../epam/dlab/backendapi/dao/ProjectDAOImpl.java | 9 +- .../service/impl/ProjectServiceImpl.java | 3 + .../backendapi/service/ProjectServiceImplTest.java | 427 + 7 files changed, 443 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index c327cfc..47645ff 100644 --- a/pom.xml +++ b/pom.xml @@ -65,6 +65,8 @@ **/*Exception.java, **/*DAO.java, **/*DAOImpl.java, +**/*Configuration.java, +**/*ApplicationConfiguration.java, src/main/java/com/epam/dlab/dto/**, src/main/java/com/epam/dlab/backendapi/interceptor/**, src/main/java/com/epam/dlab/backendapi/auth/**, @@ -80,7 +82,8 @@ src/main/java/com/epam/dlab/backendapi/validation/**, src/main/java/com/epam/dlab/process/**, src/main/java/com/epam/dlab/backendapi/modules/**, -src/main/java/com/epam/dlab/backendapi/validation/** +src/main/java/com/epam/dlab/backendapi/validation/**, +src/main/java/com/epam/dlab/backendapi/schedulers/** diff --git a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/ProvisioningServiceApplicationConfiguration.java b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/ProvisioningServiceApplicationConfiguration.java index 1025ad6..4edc8af 100644 --- a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/ProvisioningServiceApplicationConfiguration.java +++ b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/ProvisioningServiceApplicationConfiguration.java @@ -20,6 +20,7 @@ package com.epam.dlab.backendapi; import com.epam.dlab.ServiceConfiguration; +import com.epam.dlab.backendapi.conf.CloudConfiguration; import com.epam.dlab.backendapi.core.Directories; import com.epam.dlab.backendapi.validation.ProvisioningServiceCloudConfigurationSequenceProvider; import com.epam.dlab.validation.AwsValidation; diff --git a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/CloudConfiguration.java b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/conf/CloudConfiguration.java similarity index 98% rename from services/provisioning-service/src/main/java/com/epam/dlab/backendapi/CloudConfiguration.java rename to services/provisioning-service/src/main/java/com/epam/dlab/backendapi/conf/CloudConfiguration.java index 9d61210..c25624c 100644 --- a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/CloudConfiguration.java +++ b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/conf/CloudConfiguration.java @@ -17,7 +17,7 @@ * under the License. */ -package com.epam.dlab.backendapi; +package com.epam.dlab.backendapi.conf; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; diff --git a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/commands/CommandBuilder.java b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/commands/CommandBuilder.java index a212d0a..f99eca4 100644 --- a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/commands/CommandBuilder.java +++ b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/commands/CommandBuilder.java @@ -19,8 +19,8 @@ package com.epam.dlab.backendapi.core.commands; -import com.epam.dlab.backendapi.CloudConfiguration; import com.epam.dlab.backendapi.ProvisioningServiceApplicationConfiguration; +import com.epam.dlab.backendapi.conf.CloudConfiguration; import com.epam.dlab.cloud.CloudProvider; import com.epam.dlab.dto.ResourceBaseDTO; import com.epam.dlab.dto.aws.AwsCloudSettings; diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/ProjectDAOImpl.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/ProjectDAOImpl.java index 99073d1..f08e3a3 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/ProjectDAOImpl.java +++ b/services/self-service/src/main/java/
[incubator-dlab] branch develop updated: Sonar code smell changes
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 074f5bf Sonar code smell changes new a493c9c Merge remote-tracking branch 'origin/develop' into develop 074f5bf is described below commit 074f5bf38446c09b3c891f4f13f18e8f418280c9 Author: Oleh Fuks AuthorDate: Mon Aug 3 11:32:57 2020 +0300 Sonar code smell changes --- .../azure/AzureInvoiceCalculationService.java | 2 - .../billing/azure/CalculateBillingService.java | 1 + .../dlab/billing/azure/config/SecurityConfig.java | 2 +- .../epam/dlab/billing/gcp/conf/SecurityConfig.java | 4 +- .../com/epam/dlab/billing/gcp/dao/BillingDAO.java | 3 +- .../dlab/billing/gcp/service/BillingService.java | 3 +- .../src/main/java/com/epam/dlab/MongoKeyWords.java | 30 -- .../dlab/dto/exploratory/ExploratoryCreateDTO.java | 3 + .../dlab/dto/exploratory/ExploratoryGitCreds.java | 4 +- .../dlab/dto/exploratory/ExploratoryImageDTO.java | 1 + .../java/com/epam/dlab/model/aws/ReportLine.java | 17 +++--- .../main/java/com/epam/dlab/util/ServiceUtils.java | 66 +++--- .../java/com/epam/dlab/util/UsernameUtils.java | 6 +- .../src/main/java/com/epam/dlab/ModuleBase.java| 22 .../src/main/java/com/epam/dlab/auth/UserInfo.java | 53 +++-- .../java/com/epam/dlab/rest/contracts/EdgeAPI.java | 28 - .../backendapi/resources/aws/EdgeResourceAws.java | 7 ++- .../resources/azure/EdgeResourceAzure.java | 7 ++- .../backendapi/resources/gcp/EdgeResourceGcp.java | 7 ++- 19 files changed, 120 insertions(+), 146 deletions(-) diff --git a/services/billing-azure/src/main/java/com/epam/dlab/billing/azure/AzureInvoiceCalculationService.java b/services/billing-azure/src/main/java/com/epam/dlab/billing/azure/AzureInvoiceCalculationService.java index b3eec4f..441475e 100644 --- a/services/billing-azure/src/main/java/com/epam/dlab/billing/azure/AzureInvoiceCalculationService.java +++ b/services/billing-azure/src/main/java/com/epam/dlab/billing/azure/AzureInvoiceCalculationService.java @@ -22,7 +22,6 @@ package com.epam.dlab.billing.azure; import com.epam.dlab.billing.BillingCalculationUtils; import com.epam.dlab.billing.azure.config.BillingConfigurationAzure; import com.epam.dlab.billing.azure.model.AzureDailyResourceInvoice; -import com.epam.dlab.billing.azure.model.AzureDlabBillableResource; import com.epam.dlab.billing.azure.rate.AzureRateCardClient; import com.epam.dlab.billing.azure.rate.Meter; import com.epam.dlab.billing.azure.rate.RateCardResponse; @@ -58,7 +57,6 @@ public class AzureInvoiceCalculationService { private static final long MAX_AUTH_TOKEN_TTL_MILLIS = 9L * 60L * 1000L; private BillingConfigurationAzure billingConfigurationAzure; - private Map billableResources; /** * Constructs service class diff --git a/services/billing-azure/src/main/java/com/epam/dlab/billing/azure/CalculateBillingService.java b/services/billing-azure/src/main/java/com/epam/dlab/billing/azure/CalculateBillingService.java index d432337..2f265c0 100644 --- a/services/billing-azure/src/main/java/com/epam/dlab/billing/azure/CalculateBillingService.java +++ b/services/billing-azure/src/main/java/com/epam/dlab/billing/azure/CalculateBillingService.java @@ -23,6 +23,7 @@ import com.epam.dlab.dto.billing.BillingData; import java.util.List; +@FunctionalInterface public interface CalculateBillingService { List getBillingData(); } diff --git a/services/billing-azure/src/main/java/com/epam/dlab/billing/azure/config/SecurityConfig.java b/services/billing-azure/src/main/java/com/epam/dlab/billing/azure/config/SecurityConfig.java index 35e341c..9ee3d0a 100644 --- a/services/billing-azure/src/main/java/com/epam/dlab/billing/azure/config/SecurityConfig.java +++ b/services/billing-azure/src/main/java/com/epam/dlab/billing/azure/config/SecurityConfig.java @@ -44,7 +44,7 @@ class SecurityConfig extends KeycloakWebSecurityConfigurerAdapter { } @Bean -public KeycloakConfigResolver KeycloakConfigResolver() { +public KeycloakConfigResolver keycloakConfigResolver() { return new KeycloakSpringBootConfigResolver(); } diff --git a/services/billing-gcp/src/main/java/com/epam/dlab/billing/gcp/conf/SecurityConfig.java b/services/billing-gcp/src/main/java/com/epam/dlab/billing/gcp/conf/SecurityConfig.java index ad960b0..5666283 100644 --- a/services/billing-gcp/src/main/java/com/epam/dlab/billing/gcp/conf/SecurityConfig.java +++ b/services/billing-gcp/src/main/java/com/epam/dlab/billing/gcp/conf/SecurityConfig.java @@ -44,8 +44,8 @@ class SecurityConfig extends KeycloakWebSecurityConfigurerAdapter { } @Bean -public KeycloakConfigResolver KeycloakConfigResolver() { -return
[incubator-dlab] branch develop updated: Sonar code smell changes
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 203c99a Sonar code smell changes 203c99a is described below commit 203c99a1b7292b5525ce8adb54695fa61fd7f484 Author: Oleh Fuks AuthorDate: Fri Jul 31 15:52:34 2020 +0300 Sonar code smell changes --- .../com/epam/dlab/backendapi/dao/AuditDAOImpl.java | 2 +- .../com/epam/dlab/backendapi/dao/SecurityDAO.java | 44 +++--- .../epam/dlab/backendapi/domain/EndpointDTO.java | 1 - .../resources/ImageExploratoryResource.java| 2 +- .../resources/LibExploratoryResource.java | 1 - .../resources/callback/GitCredsCallback.java | 3 -- .../resources/callback/LibraryCallback.java| 2 - .../resources/callback/ReuploadKeyCallback.java| 2 - .../com/epam/dlab/backendapi/roles/UserRole.java | 8 +++- .../backendapi/service/ExternalLibraryService.java | 1 + .../dlab/backendapi/service/GuacamoleService.java | 1 + .../backendapi/service/KeycloakServiceImpl.java| 7 ++-- .../backendapi/service/ReuploadKeyService.java | 3 +- .../dlab/backendapi/service/SystemInfoService.java | 1 + .../epam/dlab/backendapi/service/TagService.java | 1 + .../backendapi/service/impl/BucketServiceImpl.java | 7 ++-- .../impl/InfrastructureTemplateServiceImpl.java| 6 ++- .../service/impl/UserGroupServiceImpl.java | 7 ++-- .../epam/dlab/backendapi/util/CSVFormatter.java| 24 ++-- 19 files changed, 62 insertions(+), 61 deletions(-) diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/AuditDAOImpl.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/AuditDAOImpl.java index fefa1a4..9886449 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/AuditDAOImpl.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/AuditDAOImpl.java @@ -57,7 +57,7 @@ import static com.mongodb.client.model.Filters.in; import static com.mongodb.client.model.Filters.lte; public class AuditDAOImpl extends BaseDAO implements AuditDAO { -private final static String AUDIT_COLLECTION = "audit"; +private static final String AUDIT_COLLECTION = "audit"; private static final String RESOURCE_NAME_FIELD = "resourceName"; private static final String RESOURCE_TYPE_FIELD = "type"; private static final String TIMESTAMP_FIELD = "timestamp"; diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/SecurityDAO.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/SecurityDAO.java index 0c76422..a0ec24f 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/SecurityDAO.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/SecurityDAO.java @@ -20,10 +20,8 @@ package com.epam.dlab.backendapi.dao; import com.epam.dlab.auth.UserInfo; -import com.epam.dlab.auth.dto.UserCredentialDTO; import com.epam.dlab.backendapi.conf.SelfServiceApplicationConfiguration; import com.epam.dlab.exceptions.DlabException; -import com.epam.dlab.util.UsernameUtils; import com.google.inject.Inject; import com.google.inject.Singleton; import com.mongodb.client.FindIterable; @@ -31,35 +29,35 @@ import com.mongodb.client.model.Projections; import org.bson.Document; import org.keycloak.representations.AccessTokenResponse; -import java.util.*; +import java.util.Collections; +import java.util.Date; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; import java.util.stream.Collectors; -import static com.epam.dlab.backendapi.dao.MongoCollections.LOGIN_ATTEMPTS; import static com.epam.dlab.backendapi.dao.MongoCollections.ROLES; -import static com.mongodb.client.model.Filters.*; -import static com.mongodb.client.model.Projections.*; +import static com.mongodb.client.model.Filters.and; +import static com.mongodb.client.model.Filters.eq; +import static com.mongodb.client.model.Filters.gte; +import static com.mongodb.client.model.Filters.ne; +import static com.mongodb.client.model.Projections.exclude; +import static com.mongodb.client.model.Projections.fields; +import static com.mongodb.client.model.Projections.include; /** * DAO write the attempt of user login into DLab. */ @Singleton public class SecurityDAO extends BaseDAO { - - @Inject - private SelfServiceApplicationConfiguration conf; private static final String SECURITY_COLLECTION = "security"; private static final String TOKEN_RESPONSE = "tokenResponse"; + private static final String LAST_ACCESS = "last_access"; - /** -* Write the attempt of user logi
[incubator-dlab] branch develop updated: Removed method to simply inherit it.
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new d330f61 Removed method to simply inherit it. d330f61 is described below commit d330f61d332fa317885d95b9192c082c1373b6fe Author: Oleh Fuks AuthorDate: Fri Jul 31 15:27:04 2020 +0300 Removed method to simply inherit it. --- .../java/com/epam/dlab/backendapi/auth/KeycloakAuthenticator.java | 8 1 file changed, 8 deletions(-) diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/auth/KeycloakAuthenticator.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/auth/KeycloakAuthenticator.java index d48b5e2..4b39290 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/auth/KeycloakAuthenticator.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/auth/KeycloakAuthenticator.java @@ -22,13 +22,11 @@ package com.epam.dlab.backendapi.auth; import com.epam.dlab.auth.UserInfo; import de.ahus1.keycloak.dropwizard.AbstractKeycloakAuthenticator; import de.ahus1.keycloak.dropwizard.KeycloakConfiguration; -import io.dropwizard.auth.AuthenticationException; import org.keycloak.KeycloakSecurityContext; import org.keycloak.representations.AccessToken; import javax.servlet.http.HttpServletRequest; import java.util.List; -import java.util.Optional; import static java.util.Collections.emptyList; @@ -41,12 +39,6 @@ public class KeycloakAuthenticator extends AbstractKeycloakAuthenticator authenticate(HttpServletRequest request) throws AuthenticationException { - return super.authenticate(request); - - } - - @Override @SuppressWarnings("unchecked") protected UserInfo prepareAuthentication(KeycloakSecurityContext keycloakSecurityContext, HttpServletRequest httpServletRequest, - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: Created test for BucketServiceImpl
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 21c4933 Created test for BucketServiceImpl 21c4933 is described below commit 21c4933c534cc146b1fdb863cba53169201dbdb6 Author: Oleh Fuks AuthorDate: Fri Jul 31 14:54:05 2020 +0300 Created test for BucketServiceImpl --- .../epam/dlab/backendapi/resources/TestBase.java | 17 +- .../service/impl/BucketServiceImplTest.java| 262 + 2 files changed, 278 insertions(+), 1 deletion(-) diff --git a/services/self-service/src/test/java/com/epam/dlab/backendapi/resources/TestBase.java b/services/self-service/src/test/java/com/epam/dlab/backendapi/resources/TestBase.java index ea6b9cc..37395a5 100644 --- a/services/self-service/src/test/java/com/epam/dlab/backendapi/resources/TestBase.java +++ b/services/self-service/src/test/java/com/epam/dlab/backendapi/resources/TestBase.java @@ -20,8 +20,14 @@ package com.epam.dlab.backendapi.resources; import com.epam.dlab.auth.UserInfo; +import com.epam.dlab.backendapi.domain.EndpointDTO; +import com.epam.dlab.cloud.CloudProvider; import com.epam.dlab.rest.mappers.ResourceNotFoundExceptionMapper; -import io.dropwizard.auth.*; +import io.dropwizard.auth.AuthDynamicFeature; +import io.dropwizard.auth.AuthValueFactoryProvider; +import io.dropwizard.auth.AuthenticationException; +import io.dropwizard.auth.Authenticator; +import io.dropwizard.auth.Authorizer; import io.dropwizard.auth.oauth.OAuthCredentialAuthFilter; import io.dropwizard.testing.junit.ResourceTestRule; import org.glassfish.jersey.media.multipart.MultiPartFeature; @@ -38,6 +44,11 @@ public class TestBase { protected final String TOKEN = "TOKEN"; protected final String USER = "testUser"; + protected final String ENDPOINT_NAME = "local"; + protected final String ENDPOINT_URL = "http://localhost:8443/;; + protected final String ENDPOINT_ACCOUNT = "account"; + protected final String ENDPOINT_TAG = "tag"; + @SuppressWarnings("unchecked") private static Authenticator authenticator = mock(Authenticator.class); @SuppressWarnings("unchecked") @@ -74,4 +85,8 @@ public class TestBase { protected UserInfo getUserInfo() { return new UserInfo(USER, TOKEN); } + + protected EndpointDTO getEndpointDTO() { + return new EndpointDTO(ENDPOINT_NAME, ENDPOINT_URL, ENDPOINT_ACCOUNT, ENDPOINT_TAG, EndpointDTO.EndpointStatus.ACTIVE, CloudProvider.AWS); + } } diff --git a/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/BucketServiceImplTest.java b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/BucketServiceImplTest.java new file mode 100644 index 000..641100d --- /dev/null +++ b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/BucketServiceImplTest.java @@ -0,0 +1,262 @@ +/* + * 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.service.impl; + +import com.epam.dlab.backendapi.domain.EndpointDTO; +import com.epam.dlab.backendapi.resources.TestBase; +import com.epam.dlab.backendapi.service.EndpointService; +import com.epam.dlab.dto.bucket.BucketDTO; +import com.epam.dlab.dto.bucket.BucketDeleteDTO; +import com.epam.dlab.dto.bucket.FolderUploadDTO; +import com.epam.dlab.exceptions.DlabException; +import com.epam.dlab.rest.client.RESTService; +import org.apache.http.HttpStatus; +import org.glassfish.jersey.media.multipart.FormDataMultiPart; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.Response; +import java.io.ByteArrayInputStream; +import java.io.IOException; +impo
[incubator-dlab] branch develop updated: Annotated the "AccessKeyService" interface with the FunctionalInterface annotation
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new c370d06 Annotated the "AccessKeyService" interface with the FunctionalInterface annotation c370d06 is described below commit c370d065e66d5e1cf769ead97a055286ab1e8252 Author: Oleh Fuks AuthorDate: Thu Jul 30 17:54:36 2020 +0300 Annotated the "AccessKeyService" interface with the FunctionalInterface annotation --- .../main/java/com/epam/dlab/backendapi/service/AccessKeyService.java| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/AccessKeyService.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/AccessKeyService.java index c037285..2c84226 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/AccessKeyService.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/AccessKeyService.java @@ -22,7 +22,7 @@ package com.epam.dlab.backendapi.service; import com.epam.dlab.auth.UserInfo; import com.epam.dlab.backendapi.resources.dto.KeysDTO; +@FunctionalInterface public interface AccessKeyService { - KeysDTO generateKeys(UserInfo userInfo); } - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: Removed unnecessary field
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 0877072 Removed unnecessary field 0877072 is described below commit 087707210275c73a135e8789046f00c1e30b6c55 Author: Oleh Fuks AuthorDate: Thu Jul 30 17:44:58 2020 +0300 Removed unnecessary field --- .../epam/dlab/backendapi/resources/ProvisioningHealthCheckResource.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/resources/ProvisioningHealthCheckResource.java b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/resources/ProvisioningHealthCheckResource.java index e50d7ae..a46171b 100644 --- a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/resources/ProvisioningHealthCheckResource.java +++ b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/resources/ProvisioningHealthCheckResource.java @@ -34,8 +34,6 @@ import javax.ws.rs.core.Response; @Path("/healthcheck") @Produces(MediaType.APPLICATION_JSON) public class ProvisioningHealthCheckResource { -private static final String HEALTH_CHECK = "ProvisioningHealthCheck"; - @Inject private ProvisioningServiceApplicationConfiguration configuration; - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: Annotated the "CmdCommand" interface with the FunctionalInterface annotation
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new fd4ed06 Annotated the "CmdCommand" interface with the FunctionalInterface annotation fd4ed06 is described below commit fd4ed06cea27a1dbe2eadf9241383cf4275f5c47 Author: Oleh Fuks AuthorDate: Thu Jul 30 17:24:05 2020 +0300 Annotated the "CmdCommand" interface with the FunctionalInterface annotation --- .../src/main/java/com/epam/dlab/backendapi/core/commands/CmdCommand.java | 1 + 1 file changed, 1 insertion(+) diff --git a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/commands/CmdCommand.java b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/commands/CmdCommand.java index d8fb126..0adfaa9 100644 --- a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/commands/CmdCommand.java +++ b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/commands/CmdCommand.java @@ -19,6 +19,7 @@ package com.epam.dlab.backendapi.core.commands; +@FunctionalInterface public interface CmdCommand { String toCMD(); } \ No newline at end of file - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: Annotated the "MetadataHolder" interface with the @FunctionalInterface annotation
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new d288aa5 Annotated the "MetadataHolder" interface with the @FunctionalInterface annotation d288aa5 is described below commit d288aa5d3314d1244b426b7eb5f282dca1937a76 Author: Oleh Fuks AuthorDate: Thu Jul 30 17:14:12 2020 +0300 Annotated the "MetadataHolder" interface with the @FunctionalInterface annotation --- .../src/main/java/com/epam/dlab/backendapi/core/MetadataHolder.java | 1 + 1 file changed, 1 insertion(+) diff --git a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/MetadataHolder.java b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/MetadataHolder.java index 7ad52d7..defbeaf 100644 --- a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/MetadataHolder.java +++ b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/MetadataHolder.java @@ -25,6 +25,7 @@ import com.epam.dlab.dto.imagemetadata.ImageType; import java.util.Set; +@FunctionalInterface public interface MetadataHolder { Set getMetadata(ImageType metadataType); } - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: [DLAB-1916] Cluster version (#831)
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new e76e167 [DLAB-1916] Cluster version (#831) e76e167 is described below commit e76e1670ebfb4c5ee1b385d450d02753bafae2fb Author: Pavel Papou AuthorDate: Thu Jul 30 09:25:57 2020 -0400 [DLAB-1916] Cluster version (#831) [DLAB-1916] Cluster version --- .../com/epam/dlab/dto/computational/UserComputationalResource.java| 4 1 file changed, 4 insertions(+) diff --git a/services/dlab-model/src/main/java/com/epam/dlab/dto/computational/UserComputationalResource.java b/services/dlab-model/src/main/java/com/epam/dlab/dto/computational/UserComputationalResource.java index 5f131a1..aa25af4 100644 --- a/services/dlab-model/src/main/java/com/epam/dlab/dto/computational/UserComputationalResource.java +++ b/services/dlab-model/src/main/java/com/epam/dlab/dto/computational/UserComputationalResource.java @@ -67,6 +67,10 @@ public class UserComputationalResource { private int dataengineInstanceCount; @JsonProperty("instance_id") private String instanceId; + @JsonProperty("dataproc_version") + private String gcpClusterVersion; + @JsonProperty("emr_version") + private String awsClusterVersion; private int totalInstanceCount; protected List config; private Map tags; - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: Updated coverage exclusion for sonar
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 9967ea3 Updated coverage exclusion for sonar 9967ea3 is described below commit 9967ea3bf4e9d6f3b78bc22fb563a838c25ed5f3 Author: Oleh Fuks AuthorDate: Thu Jul 30 12:47:33 2020 +0300 Updated coverage exclusion for sonar --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 11afc25..c327cfc 100644 --- a/pom.xml +++ b/pom.xml @@ -66,6 +66,7 @@ **/*DAO.java, **/*DAOImpl.java, src/main/java/com/epam/dlab/dto/**, +src/main/java/com/epam/dlab/backendapi/interceptor/**, src/main/java/com/epam/dlab/backendapi/auth/**, src/main/java/com/epam/dlab/backendapi/conf/**, src/main/java/com/epam/dlab/backendapi/domain/**, - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: [DLAB-1973] Conveyed dependency for custom image
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 038682b [DLAB-1973] Conveyed dependency for custom image 038682b is described below commit 038682bfb0125fbfa5bc9f25478c17f8f378a705 Author: Oleh Fuks AuthorDate: Thu Jul 30 12:40:13 2020 +0300 [DLAB-1973] Conveyed dependency for custom image --- .../src/main/java/com/epam/dlab/dto/exploratory/LibInstallDTO.java | 5 + .../src/main/java/com/epam/dlab/model/library/Library.java | 6 ++ .../main/java/com/epam/dlab/backendapi/dao/ExploratoryLibDAO.java | 2 ++ .../epam/dlab/backendapi/service/impl/ExploratoryServiceImpl.java | 1 + 4 files changed, 14 insertions(+) diff --git a/services/dlab-model/src/main/java/com/epam/dlab/dto/exploratory/LibInstallDTO.java b/services/dlab-model/src/main/java/com/epam/dlab/dto/exploratory/LibInstallDTO.java index 78f6e89..1d670a9 100644 --- a/services/dlab-model/src/main/java/com/epam/dlab/dto/exploratory/LibInstallDTO.java +++ b/services/dlab-model/src/main/java/com/epam/dlab/dto/exploratory/LibInstallDTO.java @@ -77,4 +77,9 @@ public class LibInstallDTO { setErrorMessage(errorMessage); return this; } + + public LibInstallDTO withAddedPackages(List addedPackages) { + setAddedPackages(addedPackages); + return this; + } } diff --git a/services/dlab-model/src/main/java/com/epam/dlab/model/library/Library.java b/services/dlab-model/src/main/java/com/epam/dlab/model/library/Library.java index 0ca4562..f40521c 100644 --- a/services/dlab-model/src/main/java/com/epam/dlab/model/library/Library.java +++ b/services/dlab-model/src/main/java/com/epam/dlab/model/library/Library.java @@ -25,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; +import java.util.List; + @Data @JsonIgnoreProperties(ignoreUnknown = true) public class Library { @@ -34,6 +36,10 @@ public class Library { private final LibStatus status; @JsonProperty("error_message") private final String errorMessage; + @JsonProperty("available_versions") + private List availableVersions; + @JsonProperty("add_pkgs") + private List addedPackages; private String resourceName; private ResourceType type; diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/ExploratoryLibDAO.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/ExploratoryLibDAO.java index 7fbb47a..d96f069 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/ExploratoryLibDAO.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/ExploratoryLibDAO.java @@ -22,6 +22,7 @@ package com.epam.dlab.backendapi.dao; import com.epam.dlab.backendapi.util.DateRemoverUtil; import com.epam.dlab.dto.exploratory.LibInstallDTO; import com.epam.dlab.dto.exploratory.LibInstallStatusDTO; +import com.epam.dlab.dto.exploratory.LibStatus; import com.epam.dlab.exceptions.DlabException; import com.epam.dlab.model.ResourceType; import com.epam.dlab.model.library.Library; @@ -394,6 +395,7 @@ public class ExploratoryLibDAO extends BaseDAO { return ((List) libsDocument.getOrDefault(libFieldName, Collections.emptyList())) .stream() .map(d -> convertFromDocument(d, Library.class)) + .filter(library -> LibStatus.INVALID_VERSION != library.getStatus()) .peek(l -> l.withType(libType).withResourceName(resourceName)); } } \ No newline at end of file diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/ExploratoryServiceImpl.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/ExploratoryServiceImpl.java index 250245b..cdafb03 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/ExploratoryServiceImpl.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/ExploratoryServiceImpl.java @@ -461,6 +461,7 @@ public class ExploratoryServiceImpl implements ExploratoryService { private LibInstallDTO toLibInstallDto(Library l) { return new LibInstallDTO(l.getGroup(), l.getName(), l.getVersion()) .withStatus(String.valueOf(l.getStatus())) + .withAddedPackages(l.getAddedPackages()) .withErrorMessage(l.getErrorMessage()); } } - To unsubscribe, e-mail: commits-uns
[incubator-dlab] branch sonar updated: trigger commit
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch sonar in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/sonar by this push: new a1d4ed8 trigger commit a1d4ed8 is described below commit a1d4ed82e8a120f1e2ef786f7018cd6002929628 Author: Oleh Fuks AuthorDate: Thu Jul 30 11:17:36 2020 +0300 trigger commit --- infrastructure-provisioning/scripts/jenkins/sonar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrastructure-provisioning/scripts/jenkins/sonar.py b/infrastructure-provisioning/scripts/jenkins/sonar.py index 207ffef..afd0fdb 100644 --- a/infrastructure-provisioning/scripts/jenkins/sonar.py +++ b/infrastructure-provisioning/scripts/jenkins/sonar.py @@ -21,7 +21,7 @@ import sys import time import urllib -time.sleep(30) # wait for new code to be analyzed by SonarQube +time.sleep(30) # wait for new code to be analyzed by SonarQube# PROJECT_KEY = urllib.quote(sys.argv[1]) TOKEN = sys.argv[2] - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: Updated name of classes/interfaces
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 3dec71f Updated name of classes/interfaces 3dec71f is described below commit 3dec71f94182e11b1338e0b00932f35c878df8c7 Author: Oleh Fuks AuthorDate: Wed Jul 29 18:51:11 2020 +0300 Updated name of classes/interfaces --- .../dao/{BackupDao.java => BackupDAO.java} | 2 +- .../dao/{BackupDaoImpl.java => BackupDAOImpl.java} | 2 +- ...xploratoryDao.java => ImageExploratoryDAO.java} | 2 +- ...ryDaoImpl.java => ImageExploratoryDAOImpl.java} | 16 ++--- .../epam/dlab/backendapi/dao/ProjectDAOImpl.java | 4 +-- .../dao/{UserGroupDao.java => UserGroupDAO.java} | 4 +-- ...UserGroupDaoImpl.java => UserGroupDAOImpl.java} | 2 +- .../dao/{UserRoleDao.java => UserRoleDAO.java} | 2 +- .../{UserRoleDaoImpl.java => UserRoleDAOImpl.java} | 2 +- .../dropwizard/listeners/MongoStartupListener.java | 6 ++-- .../epam/dlab/backendapi/modules/DevModule.java| 24 ++--- .../dlab/backendapi/modules/ProductionModule.java | 24 ++--- .../backendapi/service/UserRoleServiceImpl.java| 4 +-- .../backendapi/service/impl/BackupServiceImpl.java | 4 +-- .../service/impl/BillingServiceImpl.java | 6 ++-- .../service/impl/EndpointServiceImpl.java | 6 ++-- .../service/impl/ExploratoryServiceImpl.java | 10 +++--- .../service/impl/ImageExploratoryServiceImpl.java | 38 ++-- .../impl/InfrastructureTemplateServiceImpl.java| 4 +-- .../service/impl/ProjectServiceImpl.java | 6 ++-- .../service/impl/UserGroupServiceImpl.java | 12 +++ .../service/UserRoleServiceImplTest.java | 18 +- .../service/impl/BackupServiceImplTest.java| 15 ++-- .../impl/ImageExploratoryServiceImplTest.java | 4 +-- .../InfrastructureTemplateServiceBaseTest.java | 4 +-- .../service/impl/UserGroupServiceImplTest.java | 42 +++--- 26 files changed, 140 insertions(+), 123 deletions(-) diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/BackupDao.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/BackupDAO.java similarity index 97% rename from services/self-service/src/main/java/com/epam/dlab/backendapi/dao/BackupDao.java rename to services/self-service/src/main/java/com/epam/dlab/backendapi/dao/BackupDAO.java index e48c5ea..1a2a11c 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/BackupDao.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/BackupDAO.java @@ -26,7 +26,7 @@ import com.epam.dlab.dto.backup.EnvBackupStatus; import java.util.List; import java.util.Optional; -public interface BackupDao { +public interface BackupDAO { void createOrUpdate(EnvBackupDTO dto, String user, EnvBackupStatus status); List getBackups(String userName); diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/BackupDaoImpl.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/BackupDAOImpl.java similarity index 97% rename from services/self-service/src/main/java/com/epam/dlab/backendapi/dao/BackupDaoImpl.java rename to services/self-service/src/main/java/com/epam/dlab/backendapi/dao/BackupDAOImpl.java index f1b599c..4ed2788 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/BackupDaoImpl.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/BackupDAOImpl.java @@ -34,7 +34,7 @@ import static com.mongodb.client.model.Filters.and; import static com.mongodb.client.model.Filters.eq; @Singleton -public class BackupDaoImpl extends BaseDAO implements BackupDao { +public class BackupDAOImpl extends BaseDAO implements BackupDAO { @Override public void createOrUpdate(EnvBackupDTO dto, String user, EnvBackupStatus status) { final Document idField = backupId(user, dto.getId()); diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/ImageExploratoryDao.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/ImageExploratoryDAO.java similarity index 97% rename from services/self-service/src/main/java/com/epam/dlab/backendapi/dao/ImageExploratoryDao.java rename to services/self-service/src/main/java/com/epam/dlab/backendapi/dao/ImageExploratoryDAO.java index 2665d47..9bab74d 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/ImageExploratoryDao.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/dao/ImageExploratoryDAO.java @@ -28,7 +28,7 @@ import com.epam.dlab.model.library.Library; import java.util.List; import java.util.Optional; -public interface ImageExplorator
[incubator-dlab] branch develop updated: Updated coverage exclusion for sonar
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 5b5cd54 Updated coverage exclusion for sonar new f6593b2 Merge remote-tracking branch 'origin/develop' into develop 5b5cd54 is described below commit 5b5cd540246b6792bc6a6ee8848d04a3e567e899 Author: Oleh Fuks AuthorDate: Wed Jul 29 18:38:07 2020 +0300 Updated coverage exclusion for sonar --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 5c220da..11afc25 100644 --- a/pom.xml +++ b/pom.xml @@ -64,6 +64,7 @@ **/*Exception.java, **/*DAO.java, +**/*DAOImpl.java, src/main/java/com/epam/dlab/dto/**, src/main/java/com/epam/dlab/backendapi/auth/**, src/main/java/com/epam/dlab/backendapi/conf/**, - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: Updated coverage exclusion for sonar
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 11f4441 Updated coverage exclusion for sonar 11f4441 is described below commit 11f444176d16c94e260020452f1986c2d7d2d493 Author: Oleh Fuks AuthorDate: Wed Jul 29 18:26:06 2020 +0300 Updated coverage exclusion for sonar --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 462ffc4..5c220da 100644 --- a/pom.xml +++ b/pom.xml @@ -63,6 +63,7 @@ **/*Exception.java, +**/*DAO.java, src/main/java/com/epam/dlab/dto/**, src/main/java/com/epam/dlab/backendapi/auth/**, src/main/java/com/epam/dlab/backendapi/conf/**, - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: Updated coverage exclusion for sonar
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 11f4441 Updated coverage exclusion for sonar 11f4441 is described below commit 11f444176d16c94e260020452f1986c2d7d2d493 Author: Oleh Fuks AuthorDate: Wed Jul 29 18:26:06 2020 +0300 Updated coverage exclusion for sonar --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 462ffc4..5c220da 100644 --- a/pom.xml +++ b/pom.xml @@ -63,6 +63,7 @@ **/*Exception.java, +**/*DAO.java, src/main/java/com/epam/dlab/dto/**, src/main/java/com/epam/dlab/backendapi/auth/**, src/main/java/com/epam/dlab/backendapi/conf/**, - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: [DLAB-298] Updated error message
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new 18088c6 [DLAB-298] Updated error message 18088c6 is described below commit 18088c61af756975dba84489222c765cbc5a55cf Author: Oleh Fuks AuthorDate: Wed Jul 29 18:12:35 2020 +0300 [DLAB-298] Updated error message --- .../dlab/backendapi/service/impl/MavenCentralLibraryService.java| 6 ++ .../epam/dlab/backendapi/validation/annotation/LibNameValid.java| 3 +-- .../epam/dlab/backendapi/resources/LibExploratoryResourceTest.java | 3 +-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/MavenCentralLibraryService.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/MavenCentralLibraryService.java index b7cbce8..13d0c86 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/MavenCentralLibraryService.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/MavenCentralLibraryService.java @@ -32,7 +32,6 @@ import lombok.extern.slf4j.Slf4j; import javax.inject.Inject; import java.net.URI; -import static java.lang.String.format; import static java.lang.String.join; @Singleton @@ -41,7 +40,7 @@ public class MavenCentralLibraryService implements ExternalLibraryService { private static final String QUOTE_ENCODED = "%22"; private static final String SEARCH_API_QUERY_FORMAT = "/solrsearch/select?q=%s=20=json=gav=jar"; - private static final String LIB_NOT_FOUND_MSG = "Artifact with id=%s, groupId=%s and version %s not found"; + private static final String LIB_NOT_FOUND_MSG = "No matches found"; private final RESTService restClient; @Inject @@ -63,8 +62,7 @@ public class MavenCentralLibraryService implements ExternalLibraryService { .stream() .findFirst() .map(artifact -> new LibraryDTO(join(":", groupId, artifactId), version)) - .orElseThrow(() -> new ResourceNotFoundException(format(LIB_NOT_FOUND_MSG, artifactId, groupId, - version))); + .orElseThrow(() -> new ResourceNotFoundException(LIB_NOT_FOUND_MSG)); } private String groupQuery(String groupId) { diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/validation/annotation/LibNameValid.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/validation/annotation/LibNameValid.java index 1e8be9b..fb10ed2 100644 --- a/services/self-service/src/main/java/com/epam/dlab/backendapi/validation/annotation/LibNameValid.java +++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/validation/annotation/LibNameValid.java @@ -34,8 +34,7 @@ import java.lang.annotation.Target; public @interface LibNameValid { - String message() default "Wrong library name format. Should be ::. E.g. io" + - ".dropwizard:dropwizard-core:1.3.5"; + String message() default "Wrong library name format. Should be ::"; Class[] groups() default {}; diff --git a/services/self-service/src/test/java/com/epam/dlab/backendapi/resources/LibExploratoryResourceTest.java b/services/self-service/src/test/java/com/epam/dlab/backendapi/resources/LibExploratoryResourceTest.java index e0c7ed4..f1b9810 100644 --- a/services/self-service/src/test/java/com/epam/dlab/backendapi/resources/LibExploratoryResourceTest.java +++ b/services/self-service/src/test/java/com/epam/dlab/backendapi/resources/LibExploratoryResourceTest.java @@ -441,8 +441,7 @@ public class LibExploratoryResourceTest extends TestBase { assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatus()); assertEquals(MediaType.APPLICATION_JSON, response.getHeaderString(HttpHeaders.CONTENT_TYPE)); - assertEquals("{\"errors\":[\"query param artifact Wrong library name format. Should be " + - "::. E.g. io.dropwizard:dropwizard-core:1.3.5\"]}", + assertEquals("{\"errors\":[\"query param artifact Wrong library name format. Should be ::\"]}", response.readEntity(String.class)); verifyZeroInteractions(externalLibraryService); - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated: Updated test for AccessKeyService, created test for AccessKeyService
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new dc2d3b9 Updated test for AccessKeyService, created test for AccessKeyService dc2d3b9 is described below commit dc2d3b9370302440eab409d9ca8702d02479ad87 Author: Oleh Fuks AuthorDate: Wed Jul 29 14:19:08 2020 +0300 Updated test for AccessKeyService, created test for AccessKeyService --- .../service/impl/AccessKeyServiceImplTest.java | 15 ++- .../service/impl/AuditServiceImplTest.java | 106 + 2 files changed, 118 insertions(+), 3 deletions(-) diff --git a/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/AccessKeyServiceImplTest.java b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/AccessKeyServiceImplTest.java index abd9fbb..f064c42 100644 --- a/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/AccessKeyServiceImplTest.java +++ b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/AccessKeyServiceImplTest.java @@ -23,6 +23,7 @@ import com.epam.dlab.auth.UserInfo; import com.epam.dlab.backendapi.conf.SelfServiceApplicationConfiguration; import com.epam.dlab.backendapi.resources.TestBase; import com.epam.dlab.backendapi.resources.dto.KeysDTO; +import com.epam.dlab.exceptions.DlabException; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; @@ -50,8 +51,16 @@ public class AccessKeyServiceImplTest extends TestBase { KeysDTO keysDTO = accessKeyService.generateKeys(userInfo); - assertEquals(USER.toLowerCase(), keysDTO.getUsername()); - assertNotNull(keysDTO.getPublicKey()); - assertNotNull(keysDTO.getPrivateKey()); + assertEquals("Usernames are not equal", USER.toLowerCase(), keysDTO.getUsername()); + assertNotNull("Public key is null", keysDTO.getPublicKey()); + assertNotNull("Private key is null", keysDTO.getPrivateKey()); + } + + @Test(expected = DlabException.class) + public void generateKeysWithException() { + UserInfo userInfo = getUserInfo(); + when(conf.getPrivateKeySize()).thenReturn(0); + + accessKeyService.generateKeys(userInfo); } } \ No newline at end of file diff --git a/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/AuditServiceImplTest.java b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/AuditServiceImplTest.java new file mode 100644 index 000..da0c002 --- /dev/null +++ b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/AuditServiceImplTest.java @@ -0,0 +1,106 @@ +/* + * 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.service.impl; + +import com.epam.dlab.backendapi.dao.AuditDAO; +import com.epam.dlab.backendapi.domain.AuditActionEnum; +import com.epam.dlab.backendapi.domain.AuditCreateDTO; +import com.epam.dlab.backendapi.domain.AuditDTO; +import com.epam.dlab.backendapi.domain.AuditResourceTypeEnum; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import java.util.ArrayList; +import java.util.List; + +import static org.mockito.Matchers.eq; +import static org.mockito.Matchers.refEq; +import static org.mockito.Mockito.verify; + +@RunWith(MockitoJUnitRunner.class) +public class AuditServiceImplTest { + private static final String USER = "user"; + private static final String PROJECT = "project"; + private static final String RESOURCE_NAME = "resourceName"; + private static final String INFO = "info"; + + @Mock + private AuditDAO auditDAO; + @InjectMocks + private AuditServiceImpl auditService; + + @Test + public void save() { +
[incubator-dlab] branch develop updated: Created test for AccessKeyServiceImpl
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new c586248 Created test for AccessKeyServiceImpl c586248 is described below commit c5862487a87bc8ac58b9fa6750762f5577904430 Author: Oleh Fuks AuthorDate: Tue Jul 28 18:16:26 2020 +0300 Created test for AccessKeyServiceImpl --- .../service/impl/AccessKeyServiceImplTest.java | 57 ++ 1 file changed, 57 insertions(+) diff --git a/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/AccessKeyServiceImplTest.java b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/AccessKeyServiceImplTest.java new file mode 100644 index 000..abd9fbb --- /dev/null +++ b/services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/AccessKeyServiceImplTest.java @@ -0,0 +1,57 @@ +/* + * 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.service.impl; + +import com.epam.dlab.auth.UserInfo; +import com.epam.dlab.backendapi.conf.SelfServiceApplicationConfiguration; +import com.epam.dlab.backendapi.resources.TestBase; +import com.epam.dlab.backendapi.resources.dto.KeysDTO; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class AccessKeyServiceImplTest extends TestBase { + + @Mock + private SelfServiceApplicationConfiguration conf; + + @InjectMocks + private AccessKeyServiceImpl accessKeyService; + + + @Test + public void generateKeys() { + UserInfo userInfo = getUserInfo(); + when(conf.getPrivateKeySize()).thenReturn(2048); + + KeysDTO keysDTO = accessKeyService.generateKeys(userInfo); + + assertEquals(USER.toLowerCase(), keysDTO.getUsername()); + assertNotNull(keysDTO.getPublicKey()); + assertNotNull(keysDTO.getPrivateKey()); + } +} \ No newline at end of file - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch develop updated (4d58043 -> 572981c)
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git. from 4d58043 Merge pull request #833 from apache/DLAB-1968 add 159eb9d [DLAB-1870] Intigration with sonar add 76a8249 Updated copyright add f529b0f [DLAB-1870] Intigration with sonar add dce5820 [DLAB-1870] Intigration with sonar add 0309886 [DLAB-1870] Intigration with sonar add 1b46e4c [DLAB-1870] Intigration with sonar add fab7998 [DLAB-1870] Intigration with sonar add 07b88e0 [DLAB-1870] Intigration with sonar add 4e6dc6e [DLAB-1870] Intigration with sonar add e9ea179 [DLAB-1870] Intigration with sonar add c820746 Updated copyright add cc4be26 Updated copyright add 580a5e8 Updated copyright add ca8d090 Updated pom add 223f348 Merge remote-tracking branch 'origin/sonar' into sonar add 3c743a7 Added sonar.py add 727deb6 Added sonar.py add 5335dc7 Updated sonar.py add 82c35ed Updated sonar.py add 6e404ae Updated sonar.py add 4f8b5dd Updated sonar.py add 95a6626 aaa add 55931ff Updated sonar.py add b62dd80 Updated sonar.py add 78025b3 Updated sonar.py add 5d8b9a5 Updated sonar.py add db12a91 Updated sonar.py add 840a045 Updated sonar.py new 572981c Merge branch 'sonar' into develop The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../scripts/jenkins/sonar.py | 33 ++-- .../aws/computational_resources/main/main.tf | 27 ++- .../aws/computational_resources/main/variables.tf | 21 +++ .../terraform/aws/endpoint/main/bucket.tf | 54 +++--- .../ssn-helm-charts/main/step-ca-chart/.helmignore | 21 +++ .../ssn-helm-charts/main/step-ca-chart/Chart.yaml | 23 ++- .../main/step-ca-chart/templates/_helpers.tpl | 21 +++ .../main/step-ca-chart/templates/bootstrap.yaml| 47 +++-- .../main/step-ca-chart/templates/ca.yaml | 203 - .../main/step-ca-chart/templates/configmaps.yaml | 117 +++- .../main/step-ca-chart/templates/ingress.yaml | 63 --- .../main/step-ca-chart/templates/rbac.yaml | 23 ++- .../main/step-ca-chart/templates/secrets.yaml | 21 +++ .../main/step-ca-chart/templates/service.yaml | 35 +++- .../templates/tests/test-connection.yaml | 27 ++- .../ssn-helm-charts/main/step-ca-chart/values.yaml | 25 ++- .../terraform/bin/deploy/billing_app_aws.yml | 21 +++ .../terraform/bin/deploy/billing_azure.yml | 21 +++ .../terraform/bin/deploy/billing_gcp.yml | 21 +++ .../terraform/bin/deploy/endpoint_fab.py | 29 ++- infrastructure-provisioning/terraform/bin/dlab.py | 20 +- .../terraform/bin/terraform-cli.py | 31 +++- .../terraform/gcp/endpoint/provisioning.py | 25 ++- .../terraform/gcp/main/main.tf | 29 ++- .../terraform/gcp/main/variables.tf| 21 +++ .../terraform/gcp/modules/common/iam.tf| 25 ++- .../terraform/gcp/modules/common/network.tf| 29 ++- .../terraform/gcp/modules/common/variables.tf | 21 +++ .../terraform/gcp/modules/data_engine/instance.tf | 28 ++- .../terraform/gcp/modules/data_engine/variables.tf | 21 +++ .../terraform/gcp/modules/dataproc/instance.tf | 83 + .../terraform/gcp/modules/dataproc/variables.tf| 21 +++ .../terraform/gcp/modules/notebook/instance.tf | 23 ++- .../terraform/gcp/modules/notebook/variables.tf| 21 +++ .../helm_charts/files/get_configmap_values.sh | 21 +++ .../modules/helm_charts/step-ca-chart/.helmignore | 21 +++ .../modules/helm_charts/step-ca-chart/Chart.yaml | 23 ++- .../step-ca-chart/templates/_helpers.tpl | 21 +++ .../step-ca-chart/templates/bootstrap.yaml | 47 +++-- .../helm_charts/step-ca-chart/templates/ca.yaml| 203 - .../step-ca-chart/templates/configmaps.yaml| 117 +++- .../step-ca-chart/templates/ingress.yaml | 62 --- .../helm_charts/step-ca-chart/templates/rbac.yaml | 23 ++- .../step-ca-chart/templates/secrets.yaml | 21 +++ .../step-ca-chart/templates/service.yaml | 35 +++- .../templates/tests/test-connection.yaml | 27 ++- .../modules/helm_charts/step-ca-chart/values.yaml | 25 ++- .../dlab/login/resources/css/login.css | 19 ++ .../keycloak-theme/dlab/login/theme.properties | 33 ++-- integration-tests-cucumber/pom.xml | 19 ++ .../main/java/org/apache/dlab/dto/EndpointDTO.java | 19 ++ .../java/o
[incubator-dlab] 01/01: Merge branch 'sonar' into develop
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git commit 572981c39df453eaaad8cced8139f7de2ae4e41e Merge: 4d58043 840a045 Author: Oleh Fuks AuthorDate: Tue Jul 28 16:21:23 2020 +0300 Merge branch 'sonar' into develop .../scripts/jenkins/sonar.py | 36 .../aws/computational_resources/main/main.tf | 27 ++- .../aws/computational_resources/main/variables.tf | 21 +++ .../terraform/aws/endpoint/main/bucket.tf | 54 +++--- .../ssn-helm-charts/main/step-ca-chart/.helmignore | 21 +++ .../ssn-helm-charts/main/step-ca-chart/Chart.yaml | 23 ++- .../main/step-ca-chart/templates/_helpers.tpl | 21 +++ .../main/step-ca-chart/templates/bootstrap.yaml| 47 +++-- .../main/step-ca-chart/templates/ca.yaml | 203 - .../main/step-ca-chart/templates/configmaps.yaml | 117 +++- .../main/step-ca-chart/templates/ingress.yaml | 63 --- .../main/step-ca-chart/templates/rbac.yaml | 23 ++- .../main/step-ca-chart/templates/secrets.yaml | 21 +++ .../main/step-ca-chart/templates/service.yaml | 35 +++- .../templates/tests/test-connection.yaml | 27 ++- .../ssn-helm-charts/main/step-ca-chart/values.yaml | 25 ++- .../terraform/bin/deploy/billing_app_aws.yml | 21 +++ .../terraform/bin/deploy/billing_azure.yml | 21 +++ .../terraform/bin/deploy/billing_gcp.yml | 21 +++ .../terraform/bin/deploy/endpoint_fab.py | 29 ++- infrastructure-provisioning/terraform/bin/dlab.py | 20 +- .../terraform/bin/terraform-cli.py | 31 +++- .../terraform/gcp/endpoint/provisioning.py | 25 ++- .../terraform/gcp/main/main.tf | 29 ++- .../terraform/gcp/main/variables.tf| 21 +++ .../terraform/gcp/modules/common/iam.tf| 25 ++- .../terraform/gcp/modules/common/network.tf| 29 ++- .../terraform/gcp/modules/common/variables.tf | 21 +++ .../terraform/gcp/modules/data_engine/instance.tf | 28 ++- .../terraform/gcp/modules/data_engine/variables.tf | 21 +++ .../terraform/gcp/modules/dataproc/instance.tf | 83 + .../terraform/gcp/modules/dataproc/variables.tf| 21 +++ .../terraform/gcp/modules/notebook/instance.tf | 23 ++- .../terraform/gcp/modules/notebook/variables.tf| 21 +++ .../helm_charts/files/get_configmap_values.sh | 21 +++ .../modules/helm_charts/step-ca-chart/.helmignore | 21 +++ .../modules/helm_charts/step-ca-chart/Chart.yaml | 23 ++- .../step-ca-chart/templates/_helpers.tpl | 21 +++ .../step-ca-chart/templates/bootstrap.yaml | 47 +++-- .../helm_charts/step-ca-chart/templates/ca.yaml| 203 - .../step-ca-chart/templates/configmaps.yaml| 117 +++- .../step-ca-chart/templates/ingress.yaml | 62 --- .../helm_charts/step-ca-chart/templates/rbac.yaml | 23 ++- .../step-ca-chart/templates/secrets.yaml | 21 +++ .../step-ca-chart/templates/service.yaml | 35 +++- .../templates/tests/test-connection.yaml | 27 ++- .../modules/helm_charts/step-ca-chart/values.yaml | 25 ++- .../dlab/login/resources/css/login.css | 19 ++ .../keycloak-theme/dlab/login/theme.properties | 33 ++-- integration-tests-cucumber/pom.xml | 19 ++ .../main/java/org/apache/dlab/dto/EndpointDTO.java | 19 ++ .../java/org/apache/dlab/mongo/MongoDBHelper.java | 19 ++ .../java/org/apache/dlab/util/JacksonMapper.java | 19 ++ .../java/org/apache/dlab/util/PropertyHelper.java | 19 ++ .../src/test/java/dlab/Constants.java | 19 ++ .../src/test/java/dlab/RunCucumberTest.java| 19 ++ .../src/test/java/dlab/endpoint/EndpointSteps.java | 19 ++ .../src/test/java/dlab/login/LoginSteps.java | 19 ++ .../src/test/resources/config.properties | 18 ++ .../src/test/resources/dlab/endpoint.feature | 18 ++ .../src/test/resources/dlab/login.feature | 18 ++ .../test_templates/rstudio/template_preparation.r | 17 ++ .../rstudio/template_visualization.r | 17 ++ pom.xml| 40 +++- .../main/java/com/epam/dlab/BillingService.java| 1 + .../billing-aws/src/main/resources/application.yml | 21 +++ .../src/main/resources/application.yml | 21 +++ services/billing-gcp/billing.yml | 21 +++ .../billing/gcp/dao/impl/BigQueryBillingDAO.java | 11 +- .../dlab/billing/gcp/model/BillingHistory.java | 19 ++ .../gcp/repository/BillingHistoryRepository.java | 19 ++ .../billing-gcp/src/main/resources/application.yml | 21 +++ .../dlab/auth/conf/AzureLoginConfiguration.java| 39 .../epam/dlab/auth/conf/GcpLoginConfiguration.java | 33
[incubator-dlab] branch sonar updated: Updated sonar.py
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch sonar in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/sonar by this push: new 840a045 Updated sonar.py 840a045 is described below commit 840a045bf479d32821897ea907cc026e057940c3 Author: Oleh Fuks AuthorDate: Mon Jul 27 11:41:22 2020 +0300 Updated sonar.py --- infrastructure-provisioning/scripts/jenkins/sonar.py | 1 - 1 file changed, 1 deletion(-) diff --git a/infrastructure-provisioning/scripts/jenkins/sonar.py b/infrastructure-provisioning/scripts/jenkins/sonar.py index 464b7c2..207ffef 100644 --- a/infrastructure-provisioning/scripts/jenkins/sonar.py +++ b/infrastructure-provisioning/scripts/jenkins/sonar.py @@ -24,7 +24,6 @@ import urllib time.sleep(30) # wait for new code to be analyzed by SonarQube PROJECT_KEY = urllib.quote(sys.argv[1]) -print(PROJECT_KEY) TOKEN = sys.argv[2] - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch sonar updated: Updated sonar.py
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch sonar in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/sonar by this push: new db12a91 Updated sonar.py db12a91 is described below commit db12a91d7f923698b00f1b53b6fb8020eac88454 Author: Oleh Fuks AuthorDate: Mon Jul 27 11:36:17 2020 +0300 Updated sonar.py --- infrastructure-provisioning/scripts/jenkins/sonar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/infrastructure-provisioning/scripts/jenkins/sonar.py b/infrastructure-provisioning/scripts/jenkins/sonar.py index 716b3d5..464b7c2 100644 --- a/infrastructure-provisioning/scripts/jenkins/sonar.py +++ b/infrastructure-provisioning/scripts/jenkins/sonar.py @@ -19,11 +19,11 @@ import requests import sys import time -import urllib.parse +import urllib time.sleep(30) # wait for new code to be analyzed by SonarQube -PROJECT_KEY = urllib.parse.quote(sys.argv[1]) +PROJECT_KEY = urllib.quote(sys.argv[1]) print(PROJECT_KEY) TOKEN = sys.argv[2] - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch sonar updated: Updated sonar.py
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch sonar in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/sonar by this push: new 5d8b9a5 Updated sonar.py 5d8b9a5 is described below commit 5d8b9a54827ca7c064d01c3fca1622eca18105d2 Author: Oleh Fuks AuthorDate: Mon Jul 27 11:29:46 2020 +0300 Updated sonar.py --- infrastructure-provisioning/scripts/jenkins/sonar.py | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/infrastructure-provisioning/scripts/jenkins/sonar.py b/infrastructure-provisioning/scripts/jenkins/sonar.py index fbb55f6..716b3d5 100644 --- a/infrastructure-provisioning/scripts/jenkins/sonar.py +++ b/infrastructure-provisioning/scripts/jenkins/sonar.py @@ -19,13 +19,19 @@ import requests import sys import time +import urllib.parse time.sleep(30) # wait for new code to be analyzed by SonarQube -PROJECT_KEY = 'com.epam.dlab%3Adlab' -TOKEN = sys.argv[1] +PROJECT_KEY = urllib.parse.quote(sys.argv[1]) +print(PROJECT_KEY) +TOKEN = sys.argv[2] -response = requests.get('http://localhost:9000/sonar/api/qualitygates/project_status?projectKey=' + PROJECT_KEY, -auth=(TOKEN, '')).json() -print(response['projectStatus']['status']) +def get_sonarqube_status(): +response = requests.get('http://localhost:9000/sonar/api/qualitygates/project_status?projectKey=' + PROJECT_KEY, +auth=(TOKEN, '')).json() +return response['projectStatus']['status'] + + +print(get_sonarqube_status()) - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch sonar updated: Updated sonar.py
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch sonar in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/sonar by this push: new 78025b3 Updated sonar.py 78025b3 is described below commit 78025b3f5575008056f52b861f3c7172566b0bd6 Author: Oleh Fuks AuthorDate: Mon Jul 27 11:09:22 2020 +0300 Updated sonar.py --- infrastructure-provisioning/scripts/jenkins/sonar.py | 4 1 file changed, 4 insertions(+) diff --git a/infrastructure-provisioning/scripts/jenkins/sonar.py b/infrastructure-provisioning/scripts/jenkins/sonar.py index 52faca6..fbb55f6 100644 --- a/infrastructure-provisioning/scripts/jenkins/sonar.py +++ b/infrastructure-provisioning/scripts/jenkins/sonar.py @@ -15,8 +15,12 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. + import requests import sys +import time + +time.sleep(30) # wait for new code to be analyzed by SonarQube PROJECT_KEY = 'com.epam.dlab%3Adlab' TOKEN = sys.argv[1] - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] branch sonar updated: Updated sonar.py
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch sonar in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/sonar by this push: new b62dd80 Updated sonar.py b62dd80 is described below commit b62dd805047c4e2ce1178ae30d8a0daf071ec223 Author: Oleh Fuks AuthorDate: Fri Jul 24 18:56:45 2020 +0300 Updated sonar.py --- infrastructure-provisioning/scripts/jenkins/sonar.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/infrastructure-provisioning/scripts/jenkins/sonar.py b/infrastructure-provisioning/scripts/jenkins/sonar.py index 3b68dd5..52faca6 100644 --- a/infrastructure-provisioning/scripts/jenkins/sonar.py +++ b/infrastructure-provisioning/scripts/jenkins/sonar.py @@ -16,9 +16,10 @@ # specific language governing permissions and limitations # under the License. import requests +import sys PROJECT_KEY = 'com.epam.dlab%3Adlab' -TOKEN = 'ca50bcc08f84b90c0324d2e04dcee5f9c5034e67' +TOKEN = sys.argv[1] response = requests.get('http://localhost:9000/sonar/api/qualitygates/project_status?projectKey=' + PROJECT_KEY, auth=(TOKEN, '')).json() - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org
[incubator-dlab] 02/02: Updated sonar.py
This is an automated email from the ASF dual-hosted git repository. ofuks pushed a commit to branch sonar in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git commit 55931ffd98feeb07e6f477e81680affee3fd4b21 Author: Oleh Fuks AuthorDate: Fri Jul 24 18:43:55 2020 +0300 Updated sonar.py --- infrastructure-provisioning/scripts/jenkins/sonar.py | 8 1 file changed, 8 insertions(+) diff --git a/infrastructure-provisioning/scripts/jenkins/sonar.py b/infrastructure-provisioning/scripts/jenkins/sonar.py index d3e4649..3b68dd5 100644 --- a/infrastructure-provisioning/scripts/jenkins/sonar.py +++ b/infrastructure-provisioning/scripts/jenkins/sonar.py @@ -15,4 +15,12 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +import requests +PROJECT_KEY = 'com.epam.dlab%3Adlab' +TOKEN = 'ca50bcc08f84b90c0324d2e04dcee5f9c5034e67' + +response = requests.get('http://localhost:9000/sonar/api/qualitygates/project_status?projectKey=' + PROJECT_KEY, +auth=(TOKEN, '')).json() + +print(response['projectStatus']['status']) - To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org