-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial docker setup in core ODC repo #382
Changes from 4 commits
827202c
96cd444
67da346
f8d5bec
8c19f0b
b73e72d
0907453
82d657e
91b9fa6
48c0782
7729996
903386e
8209a46
1a82936
01a9a16
81feb1a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.appveyor | ||
.circleci | ||
.github | ||
.travis | ||
contrib | ||
docs | ||
examples | ||
integration_tests | ||
utils |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
FROM ubuntu:16.04 | ||
# This Dockerfile should follow the Travis configuration process | ||
# available here: https://github.com/opendatacube/datacube-core/blob/develop/.travis.yml | ||
|
||
# First add the NextGIS repo | ||
RUN apt-get update && apt-get install -y \ | ||
python-software-properties \ | ||
software-properties-common | ||
|
||
RUN add-apt-repository ppa:nextgis/ppa | ||
|
||
# And now install apt dependencies, including a few of the heavy Python projects | ||
RUN apt-get update && apt-get install -y \ | ||
gdal-bin libgdal-dev libgdal20 libudunits2-0 \ | ||
python3 python3-gdal python3-setuptools python3-dev python3-numpy python3-netcdf4 \ | ||
python3-pip | ||
|
||
# Get the code, and put it in /opt | ||
ENV APPDIR=/code | ||
RUN mkdir -p $APPDIR | ||
COPY . $APPDIR | ||
|
||
# Install the dependencies | ||
WORKDIR $APPDIR | ||
|
||
# Set the locale, this is required for some of the Python packages | ||
ENV LC_ALL C.UTF-8 | ||
RUN pip3 install '.[test,analytics,celery,s3]' --upgrade | ||
RUN pip3 install ./tests/drivers/fail_drivers --no-deps --upgrade | ||
|
||
RUN python3 setup.py develop | ||
|
||
CMD datacube --help |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: '3' | ||
services: | ||
datacube: | ||
build: . | ||
volumes: | ||
- ./:/code | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So are we using a volume for code or are we copying code during build? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey Kirill, the docker-compose file uses the Dockerfile as a base, so that dependencies are already installed, and then mounts in the volume so that it has your local changes. This means you can change your code locally, and run it in Docker with the changes without rebuilding the image and creating a new container. Note that it's using the path to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see, but won't it trigger rebuild anyway, since you changed folder content and that get's copied into the docker, so from COPY down things will need to be redone anyway? Also we use python "entry points" (https://amir.rachum.com/blog/2017/07/28/python-entry-points/), how this will interact with the proposed setup? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With Docker Compose, the first build is mandatory, but later builds are manually triggered (with I'm aware of the entry points in the Just FYI, if you use this docker-compose file, the entrypoint commands (like |
||
entrypoint: | ||
python3 /code/datacube/scripts/cli_app.py | ||
command: --help |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,7 +84,7 @@ | |
'jsonschema', | ||
'netcdf4', | ||
'numpy', | ||
'psycopg2', | ||
'psycopg2-binary', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should still depend on By recent discussions at psycopg2 issue 674, it also doesn't sound to be completely resolved. It would be totally fine to |
||
'pypeg2', | ||
'python-dateutil', | ||
'pyyaml', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not too sure about "getting code from working copy strategy".
I'd rather fetch directly from github with a hash/tag/branch supplied as build argument
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The concept here is that the Dockefile is in with the code, so that it can be automatically built using Docker Cloud. We can configure tagged builds that are in sync with this repo automatically that way.
At the moment, I'm thinking we have a
latest
tag for the docker image coming out of the develop branch (that should always build and work, right?) and then tagged builds from releases.It was suggested that we do the install from PIP, since that's the 'point of truth'. But if we have the code local to the build, it's not necessary to go to GitHub and fetch it again.