Git Product home page Git Product logo

osparc-simcore-clients's Introduction

oSPARC-Simcore-Clients

To get started using the tools developed in this repository have a look at the Documentation.

For more in depth knowledge concerning the development of the repository, take a look at

For reporting an issue, use our issue tracker

Development notes

These notes are intended for people who want to contribute to the development of this repository.

The different clients for the oSPARC public API are generated using the openapi-generator-tool. The generated files should not be changed manually! Instead proposed changes should be implemented directly on the openapi-generator-repository. See also templates and customization.

Workflow

See the different clients/<language>/README.md for the workflows for generating the different clients. Here is the workflow which all clients have in common:

  • To generate a client one needs two "ingredients":
    1. The openapi specification which is a json file located in api/openapi.json. This generated in osparc-simcore and then moved here.
    2. The openapi-generator-tool. The exact docker image of this tool to use is specifies in scripts/common.Makefile.

Documentation

Each client (corresponding to a directory clients/<language>) should have a make recipy called install-doc which installs packages needed to generate the documentation for that client, as well as a make recipe docs which generates the documentation. All of these recipes are called from the root's docs recipe, which is what is called when the website is published.

Repos which depend on this one

Here is an inexhaustive list which have this repo as a dependency. So changing stuff here might break stuff there:

osparc-simcore-clients's People

Contributors

bisgaard-itis avatar elisabettai avatar pcrespov avatar wvangeit avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

osparc-simcore-clients's Issues

Fix abort multipart upload

What version of osparc are you using?

Long story short

Expected behaviour

Actual behaviour

Steps to reproduce

Your environment

Configuration defaults captures `OSPARC_*`

User Story

The Configuration object should by default capture specific environment variables. such that

from osparc import ApiClient, UsersApi, Confirmation
import os

assert Configuration() = Configuration(
    host=os.environ["OSPARC_API_HOST"],
    username=os.environ["OSPARC_API_KEY"],
    password=os.environ["OSPARC_API_SECRET"],
)

Definition of Done

