Subscribes to a Pulsar topic to get notified of incoming zip files which get extracted to a specified folder. An event is published to Pulsar to make it known the extraction was succesful.
- Git
- Docker (optional)
- Python 3.6+ (Python 3.9 and up not yet supported)
- Access to the meemoo PyPi
-
Clone this repository with:
$ git clone https://github.com/viaacode/unzip-service.git
-
Change into the new directory.
-
Set the needed config:
Included in this repository is a
config.yml.example
file. All values in the config have to be set in order for the application to function correctly. You can use!ENV ${EXAMPLE}
as a config value to make the application get theEXAMPLE
environment variable.
Note: As per the aforementioned requirements, this is a Python3
application. Check your Python version with python --version
. You may want to
substitute the python
command below with python3
if your default Python version
is < 3. In that case, you probably also want to use pip3
command.
-
Start by creating a virtual environment:
$ python -m venv env
-
Activate the virtual environment:
$ source env/bin/activate
-
Install the external modules:
$ pip install -r requirements.txt \ --extra-index-url http://do-prd-mvn-01.do.viaa.be:8081/repository/pypi-all/simple \ --trusted-host do-prd-mvn-01.do.viaa.be && \ pip install -r requirements-test.txt
-
Run the tests with:
$ pytest -v --cov=./app
-
Run the application:
$ python main.py
-
Build the container:
$ docker build -t unzip-service .
-
Run the container (with specified
.env
file):$ docker run --env-file .env unzip-service:latest