Skip to content
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

Merged
merged 2 commits into from Oct 19, 2017

Conversation

diegodelemos
Copy link
Member

@diegodelemos diegodelemos commented Oct 6, 2017

@diegodelemos diegodelemos self-assigned this Oct 6, 2017
@diegodelemos diegodelemos added this to the Client-Server milestone Oct 6, 2017
@diegodelemos
Copy link
Member Author

Remember to address reanahub/reana-workflow-engine-yadage#32 since to be able to seed, the workspace needs to be created

* 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>
Copy link
Contributor

@hjhsalo hjhsalo left a 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'])
Copy link
Contributor

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)

Copy link
Member Author

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants