Package & distribute
Last updated
Was this helpful?
Last updated
Was this helpful?
Once the algorithm is completed it needs to be packaged and made available for retrieval by the nodes. The algorithm is packaged in a Docker image. A Docker image is created from a Dockerfile, which acts as blue-print. Once the Docker image is created it needs to be uploaded to a registry so that nodes can retrieve it.
A minimal Dockerfile should include a base-image, injecting your algorithm and execution command of your algorithm. For example:
Additional Docker directives are needed when using direct communication between different algorithm containers, see Networking for more information on this.
If you are in the folder containing the Dockerfile, you can build the project as follows:
The -t
indicated the name of your image. This name is also used as reference where the image is located on the internet. If you use Docker hub to store your images, you only specify your username as repo
followed by your image name and tag: USERNAME/IMAGE_NAME:IMAGE_TAG
. When using a private registry repo
should contain the URL of the registry also: e.g. harbor2.vantage6.ai/PROJECT/IMAGE_NAME:TAG
.
Then you can push you image:
Now that is has been uploaded it is available for nodes to retrieve when they need it.
It is possible to use the Docker the framework to create signed images. When using signed image the node can verify the author of the algorithm image adding an additional protection layer.
Dockerfile
Build project
CMD
Expose
Harbor or Docker hub or whatever
public vs private
signed
When using the the Dockerfile needs to follow a certain format. You should only change the PKG_NAME
value to the R package name of your algorithm.