-
Notifications
You must be signed in to change notification settings - Fork 9
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
8 changed files
with
79 additions
and
60 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 |
---|---|---|
|
@@ -15,8 +15,8 @@ jobs: | |
strategy: | ||
matrix: | ||
python-version: | ||
- '3.9' | ||
- '3.10' | ||
- '3.11' | ||
|
||
steps: | ||
- name: Checkout code | ||
|
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,4 +1,4 @@ | ||
FROM alpine:3.15 | ||
FROM python:3.11-alpine3.20 | ||
LABEL org.opencontainers.image.title="graphsense-rest" | ||
LABEL org.opencontainers.image.maintainer="[email protected]" | ||
LABEL org.opencontainers.image.url="https://www.ikna.io/" | ||
|
@@ -13,50 +13,49 @@ ENV CONFIG_FILE=./instance/config.yaml | |
RUN mkdir -p /srv/graphsense-rest/ | ||
|
||
COPY requirements.txt /srv/graphsense-rest/ | ||
|
||
RUN apk --no-cache --update add \ | ||
bash \ | ||
python3 \ | ||
python3-dev \ | ||
py3-gunicorn \ | ||
shadow \ | ||
g++ \ | ||
postgresql-dev && \ | ||
useradd -r -m -u 10000 dockeruser && \ | ||
apk --no-cache --update --virtual build-dependendencies add \ | ||
gcc \ | ||
linux-headers \ | ||
musl-dev \ | ||
pcre-dev \ | ||
libpq-dev \ | ||
python3-dev && \ | ||
python3 -m ensurepip && \ | ||
rm -r /usr/lib/python*/ensurepip && \ | ||
pip3 install --upgrade pip setuptools && \ | ||
pip3 install -r /srv/graphsense-rest/requirements.txt && \ | ||
apk del build-dependendencies && \ | ||
rm -rf /root/.cache | ||
|
||
COPY conf/gunicorn-conf.py /home/dockeruser/gunicorn-conf.py | ||
COPY conf/gunicorn-conf.py /srv/graphsense-rest/gunicorn-conf.py | ||
COPY setup.py /srv/graphsense-rest/ | ||
COPY README.md /srv/graphsense-rest/ | ||
|
||
RUN mkdir /var/lib/graphsense-rest && \ | ||
chown dockeruser /var/lib/graphsense-rest && \ | ||
pip3 install /srv/graphsense-rest/ | ||
|
||
COPY gsrest /srv/graphsense-rest/gsrest | ||
COPY openapi_server /srv/graphsense-rest/openapi_server | ||
|
||
# COPY instance /srv/graphsense-rest/instance | ||
# https://stackoverflow.com/questions/77490435/attributeerror-cython-sources | ||
RUN echo "cython<3" > /tmp/constraint.txt | ||
|
||
RUN apk --no-cache --update add \ | ||
bash \ | ||
shadow \ | ||
git \ | ||
postgresql-dev | ||
RUN useradd -r -m -u 10000 dockeruser | ||
RUN apk --no-cache --update --virtual build-dependendencies add \ | ||
gcc \ | ||
g++ \ | ||
linux-headers \ | ||
musl-dev \ | ||
pcre-dev \ | ||
libpq-dev \ | ||
python3-dev | ||
|
||
|
||
RUN PIP_CONSTRAINT=/tmp/constraint.txt pip3 install --upgrade pip setuptools | ||
RUN apk del build-dependendencies | ||
RUN chown dockeruser /srv/graphsense-rest | ||
USER dockeruser | ||
|
||
WORKDIR /srv/graphsense-rest | ||
ENV VIRTUAL_ENV=/srv/graphsense-rest/venv | ||
ENV PATH="$VIRTUAL_ENV/bin:$PATH" | ||
RUN python3 -m venv $VIRTUAL_ENV && \ | ||
PIP_CONSTRAINT=/tmp/constraint.txt pip3 install gunicorn && \ | ||
PIP_CONSTRAINT=/tmp/constraint.txt pip3 install -r /srv/graphsense-rest/requirements.txt && \ | ||
PIP_CONSTRAINT=/tmp/constraint.txt pip3 install /srv/graphsense-rest/ | ||
|
||
|
||
# COPY instance /srv/graphsense-rest/instance | ||
|
||
RUN find gsrest/plugins -name requirements.txt -exec pip install -r {} \; | ||
|
||
CMD find gsrest/plugins -name requirements.txt -exec pip install -r {} \; && /usr/bin/gunicorn \ | ||
-c /home/dockeruser/gunicorn-conf.py \ | ||
CMD find gsrest/plugins -name requirements.txt -exec pip install -r {} \; && gunicorn \ | ||
-c /srv/graphsense-rest/gunicorn-conf.py \ | ||
"openapi_server:main('${CONFIG_FILE}')" \ | ||
--worker-class aiohttp.GunicornWebWorker |
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ info: | |
contact: | ||
name: Iknaio Cryptoasset Analytics GmbH | ||
email: [email protected] | ||
version: "1.8.0" | ||
version: "1.9.3-ts2-dev1" | ||
servers: | ||
- url: 'https://api.ikna.io' | ||
paths: | ||
|
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,9 +1,10 @@ | ||
# coding: utf-8 | ||
|
||
import sys | ||
from setuptools import setup, find_packages | ||
|
||
NAME = "openapi_server" | ||
VERSION = "24.11.0" | ||
VERSION = "1.9.3-ts2-dev1" | ||
|
||
# To install the library, run the following | ||
# | ||
|
@@ -27,7 +28,7 @@ | |
description="GraphSense API", | ||
author_email="[email protected]", | ||
keywords=["OpenAPI", "GraphSense API"], | ||
python_requires='>=3.8', | ||
python_requires='>=3.10', | ||
install_requires=REQUIRES, | ||
packages=find_packages(), | ||
package_data={'': ['openapi/openapi.yaml']}, | ||
|
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,21 +1,22 @@ | ||
[tox] | ||
skipsdist=True | ||
envlist = py310,py311 | ||
envlist = py39,py310 | ||
;requires=tox-venv | ||
|
||
[gh-actions] | ||
python = | ||
3.9: py39 | ||
3.10: py310 | ||
3.11: py311 | ||
|
||
[pytest] | ||
asyncio_mode=auto | ||
asyncio_default_fixture_loop_scope="function" | ||
|
||
[testenv] | ||
passenv = * | ||
allowlist_externals=bash | ||
deps=-r{toxinidir}/requirements.txt | ||
-r{toxinidir}/test-requirements.txt | ||
{toxinidir} | ||
|
||
commands= | ||
pytest -x --cov=openapi_server -vv | ||
bash -c "cd {toxinidir}/tests/ && make ORGANIZATION={posargs:graphsense} .runcass .runts" | ||
pytest -x --cov=openapi_server |