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
api: add workflow seeding endpoint #37
api: add workflow seeding endpoint #37
Conversation
Remember to address reanahub/reana-workflow-engine-yadage#32 since to be able to seed, the workspace needs to be created |
4a54a43
to
db37c69
Compare
* Adds a redundant field `file_name` since bravado client doesn't propagate the file name. Waiting for Yelp/bravado-core#201 to be implemented. Signed-off-by: Diego Rodriguez <diego.rodriguez@cern.ch>
ba5ed83
to
d72d1d6
Compare
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
Maybe it is worthfile :) to add just as a PR comment that implementation in this PR doesn't write the file to anywhere, as workspace is not yet created by workflow-controller (as already mentioned in #37 (comment)) and as such there is no place to write the file to.
Workflow creation by workflow-controller will be implemented in another PR.
Disclaimer: Just reviewed code. Didn't test with live REANA Cluster.
""" | ||
try: | ||
file_ = request.files['file_content'].stream.read() | ||
file_name = secure_filename(request.args['file_name']) |
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.
Adding this here just as a reminder:
The function might return an empty filename. It’s your responsibility to ensure that the filename is unique and that you generate random filename if the function returned an empty one.
(http://werkzeug.pocoo.org/docs/0.12/utils/#werkzeug.utils.secure_filename)
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.
thanks 😄 , linked to the workspace creation issue (when we will write files to disk)
Signed-off-by: Diego Rodriguez <diego.rodriguez@cern.ch>
d72d1d6
to
1c4d435
Compare
Signed-off-by: Diego Rodriguez diego.rodriguez@cern.ch