Skip to content

Commit

Permalink
fix: use docker-compose.override.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronan committed May 22, 2024
1 parent 488de0a commit 94372bc
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 24 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,5 @@ pyroengine/version.py
# Release
conda-dist/

docker-compose.yml.bak
docker-compose.yml.bak
docker-compose.override.yml
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ build:

# Run the engine wrapper
run:
bash setup-docker-compose.sh
bash scripts/setup-docker-compose.sh
docker build . -t pyronear/pyro-engine:latest
docker compose up -d
rm docker-compose.yml.bak

# Get log from engine wrapper
log:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:
resources:
limits:
cpus: "3"
memory:
memory: ""
logging:
driver: "json-file"
options:
Expand Down
19 changes: 0 additions & 19 deletions promtail/config.yml

This file was deleted.

3 changes: 2 additions & 1 deletion pyroengine/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ def analyze_stream(self, idx: int) -> None:
img = self.cameras[idx].capture()
try:
self.engine.predict(img, self.cameras[idx].ip_address)
except Exception:
except Exception as e:

Check notice on line 45 in pyroengine/core.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

pyroengine/core.py#L45

Trailing whitespace

Check warning on line 45 in pyroengine/core.py

View check run for this annotation

Codecov / codecov/patch

pyroengine/core.py#L45

Added line #L45 was not covered by tests
logging.warning(f"Unable to analyze stream from camera {self.cameras[idx]}")
logging.warning(e)

Check warning on line 47 in pyroengine/core.py

View check run for this annotation

Codecov / codecov/patch

pyroengine/core.py#L47

Added line #L47 was not covered by tests
except Exception:
logging.warning(f"Unable to fetch stream from camera {self.cameras[idx]}")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ in_limits && /memory:/ {
$0 = gensub(/memory:.*/, "memory: " mem_limit, 1)
}
{ print }
' "${DOCKER_COMPOSE_FILE}.bak" > $DOCKER_COMPOSE_FILE
' "${DOCKER_COMPOSE_FILE}.bak" > "docker-compose.override.yml"

echo "Memory limits set to $LIMIT_MEM_MB in $DOCKER_COMPOSE_FILE"

0 comments on commit 94372bc

Please sign in to comment.