Note
This service is in Experimental stage.
Repository Service for TUF Worker is part of Repository Service for TUF.
Repository Service for TUF Repository Worker Docker Image documentation
- Python >=3.10
- pip
- Pipenv
- Docker
Fork the repository on GitHub and clone it to your local machine:
git clone git@github.com:YOUR-USERNAME/repository-service-tuf-worker.git
Add a remote and regularly sync to make sure you stay up-to-date with our repository:
git remote add upstream https://github.com/repository-service-tuf/repository-service-tuf-worker
git checkout main
git fetch upstream
git merge upstream/main
This repository has the requirements.txt
and the requirements-dev.txt
files to help build your virtual environment.
We also recommend using Pipenv to manage your virtual environment.
$ pip install pipenv
$ pipenv shell
Install development requirements
$ pipenv install -d
Note
MacOS running on Macbooks M1
For developers, after above command, run
$ pip uninstall cryptography cffi -y
$ pip cache purge
$ LDFLAGS=-L$(brew --prefix libffi)/lib CFLAGS=-I$(brew --prefix libffi)/include pip install cffi cryptography
The pre-commit tool is installed as part of the development requirements.
To automatically run checks before you commit your changes you should run:
$ make precommit
This will install the git hook scripts for the first time and
run the pre-commit
tool.
Now pre-commit
will run automatically on git commit
.
Running the development Worker locally
Note
All code changes will reload the Worker container automatically.
$ make run-dev
A specific docker compose can be used giving the parameter DC=<name> For example: docker-compose-redis.yml use DC=redis
$ make run-dev DC=redis
See Makefile for more options
We use Tox to manage running the tests.
Running tests
$ tox
You can run specific test from tox.ini using -e
$ tox -e test
- Make sure you have a development environment running (
make run-dev
) - Run the FT tests
make ft-das-local
ormake ft-signed-local
Project requirements
$ pipenv install {package}
Development requirements
$ pipenv install -d {package}
$ make requirements
It is required when changing the RSTUF Worker Database Models repository_service_tuf_worker/models/
Updating the models requires a database migrations with Alembic.
Use a clear update message with M="Added field XYZ for Targets"
$ make db-migration M="update message"