Skip to content

Commit

Permalink
updating base image docker builds to use new or omit sci sub package
Browse files Browse the repository at this point in the history
  • Loading branch information
rabellino-noaa committed Feb 7, 2024
1 parent 4546c19 commit 5037fb1
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docker/python-sci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ENV LANGUAGE en_US.UTF-8

# Install dependencies (and force Python 3.11 update)
RUN conda config --add channels conda-forge && \
conda install -y python=3.11 && \
conda install -y python=3.11.6 && \
conda install -y \
pika==1.3.1 \
python-dateutil==2.8.2 \
Expand Down
14 changes: 10 additions & 4 deletions docker/python/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# alpine:3.18.2 includes python 3.11
FROM alpine:3.18.2
# alpine:3.18.6 includes python 3.11.6
FROM alpine:3.18.6

# reduce python printing to stdout on build
ENV PYTHONBUFFERED=1

RUN echo "Installing python" && \
apk add --no-cache python3 && \
apk add --update --no-cache python3 && \
if [ ! -e /usr/bin/python ]; then ln -sf python3 /usr/bin/python ; fi && \
\
echo "Installing pip" && \
Expand All @@ -31,6 +31,12 @@ RUN apk update && apk upgrade
# Install idsse common python code
WORKDIR /python/idsse_common

COPY ./python/idsse_common /python/idsse_common
# Copy the common code
COPY ./python/idsse_common/idsse/common /python/idsse_common/idsse/common
COPY ./docker/python/setup.py /python/idsse_common

# Remove the scientific packages from the base directory
RUN rm -rf /python/idsse_common/sci

# Run the setup.py
RUN python3 /python/idsse_common/setup.py install
30 changes: 30 additions & 0 deletions docker/python/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""Setup to support installation as Python library"""
import glob
from setuptools import setup

setup(name='idsse',
version='1.0',
description='IDSSe Common',
url='',
author='WIDS',
author_email='@noaa.gov',
license='MIT',
python_requires=">=3.11",
packages=['idsse.common', 'idsse.common.schema'],
data_files=[('idsse/common/schema', glob.glob('idsse/common/schema/*.json'))],
include_package_data=True,
package_data={'':['schema/*.json']},
install_requires=[
'pint',
'importlib_metadata',
'pika',
'jsonschema'
],
extras_require={
'develop': [
'pytest',
'pytest-cov',
]
},
zip_safe=False,
)

0 comments on commit 5037fb1

Please sign in to comment.