Skip to content

Commit

Permalink
Update Dockerfile.cpu
Browse files Browse the repository at this point in the history
  • Loading branch information
jordancaraballo authored Sep 30, 2024
1 parent 2c6b1eb commit 5ee52c2
Showing 1 changed file with 67 additions and 88 deletions.
155 changes: 67 additions & 88 deletions requirements/Dockerfile.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -6,100 +6,86 @@ ENV PYTHONPATH="$PYTHONPATH:/usr/local/ilab"
# why is this?????? really bad practice
ENV PYTHONPATH="/usr/local/lib/python3.8/dist-packages"
ENV REDIS_PORT="6379"
ENV REDIS_FILE="/etc/profile.d/redis_server.sh"
ENV REDIS_PORTS=$REDIS_PORT

RUN PROJECT_PATH="/usr/local/ilab" && \
REDIS_FILE="/etc/profile.d/redis_server.sh" && \
echo $PROJECT_PATH && \
mkdir -p $PROJECT_PATH

#-------------------------------------------------------------------------------
# Make NCCS specific links
#-------------------------------------------------------------------------------
#mkdir -p /att/nobackup /lscratch /att/gpfsfs/atrepo01 /att/pubrepo /css/nga/INDEX/current/nga_footprint.gdb
#for i in $(seq 1 30); do
# ln -s /gpfs/gsfs${i} /gs${i};
#done

mkdir -p $PROJECT_PATH && \
#-------------------------------------------------------------------------------
# System Dependencies
#-------------------------------------------------------------------------------
# apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade && \
# DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
# python3-pip python3-dev wget vim curl git procps gcc g++ bzip2 libssl-dev \
# libsqlite3-dev libx11-dev libgeos++-dev libproj-dev
# DEBIAN_FRONTEND=noninteractive apt-get -y autoremove && \
# rm -rf /var/lib/apt/lists/* && \
# rm -rf /var/cache/apt
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3-pip python3-dev wget vim curl git procps gcc g++ bzip2 libssl-dev \
libsqlite3-dev libx11-dev libgeos++-dev libproj-dev
DEBIAN_FRONTEND=noninteractive apt-get -y autoremove && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/apt

#-------------------------------------------------------------------------------
# Python Stack
#-------------------------------------------------------------------------------
# #python -m pip install --upgrade pip
# pip install pipx
# python -m pipx install --upgrade pip


# python -m pip install awscli s3fs
# python -m pip install celery[redis]
# python -m pip install certifi
# python -m pip install cryptography
# python -m pip install Cython
# python -m pip install dask
# python -m pip install decorator
# python -m pip install dill
# python -m pip install distributed
# python -m pip install docutils
# python -m pip install fiona
# python -m pip install flower
# python -m pip install geopandas
# python -m pip install h5py
# python -m pip install imageio
# python -m pip install ipykernel
# python -m pip install ipython
# python -m pip install ipython-genutils
# python -m pip install ipywidgets
# python -m pip install matplotlib
# python -m pip install netcdf4
# python -m pip install networkx
# python -m pip install notebook
# python -m pip install numba
# python -m pip install numexpr
# python -m pip install numpy
# python -m pip install pandas
# python -m pip install pyhdf
# python -m pip install pyproj
# python -m pip install Pysal
# python -m pip install PyYAML
# python -m pip install rasterio
# python -m pip install redis
# python -m pip install requests
# python -m pip install rioxarray
# python -m pip install scikit-image
# python -m pip install scikit-learn
# python -m pip install scipy
# python -m pip install seaborn
# python -m pip install shapely
# python -m pip install cartopy
# python -m pip install xarray
# python -m pip install urllib3
# python -m pip install zarr

# python -m pip cache purge
RUN pip install pipx && \
python -m pipx install --upgrade pip && \
python -m pip install awscli s3fs && \
python -m pip install celery[redis] && \
python -m pip install certifi && \
python -m pip install cryptography && \
python -m pip install Cython && \
python -m pip install dask && \
python -m pip install decorator && \
python -m pip install dill && \
python -m pip install distributed && \
python -m pip install docutils && \
python -m pip install fiona && \
python -m pip install flower && \
python -m pip install geopandas && \
python -m pip install h5py && \
python -m pip install imageio && \
python -m pip install ipykernel && \
python -m pip install ipython && \
python -m pip install ipython-genutils && \
python -m pip install ipywidgets && \
python -m pip install matplotlib && \
python -m pip install netcdf4 && \
python -m pip install networkx && \
python -m pip install notebook && \
python -m pip install numba && \
python -m pip install numexpr && \
python -m pip install numpy && \
python -m pip install pandas && \
python -m pip install pyhdf && \
python -m pip install pyproj && \
python -m pip install Pysal && \
python -m pip install PyYAML && \
python -m pip install rasterio && \
python -m pip install redis && \
python -m pip install requests && \
python -m pip install rioxarray && \
python -m pip install scikit-image && \
python -m pip install scikit-learn && \
python -m pip install scipy && \
python -m pip install seaborn && \
python -m pip install shapely && \
python -m pip install cartopy && \
python -m pip install xarray && \
python -m pip install urllib3 && \
python -m pip install zarr && \
python -m pip install earthengine-api && \
python -m pip install geemap && \
python -m pip install geedim && \
python -m pip install vhr-cloudmask && \
python -m pip cache purge

# # Add redis-server binary to /usr/local/bin
# export pyVer=`python --version | awk -F' ' '{print $2}' | awk -F'.' '{print $1"."$2}'`
# ln -sf /usr/local/lib/python${pyVer}/dist-packages/redis_server/bin/redis-server /usr/local/bin/redis-server

# --------------- 2/16/23 Adding this from ilab-base-gdal-3.3.3-v5.def file
RUN export pyVer=`python --version | awk -F' ' '{print $2}' | awk -F'.' '{print $1"."$2}'` && \
ln -sf /usr/local/lib/python${pyVer}/dist-packages/redis_server/bin/redis-server /usr/local/bin/redis-server && \
echo "redis-server --daemonize yes --port \$REDIS_PORT" >> $REDIS_FILE; && \
echo "export SINGULARITYENV_REDIS_PORTS=\$REDIS_PORT" >> $REDIS_FILE; && \
chmod +x $REDIS_FILE;

# # 3/11/22 modified by Caleb for verson 2.0.0 for testing of 2 lines below
# # 5/4/22 Testing passed. nepac and.. app containers also passed so making this ilab-base-3.3.3-v2 the new production version 2.
# # Setup redis-server daemon. Sets REDIS_PORT env variable for celery-based applications to reference the correct redis port at run-time.
# # echo "export REDIS_PORT=\"\$(python -c 'import socket; s = socket.socket(); s.bind((\"\", 0)); print(s.getsockname()[1]); s.close();')\"" > $REDIS_FILE
# echo "redis-server --daemonize yes --port \$REDIS_PORT" >> $REDIS_FILE;
# echo "export SINGULARITYENV_REDIS_PORTS=\$REDIS_PORT" >> $REDIS_FILE;
# chmod +x $REDIS_FILE;
#
#%runscript
# /bin/bash -c "source /etc/profile.d/redis_server.sh"
# exec "$@"
Expand All @@ -111,11 +97,4 @@ RUN PROJECT_PATH="/usr/local/ilab" && \
#
# # --------------------------------------------------------------------------
#
#%test
#
# cat /etc/os-release | grep 20
# gdalinfo --formats | grep -i jpeg
# gdalinfo --formats | grep -i hdf
# ogrinfo --formats | grep GDB
# python -V | grep 3
# python -c 'from osgeo import gdal; print(gdal.__version__)'

0 comments on commit 5ee52c2

Please sign in to comment.