This commit is contained in:
2026-10-10 11:05:32 +03:00
parent f4b49e450f
commit 991a0c8b56
16 changed files with 1078 additions and 0 deletions
@@ -0,0 +1,13 @@
# syntax=docker/dockerfile:1
FROM python:3.12-slim
RUN apt-get update && apt-get install -y curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /worker
COPY requirements.txt .
RUN --mount=type=cache,id=distsys-course-pip,target=/root/.cache/pip,sharing=locked \
pip install -r requirements.txt
COPY . .
CMD ["python3", "-u", "worker.py"]
@@ -0,0 +1 @@
pika==1.3.2
@@ -0,0 +1,15 @@
class Worker:
# TODO: Implement server
def __init__(self, mq_host, mq_port, data_dir):
pass
def produce_image_caption(self, image_url):
return str(abs(hash(image_url)) % (10 ** 8))
def run(self):
raise NotImplementedError
if __name__ == '__main__':
worker = Worker('rabbitmq', 5672, '/data')
worker.run()