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

Documentation geoips installation #651

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

biosafetylvl5
Copy link
Collaborator

@biosafetylvl5 biosafetylvl5 commented Jun 26, 2024

Related Issues

fixes #609
related to #611 and #531

Testing Instructions

Build the docs 🙂

Summary

I updated the install docs. They were tested line-by-line on a mac and a debian system for conda, expert and docker installs.

Output

All done:

Return values:
  Python install: 
  sphinx html:    0
  sphinx latex:   None
  latex pdf make: None
  warnings html:  
  warnings latex: 
  warnings make:  

Final retval: 0

Relevant XKCD: (Universal Install Script)

image

@biosafetylvl5 biosafetylvl5 linked an issue Jun 26, 2024 that may be closed by this pull request
8 tasks
@biosafetylvl5 biosafetylvl5 marked this pull request as ready for review July 22, 2024 15:45
@biosafetylvl5 biosafetylvl5 self-assigned this Jul 22, 2024

.. code:: bash

mamba activate geoips
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think conda activate geoips all the time - mamba activate doesn't seem to actually work.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point - changed

Comment on lines 120 to 142
Install system dependencies directly
------------------------------------

If you are an expert user, you may want to install the dependencies manually. Do not do this if you already installed
dependencies with Conda.

Required
^^^^^^^^

* ``git``
* ``openblas`` (required for scipy pip install)
* ``make`` (required for pypublicdecompwt)
* ``python`` >= 3.9

Optional
^^^^^^^^

* ``gfortran`` (required for plugins including fortran builds)
* ``gcc`` and ``g++`` (required for plugins including fortran or C builds, and ARM machines)
* ``pdflatex`` (optional, for building pdf documentation)
* ``wget`` (required for downloading test data)
* ``make`` (optional, for building packages on ARM machines)
* Test data repos can be installed in `$GEOIPS_TESTDATA_DIR`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think this should not go in the standard installation. We should keep the standard installation very clean and vanilla, to avoid unnecessary confusion. Our standard supported installation is conda - and this is not necessary if you are installing with conda.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just remove this entire section

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To echo Mindy, I also agree that the standard installation instructions (conda install on a Linux machine) should be clean and as minimal as possible. I think it not only makes it easier for the end-user, but also makes it easier for us to help troubleshoot a standard installation if needed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! I changed this document to be conda only 🙂

# Ensure geoips python environment enabled before installing geoips
pip install "$GEOIPS_PACKAGES_DIR/geoips[doc,lint,test,debug]"

The optional dependencies are:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"All of the optional dependencies are required in order for tests to pass"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that true for debug, lint and doc?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My install is passing base_test with only test

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I'm not passing the pytest with or without the lint/doc/debug

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build_docs.sh is part of the "test_all.sh" scripts in geoips_clavrx and data_fusion, and full_test.sh to pass. If we want people to use the test_all.sh and/or full_test.sh to confirm full functionality, then it does include doc and lint. Probably not debug

Comment on lines 188 to 203
Development
-----------

The installation steps for developers are the same as for normal and/or expert users, except for one step.

Most developers use Conda installations, but any dependency management solution is fine.

When installing geoips, please install all the extras and install in **editable** mode so that changes to the code are
immediately reflected in the installed package. Eg.

.. code:: bash

# Ensure geoips python environment enabled before installing geoips
pip install -e "$GEOIPS_PACKAGES_DIR/geoips[doc,lint,test,debug]"

See the [ADDING FUNCTIONALITY] page for more details on how to contribute to GeoIPS.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If people are cloning the repo anyway, why not just do the editable install and leave it at that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using -e means the system points to the current folder, whereas usually it's copied elsewhere. So -e means if you delete the clone, your install will break.... Not sure if that's important, so I can just leave it as -e by default for now

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to -e by default

Comment on lines 205 to 231
Docker
------

We provide a working Dockerfile that can be used to run GeoIPS in a container.

The Dockerfile can be built into a Docker image by cloning the GeoIPS repository and
running ``docker build``. For example:

.. code:: bash

git clone https://github.com/NRLMMD-GEOIPS/geoips.git geoips
cd geoips
docker build -t geoips .

The Docker image can be run with the following command:

.. code:: bash

docker run -it geoips # Run the container in interactive mode

Right now, the Docker image is only used for development and testing.

We suggest mounting in a data directory so your containers don't get too large.

If you are interested in using the Docker build
for production or plugin development, please reach
out to us via our contact page [CONTACT PAGE] or create an issue on GitHub [ISSUE PAGE].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be in a separate document. I think this installation should 100% only be for the "standard" conda based install.

Copy link
Collaborator Author

@biosafetylvl5 biosafetylvl5 Jul 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved non-conda portions to a separate document

Comment on lines 167 to 170
.. code:: bash

# Ensure geoips python environment enabled before installing geoips
pip install "$GEOIPS_PACKAGES_DIR/geoips"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just take this out as well - just do the full editable install that is required for the tests to pass.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to -e. Is a full install required for tests?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depends how we want people to test geoips_clavrx and data_fusion

Comment on lines 174 to 177
.. code:: bash

# Ensure geoips python environment enabled before installing geoips
pip install "$GEOIPS_PACKAGES_DIR/geoips[doc,lint,test,debug]"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just go with pip install -e here, and take out the next section.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to -e and moved the development section to a different document

Comment on lines 96 to 99
.. note::

If you would like to run plugins that require fortran, you will need to install ``gfortran``.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

People will likely not know this in advance, so it may just confuse matters whether thye need it or not.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed, added to default install command

Comment on lines 127 to 137
.. code:: bash

# Ensure geoips python environment enabled before installing geoips
pip install -e "$GEOIPS_PACKAGES_DIR/geoips[test]"

If you want to install GeoIPS with all optional dependencies, you can use:

.. code:: bash

# Ensure geoips python environment enabled before installing geoips
pip install "$GEOIPS_PACKAGES_DIR/geoips[doc,lint,test,debug]"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would ONLY include

pip install -e "$GEOIPS_PACKAGES_DIR/geoips[doc,lint,test,debug]"

Right now the tests will fail if doc,lint,test,debug are not all installed.

Just have one geoips installation method.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add -e to the second line - is there any reason to install doc, lint, and debug? See above - my tests seem to be passing without them

# Ensure geoips python environment enabled before installing geoips
pip install "$GEOIPS_PACKAGES_DIR/geoips[doc,lint,test,debug]"

The optional dependencies are:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would make a note here:

"These optional dependencies are all required for tests to fully pass"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comments above 🙂

Comment on lines +3 to +33
Install GeoIPS
--------------

We can use ``pip`` to install all GeoIPS Python dependencies, and GeoIPS itself.

First, clone the GeoIPS git repository:

.. code:: bash

git clone https://github.com/NRLMMD-GeoIPS/geoips.git $GEOIPS_PACKAGES_DIR/geoips

.. code:: bash

# Ensure geoips python environment enabled before installing geoips
pip install "$GEOIPS_PACKAGES_DIR/geoips"

If you want to install GeoIPS with all optional dependencies, you can use:

.. code:: bash

# Ensure geoips python environment enabled before installing geoips
pip install "$GEOIPS_PACKAGES_DIR/geoips[doc,lint,test,debug]"

The optional dependencies are:

- ``doc``: for building the documentation with Sphinx
(the documentation is also available online at
https://nrlmmd-geoips.github.io/geoips/)
- ``lint``: for linting the code (useful for developers)
- ``test``: for running the tests
- ``debug``: for debugging the code with IPython/jupyter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the intention for this section of the installation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intention is to - later - embed it in the advanced and the basic installation instructions

Comment on lines +1 to +11
:orphan:

Testing
=======

.. note::

Setting up WSL through windows is the easiest method for running GeoIPS on
a Windows system. To do so, follow directions on
`Microsoft WSL Install <https://learn.microsoft.com/en-us/windows/wsl/install>`_.
This requires administrator privileges.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the intention for this section of the getting started?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intention is to add more information about testing geoips in the future, but that's not needed here

Comment on lines +8 to +35
Installing
==========

.. note::

Setting up WSL through windows is the easiest method for running GeoIPS on
a Windows system. To do so, follow directions on
`Microsoft WSL Install <https://learn.microsoft.com/en-us/windows/wsl/install>`_.
This requires administrator privileges.

For all installation methods, you need to setup environmental variables.

The required environmental variables are:

-``GEOIPS_PACKAGES_DIR`` is where GeoIPS looks for itself and its plugin packages
-``GEOIPS_TESTDATA_DIR`` is where GeoIPS looks to find its test datasets
-``GEOIPS_OUTDIRS`` defines where GeoIPS will write output data and imagery

These are fine defaults for most users:

.. code:: bash

export GEOIPS_PACKAGES_DIR=$HOME/geoips
export GEOIPS_TESTDATA_DIR=$GEOIPS_PACKAGES_DIR/test_data
export GEOIPS_OUTDIRS=$GEOIPS_PACKAGES_DIR/outdirs

If desired, the GeoIPS environment variables can be added to your
default shell configuration file (which is typically stored in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we going to link to this from anywhere, or just leave it orphaned for now, for later update / completion?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ I think orphaned for now is fine

| # # # This source code is protected under the license referenced at
| # # # https://github.com/NRLMMD-GEOIPS.

Installing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is going to be our "official" installatin method that we are sending out for people to use this week, then we will need to update the README.md to point here for installation.

Do we want to update this now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what I tested, but I'm fine sending out the old instructions and waiting on this if we still have things to discuss

@biosafetylvl5 biosafetylvl5 added the documentation Improvements or additions to documentation label Jul 22, 2024

.. code:: bash

mamba create -y -n geoips -c conda-forge python=3.10 openblas git gfortran **pyhdf**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might just comment this line so people don't do this by default. I don't know if it matters either way, but 99% sure people will just copy/paste their way through.

https://nrlmmd-geoips.github.io/geoips/)
- ``lint``: for linting the code (useful for developers)
- ``test``: for running the tests
- ``debug``: for debugging the code with IPython/jupyter (also useful for developers)
Copy link
Contributor

@mindyls mindyls Jul 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is worth having the base_install.sh and base_test.sh bundled as part of the basic installation - it is worth having immediate feedback that the install was successful. And it's really only 3 extra lines (base_install.sh, create_plugin_registries, and base_test.sh).

Oh - there is no create_plugin_registries included in this installation, so geoips is not fully functional at the end of this document.

@biosafetylvl5 biosafetylvl5 marked this pull request as draft October 21, 2024 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Documentation: Environmental Setups for GeoIPS Installation
3 participants