Open a jupyter-math service in osparc (see ITISFoundation/jupyter-math#29, ITISFoundation/osparc-simcore#5695)

from osparc import ApiClient, UsersApi, Confirmation
import os

cfg = Configuration()
print(cfg.host)

with ApiClient(cfg) as api_client:
    users_api = UsersApi(api_client)
    profile = users_api.get_my_profile()
    print(profile)

๐Ÿšš Reorganize client to improve workflows

Description

In order to have a great workflow in place, where maintainability is as low as possible and where we can easily support new types of clients, we need to restructure the repo.

Tasks

Expose osparc python package within the sparc.client

Here's a list of tasks which should be achieved:

docstring of jobs is wrong

What version of osparc are you using?

0.6.3

Long story short

the docstring of jobs says there are optional parameters, but the method does not allow for more than solver_key and solver_version

Expected behaviour

correct docstring or modified method

Actual behaviour

wrong doctring

Steps to reproduce

pip install osparc

with osparc.ApiClient(cfg) as api_client:
    solvers_api = osparc.SolversApi(api_client)
    solvers_api.jobs(id, version)

Your environment

Introduce proper logging

Currently there are print statements spread out in the client. These need to be converted into proper a proper logging system

Ensure jobs are deleted after e2e client

Long story short

The following should be added to the e2e client tests:

Tasks

list_jobs entrypoint redirects to internal function for paged function

What version of osparc are you using?

0.6.3

Long story short

pip install osparc
then doing

with osparc.ApiClient(cfg) as api_client:
    solvers_api = osparc.SolversApi(api_client)
    solvers_api.list_jobs(...)

the doc string of list_jobs tells me to look at get_jobs_page for the paginated version. then looking at get_jobs_page tells me it is internal.
The proper paginated method is called jobs

Expected behaviour

the docstring should bring me to the correct paginated method.

Actual behaviour

docstring is wrong

Steps to reproduce

Your environment

Clean up after introducing e2e testing.

Here's the list of tasks for this ticket:

Tasks

[
  {
    "name": "master": {
      "url": "api.osparc-master.speag.com",
      "is_compatible": true,
      "url": "api.osparc-staging.speag.com",
      "is_compatible": false,
      "url": "api.osparc.speag.com",
      "is_compatible": false,
      "url": "api.staging.osparc.io",
      "is_compatible": false,
      "url": "api.osparc.io",
      "is_compatible": false
    }
  },
  {
    "name": "production": {
      "url": "api.osparc-master.speag.com",
      "is_compatible": true,
      "url": "api.osparc-staging.speag.com",
      "is_compatible": true,
      "url": "api.osparc.speag.com",
      "is_compatible": true,
      "url": "api.staging.osparc.io",
      "is_compatible": true,
      "url": "api.osparc.io",
      "is_compatible": true
    }
  }
]
[
  {
    "name": "master": {
      "url": "api.osparc-master.speag.com",
      "is_compatible": true,
      "url": "api.osparc-staging.speag.com",
      "is_compatible": false,
      "url": "api.osparc.speag.com",
      "is_compatible": false,
      "url": "api.staging.osparc.io",
      "is_compatible": false,
      "url": "api.osparc.io",
      "is_compatible": false
    }
  },
  {
    "name": "production": {
      "url": "api.osparc-master.speag.com",
      "is_compatible": true,
      "url": "api.osparc-staging.speag.com",
      "is_compatible": true,
      "url": "api.osparc.speag.com",
      "is_compatible": true,
      "url": "api.staging.osparc.io",
      "is_compatible": true,
      "url": "api.osparc.io",
      "is_compatible": true
    }
  }
]

Multi-version documentation

Currently only master documentation is published in pages

  • released package does not sync with published doc
  • do not keep doc of previous package releases

Add test for logstreaming

User Story

We need to have a test running against sim4life.io which tests the log streaming which will warn us in case i fails.

Example

Definition of Done

Upload limit

User Story

Add an upload limit, so that users can only upload a given amount of data to the osparc platform.

release of osparc python client

Add a tutorial which shows the functionality developed during the Watermelon sprint

Tasks

Introduce longer timeout threshold for multipart upload

What version of osparc are you using?

Long story short

When running a lot of multipart uploads concurrently, the completion request to S3 times out.

Expected behaviour

Actual behaviour

Steps to reproduce

Your environment

Add test to run jupyter notebooks

Jupyter notebooks are currently auto-generated from markdown doc. Verify that every code cell runs "as is" (e.g. no variables missing, etc). Ideally this should be an automatic job in the CI

Basic tutorial 2: Pseudo-code for user story involving CWL @elisabettai

As a user, I would like to do this using the osparc Python package (called osparc later on for simplicity):

User story

  • I found some excel files on the SPARC Portal here: https://sparc.science/datasets/273?type=dataset&datasetDetailsTab=files&path=files%2Fderivative
  • Download one/all of them using osparc (I am assuming the file entrypoints can do that)
  • Then I want to make some analysis/plots out of those data. So I check if there is some solver that accept as input xlsx file as input (This I guess can be achieved by querying all the solvers ports. think we don't have any service of this type.
  • But I see that there's a solver called osparc python runner (see here how to use it.).
  • I then develop my python code locally to plot/analyse the data and output a figure in the output ports, I package it according to how the osparc python runner requires.
  • I give my code as the input to the osparc python runner
  • I run then the job with the osparc python runner and I get the job status and logs (or render them on the screen while running, but I doubt this is possible already). I want to see if the job ran successfully
  • Once I get a successful run, I upload the output figure to the system (is this the purpose of /v0/files/content?

Improve release workflow

Possible workflows provided changes in OAS of osparc-simcore public API

  • new osparc-simcore public API merges to master

    • osparc-simcore/tests/public-api already tests against current master
    • manual run tests/public-api/examples/sleeper.py?
  • new osparc-simcore public API pre-released to staging

    • set version as beta with commit-id?
    • test repo version against staging?
    • publish to pypi
    • test published version against staging? and all previous versions as well
    • manual test run tests/public-api/examples/sleeper.py?
    • announce release?
  • new osparc-simcore public API released to production

    • dump version as major/minor/patch ...
    • test repo version against production?
    • publish to pypi
    • test published version against production? and all previous versions as well
    • manual test run tests/public-api/examples/sleeper.py?
    • announce release?
  • Where to announce pre/release?:

    • osparc-simcore CHANGELOG
    • support-channel (see NOTES)

Baklava issue

Add tutorial specific for files - also to test corner cases of the system.

Nice to have

Write basic tutorial in "sparc.client-language" in the [tutorial](https://github.com/nih-sparc/sparc.client/blob/main/docs/tutorial.ipynb)

This was pointed out at the Tech call (July 13) by @mguidon.

  1. The current plan is to have the documentation on Readme. We can get help in moving/copying our documentation there. See this wrike ticket here (https://www.wrike.com/open.htm?id=920664113)

  2. They asked for ideas of a cross-core tutorial (https://docs.google.com/spreadsheets/d/1WZIjBVo2wyQyxiPP7KzEmchBf_9UX48hvaielX1kST4/edit#gid=944422487) until Wednesday, July 19th such that it can be discussed in the PI meeting

This task is about Point 1.
fyi @pcrespov

Tasks

  1. documentation
    bisgaard-itis

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.