Skip to content

Commit

Permalink
Remove Docker (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
wtgee authored Dec 27, 2021
1 parent d29b0c8 commit b20034f
Show file tree
Hide file tree
Showing 14 changed files with 61 additions and 294 deletions.
27 changes: 0 additions & 27 deletions .dockerignore

This file was deleted.

27 changes: 14 additions & 13 deletions .github/workflows/pythontest.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: Test Python

on: [ push, pull_request ]
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.7 ]
python-version: [ "3.10" ]
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -22,21 +21,23 @@ jobs:
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=100 --statistics
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [ 3.7 ]
os: [ ubuntu-latest ]
python-version: [ '3.7', '3.8', '3.9', '3.10' ]
exclude:
- os: macos-latest
python-version: '3.8'
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build panoptes-utils in container
run: |
docker build -t panoptes-utils:testing -f tests/Dockerfile .
mkdir -p logs && chmod -R 777 logs
mkdir -p build && chmod -R 777 build
- name: Test panoptes-utils
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install and test panoptes-utils on ${{ matrix.python-version }}
run: |
docker run --rm -i --privileged -v "${PWD}/build:/app/build" -v "${PWD}/logs:/app/logs" panoptes-utils:testing
pip install -e ".[config,images,testing,social]"
pytest
- name: Upload coverage report to codecov.io
uses: codecov/codecov-action@v1
if: success()
Expand Down
56 changes: 18 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,6 @@ Utility functions for use within the [Project PANOPTES](https://projectpanoptes.

This library defines a number of modules that contain useful functions as well as a few services.

Dependencies
------------

There are a few system dependencies depending on what functionality you will be using.

In particular, the plate solving requires `astrometry.net` and the appropriate index files.

Use the following on a debian-based system (e.g. Ubuntu) to install all dependencies:

```bash
apt-get update

apt-get install --no-install-recommends --yes \
wait-for-it \
bzip2 ca-certificates gcc pkg-config \
libffi-dev libssl-dev \
astrometry.net astrometry-data-tycho2-08 astrometry-data-tycho2 \
dcraw exiftool libcfitsio-dev libcfitsio-bin \
libfreetype6-dev libpng-dev libjpeg-dev libffi-dev \
git
```

Install
-------

Expand All @@ -51,28 +29,30 @@ pip install -e ".[config,docs,images,testing,social]"

See the full documentation at: https://panoptes-utils.readthedocs.io

Docker Service
==============

The `docker` folder defines an image that can be used as the base for other
PANOPTES services.
Config Server
-------------

The `Dockerfile` is built by the `cloudbuild.yaml` and stored in Google
Registry as `gcr.io/panoptes-exp/panoptes-utils:latest`.
There is a simple key-value configuration server available as part of the module.

You can pull the image like any other docker image:
After installing with the `config` option as above, type:

```
docker pull gcr.io/panoptes-exp/panoptes-utils:latest
```bash
panoptes-config-server run --config-file <path-to-file.yaml>
```

Config Server
-------------
Dependencies
------------

There is also a service defined in `docker-compose.yaml` that will run the
`panoptes-config-server` cli tool.
There are a few system dependencies depending on what functionality you will be using.

In particular, the plate solving requires `astrometry.net` and the appropriate index files.

Use the following on a debian-based system (e.g. Ubuntu) to install all dependencies:

```bash
PANOPTES_CONFIG_FILE=/path/to/config.yaml docker-compose \
-f docker/docker-compose.yaml up
apt-get update && apt-get install --no-install-recommends --yes \
libffi-dev libssl-dev \
astrometry.net astrometry-data-tycho2 \
dcraw exiftool libcfitsio-dev libcfitsio-bin \
libfreetype6-dev libpng-dev libjpeg-dev libffi-dev
```
14 changes: 13 additions & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from _pytest.logging import caplog as _caplog # noqa
from loguru import logger
from matplotlib import pyplot as plt

from panoptes.utils.config.server import config_server
from panoptes.utils.database import PanDB

Expand Down Expand Up @@ -55,12 +56,14 @@ def pytest_configure(config):
config_server(config_file, host='localhost', port=8765, load_local=False, save_local=False)
logger.success('Config server set up')

config.addinivalue_line('markers', 'plate_solve: Tests that require astrometry.net')


def pytest_addoption(parser):
db_names = ",".join(_all_databases) + ' (or all for all databases)'
group = parser.getgroup("PANOPTES pytest options")
group.addoption(
"--astrometry",
"--test-solve",
action="store_true",
default=False,
help="If tests that require solving should be run")
Expand All @@ -72,6 +75,15 @@ def pytest_addoption(parser):
". Note that travis-ci will test all of them by default."))


def pytest_collection_modifyitems(config, items):
if config.getoption('--test-solve'):
return
skip_solve = pytest.mark.skip(reason='No plate solving requested')
for item in items:
if 'plate_solve' in item.keywords:
item.add_marker(skip_solve)


@pytest.fixture(scope='session')
def config_path():
return os.getenv('PANOPTES_CONFIG_FILE', 'tests/testing.yaml')
Expand Down
2 changes: 0 additions & 2 deletions docker/.gcloudignore

This file was deleted.

64 changes: 0 additions & 64 deletions docker/Dockerfile

This file was deleted.

58 changes: 0 additions & 58 deletions docker/cloudbuild.yaml

This file was deleted.

21 changes: 0 additions & 21 deletions docker/docker-compose.yaml

This file was deleted.

22 changes: 0 additions & 22 deletions docker/environment.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ install_requires =
Deprecated
loguru
numpy
pyserial
pyserial>=3.4
python-dateutil
requests
ruamel.yaml
Expand Down
Loading

0 comments on commit b20034f

Please sign in to comment.