Package: nevermined-compute-api
Nevermined Compute APICompute to the Data Infrastructure Orchestration Micro-serviceTable of Contentsnevermined-compute-apiAboutGetting StartedLocal EnvironmentSetting up minikubeRunning the ServiceTestingNew VersionLicenseAboutThe 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 theNevermined 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 objectsList the workflows registered in K8sStop a running workflow executionGet information about the state of execution of a workflowThe Compute API doesn't provide any storage capability for workflows, all the state is stored directly in the K8s cluster.Getting StartedLocal EnvironmentThe 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 minikubeFirst is necessary to configure theminikubecompute stack usingnevermined-tools# There are some bugs affecting minikube with k8s 1.18.0 so we need to use 1.17.0$minikubeconfigsetkubernetes-version1.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$kubectlcreateconfigmapartifacts\--from-file=$HOME/.nevermined/nevermined-contracts/artifacts/\--namespace=nevermined-compute# Start the argo-artifacts service$helminstallargo-artifactsstable/minio--setservice.type=LoadBalancer\--setfullnameOverride=argo-artifacts# If helm can't find argo-artifacts add the helm repo and try again$helmrepoaddstablehttps://kubernetes-charts.storage.googleapis.com/
$helmrepoupdateRunning the ServiceOnce you have the compute stack running withminikube, 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 variablesexportFLASK_APP=nevermined_compute_api/run.pyexportPROVIDER_ADDRESS=0x00bd138abd70e2f00903268f3db08f2d25677c9eexportPROVIDER_PASSWORD=node0exportPROVIDER_KEYFILE=test/resources/data/publisher_key_file.json# start the compute api$flaskrun--host=0.0.0.0--port=8050Having the server running you can find the complete Swagger API documentation
athttp://localhost:8050/api/v1/docs/TestingAutomatic tests are set up via GitHub actions.New VersionThebumpversion.shscript helps bump the project version. You can execute the script using{major|minor|patch}as first argument, to bump the version accordingly.AttributionThis library service in theOcean ProtocolOperator Service.
It keeps the same Apache v2 License and adds some improvements. SeeNOTICE file.LicenseCopyright 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.