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

Reenable docker environment #242

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
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM jupyter/minimal-notebook:latest

USER root

RUN apt-get update && apt-get install -y libgl1-mesa-glx gdb

RUN apt-get install -y libtiff5-dev libjpeg8-dev libopenjp2-7-dev zlib1g-dev \
libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk \
libharfbuzz-dev libfribidi-dev libxcb1-dev

RUN apt-get -o Dpkg::Options::="--force-confmiss" install --reinstall netbase

USER jovyan

RUN python3 -m pip install gdbgui matplotlib coverage

WORKDIR /home/jovyan

COPY --chown=jovyan:users ./requirements.txt ./requirements.txt

RUN pip install -r ./requirements.txt

CMD start-notebook.sh
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ Table of contents
- [Usage](#usage)
- [_Simple example to illustrate the use of SpatialPy_](#simple-example-to-illustrate-the-use-of-spatialpy)
- [_Docker environment_](#docker-environment)
- [_Debugging_](#debugging)
- [_Profiling_](#profiling)
- [Getting help](#getting-help)
- [Contributing](#contributing)
- [_Debugging_](#debugging)
- [_Profiling_](#profiling)
- [License](#license)
- [Authors and history](#authors-and-history)
- [Acknowledgments](#acknowledgments)
Expand Down Expand Up @@ -72,8 +72,7 @@ SpatialPy provides simple object-oriented abstractions for defining a model of a

The `run()` method can be customized using keyword arguments to select different solvers, random seed, data return type and more. For more detailed examples on how to use SpatialPy, please see the Jupyter notebooks contained in the [examples](https://github.com/StochSS/SpatialPy/tree/main/examples) subdirectory.


### Docker environment
### Docker environment (DOES NOT WORK)

You can use Docker to create a repeatable environment for developing and debugging SpatialPy. The supplied Dockerfile starts a jupyter server with SpatialPy dependencies installed.

Expand All @@ -83,7 +82,7 @@ Otherwise:

```bash
docker build -t spatialpy:latest .
docker run -v ./:/home/jovyan/spatialpy -v ./tmp:/tmp -p 8888:8888 -p 5000:5000
docker run -it spatialpy:latest -v ./:/home/jovyan/spatialpy -v ./tmp:/tmp -p 8888:8888 -p 5000:5000 /bin/bash -c "start-notebook.sh"
```

The SpatialPy repo is mounted into /home/jovyan so you can import it in the usual way for development (see examples).
Expand All @@ -92,16 +91,6 @@ Any changes you make to your local codebase are reflected in the docker containe

The `/tmp` directory is also mounted for easy access to build and result directories.

### Debugging

In order to compile the solver binary for use by the debugger, run `solver.compile()` with `debug=True`. This will inject the `-g` flag into the `gcc` command that compiles the solver, enabling gdb debug information.

You can invoke `solver.run_debugger()` anytime after you instantiate a solver in Python to start up a new session of gdbgui. The debugger will be available at http://127.0.0.1:5000.


### Profiling

To enable profiling, both `solver.compile()` and `solver.run()` need to be invoked with `profile=True`. If you don't run `solver.compile()` explicitly, invoking `solver.run()` with `profile=True` will run `compile()` correctly for you.

Getting help
------------
Expand All @@ -121,6 +110,16 @@ New developments happen primarily in the [`develop`](https://github.com/StochSS/
|:---------------:|:--------------:|
| [![Build Status](https://github.com/StochSS/SpatialPy/actions/workflows/run-tests.yml/badge.svg)](https://github.com/StochSS/SpatialPy/actions/workflows/run-tests.yml) | [![Build Status](https://github.com/StochSS/SpatialPy/actions/workflows/run-tests.yml/badge.svg?branch=develop)](https://github.com/StochSS/SpatialPy/actions/workflows/run-tests.yml)

### Debugging

In order to compile the solver binary for use by the debugger, run `solver.compile()` with `debug=True`. This will inject the `-g` flag into the `gcc` command that compiles the solver, enabling gdb debug information.

You can invoke `solver.run_debugger()` anytime after you instantiate a solver in Python to start up a new session of gdbgui. The debugger will be available at http://127.0.0.1:5000.


### Profiling

To enable profiling, both `solver.compile()` and `solver.run()` need to be invoked with `profile=True`. If you don't run `solver.compile()` explicitly, invoking `solver.run()` with `profile=True` will run `compile()` correctly for you.
License
-------

Expand Down
17 changes: 0 additions & 17 deletions RELEASE_NOTES

This file was deleted.