You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sdap.apache.org by ea...@apache.org on 2020/06/25 21:09:06 UTC

[incubator-sdap-nexus] branch climatology created (now edc6497)

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

eamonford pushed a change to branch climatology
in repository https://gitbox.apache.org/repos/asf/incubator-sdap-nexus.git.


      at edc6497  wip

This branch includes the following new commits:

     new edc6497  wip

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.



[incubator-sdap-nexus] 01/01: wip

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

eamonford pushed a commit to branch climatology
in repository https://gitbox.apache.org/repos/asf/incubator-sdap-nexus.git

commit edc64975f6be853c7a556283195b3abf93bc79c2
Author: Eamon Ford <ea...@jpl.nasa.gov>
AuthorDate: Mon Mar 23 09:30:15 2020 -0700

    wip
---
 data-access/nexustiles/dao/SolrProxy.py | 14 +++++++-------
 data-access/nexustiles/nexustiles.py    |  6 +++---
 docker/nexus-webapp/Dockerfile          | 10 +++++-----
 helm/templates/webapp.yaml              |  2 +-
 4 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/data-access/nexustiles/dao/SolrProxy.py b/data-access/nexustiles/dao/SolrProxy.py
index 0a36707..058f777 100644
--- a/data-access/nexustiles/dao/SolrProxy.py
+++ b/data-access/nexustiles/dao/SolrProxy.py
@@ -281,7 +281,7 @@ class SolrProxy(object):
             ]
         }
 
-        if 0 < start_time <= end_time:
+        if 0 <= start_time <= end_time:
             search_start_s = datetime.utcfromtimestamp(start_time).strftime(SOLR_FORMAT)
             search_end_s = datetime.utcfromtimestamp(end_time).strftime(SOLR_FORMAT)
 
@@ -313,7 +313,7 @@ class SolrProxy(object):
             ]
         }
 
-        if 0 < start_time <= end_time:
+        if 0 <= start_time <= end_time:
             search_start_s = datetime.utcfromtimestamp(start_time).strftime(SOLR_FORMAT)
             search_end_s = datetime.utcfromtimestamp(end_time).strftime(SOLR_FORMAT)
 
@@ -345,7 +345,7 @@ class SolrProxy(object):
             ]
         }
 
-        if 0 < start_time <= end_time:
+        if 0 <= start_time <= end_time:
             search_start_s = datetime.utcfromtimestamp(start_time).strftime(SOLR_FORMAT)
             search_end_s = datetime.utcfromtimestamp(end_time).strftime(SOLR_FORMAT)
 
@@ -382,7 +382,7 @@ class SolrProxy(object):
             'facet.mincount': 1
         }
 
-        if 0 < start_time <= end_time:
+        if 0 <= start_time <= end_time:
             search_start_s = datetime.utcfromtimestamp(start_time).strftime(SOLR_FORMAT)
             search_end_s = datetime.utcfromtimestamp(end_time).strftime(SOLR_FORMAT)
 
@@ -419,7 +419,7 @@ class SolrProxy(object):
             ]
         }
 
-        if 0 < start_time <= end_time:
+        if 0 <= start_time <= end_time:
             search_start_s = datetime.utcfromtimestamp(start_time).strftime(SOLR_FORMAT)
             search_end_s = datetime.utcfromtimestamp(end_time).strftime(SOLR_FORMAT)
 
@@ -551,7 +551,7 @@ class SolrProxy(object):
             'fq': metadata
         }
 
-        if 0 < start_time <= end_time:
+        if 0 <= start_time <= end_time:
             additionalparams['fq'].append(self.get_formatted_time_clause(start_time, end_time))
 
         self._merge_kwargs(additionalparams, **kwargs)
@@ -598,7 +598,7 @@ class SolrProxy(object):
             min_lon, min_lat, max_lon, max_lat = bounding_polygon.bounds
             additionalparams['fq'].append("geo:[%s,%s TO %s,%s]" % (min_lat, min_lon, max_lat, max_lon))
 
-        if 0 < start_time <= end_time:
+        if 0 <= start_time <= end_time:
             additionalparams['fq'].append(self.get_formatted_time_clause(start_time, end_time))
 
         if metadata:
