Comments (8)
I think the best way to handle this is have cleanup
refer to what we do when the job succeeds, and have a separate option, cleanup_on_failure
for when the job fails.
from mrjob.
would these options be directories/files to remove or more complex actions?
from mrjob.
Yeah, cleanup just removes files. Here's what I was imagining:
The default behavior would be the same, on success (cleanup
), cleanup everything, and on failure (cleanup_on_failure
), clean up nothing.
cleanup
and cleanup_on_failure
would both take lists of strings describing what to clean up, with these possible values:
- ALL
- NONE
- SCRATCH
- LOCAL_SCRATCH
- REMOTE_SCRATCH
- LOGS
On the command line, you could specify something like --cleanup-on-failure=LOCAL_SCRATCH,LOGS
or --cleanup=NONE
Does this seem like a good design? Is it something you'd be interested in working on? :)
from mrjob.
Yeah I would be interested in working on that.
is the default behavior NONE, for both --cleanup and --cleanup-on-failure?
I had in mind a more functional approach where you could pass in function pointers that would do whatever you liked in the event of a success or failure. Perhaps you would like to be notified via text message if a job failed. My approach would not work when executing jobs from the command line, so we can go with your approach.
from mrjob.
Cool, it's yours (though github 500s when I try to assign it to you, darn!)
The default behavior is ALL
for cleanup
and NONE
for cleanup_on_failure
(which is the same as the current behavior, which we call IF_SUCCESSFUL
).
The main point of cleanup is just to make sure temporary files don't pile up over time, so a simple approach ought to work. For example, if you want to be notified of a job's success or failure, just wrap it in something that looks for a nonzero return code or an exception (depending on how you run it).
Having said that, can you think of other use cases where more flexible cleanup actions would be helpful?
from mrjob.
Oh, and please work from the development
branch; it's different enough that merging in changes made against master
might be tricky.
from mrjob.
Ah, had to add you as a team member. Congrats, you are the official owner of this Issue. :)
from mrjob.
It would also be nice if the cleanup functions could be called on their own w.r.t. a job ID from the command line. Typing s3cmd del --recursive
can get tedious when debugging. python mrjob/tools/emr/cleanup.py --behavior=ALL j-MY_JOB_ID
would be much better.
from mrjob.
Related Issues (20)
- upgrade boto3/botocore to support StepConcurrencyLevel HOT 2
- fetching progress from resource manager shouldn't rely on SSH tunnel
- progress indicators are wrong when steps run simultaneously HOT 1
- useless return value from make_pooled_cluster() in pooling tests
- pool_wait_minutes shouldn't wait if pool is empty
- add pool_timeout_minutes option
- add pool_jitter_seconds option HOT 1
- Error when running on hadoop "Found 2 unexpected arguments on the command line" HOT 1
- add_passthru_arg on hadoop
- It possible to prevent decompression and/or splitting in local or inline mode
- Can I write map and reduce in many different class?
- Assign tags on EMR creation in single API call
- ignore unrecognized arguments HOT 1
- code breaks locally but runs fine remotely on hadoop cluster HOT 2
- Hadoop counter in mrjob
- trying to run mr job python script
- Failure to run mrjob on dataproc
- total sort HOT 1
- Read Specific Column From csv file
- Python 3.12 support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mrjob.