nchammas / flintrock

A command-line tool for launching Apache Spark clusters.
Apache License 2.0
637 stars 116 forks source link

Feat/save spot log file #353

Closed emersonfcamara closed 1 year ago

emersonfcamara commented 2 years ago

This PR makes the following changes:

I tested this PR by creating some flintrock clusters, destroying them and checking if the requests instances was successfully terminated.

To use this new strategy using a container you should set one environment variable called LOG_FOLDER so the flintrock will use this variable to know when to create the log file, below are the example using this strategy.

docker run -it --rm \ -v $$(pwd)/src:/app/mail-ignition/src \ -v $$(pwd)/chaordic/src:/app/mail-ignition/chaordic/src \ -v $$(pwd)/chaordic/tools:/app/mail-ignition/chaordic/tools \ -v $$(pwd)/core/src:/app/mail-ignition/core/src \ -v $$(pwd)/core/tools:/app/mail-ignition/core/tools \ -v $$(pwd)/mail-library/src:/app/mail-ignition/mail-library/src \ -v $$(pwd)/../mail-devops/:/app/mail-devops \ -e ENVIRONMENT=development \ -e LOG_FOLDER=/app/mail-ignition/core/tools/flintrock/logs \ retargeting/mail-ignition /bin/bash

To use the same strategy in a linux server just set the environment variable using export command like below.

export LOG_FOLDER=/app/mail-ignition/core/tools/flintrock/logs

nchammas commented 2 years ago

Hello and sorry about the late reply here.

I have been working on some improvements to Flintrock that will make cleanup of failed launches much more reliable and complete.

I'm going to hold off on reviewing this PR until I get that work done, because it may address your problem. If it doesn't, I'll come back to this PR.

nchammas commented 1 year ago

@emersonfcamara - I think #362 should address any problems with Flintrock leaving behind malformed nodes from failed launches, including spot instances. If that PR doesn't address your problem, please chime in and I'd be happy to revisit this issue.

I also see that this PR includes some unrelated changes, so if you want me to take another look at this work then it'll probably be best if you create a new PR that contains just your changes.