Wrappers
Last updated
Was this helpful?
Last updated
Was this helpful?
The algorithm wrapper simplifies and standardizes the interaction between algorithm and node. The and the algorithm wrapper are tied together and use the same standards. The algorithm wrapper:
reads the environment variables and file mounts and supplies these to your algorithm.
provides an for the docker container
allows to write a single algorithm for multiple types of data sources
The wrapper is language specific and currently we support Python and R. Extending this concept to other languages is not so complex.
The signature of your function has to contain data
as the first argument. The method name should have a RPC_
prefix. Everything that is returned by the function will be written to the output file.
It is quite common to have a central part of your federated analysis which orchestrates the algorithm and combines the partial results. A common pattern for a central function would be:
Request partial models from all participants
Obtain the partial models
Combine the partial models to a global model
(optional) Repeat step 1-3 until the model converges
It is possible to run the central part of the analysis on your own machine, but it is also possible to let vantage6 handle the central part. There are several advantages to letting vantage6 handle this:
You don't have to keep your machine running during the analysis
You don't need to use the same programming language as the algorithm in case a language specific serialization is used in the algorithm
Note that central functions also run at a node and not at the server.
In contrast to the federated functions, central functions are not prefixed. The first argument needs to be client
and the second argument needs to be data
. The data
argument contains the local data and the client
argument provides an interface to the vantage6-server.
The argument data is not present in the R-wrapper. This is a consistency issue which will be solved in a future release.
The docker wrappers read the local data source and supplies this to your functions in your algorithm. Currently CSV and SPARQL for Python and a CSV wrapper for R is supported. Since the wrapper handles the reading of the data, you need to rebuild your algorithm with a different wrapper to make it compatible with a different type of data source. You do this by updating the CMD
directive in the dockerfile.
TODO