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

sim4life.io - WP6: API #952

Closed
18 tasks done
Tracked by #878
mguidon opened this issue May 9, 2023 · 10 comments
Closed
18 tasks done
Tracked by #878

sim4life.io - WP6: API #952

mguidon opened this issue May 9, 2023 · 10 comments
Assignees
Labels
PO issue Created by Product owners s4l:web sim4life product in osparc.io
Milestone

Comments

@mguidon
Copy link
Member

mguidon commented May 9, 2023

Description

At sim4life.io, we recognize the importance of providing a comprehensive API that is both flexible and user-friendly. As part of this commitment, we have ensured that our API supports a wide range of features:

  • Files: upload/download/delete
  • Solvers: start/stop/delete jobs, streaming of job progress
  • Studies: create/modify/delete/run
  • Users: personal preferences, remaining simulation hours

Via API, users will also be able to define the hardware on which their services run.

This is Sparta!

Preview Give feedback
  1. a:apiserver t:enhancement
    bisgaard-itis
  2. bisgaard-itis

Kobayashi Maru

Preview Give feedback
  1. 3 of 5
    a:api a:apiserver t:enhancement
    bisgaard-itis pcrespov

Microhistory

Preview Give feedback
  1. bisgaard-itis
  2. 0 of 4
    enhancement
    bisgaard-itis elisabettai
  3. a:dask-service bug
    sanderegg
  4. a:apiserver
    sanderegg
  5. a:api t:enhancement
    sanderegg
  6. 2 of 2
    a:apiserver a:database
    bisgaard-itis pcrespov
  7. a:apiserver
    pcrespov

Quilmes

Preview Give feedback
  1. 6 of 6
    e2e t:enhancement
    bisgaard-itis

Baklava

Preview Give feedback
  1. a:apiserver
    pcrespov

Sundae

Preview Give feedback
  1. 2 of 2
    a:apiserver t:enhancement
    pcrespov

Watermelon

Preview Give feedback
  1. a:apiserver t:enhancement
    pcrespov
  2. type:enhancement
    pcrespov
  3. 3 of 3
    t:maintenance
    bisgaard-itis
  4. a:api t:enhancement
    pcrespov
  5. a:apiserver t:maintenance
    pcrespov
@mguidon mguidon added s4l:web sim4life product in osparc.io PO issue Created by Product owners labels May 9, 2023
@mguidon mguidon mentioned this issue May 9, 2023
@mguidon mguidon changed the title sim4life.io - API sim4life.io - WP6 API May 9, 2023
@mguidon mguidon changed the title sim4life.io - WP6 API sim4life.io - WP6: API May 9, 2023
@pcrespov pcrespov added this to the Pastel de Nata milestone May 12, 2023
@pcrespov
Copy link
Member

pcrespov commented Jun 1, 2023

@pcrespov pcrespov modified the milestones: Pastel de Nata, Watermelon Jun 12, 2023
@pcrespov
Copy link
Member

pcrespov commented Jun 12, 2023

Update Watermelon

Improving API development& release workflow

Specification-based design starts in openapi specs (OAS) which acts as a contract. Both client and server are built to satisfy that contract. The OAS need to be backwards compatible. The core-part of the client is auto-generated.

The following is a list of actions which have been performed this sprint. Each action is a step towards achieving one/multiple bigger goals which are listed next to the actions.

action goal
automate generation of python client
  • enable osparc team to develop and support new features fast
  • support for clients from different languages
automatic testing client vs server ensure quality (quickly detect bugs)
automatic testing of tutorials/documentation ensure we have great, user-friendly documentation
add client support for new features on server expose new functionality to users

