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

rkk pushed a commit to branch SDAP-532
in repository https://gitbox.apache.org/repos/asf/sdap-nexus.git

commit c83fa758bbf48bf54e8d66b7a92307e9e682e6f9
Author: rileykk <[email protected]>
AuthorDate: Tue Dec 17 15:25:04 2024 -0800

    GDAL install initial implementation
---
 docker/nexus-webapp/Dockerfile      | 18 +++++----
 docker/nexus-webapp/install_gdal.sh | 74 +++++++++++++++++++++++++++++++++++++
 tools/build/build.py                |  2 +-
 3 files changed, 86 insertions(+), 8 deletions(-)

diff --git a/docker/nexus-webapp/Dockerfile b/docker/nexus-webapp/Dockerfile
index ae4d51c..770b655 100644
--- a/docker/nexus-webapp/Dockerfile
+++ b/docker/nexus-webapp/Dockerfile
@@ -15,6 +15,8 @@
 
 FROM eclipse-temurin:8
 
+ENV LD_LIBRARY_PATH="/usr/lib:/usr/local/lib/"
+
 COPY --chmod=755 docker/nexus-webapp/install_python.sh /tmp/install_python.sh
 
 # Install python
@@ -23,6 +25,15 @@ RUN ln -s /opt/python/3.9.7/bin/python3.9  
/opt/python/3.9.7/bin/python
 
 ENV PATH="/opt/python/3.9.7/bin:$PATH"
 
+# Install additional dependencies for image
+RUN apt-get update && \
+    apt-get install --no-install-recommends -y tini git && \
+    apt-get clean && \
+    rm -rf /var/lib/apt/lists/*
+
+COPY --chmod=755 docker/nexus-webapp/install_gdal.sh /tmp/install_gdal.sh
+RUN /tmp/install_gdal.sh
+
 # Python & Poetry env vars
 ENV PYTHONUNBUFFERED=1 \
     # prevents python creating .pyc files
@@ -64,12 +75,6 @@ COPY README.md README LICENSE NOTICE ./
 
 ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH"
 
-# Install additional dependencies for image
-RUN apt-get update && \
-    apt-get install --no-install-recommends -y proj-bin tini git && \
-    apt-get clean && \
-    rm -rf /var/lib/apt/lists/*
-
 # Install poetry, install project, cleanup, and remove poetry install from 
layer
 RUN curl -sSL https://install.python-poetry.org -o /tmp/install_poetry.py &&  \
     python /tmp/install_poetry.py && \
@@ -97,7 +102,6 @@ ENV  \
     SPARK_HOME=/incubator-sdap-nexus/.venv/lib/python3.9/site-packages/pyspark 
\
     PYSPARK_DRIVER_PYTHON=/incubator-sdap-nexus/.venv/bin/python3.9 \
     PYSPARK_PYTHON=/incubator-sdap-nexus/.venv/bin/python3.9 \
-    LD_LIBRARY_PATH=/usr/lib \
     REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
 
 # This image has k8s client jar version 5.4.1, idk if we should force-install 
4.12.0 or if it's even needed anymore...
diff --git a/docker/nexus-webapp/install_gdal.sh 
b/docker/nexus-webapp/install_gdal.sh
new file mode 100755
index 0000000..4e029de
--- /dev/null
+++ b/docker/nexus-webapp/install_gdal.sh
@@ -0,0 +1,74 @@
+#!/usr/bin/env bash
+# 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.
+
+set -e
+
+echo "Installing dependencies"
+
+apt-get update
+apt-get install --no-install-recommends -y sqlite3 cmake libtiff-dev 
libcurl4-openssl-dev
+apt-get clean
+rm -rf /var/lib/apt/lists/*
+
+echo "Building & installing PROJ"
+
+mkdir -p /tmp/gdal-proj/
+cd /tmp/gdal-proj/
+
+wget 'https://download.osgeo.org/proj/proj-8.2.1.tar.gz'
+tar xf proj-8.2.1.tar.gz
+
+rm proj-8.2.1.tar.gz
+cd proj-8.2.1/
+
+mkdir build
+cd build/
+
+cmake .. -DCURL_LIBRARY=/usr/lib/x86_64-linux-gnu/libcurl.so.4 
-DCURL_INCLUDE_DIR=/usr/include/x86_64-linux-gnu/curl/ 
-DCMAKE_BUILD_TYPE=Release
+cmake --build .
+cmake --build . --target install
+
+proj
+
+# I'd like to run these but they seem to hang sometimes
+#ctest -E nkg
+
+projsync --system-directory --all
+
+cd /tmp/gdal-proj/
+rm -rf proj-8.2.1/
+
+echo "Building & installing GDAL"
+
+wget 
'https://github.com/OSGeo/gdal/releases/download/v3.10.0/gdal-3.10.0.tar.gz'
+tar xf gdal-3.10.0.tar.gz
+
+rm gdal-3.10.0.tar.gz
+cd gdal-3.10.0/
+
+mkdir build
+cd build/
+
+cmake .. -DGDAL_BUILD_OPTIONAL_DRIVERS=OFF -DOGR_BUILD_OPTIONAL_DRIVERS=OFF 
-DCMAKE_BUILD_TYPE=Release
+cmake --build .
+cmake --build . --target install
+
+gdalinfo --version
+
+cd /tmp
+rm -rf gdal-proj/
+
+echo "Done"
diff --git a/tools/build/build.py b/tools/build/build.py
index da2393f..9431daa 100644
--- a/tools/build/build.py
+++ b/tools/build/build.py
@@ -365,7 +365,7 @@ def pull_source(dst_dir: tempfile.TemporaryDirectory, 
build: dict):
                 print(f'{path} either does not exist or is not a directory')
                 exit(1)
 
-            print(f'Copying Ingester {os.path.abspath(path)} -> 
{os.path.join(dst_dir.name, "nexus")}')
+            print(f'Copying Ingester {os.path.abspath(path)} -> 
{os.path.join(dst_dir.name, "ingester")}')
 
             shutil.copytree(
                 path,

Reply via email to