Skip to content

Template structure

When building a new worker from our official template, a file structure gets created for you to ease the burden of setting up a Python package, a Docker build, with the best development practices:

.arkindex.yml
YAML configuration file that allows Arkindex to understand what it should do with this repository. To learn more about this file, see YAML configuration.
.cookiecutter.json
JSON file that stores the options you defined when creating a new worker. This file can be reused to fetch template updates.
.dockerignore
Lists which files to exclude from the Docker build context. For more information, see the Docker documentation.
.gitignore
Lists which files to exclude from Git versioning. For more information, see the Git docs.
.gitlab-ci.yml
Configures the GitLab CI jobs and pipelines. To learn more about the configuration we provide, see GitLab Continuous Integration for workers.
.pre-commit.config.yaml
Configures the pre-commit hook.
Dockerfile
Specifies how the Docker image will be built. You can change the instructions in this file to update the image to the needs of your worker, for example to install system dependencies.
Makefile
Mostly used to build releases of a worker more easily. For more information, see Maintaining a worker.
tox.ini
Configures the Python unit test runner. For more information, see the tox docs.
pyproject.toml
Configures the worker’s Python package.
ci/build.sh
Script that gets run by CI pipelines to build the Docker image.
tests/test_worker.py
An example unit test file. For more information, see Writing tests for your worker.
descriptions/[__slug].md
Describe your worker in this file. The file should be named after its slug. The content should be valid Markdown. It will be published and visible on Arkindex.
worker_[__module]/__init__.py
Declares the folder as a Python package.
worker_[__module]/worker.py
The core part of the worker. This is where you can write code that processes Arkindex elements. For more information, see Implementing an Elements worker.