Skip to content

Commit

Permalink
Merge pull request #46 from hydroshare/python-3-wip
Browse files Browse the repository at this point in the history
Python 3 upgrade
  • Loading branch information
sblack-usu authored Jan 16, 2020
2 parents d77a1e5 + 73d66fc commit 91b65c8
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 82 deletions.
47 changes: 31 additions & 16 deletions Dockerfile
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:2.7.11
FROM python:3.6-jessie
MAINTAINER Michael J. Stealey <[email protected]>

ENV DEBIAN_FRONTEND noninteractive
Expand All @@ -10,14 +10,18 @@ RUN apt-get update && apt-get install -y \
apt-transport-https \
ca-certificates \
sudo \
&& apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D \
&& curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
&& apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

RUN curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -

# Add docker.list and requirements.txt - using /tmp to keep hub.docker happy
COPY . /tmp
RUN cp /tmp/docker.list /etc/apt/sources.list.d/ \
&& cp /tmp/requirements.txt /requirements.txt

RUN sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list' \
&& wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -

RUN apt-get update && apt-get install -y --fix-missing --no-install-recommends \
apt-utils \
docker-engine \
Expand All @@ -43,20 +47,24 @@ RUN npm install -g phantomjs-prebuilt

WORKDIR /

#install numpy before matplotlib
RUN pip install 'numpy==1.16.0'
RUN pip install git+https://github.com/sblack-usu/defusedexpat.git

# Install pip based packages (due to dependencies some packages need to come first)
RUN export CPLUS_INCLUDE_PATH=/usr/include/gdal \
&& export C_INCLUDE_PATH=/usr/include/gdal \
&& export GEOS_CONFIG=/usr/bin/geos-config \
&& HDF5_INCDIR=/usr/include/hdf5/serial \
&& pip install --upgrade pip \
&& pip install -r requirements.txt

# Install GDAL 2.1.0 from source
RUN wget http://download.osgeo.org/gdal/2.1.3/gdal-2.1.3.tar.gz \
&& tar -xzf gdal-2.1.3.tar.gz \
&& rm gdal-2.1.3.tar.gz

WORKDIR /gdal-2.1.3
RUN export CPLUS_INCLUDE_PATH=/usr/include/gdal
RUN export C_INCLUDE_PATH=/usr/include/gdal
RUN export GEOS_CONFIG=/usr/bin/geos-config
RUN HDF5_INCDIR=/usr/include/hdf5/serial
RUN pip install --upgrade pip
RUN pip install -r requirements.txt

# Install GDAL 2.4.1 from source
RUN wget http://download.osgeo.org/gdal/2.4.1/gdal-2.4.1.tar.gz \
&& tar -xzf gdal-2.4.1.tar.gz \
&& rm gdal-2.4.1.tar.gz

WORKDIR /gdal-2.4.1
RUN ./configure --with-python --with-geos=yes \
&& make \
&& sudo make install \
Expand All @@ -72,6 +80,11 @@ RUN wget -qO - https://packages.irods.org/irods-signing-key.asc | sudo apt-key a
irods-runtime \
irods-icommands

# inplaceedit in pip doesn't seem compatible with Django 1.11 yet...
RUN pip install git+https://github.com/theromis/django-inplaceedit.git@e6fa12355defedf769a5f06edc8fc079a6e982ec
# foresite-toolkit in pip isn't compatible with python3
RUN pip install git+https://github.com/sblack-usu/foresite-toolkit.git#subdirectory=foresite-python/trunk

# Install SSH for remote PyCharm debugging
RUN mkdir /var/run/sshd
RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config
Expand All @@ -88,6 +101,8 @@ RUN groupadd --system storage-hydro --gid=10000 \
RUN echo 'hydro-service:docker' | chpasswd
ENV DEBIAN_FRONTEND teletype

