# Environment Set environment variables in .env file or via shell: ```bash export API_KEY="APIKEY TO USE THIS API" export HUGGINGFACE_ACCESS_TOKEN="HF READ ACCESS TOKEN" ``` ## Consul environment To use the enviroment variables from Consul, set variables in consul.env file or via shell: ```bash TGX_CONSUL_AUTH_USER="CONSUL AUTH USER" TGX_CONSUL_AUTH_PASS="CONSUL AUTH PASSWORD" TGX_CONSUL_TOKEN="CONSUL TOKEN" TGX_CONSUL_NODES="CONSUL_URLS_SEPARTEDBY_;" ``` # Development Dependencies and run is managed by Poetry ## Dependencies Use Poetry to Update and install dependencies: ```bash poetry update poetry install ``` ## Build ### Using docker compose ```bash docker compose build --no-cache docker compose up -d ``` *NOTE* Docker compose is set to run on port 8080, change the port in docker-compose.yml if needed. ### Docker API Check if docker daemon is running: ```bash sudo systemctl start docker ``` Build docker: ```bash docker build -t mappingservice . ``` ## Run ### Console ```bash poetry run uvicorn mappingservice.main:app --reload ``` Site runs at http://127.0.0.1:8000/ml-api ### Docker ```bash docker run -d --name mycontainer -p 80:80 mappingservice ``` ##### Run Send Consul variables on Docker run ###### API ```bash docker run -e TGX_CONSUL_NODES='URL_NODES' -e TGX_CONSUL_TOKEN='TOKEN' -e TGX_CONSUL_AUTH_USER='USER' -e TGX_CONSUL_AUTH_PASS='PWD' -d --name mycontainer -p 80:80 mappingservice ``` ### Benchmark Use Poetry to Update and install Locust dependencies: ```bash poetry update --only benchmark poetry install --only benchmark ``` Run Locust in terminal ```bash locust -f ./benchmark/ ``` Site runs at http://localhost:8089/