If you want to use your own data sources or algorithms on the UP42 platform, you can create custom blocks that can be seamlessly added to your workflows as data or processing blocks. These blocks will appear in the console tab Custom blocks.
While developing custom blocks in Python, we recommend using the UP42 block utilities package. This package contains base classes for data and processing blocks, and several facilities to handle testing.
Clone the example block using Git and navigate to the folder that contains the Dockerfile and UP42Manifest:
git clone https://github.com/up42/sharpening.git cd sharpening
In this guide, we will skip modifying the example code and directly push the block to the UP42 platform. For more advanced instructions on custom block development, please refer to Developing a custom processing block.
To log in to the UP42 Docker registry, replace the username with the email address associated with the UP42 account. When asked for your password, enter the password of your UP42 account.
# Template docker login -u=<USERNAME> http://registry.up42.com
# Example docker login -firstname.lastname@example.org http://registry.up42.com
To build the block image, you need to use your UP42 user ID. This can be found in the console tab Custom blocks, where you need to click on PUSH A BLOCK TO THE PLATFORM*.
A new window will open. At the bottom of the window, go to the section Push the image to the UP42 Docker registry. Copy the user ID from the command (e.g.
Build the Docker image with the command below:
# Template docker build . -t registry.up42.com/<USER-ID>/sharpening:1.0 \ --build-arg manifest="$(cat UP42Manifest.json)"
# Example docker build . -t registry.up42.com/6760d08e-54e3-4f1c-b22e-6ba605ec7592/sharpening:1.0 \ --build-arg manifest="$(cat UP42Manifest.json)"
Now you can push the image to the UP42 Docker registry. To proceed, you need to use your UP42 user ID.
# Template docker push registry.up42.com/<USER-ID>/sharpening:1.0
# Example docker push registry.up42.com/6760d08e-54e3-4f1c-b22e-6ba605ec7592/sharpening:1.0
The Sharpening block will now be displayed in the console tab Custom blocks.
This process assumes that you already built workflows by following the steps from the article Create a workflow.
When building a workflow, you can add the custom block from the tab Custom blocks.
Congratulations, you successfully pushed a custom block to your UP42 Docker registry! For more advanced instructions on custom block development & publishing, please refer to Developing a custom processing block.