diff --git a/data-access/nexustiles/nexustiles.py b/data-access/nexustiles/nexustiles.py
index 81f086f..334d9f5 100644
--- a/data-access/nexustiles/nexustiles.py
+++ b/data-access/nexustiles/nexustiles.py
@@ -219,7 +219,7 @@ class NexusTileService(object):
                                  **kwargs):
         tiles = self.find_tiles_in_box(min_lat, max_lat, min_lon, max_lon, ds, start_time, end_time, **kwargs)
         tiles = self.mask_tiles_to_bbox(min_lat, max_lat, min_lon, max_lon, tiles)
-        if 0 < start_time <= end_time:
+        if 0 <= start_time <= end_time:
             tiles = self.mask_tiles_to_time_range(start_time, end_time, tiles)
 
         return tiles
@@ -227,7 +227,7 @@ class NexusTileService(object):
     def get_tiles_bounded_by_polygon(self, polygon, ds=None, start_time=0, end_time=-1, **kwargs):
         tiles = self.find_tiles_in_polygon(polygon, ds, start_time, end_time, **kwargs)
         tiles = self.mask_tiles_to_polygon(polygon, tiles)
-        if 0 < start_time <= end_time:
+        if 0 <= start_time <= end_time:
             tiles = self.mask_tiles_to_time_range(start_time, end_time, tiles)
 
         return tiles
@@ -362,7 +362,7 @@ class NexusTileService(object):
         :param tiles: List of tiles
         :return: A list tiles with data masked to specified time range
         """
-        if 0 < start_time <= end_time:
+        if 0 <= start_time <= end_time:
             for tile in tiles:
                 tile.times = ma.masked_outside(tile.times, start_time, end_time)
 
diff --git a/docker/nexus-webapp/Dockerfile b/docker/nexus-webapp/Dockerfile
index f4e206a..7ed7138 100644
--- a/docker/nexus-webapp/Dockerfile
+++ b/docker/nexus-webapp/Dockerfile
@@ -18,6 +18,10 @@ FROM nexusjpl/alpine-pyspark:2.4.4
 MAINTAINER Apache SDAP "dev@sdap.apache.org"
 
 
+ARG CONDA_VERSION="4.7.12.1"
+ARG CONDA_MD5="81c773ff87af5cfac79ab862942ab6b3"
+ARG CONDA_DIR="/opt/conda"
+
 ENV PYTHONPATH=${PYTHONPATH}:/opt/spark/python:/opt/spark/python/lib/py4j-0.10.7-src.zip:/opt/spark/python/lib/pyspark.zip/python:/usr/lib \
     NEXUS_SRC=/tmp/incubator-sdap-nexus \
     PROJ_LIB=/opt/conda/lib/python2.7/site-packages/pyproj/data	\
@@ -52,10 +56,6 @@ RUN apk --no-cache add wget zlib && \
     ln -s /lib/libc.musl-x86_64.so.1 /usr/glibc-compat/lib && \
     ln -s /usr/lib/libgcc_s.so.1 /usr/glibc-compat/lib
 
-ARG CONDA_VERSION="4.7.12.1"
-ARG CONDA_MD5="81c773ff87af5cfac79ab862942ab6b3"
-ARG CONDA_DIR="/opt/conda"
-
 COPY docker/nexus-webapp/install_conda.sh ./install_conda.sh
 RUN /tmp/install_conda.sh 
 
@@ -68,7 +68,7 @@ RUN cd /usr/lib && ln -s libcom_err.so.2 libcom_err.so.3 && \
     ln -s libjpeg.so.9 libjpeg.so.8
 
 # Change REBUILD_CODE if you want tell Docker not to use cached layers from this line on
-ARG REBUILD_CODE=0
+ARG REBUILD_CODE=1
 
 ARG APACHE_NEXUSPROTO=https://github.com/apache/incubator-sdap-nexusproto.git
 ARG APACHE_NEXUSPROTO_BRANCH=master
diff --git a/helm/templates/webapp.yaml b/helm/templates/webapp.yaml
index 2c08bf3..377fad6 100644
--- a/helm/templates/webapp.yaml
+++ b/helm/templates/webapp.yaml
@@ -7,7 +7,7 @@ spec:
   pythonVersion: "2"
   mode: cluster
   image: {{ .Values.webapp.distributed.image }}
-  imagePullPolicy: Always 
+  imagePullPolicy: IfNotPresent
   mainApplicationFile: local:///incubator-sdap-nexus/analysis/webservice/webapp.py
   sparkVersion: "2.4.4"
   restartPolicy: