I have a scenario where I'm executing the commands on EC2
via AWS-SSM(Systems Manager)
. These are ML
training commands. So if I want to show the epochs loss
and accuracy
information in real-time onto the frontend, I can only show after the AWS-AnsiblePlaybook
has executed the task
, where the task
is logged to CloudWatch
and I can stream.
But if i want to show it realtime, How can I show it? Is it possible at all ?
Will this work for your use case? In a bash script, you can add a line like this for user data:
That will cause the user-data logs to be send to the console, where they will be viewable from the EC2 console by selecting the instance and choosing Instance settings - Get System Log. So if you take wherever you are logging your commands and redirect it similarly to the console, that should give you access to the real-time logs.
Or will using S3 work, like outlined at https://aws.amazon.com/blogs/mt/streaming-aws-systems-manager-run-command-output-to-amazon-cloudwatch-logs/ ?