#How to create a wrapper over Dagger Javascript SDK?

1 messages · Page 1 of 1 (latest)

chrome dagger
#

I am platform engineer at a services company, We have written pipelines for java,golang,python,terraofrm and many other language in jenkins, gitlab, ADO. With all this expereince.

I want to create a simple abstraction (with our best practices involved) over Dagger, such that it can be easily consumed by developers.

Do we have any guide surround this?

PFA the attched code snapshot

The end goal is developer use our SDK to write pipelines on their own

import Pipeline from "./pipeline.mjs";

const p = new Pipeline();
p.run()
cedar magnet
#

We are developing a SDK for our usage purposes which we will hopefully open source soon. Dagger being very non-opinionated and thus enables us to create the framework in whatever way you want. Using class like this is okay but not a way I am a fan of — but in the end it is all matter of taste. I think this is matter of a question of what structure in code you like.

sweet gust
#

Hello @chrome dagger and @cedar magnet ! Two points here:

  1. Yes @cedar magnet is correct that since your Dagger pipeline logic is “just code”, a big part of Dagger best practices are simply the best practices of your language of choice. That includes the time-honored tradition of never agreeing on the best way to organize your code 🙂

  2. There is a big feature coming later this year, that adds cross-language composition and component reuse. This works by packaging your code as a Dagger “module” and exposing it as an http/graphql API the same way we expose our own API. Then you get a generated SDK for any language (plus other Dagger modules can use yours as a dependency cross-language). This doesn’t break what you’re currently doing, but still worth knowing about since it will open new possibilities. See #daggernauts for discussion of this upcoming feature.

cedar magnet
#

great 🙂 zenith looks promising.

subtle wraith
#

adds cross-language composition and component reuse

Literally the most exciting thing ever.