Closed amtins closed 1 week ago
After checking the AWS documentation I choose to go with AWS App Runner as it seems to be the most appropriate tool to run this service.
I've add and granted access to pillarbox-event-dispatcher
the AWS Connector for GitHub
app which will allow to deploy the app each time a commit is made against main
.
The configuration is quite straightforward.
AWS App Runner use an old version of Go, what a shame... Go runtime release information. A github issue begin for support https://github.com/aws/apprunner-roadmap/issues/225
I'll have to modify the code to make it 1.18.10 compatible, which shouldn't be a huge deal. However if for some reason this still not work I'll have to ask the devops team to setup an ECS or whatever name it's called. I'd like to avoid to rely as much as possible on someone else and having some crazy infrastructure just for publishing dumb app.
I removed the code incompatible with go version provided by AWS App Runner and change the default port from 8080
to 3569
and everything start to work just fine.
I also proxied the snitch trafic to Pillarbox Event Dispatcher to stress test le bousin and everything went just fine.
https://zdkimhgwhh.eu-central-1.awsapprunner.com/health
Open a terminal and paste (event consumer):
curl -n https://zdkimhgwhh.eu-central-1.awsapprunner.com/event-dispatcher
Open another terminal tab and paste (event sender):
curl -X POST https://zdkimhgwhh.eu-central-1.awsapprunner.com/metrics -H 'Content-Type: application/json' -d "{\"msg\": \"data\", \"timestamp\": \"$EPOCHSECONDS\"}"
I'll push the README
tomorrow.
I just noticed that AWS App Runner has a request timeout limit of 120 seconds, according to the documentation (refer to the first note under Web requests). I feel like I'm being babysitted...
The following header is removed by AWS https://github.com/SRGSSR/pillarbox-event-dispatcher/blob/ca6b2b1e144b068f74611c0e095fe2c39e397c9a/api/handler/handlers.go#L59
A GitHub issue about adding SSE support open since 2021, this shows how Amazon treat their costumers...
I found AWS Lambda response streaming, which is totally unacceptable since it forces you to use Amazon.
This means that the only remaining solution is to setup an EC2 ECS or whatever it's called.
From my point of view this AWS App Runner situation is a blocker for me. So it would be great to work with someone from sysadmin team setup an AWS whatever, so that we can close this task. To be precise, this service must be hosted in a different instance/container from any data consumer.
Description
As a Pillarbox player, I'd like to be able to send events about the state of media playback in order to feed tools that measure the state of our services.
Acceptance criteria