eecs485staff / madoop

A light weight MapReduce framework for education
MIT License
9 stars 4 forks source link

Avoid error on non-Python exe #23

Closed awdeorio closed 2 years ago

awdeorio commented 2 years ago

The current implementation will produce an error for anything other than a Python mapper or reducer. We should support any executable. The only thing in the way is check_shebang(), which I recall we added to avoid a confusing (lack of) error.

jaredzh commented 2 years ago

Should we replace check_shebang() with another function to check that the mapper and reducer is an executable? We could just emphasize in the p5 spec that the students should include the shebang at the top of their files.

awdeorio commented 2 years ago

Yep, I think it would be nice to provide sane error messages. Perhaps a dummy input with an empty string?

jaredzh commented 2 years ago

What do you mean by a dummy input with empty string?

awdeorio commented 2 years ago

What do you mean by a dummy input with empty string?

One way to check if a mapper or reducer executable is valid is to execute it with an empty string input. Just to check if it throws an error. Or perhaps there's a more elegant way to do this. I don't think checking the executable bit is adequate because the shebang could be messed up.