-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/Sandbox #12
Feat/Sandbox #12
Conversation
Just realized I pulled from |
A note on the sandbox for my branch #13: @app.route("/eval_func", methods=["POST"])
def evaluate_function():
req_json = request.get_json()
code_string = req_json["code"]
func_name = req_json["func_name"]
return execute_with_result(code_string, func_name, 5.0).__repr__() where
We just need to have a slightly different
I don't know what we do with codes with errors, so that |
@TheExGenesis Thanks for the great work! Can you pull from main, make sure your code still works and can interface with @honglu2875's code (see https://github.com/CarperAI/ELM/blob/main/map_elites/environments.py#L213), then I think we're ready to merge! |
@honglu2875 can I ask why the name Also it seems to me different environments might benefit from different dedicated functions since e.g. your interface assumes an ndarray and uses the sandbox for a full eval, while the sodaracer only requires the sandbox to generate the racers, not for eval. I'll accommodate the ImageOptim of course. |
Oh yeah I literally copied&pasted the other codes in Yes, I agree that a different function and interface make total sense. Feel free to also change the name of the endpoint if necessary. The modification on my side is trivial.
|
Thanks for responding! I'll make the error codes nicer by returning json. Don't have a great idea of what to do concurrency-wise for the execs, open to suggestions. EDIT: I added batch processing, it's not concurrent tho. |
@herbiebradley confirmed that the code still works and interface is compatible with H's work. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I added a few comments. Thanks for the work!
tells pipenv which versions to install
all good, handled the comments :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I'll merge now!
For now, we have a sandboxed server that we can hit up from outside the sandbox with code and it will return a serialized walker object. (see
sandbox/server/index.py
Evaluation can in principle be done outside of the sandbox since the arbitrary code is only used for generating walklers, which are then safe.
Open questions:
walker.validate()
returns false. I suspect it's a problem with the validate function rather than the descriptions but did not check.