Extending osparc public API

  • Improved testing:
    • New backwards compatibility tests
    • New mocks of backend stack responses for fast testing
  • These are the new/changed entrypoints
  1. GET /v0/files/page
  2. GET /v0/solvers/page
  3. GET /v0/solvers/releases/page
  4. GET /v0/solvers/{solver_key}/releases/page
  5. GET /v0/solvers/{solver_key}/releases/{version}/ports
  6. GET /v0/solvers/{solver_key}/releases/{version}/jobs/page
  7. GET /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}/metadata
  8. PUT /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}/metadata
  9. GET /v0/studies/
  10. GET /v0/studies/{study_id}
  11. GET /v0/studies/{study_id}/ports
  12. GET /v0/studies/{study_id}/jobs
  13. POST /v0/studies/{study_id}/jobs
  14. GET /v0/studies/{study_id}/jobs/{job_id}
  15. DELETE /v0/studies/{study_id}/jobs/{job_id}
  16. POST /v0/studies/{study_id}/jobs/{job_id}:start
  17. POST /v0/studies/{study_id}/jobs/{job_id}:stop
  18. POST /v0/studies/{study_id}/jobs/{job_id}:inspect
  19. POST /v0/studies/{study_id}/jobs/{job_id}/outputs
  20. POST /v0/studies/{study_id}/jobs/{job_id}/outputs/logfile
  21. GET /v0/studies/{study_id}/jobs/{job_id}/metadata
  22. PUT /v0/studies/{study_id}/jobs/{job_id}/metadata
  23. DELETE /v0/files/{file_id}
  24. DELETE /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}

See more details comparing swagger views for:

Snapshot of progress and next steps

image

Goal

  • full tutorial/s in python that demos all entrypoints above
  • online doc

@elisabettai
Copy link
Contributor

elisabettai commented Jul 7, 2023

See more details comparing swagger views for:

current [openapi.json](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pcrespov/sandbox-python/c1d3e4f7565a26461f510df8f333548cfa83e3ce/api/openapi.json)
new [openapi-dev.json](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pcrespov/sandbox-python/c1d3e4f7565a26461f510df8f333548cfa83e3ce/api/openapi-dev.json)

@pcrespov, am I missing something or these two links above point to the same version of the API? I'm unable to see the diffs by eye in Swagger. 🙃

@pcrespov
Copy link
Member

pcrespov commented Jul 7, 2023

@elisabettai no, one is pointing to the current openapi.json and the other the the new under dev . The diff is the list that I show you above. I also have an automatic report with the diff but it is not easy to visualize (it is for machines!)

@matusdrobuliak66 matusdrobuliak66 modified the milestones: Watermelon, Sundae Jul 24, 2023
@bisgaard-itis
Copy link
Contributor

bisgaard-itis commented Aug 10, 2023

Update Sundae

@bisgaard-itis
Copy link
Contributor

bisgaard-itis commented Sep 7, 2023

Update Baklava

  • Cloning of studies/templates was implemented. This is crucial for being able to produce tutorials and documentation which can be shared with anyone and they can run it. It also enables us to have documentation which consists of jupyter notebooks. That means the documentation is testable. PublicAPI: studies w/ computational services osparc-simcore#4177
  • Endpoint was added for deleting files on the server side. Public API files resources osparc-simcore#4641
  • Associate a checksum with files on the server. This allows for cheap lookup of files (checksum can be computed locally) and reduced number of uploads (with this in place we can check if a file is already on the server before uploading it). This is still work in progress Public API files resources osparc-simcore#4641
  • Job Log streaming : API Job logs: Enable streaming of logs osparc-simcore#4652 🚧
  • These are the new entrypoints with respect to the released ones and their status (✅-done, 🚧-in progress):
    • GET /v0/files/page
    • POST /v0/files/{file_id}:abort
    • POST /v0/files/{file_id}:complete
    • POST /v0/files/content
    • DELETE /v0/files/{file_id}
    • GET /v0/solvers/page
    • GET /v0/solvers/releases/page
    • GET /v0/solvers/{solver_key}/releases/page
    • GET /v0/solvers/{solver_key}/releases/{version}/ports
    • GET /v0/solvers/{solver_key}/releases/{version}/jobs/page
    • GET /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}/metadata
    • PATCH /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}/metadata
    • DELETE /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}
    • GET /v0/studies
    • GET /v0/studies/{study_id}
    • POST /v0/studies/{study_id}:clone
    • GET /v0/studies/{study_id}/ports
    • GET /v0/studies/{study_id}/jobs 🚧
    • POST /v0/studies/{study_id}/jobs 🚧
    • GET /v0/studies/{study_id}/jobs/{job_id} 🚧
    • DELETE /v0/studies/{study_id}/jobs/{job_id} 🚧
    • POST /v0/studies/{study_id}/jobs/{job_id}:start 🚧
    • POST /v0/studies/{study_id}/jobs/{job_id}:stop 🚧
    • POST /v0/studies/{study_id}/jobs/{job_id}:inspect 🚧
    • POST /v0/studies/{study_id}/jobs/{job_id}/outputs 🚧
    • POST /v0/studies/{study_id}/jobs/{job_id}/outputs/logfile 🚧
    • GET /v0/studies/{study_id}/jobs/{job_id}/metadata 🚧
    • PUT /v0/studies/{study_id}/jobs/{job_id}/metadata 🚧

