Refactor ingestor lease management and update Docker configurations - Updated CMD in Dockerfile to use the correct application entry point. - Added docker compose command to remove volumes in README. - Removed unnecessary restart policy from ingestor service in docker-compose.yaml. - Refactored manage_leases method in Ingestor class to improve clarity and parameter naming. - Added get_number_of_leases method in IngestorManager to retrieve active leases. - Implemented get_all_leases method in ResourceManager to fetch active leases from Redis. - Enhanced unit tests for lease management in test_ingestor_manager and test_resource_manager.
60 lines
1.0 KiB
Markdown
60 lines
1.0 KiB
Markdown
# sientia-dataops-opc-gateway
|
|
OPC gateway to manage Scouter pipelines
|
|
|
|
## Local tests
|
|
### Generate your ssh key to Docker
|
|
'''
|
|
ssh-keygen -t ed25519 -C "docker-access" -f ~/.ssh/id_ed25519_docker
|
|
'''
|
|
Add the public key to yout Git SSH keys
|
|
|
|
### Enable Docker BuildKit
|
|
'''
|
|
export DOCKER_BUILDKIT=1
|
|
'''
|
|
or make it permanent:
|
|
'''
|
|
echo '{ "features": { "buildkit": true } }' | sudo tee /etc/docker/daemon.json
|
|
sudo systemctl restart docker
|
|
'''
|
|
|
|
### Run docker compose
|
|
'''
|
|
docker compose down -v
|
|
docker compose build --ssh default=$HOME/.ssh/id_ed25519_docker
|
|
docker compose up -d
|
|
'''
|
|
|
|
### Populate redis server
|
|
Create venv with python3.11
|
|
'''
|
|
python3.11 -m venv venv
|
|
source ./venv/bin/activate
|
|
'''
|
|
Install requirements
|
|
'''
|
|
pip install -r requirements.txt
|
|
'''
|
|
Run feeder
|
|
'''
|
|
python simulator/redis-feeder.py
|
|
'''
|
|
|
|
## Unit tests
|
|
### Install pytest
|
|
'''
|
|
pip install pytest
|
|
'''
|
|
### Run pytest
|
|
'''
|
|
pytest
|
|
'''
|
|
### Get current coverage
|
|
'''
|
|
pip install pytest-cov
|
|
pytest --cov=ingestor
|
|
'''
|
|
### Generate complete report
|
|
'''
|
|
pytest --cov=ingestor --cov-report=html
|
|
''' |