bcgov / nr-rfc-grib-copy

Demo of using github actions to copy / process raw data
Apache License 2.0
2 stars 2 forks source link

Event Listener - Trigger Github action #16

Open franTarkenton opened 1 year ago

franTarkenton commented 1 year ago

Having:

  1. created an automated build process to create the container image
  2. created an automated deployment for the container

This ticket will figure out:

  1. how to call a gha remotely via rest call or webhook etc...
  2. ammend existing listener code to emit the web call above ^ when all the regional_grib and global_grib data that we are interested in has been emitted.
franTarkenton commented 1 year ago

completed so far

remaining

franTarkenton commented 1 year ago

I deployed and seems to be working. Picks up residual events that are defined in the cache and emits the associated events. Still not seeing the script emit events based on regular event loop.

In other words events get cached and written to the database. At startup the cached events are checked to see if their are associated events to be emitted. When there are these events are working. After this step the script starts to monitor the topics it has subscribed to. For each event the script should check to see if all the data is now there, and if so emit an event. This final step is not currently working.

Changes in latest pr... will montior to see if they have resolved this issue

franTarkenton commented 1 year ago

Once we see the jobs being triggered, will circle back and remove the cron trigger that is currently described in the workflow.

franTarkenton commented 1 year ago

The events are not getting emitted because the token used to trigger the actions is not getting passed to the helm chart secret. Turns out this is no longer possible, and you need to create a PAT, then copy the pat into the repo. It doesn't look like there is a way to update the PAT in any kind of automated way! That said all that is required is to update the token, then update the secret in the repo with the token, then re-deploy the helm chart.

franTarkenton commented 1 year ago

Merging this code. Looking through the kibana logs believe that its working correctly considering deficiencies identified in https://github.com/bcgov/nr-rfc-grib-copy/issues/56

Will continue to monitor the deployed version associated with PR-51 and branch: feat/16-add-debugging-endpoint.

If prod succeeds this weekend will close this ticket

Pivotting onto issue: https://github.com/bcgov/nr-rfc-grib-copy/issues/56

franTarkenton commented 1 year ago

As the prod database grows with events that are stale the query to the database is starting to use up a lot of memory. Going to modify how the events are cached in the following way:

franTarkenton commented 1 year ago

Changes recently pushed should improve pod stability. Will check in the morning to verify that the messages are being recieved and the appropriate events are being emitted

franTarkenton commented 1 year ago

Looking at the logs for the gha... it looks like the following improvements are now functional:

franTarkenton commented 1 year ago

Been monitoring for 1 week without incident. Events are being emitted, and the CMC download / process pipeline is now working