Skip to content
Snippets Groups Projects
Commit fe40cbd3 authored by Nishanth artham's avatar Nishanth artham
Browse files

bootstrap with worker template

parent e38d8871
No related branches found
No related tags found
1 merge request!1Bootstrap the repo with the base-worker tempalte
Pipeline #130010 failed
......@@ -6,3 +6,4 @@
"author": "Nishanth artham",
"email": "arthamnishanth123@gmail.com"
}
\ No newline at end of file
......@@ -3,7 +3,7 @@ FROM python:3
WORKDIR /src
# Install worker as a package
COPY worker_{{cookiecutter.slug}} worker_{{cookiecutter.slug}}
COPY worker_palmira worker_palmira
COPY requirements.txt setup.py VERSION ./
RUN pip install .
......@@ -11,4 +11,4 @@ RUN pip install .
RUN curl https://assets.teklia.com/teklia_dev_ca.pem > /usr/local/share/ca-certificates/arkindex-dev.crt && update-ca-certificates
ENV REQUESTS_CA_BUNDLE /etc/ssl/certs/ca-certificates.crt
CMD ["worker-{{ cookiecutter.slug }}"]
CMD ["worker-palmira"]
......@@ -5,8 +5,8 @@ from pathlib import Path
from setuptools import find_packages, setup
MODULE = "worker_{{cookiecutter.slug}}"
COMMAND = "worker-{{cookiecutter.slug}}"
MODULE = "worker_palmira"
COMMAND = "worker-palmira"
def parse_requirements_line(line):
......@@ -33,9 +33,9 @@ def parse_requirements():
setup(
name=MODULE,
version=open("VERSION").read(),
description="{{ cookiecutter.description }}",
author="{{ cookiecutter.author }}",
author_email="{{ cookiecutter.email }}",
description="Palm Leaf Manuscript Region Annotator",
author="Nishanth artham",
author_email="arthamnishanth123@gmail.com",
install_requires=parse_requirements(),
entry_points={"console_scripts": [f"{COMMAND}={MODULE}.worker:main"]},
packages=find_packages(),
......
......@@ -22,7 +22,7 @@ def setup_environment(responses, monkeypatch):
# Set schema url in environment
os.environ["ARKINDEX_API_SCHEMA_URL"] = schema_url
# Setup a fake worker run ID
os.environ["ARKINDEX_WORKER_RUN_ID"] = "1234-{{ cookiecutter.slug }}"
os.environ["ARKINDEX_WORKER_RUN_ID"] = "1234-palmira"
# Setup a mock api client instead of using a real one
monkeypatch.setattr(BaseWorker, "setup_api_client", lambda _: MockApiClient())
......@@ -8,6 +8,6 @@ def test_dummy():
def test_import():
"""Import our newly created module, through importlib to avoid parsing issues"""
worker = importlib.import_module("worker_{{ cookiecutter.slug }}.worker")
worker = importlib.import_module("worker_palmira.worker")
assert hasattr(worker, "Demo")
assert hasattr(worker.Demo, "process_element")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment