Skip to main content

banner

Nevermined Compute API

Compute to the Data Infrastructure Orchestration Micro-service

Table of Contents

About

The Compute API is a micro-service implementing the Nevermined Compute to the Data use case, in charge of managing the workflow executing requests. Typically the Compute Service is integrated with the Nevermined Gateway, but can be called independently of it.

The Compute API is in charge of establishing the communication with the K8s cluster, allowing to:

  • Register workflows as K8s objects
  • List the workflows registered in K8s
  • Stop a running workflow execution
  • Get information about the state of execution of a workflow

The Compute API doesn't provide any storage capability for workflows, all the state is stored directly in the K8s cluster.

Getting Started

Local Environment

The Compute API is in charge of receiving the requests for running compute workflows and the setup of those in the K8s infrastructure. To do that, in a local environment the Compute API needs connectivity to you K8s environment.

There are multiple configurations and deployments of K8s possible, but here we are going to show how to connect to an existing K8s cluster running in minikube.

Setting up minikube

First is necessary to configure the minikube compute stack using nevermined-tools

# There are some bugs affecting minikube with k8s 1.18.0 so we need to use 1.17.0
$ minikube config set kubernetes-version 1.17.0

# Start compute stack
$ ./scripts/setup_minikube.sh

# If minikube refuses to start due to virtualization problems be can set the minikube driver to docker
$ MINIKUBE_DRIVER=docker ./scripts/setup_minikube.sh

# Create a configmap for the artifacts
$ kubectl create configmap artifacts \
    --from-file=$HOME/.nevermined/nevermined-contracts/artifacts/ \
    --namespace=nevermined-compute

# Start the argo-artifacts service
$ helm install argo-artifacts stable/minio --set service.type=LoadBalancer \
    --set fullnameOverride=argo-artifacts

# If helm can't find argo-artifacts add the helm repo and try again
$ helm repo add stable https://kubernetes-charts.storage.googleapis.com/
$ helm repo update

Running the Service

Once you have the compute stack running with minikube, running the service is as simple as running the following commands:

# Copy the artifacts
$ ./scripts/wait_for_migration_and_extract_keeper_artifacts.sh

# Set the environment variables
export FLASK_APP=nevermined_compute_api/run.py
export PROVIDER_ADDRESS=0x00bd138abd70e2f00903268f3db08f2d25677c9e
export PROVIDER_PASSWORD=node0
export PROVIDER_KEYFILE=test/resources/data/publisher_key_file.json

# start the compute api
$ flask run --host=0.0.0.0 --port=8050

Having the server running you can find the complete Swagger API documentation at http://localhost:8050/api/v1/docs/

Testing

Automatic tests are set up via GitHub actions.

New Version

The bumpversion.sh script helps bump the project version. You can execute the script using {major|minor|patch} as first argument, to bump the version accordingly.

Attribution

This library service in the Ocean Protocol Operator Service. It keeps the same Apache v2 License and adds some improvements. See NOTICE file.

License

Copyright 2020 Keyko GmbH
This product includes software developed at
BigchainDB GmbH and Ocean Protocol (https://www.oceanprotocol.com/)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Metadata

Release files for nevermined-compute-api 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nevermined-compute-api 0.3.0
File Size Uploaded Provenance
nevermined-compute-api-0.3.0.tar.gz 16.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for nevermined-compute-api 0.3.0
File Interpreter ABI Platform
nevermined_compute_api-0.3.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 33.4 kB

Release files / nevermined-compute-api-0.3.0.tar.gz

Download URL nevermined-compute-api-0.3.0.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5c2ee847657e3910ccc97ef78ad1612e2f266018eff2cfe929bfcdfa30b98588
BLAKE2b-256 checksum
How to use checksums
ca2cee327c745661f7d6ec374bdb804ec9fdab64cada61bc9f994e4d731cab29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

Release files / nevermined_compute_api-0.3.0-py2.py3-none-any.whl

Download URL nevermined_compute_api-0.3.0-py2.py3-none-any.whl
Size 16.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
2fdc9deda5d03ac266e0e04eba983f225b14b1de370e03cdb2df0062f7cc1f88
BLAKE2b-256 checksum
How to use checksums
6d562fc3c2e23c3519369e25714da04c90578dea63682dc6c37af668bd9b66a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

Security for nevermined-compute-api 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page