You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sdap.apache.org by tl...@apache.org on 2020/08/05 01:32:10 UTC

[incubator-sdap-ingester] branch SDAP-266 updated (d852221 -> 5615e92)

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

tloubrieu pushed a change to branch SDAP-266
in repository https://gitbox.apache.org/repos/asf/incubator-sdap-ingester.git.


 discard d852221  add READNE note on synchronization of configmap with local path
     add c599caf  SDAP-271 Cassandra authentication support (#11)
     new 5615e92  add READNE note on synchronization of configmap with local path

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (d852221)
            \
             N -- N -- N   refs/heads/SDAP-266 (5615e92)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

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:
 granule_ingester/docker/entrypoint.sh              |  2 ++
 .../granule_ingester/exceptions/Exceptions.py      | 41 ++++++++++++++++++++++
 .../granule_ingester/exceptions/__init__.py        | 11 ++++++
 granule_ingester/granule_ingester/main.py          | 30 ++++++++++++----
 .../granule_ingester/writers/CassandraStore.py     | 39 ++++++++++++++------
 5 files changed, 106 insertions(+), 17 deletions(-)
 create mode 100644 granule_ingester/granule_ingester/exceptions/Exceptions.py
 create mode 100644 granule_ingester/granule_ingester/exceptions/__init__.py


[incubator-sdap-ingester] 01/01: add READNE note on synchronization of configmap with local path

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

tloubrieu pushed a commit to branch SDAP-266
in repository https://gitbox.apache.org/repos/asf/incubator-sdap-ingester.git

commit 5615e921eb9e67d56efeec532bf80117bf493b66
Author: thomas loubrieu <th...@jpl.nasa.gov>
AuthorDate: Tue Aug 4 18:29:56 2020 -0700

    add READNE note on synchronization of configmap with local path
---
 config_operator/README.md               | 14 ++++++++++++--
 config_operator/config_operator/main.py | 17 ++++++++++-------
 2 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/config_operator/README.md b/config_operator/README.md
index 5f02804..d102d10 100644
--- a/config_operator/README.md
+++ b/config_operator/README.md
@@ -2,13 +2,23 @@
 
 ## Purpose
 
-Component which synchonizes local configuration in a directory, on a file system, or configuration files managed in a git repository with kubernetes configMap.
-This helps to make a configuration managed by the operators in a single place (git, host file system) available in the kubernetes cluster.
+Component which synchonizes configuration in a remote **GIT** repository with kubernetes configMap.
+This helps to make a configuration managed by the operators in a single place (git) available in the kubernetes cluster.
 
 For SDAP, it is used to make the configuration of the collections to be ingested available to the ingester service pods.
 
 The component runs as a kubernetes operator (see containerization section)
 
+To synchronize a configuration from a **local directory** on kubernetes hosts, you should use the following commands:
+
+    kubectl create configmap collections-config --from-file=/opt/sdap-collection-config/  -n <namespace> 
+    
+To update the configmap from the same directory run:
+
+    kubectl create configmap collections-config --from-file=/opt/sdap-collection-config/ -o yaml --dry-run | kubectl replace -n <namespace> -f -
+    
+
+
 # Developers
 
     git clone ...
diff --git a/config_operator/config_operator/main.py b/config_operator/config_operator/main.py
index 45d530f..fbbbe6b 100644
--- a/config_operator/config_operator/main.py
+++ b/config_operator/config_operator/main.py
@@ -1,14 +1,16 @@
 import logging
 import asyncio
 import kopf
-from config_operator.config_source import RemoteGitConfig
+from config_operator.config_source import RemoteGitConfig, LocalDirConfig
 from config_operator.k8s import K8sConfigMap
 
 logging.basicConfig(level=logging.INFO)
 logger = logging.getLogger(__name__)
 
 
-def create_config_synchronizer(spec, namespace):
+UPDATE_EVERY_SECOND_PROPERTY = 'update-every-seconds'
+
+def create_git_config_synchronizer(spec, namespace):
     if 'git-url' not in spec.keys():
         raise kopf.HandlerFatalError(f"git-url must be set.")
     if 'config-map' not in spec.keys():
@@ -20,7 +22,7 @@ def create_config_synchronizer(spec, namespace):
     logger.info(f'config-map = {config_map}')
 
     _kwargs = {}
-    for k in {'git-branch', 'git-username', 'git-token', 'update-every-seconds'}:
+    for k in {'git-branch', 'git-username', 'git-token', UPDATE_EVERY_SECOND_PROPERTY}:
         if k in spec:
             logger.info(f'{k} = {spec[k]}')
             _kwargs[k.replace('-', '_')] = spec[k]
@@ -38,24 +40,25 @@ def create_config_synchronizer(spec, namespace):
 
 @kopf.on.create('sdap.apache.org', 'v1', 'gitbasedconfigs')
 def create_fn(body, spec, **kwargs):
-    logger.info(f'sdap config operator creation')
+    logger.info(f'sdap git config operator creation')
 
     namespace = body['metadata']['namespace']
 
     msg = create_config_synchronizer(spec, namespace)
 
-    logger.info(f'sdap config operator created {msg}')
+    logger.info(f'sdap git config operator created {msg}')
 
     return {'message': msg}
 
 
+
 @kopf.on.update('sdap.apache.org', 'v1', 'gitbasedconfigs')
 def update_fn(spec, status, namespace, **kwargs):
-    logger.info(f'sdap config operator update')
+    logger.info(f'sdap git config operator update')
 
     msg = create_config_synchronizer(spec, namespace)
 
-    logger.info(f'sdap config operator updated {msg}')
+    logger.info(f'sdap local config operator updated {msg}')
 
     return {'message': msg}