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 2024/03/04 17:05:10 UTC

(incubator-sdap-ingester) 01/01: Removed conda from docker image build

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

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

commit a0056bf2a83d4059d4a769a7feecc4fe5772e2aa
Author: rileykk <ri...@jpl.nasa.gov>
AuthorDate: Mon Mar 4 09:04:48 2024 -0800

    Removed conda from docker image build
    
    - Base image -> Java (to support possible nexusproto build)
    - Just use pip in setup.py
---
 granule_ingester/docker/Dockerfile                 | 14 ++++---
 .../docker/{Dockerfile => Dockerfile.old}          |  0
 granule_ingester/docker/install_python.sh          | 48 ++++++++++++++++++++++
 granule_ingester/requirements.txt                  | 14 +++++++
 granule_ingester/setup.py                          |  8 ++--
 5 files changed, 75 insertions(+), 9 deletions(-)

diff --git a/granule_ingester/docker/Dockerfile b/granule_ingester/docker/Dockerfile
index e285872..6cac27a 100644
--- a/granule_ingester/docker/Dockerfile
+++ b/granule_ingester/docker/Dockerfile
@@ -13,13 +13,19 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-FROM continuumio/miniconda3:4.8.2-alpine
+FROM eclipse-temurin:8
 
 USER root
 
-ENV PATH="/opt/conda/bin:$PATH"
+COPY --chmod=755 granule_ingester/docker/install_python.sh /install_python.sh
 
-RUN apk update --no-cache && apk add --no-cache --virtual .build-deps git openjdk8
+# Install python
+RUN /install_python.sh
+RUN ln -s /opt/python/3.7.6/bin/python3.7  /opt/python/3.7.6/bin/python
+
+ENV PATH="/opt/python/3.7.6/bin:$PATH"
+
+#RUN apk update --no-cache && apk add --no-cache --virtual .build-deps git openjdk8
 
 COPY VERSION.txt /VERSION.txt
 COPY common /common
@@ -40,6 +46,4 @@ RUN cd /sdap && python setup.py install
 
 RUN pip install boto3==1.16.10
 
-RUN apk del .build-deps
-
 ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]
\ No newline at end of file
diff --git a/granule_ingester/docker/Dockerfile b/granule_ingester/docker/Dockerfile.old
similarity index 100%
copy from granule_ingester/docker/Dockerfile
copy to granule_ingester/docker/Dockerfile.old
diff --git a/granule_ingester/docker/install_python.sh b/granule_ingester/docker/install_python.sh
new file mode 100755
index 0000000..0005bec
--- /dev/null
+++ b/granule_ingester/docker/install_python.sh
@@ -0,0 +1,48 @@
+#!/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 build dependencies"
+
+apt-get update
+apt-get upgrade -y
+apt-get install --no-install-recommends -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev liblzma-dev tk-dev libffi-dev
+apt-get clean
+rm -rf /var/lib/apt/lists/*
+
+echo "Downloading & extracting source tarball"
+
+cd /tmp/
+wget https://www.python.org/ftp/python/3.7.6/Python-3.7.6.tgz
+tar xzf Python-3.7.6.tgz
+cd Python-3.7.6
+
+echo "Running install"
+
+./configure --prefix=/opt/python/3.7.6/ --enable-optimizations --with-lto --with-computed-gotos --with-system-ffi
+make -j "$(nproc)"
+make altinstall
+
+echo "Cleaning up install dir"
+
+rm /tmp/Python-3.7.6.tgz
+cd /tmp/
+rm -rf Python-3.7.6
+
+echo "Final steps..."
+
+/opt/python/3.7.6/bin/python3.9 -m pip install --upgrade pip setuptools wheel
diff --git a/granule_ingester/requirements.txt b/granule_ingester/requirements.txt
index 00a54e1..c798fec 100644
--- a/granule_ingester/requirements.txt
+++ b/granule_ingester/requirements.txt
@@ -22,3 +22,17 @@ kazoo==2.8.0
 aio-pika==6.7.1
 elasticsearch[async]
 urllib3==1.26.2
+
+# Contents of conda-requirements.txt
+
+numpy>=1.15.4
+scipy
+netcdf4==1.5.3
+pandas>=1.0.4
+pytz==2019.3
+xarray>=0.19.0
+pyyaml==5.3.1
+aiohttp==3.6.2
+tenacity
+requests==2.27.1
+
diff --git a/granule_ingester/setup.py b/granule_ingester/setup.py
index e99900d..f3cdffb 100644
--- a/granule_ingester/setup.py
+++ b/granule_ingester/setup.py
@@ -23,10 +23,10 @@ with open('requirements.txt') as f:
 with open('../VERSION.txt', 'r') as f:
     __version__ = f.readline()
 
-try:
-    check_call(['conda', 'install', '-y', '-c', 'conda-forge', '--file', 'conda-requirements.txt'])
-except (CalledProcessError, IOError) as e:
-    raise EnvironmentError("Error installing conda packages", e)
+# try:
+#     check_call(['conda', 'install', '-y', '-c', 'conda-forge', '--file', 'conda-requirements.txt'])
+# except (CalledProcessError, IOError) as e:
+#     raise EnvironmentError("Error installing conda packages", e)
 
 setup(
     name='sdap_granule_ingester',