Skip to content

Commit 49bc3fd

Browse files
committed
Docker support
1 parent 9a16c07 commit 49bc3fd

5 files changed

Lines changed: 19 additions & 8 deletions

File tree

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM python:3.7-slim
2+
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
3+
WORKDIR /tmp
4+
COPY anthill /tmp/anthill
5+
COPY setup.py /tmp
6+
COPY pip.conf ~/
7+
RUN pip install .
8+
RUN rm -rf /tmp

anthill/common/aqmp.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,8 +1092,11 @@ async def consume(self):
10921092
self._consumer_tag = consumer_tag
10931093
log.debug('Consumer tag is %s', self._consumer_tag)
10941094

1095-
def cancel(self):
1096-
return self._channel.basic_cancel(consumer_tag=self._consumer_tag_given)
1095+
async def cancel(self):
1096+
if self._consumer_tag is None:
1097+
return
1098+
await self._channel.basic_cancel(consumer_tag=self._consumer_tag)
1099+
self._consumer_tag = None
10971100

10981101

10991102
class TimeoutError(Exception):

anthill/common/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ def listen_server(self):
396396

397397
def listen_port(ports):
398398
for port in ports:
399-
self.http_server.listen(int(port), "127.0.0.1")
399+
self.http_server.listen(int(port), "0.0.0.0")
400400

401401
def listen_unix(sockets):
402402
for sock in sockets:

pip.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[global]
2+
extra-index-url = https://cdn.anthillplatform.org/python
3+
https://pypi.org/simple

setup.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,10 @@
1515
"cffi==1.11.5",
1616
"cryptography==2.3.1",
1717
"expiringdict==1.1.4",
18-
"python-geoip-python3==1.3",
19-
# get the latest available
20-
"python-geoip-geolite2-yplan",
2118
"psutil==5.6.6",
2219
"lazy==1.3",
2320
"pympler==0.6",
24-
"sprockets-influxdb==2.2.0",
21+
"sprockets-influxdb==2.2.1",
2522
"aioredis==1.1.0",
2623
"pika==0.12.0",
2724
"anthill-PyMySQL==0.9.999",
@@ -31,7 +28,7 @@
3128

3229
setup(
3330
name='anthill-common',
34-
version='0.2.4',
31+
version='0.2.5',
3532
package_data={
3633
"anthill.common": ["anthill/common/sql", "anthill/common/static"]
3734
},

0 commit comments

Comments
 (0)