Skip to content

Conversation

@mrodm
Copy link
Contributor

@mrodm mrodm commented Feb 19, 2024

Add docker compose stop command before processing the service logs. This will ensure that all logs are written to the target file. For instance, logs from commands run as a consequence of trap in bash.

Terraform containers do make use of those traps to run terraform destroy command:

cleanup() {
r=$?
set -x
terraform destroy -auto-approve
exit $r
}
trap cleanup EXIT INT TERM

@mrodm mrodm self-assigned this Feb 19, 2024
@mrodm mrodm changed the title Retrieve logs from cleanup Add docker-compose stop before retrieving logs from service Feb 19, 2024
@mrodm mrodm changed the title Add docker-compose stop before retrieving logs from service Add docker-compose stop before retrieving logs from service deployer Feb 19, 2024
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @mrodm

@mrodm
Copy link
Contributor Author

mrodm commented Feb 19, 2024

test integrations

@elasticmachine
Copy link
Collaborator

Created or updated PR in integrations repository to test this version. Check elastic/integrations#9195

@mrodm mrodm marked this pull request as ready for review February 20, 2024 09:35
@mrodm mrodm requested a review from a team February 20, 2024 09:35
}
if err := p.Stop(compose.CommandOptions{
Env: opts.Env,
ExtraArgs: []string{"-t", "300"}, // default shutdown timeout 10 seconds
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to make this configurable at some point.

@mrodm mrodm merged commit 27d7f20 into elastic:main Feb 20, 2024
@mrodm mrodm deleted the retrieve_logs_from_cleanup branch February 20, 2024 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants