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 Slide

  2. View Slide

  3. sensitive data
    Aircloak
    analyst
    query
    non sensitive result

    View Slide

  4. aircloak
    air
    cloak
    central
    common
    integration_test
    ...

    View Slide

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

    View Slide

  6. outgrowing Travis CI
    long build times
    flakiness
    low throughput

    View Slide

  7. solution
    self-hosting

    View Slide

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

    View Slide

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

    View Slide

  10. View Slide

  11. GitHub poller
    GitHub
    poll
    list of branches and PRs

    View Slide

  12. aircloak_ci
    GitHub poller builds
    branch x pull request y

    View Slide

  13. pull request x
    air cloak …

    View Slide

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

    View Slide

  15. report success
    build components
    await approval
    report mergeability

    View Slide

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

    View Slide

  17. 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 Slide

  18. View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  26. component
    command 1 command 2 …

    View Slide

  27. build
    component 1 component 2 …

    View Slide

  28. builds
    build 1 build 2 …

    View Slide

  29. not open-source (yet!)

    View Slide

  30. View Slide

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

    View Slide

  32. 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 Slide

  33. distributed systems
    persistence
    partial deployment

    View Slide

  34. 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 Slide

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

    View Slide