-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
172 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.venv | ||
build | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
QSL_DATA_MOUNT=<absolute path where your qgis projects are stored> | ||
QSL_LOG_LEVEL=debug | ||
QSL_REPLICAS=1 | ||
QSL_REDIS_URL=redis://redis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Build and push worker | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
file: Dockerfile | ||
target: release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,6 @@ | |
*.egg-info/ | ||
__pycache__/ | ||
src/*.egg-info | ||
.env | ||
build | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,25 @@ | ||
FROM ghcr.io/opengisch/qgis-slim:3.34.10 AS dev | ||
FROM ghcr.io/opengisch/qgis-slim:3.34.10 AS base | ||
|
||
# switch to root user for install | ||
USER 0 | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
python3-pip \ | ||
python3-setuptools | ||
|
||
######################### | ||
# DEV | ||
######################### | ||
FROM base AS dev | ||
|
||
LABEL org.opengisch.author="Clemens Rudert <[email protected]>" | ||
LABEL org.opengisch.image.title="QGIS-Server-Light" | ||
USER 0 | ||
|
||
RUN apt-get update -y && \ | ||
apt-get install -y \ | ||
python3-full \ | ||
python3-dev \ | ||
make \ | ||
build-essential | ||
RUN apt-get install -y \ | ||
python3-venv \ | ||
make | ||
|
||
WORKDIR /opt/qgis-server-light/ | ||
ADD requirements.worker.txt . | ||
|
@@ -29,3 +39,23 @@ RUN VENV_PATH=${VENV_PATH} make dev | |
ENTRYPOINT ["/tini", "--", "/opt/qgis-server-light/venv/bin/python3", "-m"] | ||
|
||
CMD ["qgis_server_light.worker.redis"] | ||
|
||
######################### | ||
# BUILDER (FOR RELEASE) | ||
######################### | ||
FROM base AS builder | ||
|
||
WORKDIR /app | ||
COPY ./ . | ||
RUN WITH_WORKER=true python3 setup.py bdist_wheel | ||
|
||
######################### | ||
# RELEASE | ||
######################### | ||
FROM base AS release | ||
COPY --from=builder /app/dist/*.whl /tmp | ||
RUN pip3 install /tmp/*.whl | ||
|
||
USER 1001 | ||
|
||
CMD ["redis_worker"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ include CHANGES.md | |
include README.md | ||
include LICENSE.md | ||
include pytest.ini | ||
include requirements.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,73 @@ | ||
import os | ||
import re | ||
|
||
from setuptools import setup, find_packages | ||
from setuptools import setup | ||
|
||
here = os.path.abspath(os.path.dirname(__name__)) | ||
with open(os.path.join(here, 'README.md')) as f: | ||
with open(os.path.join(here, "README.md")) as f: | ||
README = f.read() | ||
with open(os.path.join(here, 'CHANGES.md')) as f: | ||
with open(os.path.join(here, "CHANGES.md")) as f: | ||
CHANGES = f.read() | ||
|
||
with open(os.path.join(here, 'requirements.interface.txt')) as f: | ||
re_ = re.compile(r'(.+)==') | ||
recommend = f.read().splitlines() | ||
requires = [re_.match(r).group(1) for r in recommend] | ||
with open(os.path.join(here, "requirements.interface.txt")) as f: | ||
install_requires = f.read().splitlines() | ||
|
||
tests_require = [ | ||
'pytest', # includes virtualenv | ||
'pytest-cov' | ||
] | ||
tests_require = ["pytest", "pytest-cov"] # includes virtualenv | ||
worker_files = {} | ||
worker_modules = [] | ||
worker_packages = [] | ||
worker_scripts = [] | ||
if os.environ.get("WITH_WORKER", False): | ||
with open(os.path.join(here, "requirements.worker.txt")) as f: | ||
install_requires = install_requires + f.read().splitlines() | ||
|
||
worker_files = {"qgis_server_light.worker": ["*.py"]} | ||
worker_modules = [ | ||
"qgis_server_light/worker/engine", | ||
"qgis_server_light/worker/image_utils", | ||
"qgis_server_light/worker/qgis", | ||
"qgis_server_light/worker/redis", | ||
"qgis_server_light/worker/runner", | ||
] | ||
worker_packages = ["qgis_server_light.worker"] | ||
worker_scripts = ["redis_worker=qgis_server_light.worker.redis:main"] | ||
|
||
package_data = {"qgis_server_light.interface": ["*.py"]} | ||
package_data.update(worker_files) | ||
|
||
setup( | ||
name='qgis_server_light', | ||
version='v0.0.1', | ||
description='qgis renderer as a python process', | ||
long_description=README + '\n\n' + CHANGES, | ||
name="qgis_server_light", | ||
version="v0.0.1", | ||
description="qgis renderer as a python process", | ||
long_description=README + "\n\n" + CHANGES, | ||
classifiers=[ | ||
"Development Status :: 2 - Pre-Alpha", | ||
"Intended Audience :: Developers", | ||
"Programming Language :: Python", | ||
"Framework :: Pyramid", | ||
"Programming Language :: Python :: 3.10", | ||
"Topic :: Internet :: WWW/HTTP", | ||
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application", | ||
"Topic :: Internet :: WWW/HTTP :: ASGI :: Application", | ||
"Typing :: Typed", | ||
], | ||
author='Clemens Rudert (OPENGIS.ch)', | ||
author_email='[email protected]', | ||
url='https://github.com/opengisch/qgis-server-light', | ||
keywords=['web worker qgis qgis-server processing'], | ||
packages=['qgis_server_light.interface'], | ||
package_dir={'': 'src'}, | ||
package_data={ | ||
"qgis_server_light.interface": ["*.py"] | ||
}, | ||
author="Clemens Rudert (OPENGIS.ch)", | ||
author_email="[email protected]", | ||
url="https://github.com/opengisch/qgis-server-light", | ||
keywords=["web worker qgis qgis-server processing"], | ||
packages=["qgis_server_light.interface"] + worker_packages, | ||
package_dir={"": "src"}, | ||
package_data=package_data, | ||
py_modules=[ | ||
'qgis_server_light/interface/job', | ||
'qgis_server_light/interface/dispatcher', | ||
'qgis_server_light/interface/qgis' | ||
|
||
], | ||
"qgis_server_light/interface/job", | ||
"qgis_server_light/interface/dispatcher", | ||
"qgis_server_light/interface/qgis", | ||
] | ||
+ worker_modules, | ||
include_package_data=True, | ||
zip_safe=False, | ||
project_urls={ | ||
'Documentation': 'https://github.com/opengisch/qgis-server-light', | ||
'Changelog': 'https://github.com/opengisch/qgis-server-light/blob/master/CHANGES.md', | ||
'Issue Tracker': 'https://github.com/opengisch/qgis-server-light/issues', | ||
}, | ||
extras_require={ | ||
'recommend': recommend, | ||
'no-version': requires, | ||
'testing': tests_require, | ||
"Documentation": "https://github.com/opengisch/qgis-server-light", | ||
"Changelog": "https://github.com/opengisch/qgis-server-light/blob/master/CHANGES.md", | ||
"Issue Tracker": "https://github.com/opengisch/qgis-server-light/issues", | ||
}, | ||
entry_points={ | ||
} | ||
install_requires=install_requires, | ||
entry_points={"console_scripts": [] + worker_scripts}, | ||
) |
Oops, something went wrong.