For details, the openapi specs can be found here

@sanderegg sanderegg modified the milestones: Baklava, the nameless Sep 18, 2023
@bisgaard-itis
Copy link
Contributor

bisgaard-itis commented Oct 5, 2023

Update Quilmes

  • API: support and profile isolve workflow osparc-simcore#4604:
    • Added functionality for profiling the api server
  • Public API files resources osparc-simcore#4641
    • Added checksum to files -> only upload files if they are not already on the server
    • Only missing item in files section: Limit resources for users
  • Almost ready to release next version of client to support solver ports
  • These are the new entrypoints with respect to the released ones and their status (✅-done, ⬆️-improved, 🚧-in progress):
    • GET /v0/files/page
    • POST /v0/files/{file_id}:abort
    • POST /v0/files/{file_id}:complete
    • POST /v0/files/content ✅ ⬆️
    • DELETE /v0/files/{file_id}
    • GET /v0/solvers/page
    • GET /v0/solvers/releases/page
    • GET /v0/solvers/{solver_key}/releases/page
    • GET /v0/solvers/{solver_key}/releases/{version}/ports
    • GET /v0/solvers/{solver_key}/releases/{version}/jobs/page
    • GET /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}/metadata
    • PATCH /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}/metadata
    • DELETE /v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}
    • GET /v0/studies
    • GET /v0/studies/{study_id}
    • POST /v0/studies/{study_id}:clone
    • GET /v0/studies/{study_id}/ports
    • GET /v0/studies/{study_id}/jobs 🚧
    • POST /v0/studies/{study_id}/jobs 🚧
    • GET /v0/studies/{study_id}/jobs/{job_id} 🚧
    • DELETE /v0/studies/{study_id}/jobs/{job_id} 🚧
    • POST /v0/studies/{study_id}/jobs/{job_id}:start 🚧
    • POST /v0/studies/{study_id}/jobs/{job_id}:stop 🚧
    • POST /v0/studies/{study_id}/jobs/{job_id}:inspect 🚧
    • POST /v0/studies/{study_id}/jobs/{job_id}/outputs 🚧
    • POST /v0/studies/{study_id}/jobs/{job_id}/outputs/logfile 🚧
    • GET /v0/studies/{study_id}/jobs/{job_id}/metadata 🚧
    • PUT /v0/studies/{study_id}/jobs/{job_id}/metadata 🚧

@bisgaard-itis
Copy link
Contributor

bisgaard-itis commented Oct 31, 2023

Update [Microhistory]

Done and working

  • Wallets/payments for job submission

will be done in 3 weeks

  • add products to api server (login) and connect to backend
  • solver log streaming

will probably not be available in 3 weeks

  • filtering of paginated methods

@pcrespov
Copy link
Member

Update 7Peaks

Main implementations are

@bisgaard-itis
Copy link
Contributor

bisgaard-itis commented Jan 3, 2024

Update Kobayashi Maru

There are no current release blockers.
In order to reduce load on API server (and prepare for metamodelling framework) it is important to tackle ITISFoundation/osparc-simcore#4597 soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PO issue Created by Product owners s4l:web sim4life product in osparc.io
Projects
None yet
Development

No branches or pull requests

6 participants