diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..10c0b03 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +.github +.gitignore +README.md +.env +.pypirc +requirements.in +requirements_gpu.in +requirements_gpu.txt \ No newline at end of file diff --git a/.github/workflows/Branch-protection.yml b/.github/workflows/Branch-protection.yml new file mode 100644 index 0000000..c18d3a6 --- /dev/null +++ b/.github/workflows/Branch-protection.yml @@ -0,0 +1,11 @@ +name: Check branch origin + +on: + pull_request: + +jobs: + check-branch-protection: + uses: Geode-solutions/actions/.github/workflows/branch-protection.yml@master + with: + branch_from: 'next' + branch_to: 'master' diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml new file mode 100644 index 0000000..9161845 --- /dev/null +++ b/.github/workflows/CICD.yml @@ -0,0 +1,47 @@ +name: CICD + +on: + push: + +jobs: + build: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/next' || github.ref == 'refs/heads/master' + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.TOKEN }} + - name: Python Semantic Release + uses: python-semantic-release/python-semantic-release@master + id: semantic-release + with: + github_token: ${{ secrets.TOKEN }} + - name: Build + run: | + python3 -m pip install --upgrade build + python3 -m build + - name: Upload PYPI + if: steps.semantic-release.outputs.released == 'true' + run: | + python3 -m pip install twine + python3 -m twine upload --repository pypi dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }} + - name: Merge master -> next + if: github.ref == 'refs/heads/master' + uses: devmasx/merge-branch@master + with: + type: now + from_branch: master + target_branch: next + github_token: ${{ github.token }} + + + docker-build-squash-push: + uses: Geode-solutions/actions/.github/workflows/docker-build-squash-push.yml@master + if: github.ref == 'refs/heads/next' || github.ref == 'refs/heads/master' + with: + image_name: 'geodeapp-viewer' + tag: ${{ github.ref_name }} + secrets: + TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 68bc17f..6769e21 100644 --- a/.gitignore +++ b/.gitignore @@ -157,4 +157,4 @@ cython_debug/ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ +#.idea/ \ No newline at end of file diff --git a/.pypirc b/.pypirc new file mode 100644 index 0000000..3c0c6f3 --- /dev/null +++ b/.pypirc @@ -0,0 +1,6 @@ +[distutils] +index-servers = pypi + +[pypi] +username = __token__ +password = diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..dc60592 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,59 @@ +# CHANGELOG + + + +## v0.1.0-rc.3 (2024-06-11) + +### Feature + +* feat(SetupViewer): Trigger Semantic Realease ([`ddef573`](https://github.com/Geode-solutions/GeodeApp-Viewer/commit/ddef573231d93632e931aa6426afdda1a76f9e70)) + +### Unknown + +* Merge pull request #4 from Geode-solutions/feat_tao + +feat(SetupViewer): Trigger Semantic Realease ([`def48c0`](https://github.com/Geode-solutions/GeodeApp-Viewer/commit/def48c08a2cff28bcf82bcfa4a455ece08dda750)) + +* Merge pull request #3 from Geode-solutions/feat_tao_viewer + +added script ([`d7b331d`](https://github.com/Geode-solutions/GeodeApp-Viewer/commit/d7b331d36a3c761e9c41dbaf2996e20fcb5f2c58)) + +* links edit ([`54d5a11`](https://github.com/Geode-solutions/GeodeApp-Viewer/commit/54d5a1158ac66582d91cafe7492bb9955d1a62ef)) + +* added script ([`81096ab`](https://github.com/Geode-solutions/GeodeApp-Viewer/commit/81096ab8667df5d2c9316c320bdb4af2cf4c92e8)) + + +## v0.1.0-rc.2 (2024-04-02) + +### Fix + +* fix(gh actions): test trigger semantic-release ([`0ba50a6`](https://github.com/Geode-solutions/GeodeApp-Viewer/commit/0ba50a6cc4d7cfc917082ea91ee77c64b63d9849)) + + +## v0.1.0-rc.1 (2024-04-02) + +### Feature + +* feat(viewer): add viewer ([`b01f028`](https://github.com/Geode-solutions/GeodeApp-Viewer/commit/b01f02831f130d32a5233b4bc36722ed48b78f74)) + +### Fix + +* fix(CICD): add pypi publish ([`b31fe86`](https://github.com/Geode-solutions/GeodeApp-Viewer/commit/b31fe8662a3c233986bcb73b359742fd8bcb1ccb)) + +### Unknown + +* Merge pull request #2 from Geode-solutions/fix/pypi + +fix(CICD): add pypi publish ([`32336c6`](https://github.com/Geode-solutions/GeodeApp-Viewer/commit/32336c69e3db2712c154d3b2af30965504622b27)) + +* Merge pull request #1 from Geode-solutions/feat/viewer + +feat(viewer): add viewer ([`d59e63b`](https://github.com/Geode-solutions/GeodeApp-Viewer/commit/d59e63bcc8f1d36039a6b1f556faae8033bd4f0e)) + +* update .dockerignore ([`cf0419d`](https://github.com/Geode-solutions/GeodeApp-Viewer/commit/cf0419d0bd0bee39569582291693a7e5510aea38)) + +* requirements_gpu specific ([`2247d9c`](https://github.com/Geode-solutions/GeodeApp-Viewer/commit/2247d9c84b16b2f67662065a483dde906a4916d6)) + +* mode to python package ([`0c6ef5c`](https://github.com/Geode-solutions/GeodeApp-Viewer/commit/0c6ef5cac721a09f5ff36cca2b1b2515e9e0b265)) + +* Initial commit ([`d1d1909`](https://github.com/Geode-solutions/GeodeApp-Viewer/commit/d1d19099404133803d7f6cd139d073adc405df73)) diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..27488f0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM python:3.9-slim + +WORKDIR /app + +COPY . . +RUN pip3 install --user -r requirements.txt && pip3 cache purge +RUN pip3 install https://www.vtk.org/files/release/9.3/vtk_osmesa-9.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl +ENV PYTHONPATH="/usr/local:$PYTHONPATH" +ENV PYTHON_ENV="prod" + +CMD python src/geodeapp_viewer/app.py + +EXPOSE 1234 \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..cd8cb27 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,55 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + + +[project] +name = "GeodeApp-Viewer" +version = "0.1.0-rc.3" +dynamic = ["dependencies"] +authors = [ + { name="Geode-solutions", email="team-web@geode-solutions.com" }, +] +description = "GeopeApp-Viewer is the viewer microservice of the GeodeApp" +readme = "README.md" +requires-python = ">=3.8" +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", +] + +[project.optional-dependencies] +gpu = ["vtk == 9.*"] + +[project.urls] +"Homepage" = "https://github.com/Geode-solutions/GeodeApp-Viewer" +"Bug Tracker" = "https://github.com/Geode-solutions/GeodeApp-Viewer/issues" + +[project.scripts] +geodeapp_viewer = "geodeapp_viewer.app:run_viewer" + + +[tool.setuptools.dynamic] +dependencies = {file = ["requirements_gpu.txt"]} + +[tool.setuptools.packages.find] +where = ["src"] + +[tool.setuptools.package-data] +"geodeapp_viewer.rpc.schemas" = ["*.json"] + +[tool.semantic_release] +version_toml = [ + "pyproject.toml:project.version", +] + +[tool.semantic_release.remote.token] +env = "GH_TOKEN" + +[tool.semantic_release.branches.master] +match = "master" + +[tool.semantic_release.branches.next] +match = "next" +prerelease = true diff --git a/requirements.in b/requirements.in new file mode 100644 index 0000000..452ecb7 --- /dev/null +++ b/requirements.in @@ -0,0 +1 @@ +opengeodeweb-viewer \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..f31b6b6 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,66 @@ +# +# This file is autogenerated by pip-compile with Python 3.10 +# by the following command: +# +# pip-compile requirements.in +# +aiohttp==3.9.3 + # via + # opengeodeweb-viewer + # wslink +aiosignal==1.3.1 + # via + # aiohttp + # opengeodeweb-viewer +async-timeout==4.0.3 + # via + # aiohttp + # opengeodeweb-viewer +attrs==23.2.0 + # via + # aiohttp + # jsonschema + # opengeodeweb-viewer + # referencing +frozenlist==1.4.1 + # via + # aiohttp + # aiosignal + # opengeodeweb-viewer +idna==3.6 + # via + # opengeodeweb-viewer + # yarl +jsonschema==4.21.1 + # via opengeodeweb-viewer +jsonschema-specifications==2023.12.1 + # via + # jsonschema + # opengeodeweb-viewer +multidict==6.0.5 + # via + # aiohttp + # opengeodeweb-viewer + # yarl +opengeodeweb-viewer==0.1.1 + # via -r requirements.in +python-dotenv==1.0.1 + # via opengeodeweb-viewer +referencing==0.33.0 + # via + # jsonschema + # jsonschema-specifications + # opengeodeweb-viewer +rpds-py==0.18.0 + # via + # jsonschema + # opengeodeweb-viewer + # referencing +websocket-client==1.7.0 + # via opengeodeweb-viewer +wslink==1.12.4 + # via opengeodeweb-viewer +yarl==1.9.4 + # via + # aiohttp + # opengeodeweb-viewer diff --git a/requirements_gpu.in b/requirements_gpu.in new file mode 100644 index 0000000..caef2cb --- /dev/null +++ b/requirements_gpu.in @@ -0,0 +1 @@ +OpenGeodeWeb-Viewer[gpu] \ No newline at end of file diff --git a/requirements_gpu.txt b/requirements_gpu.txt new file mode 100644 index 0000000..2dfb862 --- /dev/null +++ b/requirements_gpu.txt @@ -0,0 +1,96 @@ +# +# This file is autogenerated by pip-compile with Python 3.9 +# by the following command: +# +# pip-compile requirements_gpu.in +# +aiohttp==3.9.3 + # via + # opengeodeweb-viewer + # wslink +aiosignal==1.3.1 + # via + # aiohttp + # opengeodeweb-viewer +async-timeout==4.0.3 + # via + # aiohttp + # opengeodeweb-viewer +attrs==23.2.0 + # via + # aiohttp + # jsonschema + # opengeodeweb-viewer + # referencing +contourpy==1.2.0 + # via matplotlib +cycler==0.12.1 + # via matplotlib +fonttools==4.50.0 + # via matplotlib +frozenlist==1.4.1 + # via + # aiohttp + # aiosignal + # opengeodeweb-viewer +idna==3.6 + # via + # opengeodeweb-viewer + # yarl +importlib-resources==6.4.0 + # via matplotlib +jsonschema==4.21.1 + # via opengeodeweb-viewer +jsonschema-specifications==2023.12.1 + # via + # jsonschema + # opengeodeweb-viewer +kiwisolver==1.4.5 + # via matplotlib +matplotlib==3.8.3 + # via vtk +multidict==6.0.5 + # via + # aiohttp + # opengeodeweb-viewer + # yarl +numpy==1.26.4 + # via + # contourpy + # matplotlib +opengeodeweb-viewer[gpu]==0.1.1 + # via -r requirements_gpu.in +packaging==24.0 + # via matplotlib +pillow==10.3.0 + # via matplotlib +pyparsing==3.1.2 + # via matplotlib +python-dateutil==2.9.0.post0 + # via matplotlib +python-dotenv==1.0.1 + # via opengeodeweb-viewer +referencing==0.33.0 + # via + # jsonschema + # jsonschema-specifications + # opengeodeweb-viewer +rpds-py==0.18.0 + # via + # jsonschema + # opengeodeweb-viewer + # referencing +six==1.16.0 + # via python-dateutil +vtk==9.3.0 + # via opengeodeweb-viewer +websocket-client==1.7.0 + # via opengeodeweb-viewer +wslink==1.12.4 + # via opengeodeweb-viewer +yarl==1.9.4 + # via + # aiohttp + # opengeodeweb-viewer +zipp==3.18.1 + # via importlib-resources diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/src/__init__.py @@ -0,0 +1 @@ + diff --git a/src/geodeapp_viewer/app.py b/src/geodeapp_viewer/app.py new file mode 100644 index 0000000..6d260d1 --- /dev/null +++ b/src/geodeapp_viewer/app.py @@ -0,0 +1,16 @@ +from opengeodeweb_viewer import vtkw_server +import os +import dotenv + +basedir = os.path.abspath(os.path.dirname(__file__)) +dot_env_path = os.path.join(basedir, "./.env") +if os.path.isfile(dot_env_path): + dotenv.load_dotenv(dot_env_path) + + +def run_viewer(): + vtkw_server.run_server() + + +if __name__ == "__main__": + run_viewer()