Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Bob: A composable and inclusive CI/CD Platform

Rahul De
February 29, 2020

Bob: A composable and inclusive CI/CD Platform

Fully built in Clojure and embodying the UNIX philosophy, almost Emacs like external extensibility and simplicity of Clojure, Bob tries to be least in our way and tries to be inclusive of our needs and is a CI/CD platform than just a tool, enabling us to build the CI we want, not be hammering away at an existing stubborn thing and more importantly making it much more approachable and inclusive to newbies.

Rahul De

February 29, 2020
Tweet

More Decks by Rahul De

Other Decks in Technology

Transcript

  1. Hello, world! • @lispyclouds • (❤ :FOSS :Diversity :Sustainable-Living :Anarcho-communism)

    • (constantly [:Clojure :Infrastructure]) • Backend and Infrastructure tooling development, Consulting @thoughtworks • Compilers, Language(Human and Machine) Nerd, VMs, High Performance • https://twitter.com/lispyclouds • https://github.com/lispyclouds
  2. • The UI. • Pipeline orchestration logic. • VCS control.

    • Tight coupling to popular VCS platforms. • Opinionated branching control. • The build plan definition as a Domain Specific Language. • Master-Worker configuration. • Build state like artifacts stored inline in non scalable ways.
  3. The traditional notion of plugins locks you into a tight

    coupling with the CI along with issues like vulnerabilities and upgrades. Addressing them outside the core isn’t simple.
  4. We absolutely have to use the same tech to write

    plugins in which the CI was built in in the traditional plugin architecture.
  5. An UI which was designed to address certain problems in

    mind is delivered by default hence pretty much providing pre-defined views of the CI infra and to control it. Multi- Modal interfaces or accessing on them can be tricky.
  6. Adding features and updates are unreliable and involve downtimes/restarts. Eg:

    features like adding proper pipeline support is arduous.
  7. Resource Providers Artifact Stores External UI External Behaviour REST REST

    REST REST Docker clj-docker-client Pipeline Artifact Resource Clojure on JVM
  8. Bob • FOSS with GNU AGPL v3+. • Exposes its

    entire vocabulary as a REST API caring only about Execution. • Highly concurrent. • Masterless cluster based scaling with a shared PostgreSQL DB for build state and events. • Has no opinions of an UI, or an opinionated build plan language like YAML and even build planning and scheduling.
  9. FROM clojure:boot as builder WORKDIR /opt COPY . . RUN

    boot show "--deps RUN boot build FROM docker:dind WORKDIR /opt RUN apk add -u wget RUN wget "https:"//cdn.azul.com/zulu/bin/zulu12.3.11-ca-jdk12.0.2-linux_musl_x64.tar.gz" RUN tar -zxvf *.tar.gz RUN rm *.tar.gz RUN mv zulu* jdk COPY "--from=builder /opt/target/bob-standalone.jar . COPY bob-entrypoint.sh /opt RUN chmod +x /opt/bob-entrypoint.sh ENTRYPOINT ["/opt/bob-entrypoint.sh"]
  10. Pipeline • Pre-Provisioned build environment with Docker. • Consists of

    Steps. • Steps are a composition of: (λ resources) "=> artifacts. • Optional environment variables.
  11. { "image": "busybox:musl", "vars": { "env": "test" }, "steps": [

    { "cmd": "echo hello > test.txt" }, { "cmd": "cat test.txt", "produces_artifact": { "name": "afile", "path": "test.txt", "store": "local" } }, { "needs_resource": "my-source", "cmd": "ls", "produces_artifact": { "name": "license-file", "path": "LICENSE", "store": "local" } } ], "resources": [ { "name": "my-source", "type": "external", "provider": "git-provider", "params": { "repo": "https://github.com/bob-cd/bob", "branch": "master" } } ] }
  12. Image1 Container1 Cmd1 Commit Image2 Cmd2 Container2 Commit … [Resource]

    [Artifact] Passed | Failed [Resource] [Artifact]
  13. Resource • An abstraction over Source Code, Raw files, pipeline

    outputs etc. • Provided via a Resource Provider which is a web server reachable by Bob. • Can be re-used multiple times in a single build.
  14. Artifact • The result of a step execution over a

    resource. • Must be pushed out of Bob as CIs should not be storing them. • Artifacts can be produced during any step of the pipeline. • Stored by an Artifact Store which is a web server reachable from Bob. • The Artifact Store is an abstraction over how to store/publish the artifact. Eg. S3, Docker Hub, Bintray etc.
  15. Going beyond just CI/CD • Bob is generic enough to

    orchestrate any task. • Can be used for any scheduling/orchestration jobs like CD for Machine Learning, data processing, scheduled batch jobs etc. • Just Execute.
  16. Other projects in the same spirit • Concourse CI •

    The UNIX tooling and philosophy • tools.deps • aws-api • Emacs
  17. Thank You! Rahul De @lispyclouds Destroy all classes! •https://github.com/bob-cd/bob •https://github.com/bob-cd/wendy

    •https://github.com/bob-cd/resource-git •https://github.com/bob-cd/artifact-local •https://github.com/lispyclouds/clj-docker-client •https://github.com/lispyclouds •https://twitter.com/lispyclouds