Skip to content

Commit

Permalink
Merge branch 'master' into reproducible-build
Browse files Browse the repository at this point in the history
  • Loading branch information
weskamm committed Nov 24, 2023
2 parents 7ca7140 + 77ea603 commit 839e4f8
Show file tree
Hide file tree
Showing 138 changed files with 3,054 additions and 1,201 deletions.
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
127 changes: 127 additions & 0 deletions .github/workflows/dockerbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: Docker Build and Publish

permissions:
packages: write

on:
workflow_dispatch:
inputs:
tags:
description: 'Manual supplied image tag like 1.16.0'
required: true
type: string
push:
tags:
- "*.*.*"
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}/mapproxy
tags: |
type=semver,pattern={{version}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push base image
uses: docker/build-push-action@v5
if: ${{ inputs.tags }}
with:
context: docker/
file: ./docker/Dockerfile
push: true
build-args: |
MAPPROXY_VERSION=${{ inputs.tags }}
target: base
tags: |
ghcr.io/${{ github.repository }}/mapproxy:${{ inputs.tags }}
platforms: linux/amd64,linux/arm64

- name: Build and push base image
uses: docker/build-push-action@v5
if: ${{ !inputs.tags }}
with:
context: docker/
file: ./docker/Dockerfile
push: true
build-args: |
MAPPROXY_VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
target: base
tags: |
ghcr.io/${{ github.repository }}/mapproxy:${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
platforms: linux/amd64,linux/arm64

- name: Build and push development image
uses: docker/build-push-action@v5
if: ${{ inputs.tags }}
with:
context: docker/
file: ./docker/Dockerfile
push: true
build-args: |
MAPPROXY_VERSION=${{ inputs.tags }}
target: development
tags: |
ghcr.io/${{ github.repository }}/mapproxy:${{ inputs.tags }}-dev
platforms: linux/amd64,linux/arm64

- name: Build and push development image
uses: docker/build-push-action@v5
if: ${{ !inputs.tags }}
with:
context: docker/
file: ./docker/Dockerfile
push: true
build-args: |
MAPPROXY_VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
target: development
tags: |
ghcr.io/${{ github.repository }}/mapproxy:${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}-dev
platforms: linux/amd64,linux/arm64

- name: Build and push nginx image
uses: docker/build-push-action@v5
if: ${{ inputs.tags }}
with:
context: docker/
file: ./docker/Dockerfile
push: true
build-args: |
MAPPROXY_VERSION=${{ inputs.tags }}
target: nginx
tags: |
ghcr.io/${{ github.repository }}/mapproxy:${{ inputs.tags }}-nginx
platforms: linux/amd64,linux/arm64

- name: Build and push nginx image
uses: docker/build-push-action@v5
if: ${{ !inputs.tags }}
with:
context: docker/
file: ./docker/Dockerfile
push: true
build-args: |
MAPPROXY_VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
target: nginx
tags: |
ghcr.io/${{ github.repository }}/mapproxy:${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}-nginx
platforms: linux/amd64,linux/arm64
4 changes: 2 additions & 2 deletions .github/workflows/ghpages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install dependencies ⏬
run: pip install sphinx sphinx-bootstrap-theme
Expand All @@ -22,8 +22,8 @@ jobs:
git config --global user.name 'ghpages'
git config --global user.email 'ghpages@users.noreply.github.com'
git fetch --all
git reset --hard HEAD
git checkout gh-pages
git pull origin gh-pages
git rebase origin/master
sphinx-build doc/ docs
git add docs
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,21 @@ jobs:
ports:
- 8087:8087
- 8098:8098

azure-blob:
image: mcr.microsoft.com/azure-storage/azurite
ports:
- 10000:10000

strategy:
matrix:
python-version: [2.7, 3.6, 3.7, 3.8, 3.9, "3.10"]
python-version: [3.8, 3.9, "3.10", "3.11"]

env:
MAPPROXY_TEST_COUCHDB: 'http://localhost:5984'
MAPPROXY_TEST_REDIS: '127.0.0.1:6379'
MAPPROXY_TEST_RIAK_HTTP: 'http://localhost:8098'
MAPPROXY_TEST_RIAK_PBC: 'pbc://localhost:8087'
MAPPROXY_TEST_AZURE_BLOB: 'http://localhost:10000'
# do not load /etc/boto.cfg with Python 3 incompatible plugin
# https://github.com/travis-ci/travis-ci/issues/5246#issuecomment-166460882
BOTO_CONFIG: '/doesnotexist'
Expand All @@ -47,15 +52,15 @@ jobs:
sudo apt install proj-bin libgeos-dev libgdal-dev libxslt1-dev libxml2-dev build-essential python-dev libjpeg-dev zlib1g-dev libfreetype6-dev protobuf-compiler libprotoc-dev -y
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Use python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Cache python deps 💾
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.OS }}-python-${{ hashFiles('**/requirements-tests.txt') }}
Expand All @@ -66,7 +71,6 @@ jobs:
- name: Install dependencies ⏬
run: |
pip install -r requirements-tests.txt
if [[ ${{ matrix.python-version }} = 2.7 || ${{ matrix.python-version }} = 3.8 ]]; then pip install -U "Pillow!=8.3.0,!=8.3.1"; fi
pip freeze
- name: Run tests 🏗️
Expand Down
26 changes: 26 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
Nightly
~~~~~~~~~~~~~~~~~

1.16.0 2023-04-13
~~~~~~~~~~~~~~~~~
Breaking:

- Removal of old unsupported python versions 2.7 and 3.6
- Tested python version range is now 3.7 to 3.11
- Lots of dependency updates

Improvements:

- New cache: Azure Blob storage
- Lots of dependency updates
- Support for JSON legends
- Updated layer preview to use latest openlayers
- Official docker images released, documentation updated

Fixes:

- Fixed issues with sqlite cache (#629 and #625)
- Dependency correction
- library detection difficulties on some operating systems
- encoding issues with umlauts in featureinfo
- Several minor bugfixes
- mapproxy-util export - derive image format from cache config

1.15.1 2022-06-14
~~~~~~~~~~~~~~~~~

Expand Down
39 changes: 18 additions & 21 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,39 @@ Dev Setup
=========

* Create parent directory for source, applications and the virtual env
* Clone source into directory mapproxy: `git clone `
* Install dependencies: https://mapproxy.org/docs/latest/install.html#install-dependencies
* Clone source into directory mapproxy: `git clone`
* Install dependencies: <https://mapproxy.org/docs/latest/install.html#install-dependencies>
* Create virtualenv: `python3.6 -m venv ./venv`
* Activate virtualenv: `source venv/bin/activate`
* Install mapproxy: `pip install -e mapproxy/`
* Install dev dependencies: `pip install -r mapproxy/requirements-tests.txt`
* Run tests:
* `cd mapproxy`
* `pytest mapproxy`
* Run single test: `pytest mapproxy/test/unit/test_grid.py -v`
* `cd mapproxy`
* `pytest mapproxy`
* Run single test: `pytest mapproxy/test/unit/test_grid.py -v`
* Create an application: `mapproxy-util create -t base-config apps/base`

* Start a dev server in debug mode: `mapproxy-util serve-develop apps/base/mapproxy.yaml --debug`


Coding Style
------------

PEP8: https://www.python.org/dev/peps/pep-0008/

PEP8: <https://www.python.org/dev/peps/pep-0008/>

Debugging
---------

- With PyCharm:
* Attach to dev server with https://www.jetbrains.com/help/pycharm/attaching-to-local-process.html
* With PyCharm:
* Attach to dev server with <https://www.jetbrains.com/help/pycharm/attaching-to-local-process.html>

- With ipython:
* `pip install ipython ipdb`
* With ipython:
* `pip install ipython ipdb`

- With Visual Studio Code:
* After creating a virtual env and mapproxy configuration:
* Create a `launch.json` file in the project-root/.vscode directory with the following content:
```
* With Visual Studio Code:
* After creating a virtual env and mapproxy configuration:
* Create a `launch.json` file in the project-root/.vscode directory with the following content:

```json
{
"version": "0.2.0",
"configurations": [
Expand All @@ -54,14 +53,12 @@ Debugging
}
```

* Then start debugging by hitting `F5`.

* Then start debugging by hitting `F5`.

Some more details in the documentation
--------------------------------------

See https://mapproxy.org/docs/latest/development.html

See <https://mapproxy.org/docs/latest/development.html>

Some incomplete notes about the structure of the software
---------------------------------------------------------
Expand All @@ -80,4 +77,4 @@ The sources live in `source/` which in turn use low-level functions from `client

The file `layer.py` merges/clips/transforms tiles.

The whole of MapProxy is stateless apart from the chache which uses locks on file system level.
The whole of MapProxy is stateless apart from the cache which uses locks on file system level.

0 comments on commit 839e4f8

Please sign in to comment.