Skip to content
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

Update windows setup instructions #1526

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/installation/setup/common_install.rst
Expand Up @@ -5,7 +5,7 @@
Python and packages
===================

Python 3.8+ is required.
Python 3.9+ is required.

Conda environment setup
-----------------------
Expand Down
79 changes: 59 additions & 20 deletions docs/installation/setup/windows.rst
Expand Up @@ -19,53 +19,92 @@ Postgres:

Download and install from `here <https://www.enterprisedb.com/downloads/postgres-postgresql-downloads>`_.

Optionally, download and install Postgis as well (required for the postgis/experimental index driver)

Refer to the instructions detailed `here <https://postgis.net/documentation/getting_started/install_windows/released_versions/>`_.


Python and packages
===================

Python 3.8+ is required.
Python 3.9+ is required.

Conda environment setup
-----------------------

Conda environments are recommended for use in isolating your ODC development environment from your system installation and other Python environments.

We recommend you use Mambaforge to set up your conda virtual environment, as all the required packages are obtained from the conda-forge channel.
Download and install it from `here <https://github.com/conda-forge/miniforge#mambaforge>`_.

Anaconda Python
---------------
Download the latest version of the Open Data Cube from the `repository <https://github.com/opendatacube/datacube-core>`_::

`Install Anaconda Python <https://www.anaconda.com/download/>`_
git clone https://github.com/opendatacube/datacube-core
cd datacube-core

Add conda-forge to package channels::
Create a conda environment named ``cubeenv``::

conda config --add channels conda-forge
mamba env create -f conda-environment.yml

Conda Environments are recommended for use in isolating your ODC development environment from your system installation and other python evironments.
If you didn't add miniforge to the Path on installation, you will need to use the full path of the executable::

Install required python packages and create an ``odc`` conda environment.
<install location>\miniforge3\condabin\mamba env create -f conda-environment.yml

Python::
Activate the ``cubeenv`` conda environment::

conda create --name odc_env python=3.8 datacube
conda activate cubeenv

Activate ``odc`` python environment::
Find out more about conda environments `here <https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/environments.html>`_.

activate odc

Postgres database configuration
===============================

This configuration supports local development using your login name.

If this is a new installation of Postgres on your system it is probably wise to set the postgres user password. As the local “postgres” user, we are allowed to connect and manipulate the server using the psql command.

Open Data Cube source and development configuration
===================================================
In a terminal, type::

Download the latest version of the software from the `repository <https://github.com/opendatacube/datacube-core>`_ ::
psql -U postgres

git clone https://github.com/opendatacube/datacube-core
cd datacube-core
Set a password for the "postgres" database role using the command::

\password postgres

and set the password when prompted. The password text will be hidden from the console for security purposes.

Type **Control+D** or **\\q** to exit the posgreSQL prompt.

By default, Postgresql is configured to use ``ident sameuser`` authentication for any connections from the same machine, which is useful for development. Check out the excellent Postgresql documentation for more information, but essentially this means that if your system username is ``foo`` and you add ``foo`` as a Postgresql user then you can connect to a database without requiring a password for many functions.

Since the only user who can connect to a fresh install is the postgres user, here is how to create yourself a database account (which is in this case also a database superuser) with the same name as your login name and then create a password for the user::

createuser -U postgres --superuser %USERNAME%
psql - U postgres

postgres=# \password <foo>

Now we can create databases for integration testing. You will need 2 databases - one for the Postgres driver and one for the PostGIS driver.
By default, these databases are called ``pgintegration`` and ``pgisintegration``, but you can name them however you want::

postgres=# create database pgintegration;
postgres=# create database pgisintegration;

Or, directly from the bash terminal::

createdb pgintegration
createdb pgisintegration

Connecting to your own database to try out some SQL should now be as easy as::

We need to specify the database user and password for the ODC integration testing. To do this::
psql -d pgintegration

copy integration_tests\integration.conf %HOME%\.datacube_integration.conf
You can now specify the database user and password for the ODC integration testing. To do this::

copy integration_tests\integration.conf %HOMEDRIVE%%HOMEPATH%\.datacube_integration.conf

Then edit the ``%HOME%\.datacube_integration.conf`` with a text editor and add the following lines replacing ``<foo>`` with your username and ``<foobar>`` with the database user password you set above (not the postgres one, your ``<foo>`` one)::
Then edit ``%HOMEDRIVE%%HOMEPATH%\.datacube_integration.conf`` with a text editor and add the following lines, replacing ``<foo>`` with your username and ``<foobar>`` with the database user password you set above (not the postgres one, your ``<foo>`` one)::

[datacube]
db_hostname: localhost
Expand Down
4 changes: 4 additions & 0 deletions wordlist.txt
Expand Up @@ -69,6 +69,7 @@ COGs
combinator
combinators
conda
condabin
conf
config
coord
Expand Down Expand Up @@ -197,6 +198,8 @@ HDF
hdf
hl
hoc
HOMEDRIVE
HOMEPATH
hostname
HPC
html
Expand Down Expand Up @@ -269,6 +272,7 @@ maxdepth
md
metadataType
MetadataTypes
miniforge
mk
mkdir
MODIS
Expand Down