Skip to content

Commit 5608ce8

Browse files
Merge pull request #28 from mchadwick-iqt/main
Switch Logging Level, Update Release Tag
2 parents 70a4e26 + 7326e18 commit 5608ce8

File tree

2 files changed

+34
-31
lines changed

2 files changed

+34
-31
lines changed

.github/workflows/release-tag.yaml

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,31 @@ on:
55
types: [ "published" ]
66

77
jobs:
8-
tag-remote:
8+
push_to_registry:
9+
name: Push Docker image to DockerHub
910
runs-on: ubuntu-latest
1011
steps:
11-
- name: Set up Docker buildx
12-
id: buildx
13-
uses: docker/setup-buildx-action@v3
14-
with:
15-
version: latest
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
1614

17-
- name: Login to Docker Hub
18-
run: echo "${{ secrets.DOCKER_TOKEN }}" | docker login --username "${{ vars.DOCKER_USERNAME }}" --password-stdin
15+
- name: Set up Docker buildx
16+
id: buildx
17+
uses: docker/setup-buildx-action@v2
18+
with:
19+
version: latest
1920

20-
- name: Build image
21-
env:
22-
GITHUB_REPOSITORY: ${{ github.repository }}
23-
DOCKER_FOLDER: "object-ledger"
24-
DOCKER_NAMESPACE: ${{ vars.DOCKER_NAMESPACE }}
25-
RELEASE_NAME: ${{ github.event.release.name }}
26-
run: |
27-
GITHUB_REPO=$(basename $GITHUB_REPOSITORY)
28-
docker buildx build $DOCKER_FOLDER \
29-
--platform linux/arm64,linux/amd64 \
30-
--push \
31-
--tag $DOCKER_NAMESPACE/$GITHUB_REPO:latest \
32-
--tag $DOCKER_NAMESPACE/$GITHUB_REPO:$RELEASE_NAME
21+
- name: Log in to DockerHub
22+
uses: docker/login-action@v1
23+
with:
24+
username: ${{ vars.DOCKER_USERNAME }}
25+
password: ${{ secrets.DOCKER_TOKEN }}
26+
27+
- name: Build and push Docker image
28+
uses: docker/build-push-action@v2
29+
env:
30+
DOCKER_FOLDER: "object-ledger"
31+
with:
32+
context: ${{ env.DOCKER_FOLDER }}
33+
platforms: linux/arm64,linux/amd64
34+
push: true
35+
tags: ${{ vars.DOCKER_NAMESPACE }}/${{ github.event.repository.name }}:${{ github.event.release.name }}

object-ledger/object_ledger_pub_sub.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -201,25 +201,25 @@ def _state_callback(
201201
None
202202
"""
203203
try:
204-
logging.info("Entered ledger output callback")
204+
logging.debug("Entered ledger output callback")
205205

206206
# Populate required state based on message type
207207
data = self._decode_payload(msg)
208208
if "ADS-B" in data:
209-
logging.info(f"Processing ADS-B state message data: {data}")
209+
logging.debug(f"Processing ADS-B state message data: {data}")
210210
state = json.loads(data["ADS-B"])
211211
state["object_id"] = state["icao_hex"]
212212
state["object_type"] = "aircraft"
213213

214214
elif "Decoded AIS" in data:
215-
logging.info(f"Processing AIS state message data: {data}")
215+
logging.debug(f"Processing AIS state message data: {data}")
216216
state = json.loads(data["Decoded AIS"])
217217
state["object_id"] = state["mmsi"]
218218
state["object_type"] = "ship"
219219
state["track"] = state["course"]
220220

221221
else:
222-
logging.info(f"Skipping state message data: {data}")
222+
logging.debug(f"Skipping state message data: {data}")
223223
return
224224

225225
# Pop keys that are not required columns
@@ -233,15 +233,15 @@ def _state_callback(
233233
entry.set_index("object_id", inplace=True)
234234
if entry.notna().all(axis=1).bool():
235235
if not entry.index.isin(self.ledger.index):
236-
logging.info(f"Adding entry state data for object id: {entry.index}")
236+
logging.debug(f"Adding entry state data for object id: {entry.index}")
237237
self.ledger = pd.concat([self.ledger, entry], ignore_index=False)
238238

239239
else:
240-
logging.info(f"Updating entry state data for object id: {entry.index}")
240+
logging.debug(f"Updating entry state data for object id: {entry.index}")
241241
self.ledger.update(entry)
242242

243243
else:
244-
logging.info(f"Invalid entry: {entry}")
244+
logging.debug(f"Invalid entry: {entry}")
245245

246246
except Exception as exception:
247247
# Set exception
@@ -266,7 +266,7 @@ def _publish_ledger(self) -> None:
266266
> self.ledger["object_type"].apply(self._get_max_entry_age)
267267
].index
268268
if not index.empty:
269-
logging.info(f"Dropping entry for object ids: {index}")
269+
logging.debug(f"Dropping entry for object ids: {index}")
270270
self.ledger.drop(
271271
index,
272272
inplace=True,
@@ -311,11 +311,11 @@ def _send_data(self, data: Dict[str, str]) -> bool:
311311
)
312312
success = self.publish_to_topic(self.ledger_topic, out_json)
313313
if success:
314-
logging.info(
314+
logging.debug(
315315
f"Successfully sent data on channel {self.ledger_topic}: {data}"
316316
)
317317
else:
318-
logging.info(f"Failed to send data on channel {self.ledger_topic}: {data}")
318+
logging.debug(f"Failed to send data on channel {self.ledger_topic}: {data}")
319319
return success
320320

321321
def main(self) -> None:

0 commit comments

Comments
 (0)