You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sdap.apache.org by rk...@apache.org on 2023/10/25 23:06:15 UTC

[incubator-sdap-ingester] branch dev updated: Install nexusproto from PyPI w/ option to build from source (#89)

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

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


The following commit(s) were added to refs/heads/dev by this push:
     new 0589f47  Install nexusproto from PyPI w/ option to build from source (#89)
0589f47 is described below

commit 0589f473c66a68830aca4b06160f8e756459e4f6
Author: Riley Kuttruff <72...@users.noreply.github.com>
AuthorDate: Wed Oct 25 16:06:10 2023 -0700

    Install nexusproto from PyPI w/ option to build from source (#89)
    
    Co-authored-by: rileykk <ri...@jpl.nasa.gov>
---
 CHANGELOG.md                                  |  1 +
 granule_ingester/docker/Dockerfile            |  4 ++++
 granule_ingester/docker/install_nexusproto.sh | 32 ++++++++++++++++-----------
 3 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9cfeab6..ec18b01 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 ### Deprecated
 ### Removed
 ### Fixed
+- SDAP-488: Workaround to build issue on Apple Silicon (M1/M2). GI image build installs nexusproto through PyPI instead of building from source. A build arg `BUILD_NEXUSPROTO` was defined to allow building from source if desired/
 ### Security
 
 ## [1.1.0] - 2023-04-26
diff --git a/granule_ingester/docker/Dockerfile b/granule_ingester/docker/Dockerfile
index 8a4e258..e285872 100644
--- a/granule_ingester/docker/Dockerfile
+++ b/granule_ingester/docker/Dockerfile
@@ -30,6 +30,10 @@ COPY granule_ingester/conda-requirements.txt /sdap/conda-requirements.txt
 COPY granule_ingester/docker/install_nexusproto.sh /install_nexusproto.sh
 COPY granule_ingester/docker/entrypoint.sh /entrypoint.sh
 
+ARG BUILD_NEXUSPROTO
+ARG APACHE_NEXUSPROTO=https://github.com/apache/incubator-sdap-nexusproto.git
+ARG APACHE_NEXUSPROTO_BRANCH=master
+
 RUN ./install_nexusproto.sh
 RUN cd /common && python setup.py install
 RUN cd /sdap && python setup.py install
diff --git a/granule_ingester/docker/install_nexusproto.sh b/granule_ingester/docker/install_nexusproto.sh
index 6cda614..e807963 100755
--- a/granule_ingester/docker/install_nexusproto.sh
+++ b/granule_ingester/docker/install_nexusproto.sh
@@ -15,21 +15,27 @@
 
 set -e
 
-APACHE_NEXUSPROTO="https://github.com/apache/incubator-sdap-nexusproto.git"
-MASTER="master"
+if [ ! -z ${BUILD_NEXUSPROTO+x} ]; then
+  echo 'Building nexusproto from source...'
 
-GIT_REPO=${1:-$APACHE_NEXUSPROTO}
-GIT_BRANCH=${2:-$MASTER}
+  APACHE_NEXUSPROTO="https://github.com/apache/incubator-sdap-nexusproto.git"
+  MASTER="master"
 
-mkdir nexusproto
-cd nexusproto
-git init
-git pull ${GIT_REPO} ${GIT_BRANCH}
+  GIT_REPO=${1:-$APACHE_NEXUSPROTO}
+  GIT_BRANCH=${2:-$MASTER}
 
-./gradlew pythonInstall --info
+  mkdir nexusproto
+  pushd nexusproto
+  git init
+  git pull ${GIT_REPO} ${GIT_BRANCH}
 
-./gradlew install --info
+  ./gradlew pythonInstall --info
 
-rm -rf /root/.gradle
-cd ..
-rm -rf nexusproto
+  ./gradlew install --info
+
+  rm -rf /root/.gradle
+  popd
+  rm -rf nexusproto
+else
+  pip install nexusproto
+fi