# set UTF-8 env locale
RUN echo UTF-8/en_US.UTF-8 UTF-8 > /etc/local.gen && locale-gen
# Cleanup
RUN apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
90 changes: 24 additions & 66 deletions requirements.txt
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
amqp==1.4.9
amqp==2.5.0
anyjson==0.3.3
arrow==0.7.0
asn1crypto==0.24.0
astroid==1.4.8
autoflake==0.6.6
autopep8==1.2.2
bagit==1.5.4
bcrypt==3.1.4
beautifulsoup4==4.5.3
billiard==3.3.0.23
bleach==3.0.2
celery==3.1.23
celery==4.3.0
cffi==1.11.5
chardet==3.0.4
click==6.7
colorama==0.3.7
configparser==3.5.0
coreapi==2.3.3
coreschema==0.0.4
coverage==4.0.3
cryptography==2.3
cycler==0.10.0
defusedexpat==0.4
#defusedexpat==0.4
defusedxml==0.4.1
Django==1.11.18
Django==1.11.23
django-appconf==1.0.2
django-autocomplete-light==2.3.3
django-braces==1.9.0
Expand All @@ -32,6 +20,7 @@ django-contrib-comments==1.9.0
django-cors-headers==2.4.0
django-crispy-forms==1.7.2
django-debug-toolbar==1.9.1
django-freshly==0.1.2
django-haystack==2.8.1
django-heartbeat==2.0.2
django-ipware==2.1.0
Expand All @@ -44,109 +33,78 @@ django-security==0.9.3
django-test-without-migrations==0.6
django-timedeltafield==0.7.10
django-widget-tweaks==1.4.1
djangorestframework==3.8.2
djangorestframework==3.9.1
docker-py==1.7.2
dominate==2.3.1
dominate==2.4.0
DoubleMetaphone==0.1
drf-haystack==1.8.5
drf-yasg==1.10.0
ecdsa==0.13
ecdsa==0.13.3
enum34==1.1.6
filebrowser-safe==0.5.0
flake8==3.5.0
flex==6.13.2
flex==6.14.1
flower==0.9.3
funcsigs==1.0.2
functools32==3.2.3.post2
#functools32==3.2.3.post2
future==0.16.0
geographiclib==1.49
geojson==1.3.2
geopy==1.16.0
gevent==1.1.2
google.foresite-toolkit==1.3.3
gevent==1.4.0
grappelli-safe==0.5.1
greenlet==0.4.10
gunicorn==19.6.0
html5lib==0.9999999
idna==2.7
inflection==0.3.1
ipaddress==1.0.22
isodate==0.5.4
itypes==1.1.0
Jinja2==2.10
jsonpointer==1.14
jsonschema==2.6.0
keepalive==0.5
kombu==3.0.35
lazy-object-proxy==1.2.2
lxml==3.7.3
mapnik==0.1
kombu==4.6.3
lxml==4.4.0
#mapnik==0.1
Markdown==3.0.1
MarkupSafe==1.0
matplotlib==1.5.1
matplotlib==3.1.2
mccabe==0.6.1
Mezzanine==4.3.1
mock==1.3.0
nameparser==0.5.7
netCDF4==1.2.4
netCDF4==1.5.1.2
nose==1.3.7
nose-timer>=0.7.4,<1.0.0
numpy==1.16.0
oauthlib==2.1.0
openapi-codec==1.3.2
oauthlib==3.1.0
OWSLib==0.10.3
pandas==0.18.0
paramiko==2.4.2
pbr==1.10.0
pep8==1.7.0
Pillow==3.1.1
prettytable==0.7.2
probableparsing==0.0.1
probablepeople==0.5.4
psutil==4.0.0
psycopg2==2.6.1
py2-ipaddress==3.4.1
psycopg2==2.8.2
ipaddress==1.0.22
pyasn1==0.4.4
pycodestyle==2.3.1
pycparser==2.18
PyCRS==0.1.3
pyflakes==1.1.0
PyCRS==1.0.1
pyflakes==1.6.0
pylint==1.5.5
PyNaCl==1.2.1
pyparsing==2.1.7
pyproj==1.9.5.1
pysolr==3.4.0
pysqlite==2.8.1
pysqlite3==0.2.1
pytest-django>=3.4.7, <4.0.0
python-crfsuite==0.9.6
python-dateutil==2.5.3
python-irodsclient==0.8.1
pytz==2016.3
PyYAML==3.13
PyYAML==5.1
rcssmin==1.0.6
rdflib==4.0.1
redis==2.10.5
requests==2.20.0
requests-oauthlib==0.6.1
rfc3987==1.3.8
rjsmin==1.0.12
robot-detection==0.4
ruamel.ordereddict==0.4.13
ruamel.yaml==0.15.52
selenium==3.0.2
sh==1.11
Shapely==1.5.13
simplejson==3.16.0
six==1.10.0
SPARQLWrapper==1.7.6
sqlparse==0.2.0
strict-rfc3339==0.7
suds-jurko==0.6
swagger-spec-validator==2.3.1
tzlocal==1.2.2
timeago==1.0.10
uritemplate==3.0.0
validate-email==1.3
virtualenv==15.0.2
websocket-client==0.37.0
wrapt==1.10.8
xmltodict==0.10.2

0 comments on commit 91b65c8

Please sign in to comment.