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

Such Great Heights, Code BEAM Lite, Amsterdam 2018

Saša Jurić
November 30, 2018

Such Great Heights, Code BEAM Lite, Amsterdam 2018

Saša Jurić

November 30, 2018
Tweet

More Decks by Saša Jurić

Other Decks in Programming

Transcript

  1. Such great heights
    @sasajuric
    aircloak.com

    View full-size slide

  2. sensitive data
    Aircloak
    analyst
    query
    non sensitive result

    View full-size slide

  3. aircloak
    air
    cloak
    central
    common
    integration_test
    ...

    View full-size slide

  4. dev flow
    pull request based
    mandatory code review
    mandatory tests

    View full-size slide

  5. outgrowing Travis CI
    long build times
    flakiness
    low throughput

    View full-size slide

  6. solution
    self-hosting

    View full-size slide

  7. custom CI
    simpler for a small problem
    flexible
    no additional knowledge required

    View full-size slide

  8. aircloak
    air
    cloak
    central
    common
    integration_test
    ci
    ...

    View full-size slide

  9. GitHub poller
    GitHub
    poll
    list of branches and PRs

    View full-size slide

  10. aircloak_ci
    GitHub poller builds
    branch x pull request y

    View full-size slide

  11. pull request x
    air cloak …

    View full-size slide

  12. changed component tested components
    air
    air
    integration_test
    ci ci
    common everything

    View full-size slide

  13. report success
    build components
    await approval
    report mergeability

    View full-size slide

  14. if not merge_conflict?(build_state) and
    tests_passed?(build_state) and
    pr_approved?(build_state)
    do: report_mergeable(build_state)

    View full-size slide

  15. Github.comment_on_issue(
    build_state,
    "Pull request can be merged #{AircloakCI.Emoji.happy()}"
    )
    Github.put_status_check_state(
    build_state,
    "continuous-integration/aircloak/mergeable",
    "pull request can be merged",
    :success
    )

    View full-size slide

  16. %{
    compile: [
    "mix deps.get",
    "mix compile"
    ],
    test: [
    "mix test",
    "mix dialyze",
    "mix format --check-formatted"
    ]
    }

    View full-size slide

  17. test_test = # ...
    test_dev = # ...
    test_prod = # ...
    %{
    compile: # ...,
    test: [test_test, test_dev, test_prod]
    }

    View full-size slide

  18. # sequence of commands
    [
    "mix deps.get",
    "mix compile"
    ]

    View full-size slide

  19. # also a sequence
    {:sequence, [
    "mix deps.get",
    "mix compile"
    ]}

    View full-size slide

  20. # independent commands
    {:parallel, [
    "mix format --check-formatted",
    "mix test",
    "mix dialyze",
    ]}

    View full-size slide

  21. {:sequence, [
    "command a",
    {:parallel, [
    "command b",
    {:sequence, [
    "command c",
    "command d"
    ]},
    "command e"
    ]},
    "command f"
    ]}

    View full-size slide

  22. command a
    command b command c command e
    command d
    command f

    View full-size slide

  23. component
    command 1 command 2 …

    View full-size slide

  24. build
    component 1 component 2 …

    View full-size slide

  25. builds
    build 1 build 2 …

    View full-size slide

  26. not open-source (yet!)

    View full-size slide

  27. uniformity
    simpler development
    simpler testing
    simpler deployment
    simpler maintenance
    improved collaboration

    View full-size slide

  28. technical feature built-in options
    services GenServer, Task
    service manager Supervisor
    service registry Registry
    k-v ETS, Mnesia
    web server Phoenix, Plug, Cowboy
    periodical jobs :timer, Quantum, Periodic
    load regulation Jobs, Safetyvalve, Sbroker
    concurrent flows Flow, GenStage

    View full-size slide

  29. distributed systems
    persistence
    partial deployment

    View full-size slide

  30. They will see us waving from such great heights
    Come down now, they'll say
    But everything looks perfect from far away
    Come down now, but we'll stay
    The Postal Service

    View full-size slide

  31. 40% off at manning.com with code
    ctwcodebeamamsterdam18
    links: bit.ly/such-great-heights-amsterdam2018

    View full-size slide