If you want to use your own processing methods or data sources on the UP42 platform, you can create custom blocks that can be seamlessly integrated into UP42 workflows. The block will appear in the Custom blocks section of your UP42 console. It can then be used like any other data or processing block.
While developing custom blocks in Python, the UP42 block utilities package can help. 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/blocks/sharpening
We will skip changing the example code here and directly push the block to the UP42 platform. See section Developing a custom processing block for more advanced instructions on custom block development.
First login to the UP42 docker registry. Replace <USERNAME> with the email address you login with on the UP42 website. Make sure Docker is running on your computer. When asked for your password, enter your UP42 account password.
docker login -u=<USERNAME> http://registry.up42.com # Example: docker login -u=[email protected] http://registry.up42.com
Then build the block container, replace <User-ID> with your UP42 User-ID.
To get your UP42 User-ID, go to the the UP42 custom-blocks menu and click on “PUSH A BLOCK TO THE PLATFORM”. At the bottom of the popup, copy your user ID from the command “Push the image to the UP42 Docker registry” (e.g.
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. Replace <User-ID> with your UP42 User-ID.
docker push registry.up42.com/<USER-ID>/sharpening:1.0 # Example: docker push registry.up42.com/6760d08e-54e3-4f1c-b22e-6ba605ec7592/sharpening:1.0
Success! The Sharpening Filter example block will now appear in the UP42 custom-blocks menu. When building a workflow it can be selected under the Custom blocks tab.
You can find more advanced instructions on custom block development & publishing in the chapter Developing a custom processing block.