brigadecore / brigade

Event-driven scripting for Kubernetes
https://brigade.sh/
Apache License 2.0
2.41k stars 246 forks source link

Declarative support? #1024

Open carolynvs opened 5 years ago

carolynvs commented 5 years ago

This is feedback based on using brigade side-by-side with azure pipelines for ~6 months for Porter.

There has been quite a bit of a steep learning curve in figuring out both how brigade's libraries, javascript, GitHub actions and events. Our brigade file has always been an exercise in copy/pasting from a working brigade.js file in someone else's project, or picking @vdice's brain. šŸ˜€

It would be helpful if there was a simplified version of brigade's agent that was optimized for helping me just run makefile targets for my CI. Really that's where I keep all of my logic, in my makefile and all I want to do is call a few different variations of targets for a branch or tag.

Right now our brigade.js file is pretty big, but the entire thing boils down to this (or some subset for a PR):

make test-unit test-integration test-cli publish publish-examples

Some of the brigade.js file has more logic than that, but really that logic should be in a makefile target, it's not only because at this point we are relying on things already being installed on an azure pipelines agent, which is cheating. šŸ˜

But if we could distill it down or make a lot of the noise in that file go way, and be able to use a declarative language with a documented schema, that would have made me feel a lot more comfortable picking up brigade and managing it myself.

I'm not trying to change how brigade works. Just saying that if we could add a mode on top of brigade that let me work more like I'm used to that maps to normal brigade under the hood, that would be interesting to look into.

technosophos commented 5 years ago

Yeah, adding a mode on top of it that would cover the base cases -- especially for standard CI/CD -- would be good.

krancour commented 5 years ago

Probably worth noting here that I've been working on something like this-- and it's based on an open specification (which is only a draft right now).

The spec is here: https://github.com/lovethedrake/drakespec

And here's a brigade-compatible worker: https://github.com/lovethedrake/brigdrake

arschles commented 5 years ago

I noticed that there is a cli for that spec available as well, so if Iā€™m not mistaken you could test out a run through this new gateway locally before you check in code. Do I have that right @krancour @carolynvs?

krancour commented 5 years ago

@arschles yes. https://github.com/lovethedrake/devdrake can execute pipelines locally using nothing more than the local Docker daemon under the hood-- no k8s involved even.

krancour commented 4 years ago

Per the 2.0 proposal, 2.0 will drastically improve support for alternative workers, but introducing new (official) ones is deferred to a subsequent 2.x release. For now, I'm dropping the 2.0 label and adding a 2.1 label.

krancour commented 2 years ago

Now that v2.0.0 is out, I am going to start revisiting this as time permits.

Some effort has previously gone into an open specification for declarative pipelines, but it hasn't been touched in some time and I think the spec itself is still in need of quite a bit of work.

I will at least revisit the effort to produce a Brigade 2-compatible worker that supports the existing draft of the spec and introduce that on an experimental basis.