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

Export pipeline as JSON feature #267

Open
jennydaman opened this issue Jun 17, 2021 · 8 comments
Open

Export pipeline as JSON feature #267

jennydaman opened this issue Jun 17, 2021 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@jennydaman
Copy link
Collaborator

jennydaman commented Jun 17, 2021

Feed view should have a button "Export" which creates a JSON representation of the selected DS plugins as part of a reproducible workflow, aka pipeline. This JSON file can be uploaded to the ChRIS store via POST request. Example:

https://github.com/FNNDSC/CHRIS_docs/blob/master/pipelines/fetal_brain_reconstruction.sh

A corresponding feature in ChRIS_store_ui is supporting import of these JSON representations of pipelines. FNNDSC/ChRIS_store_ui#224

There should already exist an API endpoint which, given a plugin instance ID, saves a snapshot of the plugin instance and its children as a pipeline. Essentially we just need to connect this endpoint to a button.

@jennydaman jennydaman added the enhancement New feature or request label Jun 17, 2021
@jennydaman
Copy link
Collaborator Author

Ideas for iteration: MVP: select one plugin, it and all its children are saved as a plugin.

Reach goal: allow selection of multiple plugins, assert selections represent a DAG, and save that.

@alsoarpit
Copy link

@sonylomo still you are working on this if not can you pass this issue to me @jennydaman

@jennydaman
Copy link
Collaborator Author

@arpit-maurya glad to see you're willing to take this up!

The original issue proposed an export to JSON feature. If you would like to take it above-and-beyond, try YAML output instead. Schema: https://github.com/FNNDSC/CHRIS_docs/blob/master/rfcs/2-pipeline_yaml.adoc

I'm sure you'll have questions about the spec, so please message me on Matrix.

@Anirudh4583
Copy link

@arpit-maurya can I assist with this issue in any way, please let me know.

@oryxwhite
Copy link

Hello @jennydaman, I'm an Outreachy intern candidate and was wondering if this would be a good issue to work on for my initial contribution.

@jennydaman
Copy link
Collaborator Author

@oryxwhite this would be a great issue, I have assigned you.

@oryxwhite
Copy link

@jennydaman could you point me towards the endpoint you mentioned that generates a snapshot of the plugin and its children? I've been looking through the API and haven't been able to find it.

@jennydaman
Copy link
Collaborator Author

@oryxwhite

POST /api/v1/pipelines/ HTTP/1.1
Accept: application/json, */*;q=0.5
Accept-Encoding: gzip, deflate, br
Authorization: Basic Y2hyaXM6Y2hyaXMxMjM0
Connection: keep-alive
Content-Length: 36
Content-Type: application/json
Host: localhost:8000
User-Agent: xh/0.17.0

{
    "plugin_inst_id": "2",
    "name": "lol1"
}




HTTP/1.1 201 Created
Allow: GET, POST
Connection: Keep-Alive
Content-Length: 600
Content-Type: application/json
Cross-Origin-Opener-Policy: same-origin
Date: Thu, 17 Nov 2022 06:04:41 GMT
Keep-Alive: timeout=2, max=100
Location: http://localhost:8000/api/v1/pipelines/2/
Referrer-Policy: same-origin
Server: Apache
Vary: Accept,Origin
X-Content-Type-Options: nosniff
X-Frame-Options: DENY

{
    "url": "http://localhost:8000/api/v1/pipelines/2/",
    "id": 2,
    "name": "lol1",
    "locked": true,
    "authors": "",
    "category": "",
    "description": "",
    "owner_username": "chris",
    "creation_date": "2022-11-17T01:04:41.295425-05:00",
    "modification_date": "2022-11-17T01:04:41.295439-05:00",
    "plugins": "http://localhost:8000/api/v1/pipelines/2/plugins/",
    "plugin_pipings": "http://localhost:8000/api/v1/pipelines/2/pipings/",
    "default_parameters": "http://localhost:8000/api/v1/pipelines/2/parameters/",
    "instances": "http://localhost:8000/api/v1/pipelines/2/instances/",
    "workflows": "http://localhost:8000/api/v1/pipelines/2/workflows/"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants