-
Notifications
You must be signed in to change notification settings - Fork 0
Setting up a new worker
Sara Veldhoen edited this page Feb 29, 2024
·
5 revisions
This assumes that you already created a GitHub repo for the new worker.
- If you are running Windows, set up WSL
- Make sure Poetry is installed in WSL.
- Clone the repository and navigate to it within WSL.
- Copy the
pyproject.toml
found in this repo to your repo and change the details found underneath[tool.poetry]
to match your project's description - Run
poetry install
to generate a virtual environment and apoetry.lock
file - Add any additional dependencies required - either using
poetry add <package-name>
or by adding them topyproject.toml
and rerunningpoetry install
.
- Copy the folder
.github
from this repository (including its contents) - Comment out the
deploy
job frommain-branch.yml
andmanual-deploy.yml
(if Docker is not set up yet - once it's set up, this needs to be uncommented and refined accordingly) - Comment out the
pytest
task inside_test.yml
(if there's no config file for it yet - uncomment and refine once (unit) tests are added) - Add an empty
.py
file (recommended:main_data_processor.py
) so thatmypy
doesn't make the workflow pipeline fail
-
Copy the
Dockerfile
from dane-audio-extraction-worker -
Copy also the
docker-entrypoint.sh
from that same repo -
For Docker to work with WSL, I followed this
-
Additionally, I had to do the following steps to be able to run docker build:
-
Create the docker group:
sudo groupadd docker
-
Add your user to the docker group:
sudo usermod -aG docker ${USER}
-
You would need to log out and log back in so that your group membership is re-evaluated. You can just
exit
WSL, then start it up again and it will work.
-
-
Lastly, to test whether the image builds or not, do:
docker build . -t <your-dane-worker>
Inside your repository's directory.