From 49bc3fd3fc0fa0c1600803c8af882893bcb03cf8 Mon Sep 17 00:00:00 2001 From: Alex Siryi Date: Sat, 9 Jan 2021 20:50:57 +0200 Subject: [PATCH 1/2] Docker support --- Dockerfile | 8 ++++++++ anthill/common/aqmp.py | 7 +++++-- anthill/common/server.py | 2 +- pip.conf | 3 +++ setup.py | 7 ++----- 5 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 Dockerfile create mode 100644 pip.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..efd307e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM python:3.7-slim +RUN apt-get update && apt-get install -y python3-dev libssl-dev libffi-dev musl-dev make gcc g++ libzmq5 libzmq3-dev curl libtool autoconf automake +WORKDIR /tmp +COPY anthill /tmp/anthill +COPY setup.py /tmp +COPY pip.conf ~/ +RUN pip install . +RUN rm -rf /tmp diff --git a/anthill/common/aqmp.py b/anthill/common/aqmp.py index 6c3fab9..85933c4 100644 --- a/anthill/common/aqmp.py +++ b/anthill/common/aqmp.py @@ -1092,8 +1092,11 @@ async def consume(self): self._consumer_tag = consumer_tag log.debug('Consumer tag is %s', self._consumer_tag) - def cancel(self): - return self._channel.basic_cancel(consumer_tag=self._consumer_tag_given) + async def cancel(self): + if self._consumer_tag is None: + return + await self._channel.basic_cancel(consumer_tag=self._consumer_tag) + self._consumer_tag = None class TimeoutError(Exception): diff --git a/anthill/common/server.py b/anthill/common/server.py index 5f19dfe..4896898 100644 --- a/anthill/common/server.py +++ b/anthill/common/server.py @@ -396,7 +396,7 @@ def listen_server(self): def listen_port(ports): for port in ports: - self.http_server.listen(int(port), "127.0.0.1") + self.http_server.listen(int(port), "0.0.0.0") def listen_unix(sockets): for sock in sockets: diff --git a/pip.conf b/pip.conf new file mode 100644 index 0000000..39eda24 --- /dev/null +++ b/pip.conf @@ -0,0 +1,3 @@ +[global] +extra-index-url = https://cdn.anthillplatform.org/python + https://pypi.org/simple diff --git a/setup.py b/setup.py index 58ff021..5f25a94 100644 --- a/setup.py +++ b/setup.py @@ -15,13 +15,10 @@ "cffi==1.11.5", "cryptography==2.3.1", "expiringdict==1.1.4", - "python-geoip-python3==1.3", - # get the latest available - "python-geoip-geolite2-yplan", "psutil==5.6.6", "lazy==1.3", "pympler==0.6", - "sprockets-influxdb==2.2.0", + "sprockets-influxdb==2.2.1", "aioredis==1.1.0", "pika==0.12.0", "anthill-PyMySQL==0.9.999", @@ -31,7 +28,7 @@ setup( name='anthill-common', - version='0.2.4', + version='0.2.5', package_data={ "anthill.common": ["anthill/common/sql", "anthill/common/static"] }, From afad11bdbbf09118334fa2b1f5c7c88972f124ee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 9 Jan 2021 18:52:01 +0000 Subject: [PATCH 2/2] Bump cryptography from 2.3.1 to 3.2 Bumps [cryptography](https://github.com/pyca/cryptography) from 2.3.1 to 3.2. - [Release notes](https://github.com/pyca/cryptography/releases) - [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pyca/cryptography/compare/2.3.1...3.2) Signed-off-by: dependabot[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5f25a94..64badc4 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ "Sphinx==1.8.1", "pyOpenSSL==18.0.0", "cffi==1.11.5", - "cryptography==2.3.1", + "cryptography==3.2", "expiringdict==1.1.4", "psutil==5.6.6", "lazy==1.3",