Resource types best practices and development: debugging and suggestions


#1

I’m starting this discussion to get an idea on tips, tricks and conventions when it comes to writing custom resource types.

Resource types are very appealing to support high level of customizability and use-case-specific functionality in the pipeline. I however find it a bit tricky (and error-prone) to debug and test resource types. Something as simple as putting output logs in the resource implementation would require multiple steps. So I would like to know how the community approach resource type development and if there are common conventions when it comes to debugging those custom implementations.

The way I have been doing it is:

  1. Develop the resource locally (as per this)
  2. Build the docker image of the resource
  3. Push the image to my dockerhub repo
  4. Build a test pipeline locally that includes my test resource as a resource_type
  5. Put the resource in action and observe output logs from there

As you can see this can be a tedious process for learning and development purposes, even if one wants to try out different features to implement in a resource type.

Any suggestions or “better” practice people could offer? What is your favorite/efficient way to write custom resources and develop new features? Are there any recommended tutorials on resource types development other than than the main docs website? Any input on this is greatly appreciated!


#2

hello,
a partial answer that focuses on the automation of the steps, and supports a feature branch workflow, can be found at https://github.com/Pix4D/s3-resource-simple.