You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datalab.apache.org by my...@apache.org on 2021/08/03 07:51:13 UTC

[incubator-datalab] branch DATALAB-2409 updated (9b6b3a7 -> 25ea16a)

This is an automated email from the ASF dual-hosted git repository.

mykolabodnar pushed a change to branch DATALAB-2409
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git.


    from 9b6b3a7  [DATALAB-2409] - [AWS] SSN configuration script refactored
     new ef5d4e8  [DATALAB-2409] -logging refactored
     new 00fa900  [DATALAB-2409] -logging refactored
     new 25ea16a  [DATALAB-2409] -logging refactored

The 3 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:
 .../src/general/lib/os/fab.py                      | 11 -----------
 .../nginx.conf => src/general/lib/os/logger.py}    | 23 ++++++++++------------
 .../src/general/scripts/aws/ssn_configure.py       |  9 +--------
 .../src/general/scripts/aws/ssn_prepare.py         |  2 +-
 4 files changed, 12 insertions(+), 33 deletions(-)
 copy infrastructure-provisioning/{scripts/deploy_keycloak/templates/nginx.conf => src/general/lib/os/logger.py} (64%)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org


[incubator-datalab] 02/03: [DATALAB-2409] -logging refactored

Posted by my...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mykolabodnar pushed a commit to branch DATALAB-2409
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git

commit 00fa900d0d8cba3adc809d239d9b32455c03adbd
Author: bodnarmykola <bo...@gmail.com>
AuthorDate: Tue Aug 3 10:50:33 2021 +0300

    [DATALAB-2409] -logging refactored
---
 infrastructure-provisioning/src/general/scripts/aws/ssn_configure.py | 2 +-
 infrastructure-provisioning/src/general/scripts/aws/ssn_prepare.py   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/infrastructure-provisioning/src/general/scripts/aws/ssn_configure.py b/infrastructure-provisioning/src/general/scripts/aws/ssn_configure.py
index d5101b1..cc3fa84 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/ssn_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/ssn_configure.py
@@ -26,7 +26,7 @@ import datalab.fab
 import datalab.meta_lib
 import datalab.ssn_lib
 import json
-import logging
+import logger
 import os
 import sys
 import traceback
diff --git a/infrastructure-provisioning/src/general/scripts/aws/ssn_prepare.py b/infrastructure-provisioning/src/general/scripts/aws/ssn_prepare.py
index 1a10b7b..c1ef836 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/ssn_prepare.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/ssn_prepare.py
@@ -25,7 +25,7 @@ import datalab.fab
 import datalab.actions_lib
 import datalab.meta_lib
 import json
-import logging
+import logger
 import os
 import sys
 import traceback

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org


[incubator-datalab] 01/03: [DATALAB-2409] -logging refactored

Posted by my...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mykolabodnar pushed a commit to branch DATALAB-2409
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git

commit ef5d4e822d212ce31d924b7cf9c241aaf27b7602
Author: bodnarmykola <bo...@gmail.com>
AuthorDate: Tue Aug 3 10:49:33 2021 +0300

    [DATALAB-2409] -logging refactored
---
 .../src/general/lib/os/fab.py                      | 11 --------
 .../src/general/lib/os/logger.py                   | 32 ++++++++++++++++++++++
 2 files changed, 32 insertions(+), 11 deletions(-)

diff --git a/infrastructure-provisioning/src/general/lib/os/fab.py b/infrastructure-provisioning/src/general/lib/os/fab.py
index 68f9c3a..cf33332 100644
--- a/infrastructure-provisioning/src/general/lib/os/fab.py
+++ b/infrastructure-provisioning/src/general/lib/os/fab.py
@@ -22,7 +22,6 @@
 import csv
 import datetime
 import json
-import logging
 import os
 import random
 import re
@@ -38,16 +37,6 @@ from fabric import *
 from patchwork.files import exists
 from patchwork import files
 
-local_log_filename = "{}_{}.log".format(os.environ['conf_resource'], os.environ['request_id'])
-local_log_filepath = "/logs/" + os.environ['conf_resource'] + "/" + local_log_filename
-logging.basicConfig(format='%(levelname)-8s [%(asctime)s]  %(message)s',
-                    level=logging.DEBUG,
-                    filename='{}'.format(local_log_filepath),
-                    filemode='w')
-console = logging.StreamHandler()
-console.setLevel(logging.INFO)
-logging.getLogger('').addHandler(console)
-
 def ensure_python_venv(python_venv_version):
     try:
         if not exists(conn, '/opt/python/python{}'.format(python_venv_version)):
diff --git a/infrastructure-provisioning/src/general/lib/os/logger.py b/infrastructure-provisioning/src/general/lib/os/logger.py
new file mode 100644
index 0000000..ad7c3b5
--- /dev/null
+++ b/infrastructure-provisioning/src/general/lib/os/logger.py
@@ -0,0 +1,32 @@
+# *****************************************************************************
+#
+# 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.
+#
+# ******************************************************************************
+
+import logging
+
+local_log_filename = "{}_{}.log".format(os.environ['conf_resource'], os.environ['request_id'])
+local_log_filepath = "/logs/" + os.environ['conf_resource'] + "/" + local_log_filename
+logging.basicConfig(format='%(levelname)-8s [%(asctime)s]  %(message)s',
+                    level=logging.DEBUG,
+                    filename='{}'.format(local_log_filepath),
+                    filemode='w')
+console = logging.StreamHandler()
+console.setLevel(logging.INFO)
+logging.getLogger('').addHandler(console)
\ No newline at end of file

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org


[incubator-datalab] 03/03: [DATALAB-2409] -logging refactored

Posted by my...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mykolabodnar pushed a commit to branch DATALAB-2409
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git

commit 25ea16a68c4e6b2774d2bf8e934cbfd4f5206e56
Author: bodnarmykola <bo...@gmail.com>
AuthorDate: Tue Aug 3 10:51:00 2021 +0300

    [DATALAB-2409] -logging refactored
---
 .../src/general/scripts/aws/ssn_configure.py                       | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/infrastructure-provisioning/src/general/scripts/aws/ssn_configure.py b/infrastructure-provisioning/src/general/scripts/aws/ssn_configure.py
index cc3fa84..30bffcf 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/ssn_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/ssn_configure.py
@@ -42,13 +42,6 @@ def cleanup_aws_resources(tag_name, service_base_name):
         raise Exception
 
 if __name__ == "__main__":
-    #configuring logs
-    local_log_filename = "{}_{}.log".format(os.environ['conf_resource'], os.environ['request_id'])
-    local_log_filepath = "/logs/" + os.environ['conf_resource'] + "/" + local_log_filename
-    logging.basicConfig(format='%(levelname)-8s [%(asctime)s]  %(message)s',
-                        level=logging.DEBUG,
-                        handlers=[logging.StreamHandler(), logging.FileHandler(local_log_filepath)])
-
     # deriving variables for ssn node deployment
     try:
         logging.info('[DERIVING NAMES]')

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org