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

Ruby Floripa 2019 - Why your company should have a Developer's Kit and how to build one

Ruby Floripa 2019 - Why your company should have a Developer's Kit and how to build one

Today modern application can be composed of multiple pieces that is not always easy to fit together. From the majestic monolith to the micro-service based architecture, there is also a good chance you depend on multiple daemons with a pleteora of configuration parameters that needs be defined in harmony so you can run a fully capable development environment.

While some approaches like docker composer may be useful to some users, you are making a tradeoff of performance and convenience, by removing the ability to run things natively. You are also making harder for any more advanced debugging techniques on a lower level of your stack.

In this talk I will show you how you can build a Developer's Toolkit that compromises nothing: performance, convenience still gives you the ability to do system-level debugging, without any docker required.

Gabriel Mazetto

August 27, 2019
Tweet

More Decks by Gabriel Mazetto

Other Decks in Programming

Transcript

  1. View Slide

  2. @brodock
    Gabriel Mazetto

    View Slide

  3. 3

    View Slide

  4. Why your company should
    have a Developer’s Toolkit
    and how to build one

    View Slide

  5. This talk is
    programming
    language
    agnostic

    View Slide

  6. I will focus more on the
    Why and less on the How…


    But you will learn enough
    to be able to do it yourself
    at the end, trust me.

    View Slide

  7. Let’s start talking
    about why you should do it…

    View Slide

  8. View Slide

  9. View Slide

  10. All that time
    invested (wasted)
    solving programming
    challenges online
    were finally
    rewarded!

    View Slide

  11. View Slide

  12. Now you are in
    and you are part
    of the team!

    View Slide

  13. View Slide

  14. View Slide

  15. But instead of
    something
    simple and
    straightforward…

    View Slide

  16. View Slide

  17. Yes, your new
    company uses
    Cloud and SaaS
    for everything…

    View Slide

  18. View Slide

  19. View Slide

  20. View Slide

  21. View Slide

  22. Let’s switch roles a little bit…
    You are now wearing the
    Tech-Lead Hat

    View Slide

  23. View Slide

  24. View Slide

  25. View Slide

  26. Have you ever
    thought of how
    much it cost to
    onboard a new
    developer?

    View Slide

  27. Salary
    WorkDaysInAMonth
    * DaysOnboarding
    Salary
    21
    * 10

    View Slide

  28. Let’s look at
    some Salary
    data on
    Glassdoor…

    View Slide

  29. View Slide

  30. View Slide

  31. View Slide

  32. Salary
    21
    * 10
    6500
    21
    * 10 = 3905,23

    View Slide

  33. So let’s talk about
    how to do it…

    View Slide

  34. Here are a few
    principles to
    guide you…

    View Slide

  35. Principles:


    1. minimal effort to
    get started

    View Slide

  36. Principles:


    2. good enough
    defaults

    View Slide

  37. Principles:


    3. expose the internals
    and make it easy to hack

    View Slide

  38. Principles:


    4. automate/scriptize as
    much as possible

    View Slide

  39. Principles:


    5. be as flexible as
    possible

    View Slide

  40. View Slide

  41. It hides
    complexity, but it
    doesn’t remove it

    View Slide

  42. Packaging new
    software is not
    easy…

    View Slide

  43. You are always
    running in
    “production
    mode” 

    by default

    View Slide

  44. View Slide

  45. # create your own postgresql data per application
    mkdir postgres
    initdb --locale=C -E utf-8 postgres/data
    # run postgresql
    postgresql -D /path/to/your/postgres/data \
    -k /path/to/your/postgres -h 127.0.0.1

    View Slide

  46. # create your own redis server per application
    mkdir redis
    cd redis && wget https://raw.githubusercontent.com/antirez/redis/5.0/
    redis.conf
    # run redis server
    redis-server /path/to/redis/redis.conf

    View Slide

  47. How to package
    and distribute?

    View Slide

  48. # Simple Procfile
    redis: redis-server redis/redis.conf
    postgresql: postgresql -D pg/data -k pg -h 127.0.0.1
    # Execute with `foreman start`

    View Slide

  49. View Slide

  50. Here are some other
    useful tools you can use

    View Slide

  51. Makefiles

    View Slide

  52. Rules
    and Dependencies

    View Slide

  53. .NOTPARALLEL:

    all: install configure
    install:
    echo "Use any shell command here."
    echo "Syntax require we ident with TABs"
    apt-get install git -y
    configure:
    git-config --global user.name "Gabriel Mazetto"
    git-config --global user.email "[email protected]"

    View Slide

  54. Custom variables

    View Slide

  55. # Local variables
    git_name: 'Gabriel Mazetto'
    git_email: '[email protected]'

    # Exported variables
    RAILS_ENV: 'test'


    .NOTPARALLEL:

    all: install configure
    install:
    @echo "Use any shell command here."
    @echo "Syntax require we ident with TABs"
    apt-get install git -y
    configure:
    git-config --global user.name "${git_name}"
    git-config --global user.email "${git_email}"

    View Slide

  56. Interfearence
    Steps

    View Slide

  57. .NOTPARALLEL:

    all: .git-config
    .git-config:
    @echo "this will be executed only once, or whenever you remove the file"
    git-config --global user.name "Gabriel Mazetto"
    git-config --global user.email "[email protected]"
    clean:
    rm .git-config

    View Slide

  58. .NOTPARALLEL:

    all: .git-config
    .git-config:
    @echo "this will be executed only once, or whenever you remove the file"
    git-config --global user.name "Gabriel Mazetto"
    git-config --global user.email "[email protected]"
    # make sure clean is not matched to an existing file on disk
    .PHONY: clean
    clean:
    rm .git-config

    View Slide

  59. Some other uses
    for a Makefile…

    View Slide

  60. Rakefiles

    View Slide

  61. desc 'Install all dependencies'
    task :install do
    puts "Use any shell command here."
    puts "Syntax require we ident with TABs"
    system "apt-get install git -y"
    end
    desc 'Configure everything'
    task :configure do
    system 'git-config --global user.name "Gabriel Mazetto"
    system 'git-config --global user.email "[email protected]"'
    end
    task :default => [:install, :configure]

    View Slide

  62. file '.git-config' do
    system 'git-config --global user.name "Gabriel Mazetto"'
    end
    directory 'gitlab' do
    system 'git clone https://gitlab.com/gitlab-org/gitlab-ce .'
    end
    task :clone_to, [:path] do
    system "git clone https://gitlab.com/gitlab-org/gitlab-ce #{@path}"
    end

    View Slide

  63. How we do at

    View Slide

  64. GitLab depends on
    multiple
    applications with
    specific
    configurations

    View Slide

  65. Production:

    Omnibus setup,


    Kubernetes Helm Chart

    View Slide

  66. View Slide

  67. GitLab
    Development Kit

    (GDK)

    View Slide

  68. # Read the Getting Started here:
    # https://gitlab.com/gitlab-org/gitlab-development-kit
    # install GDK rubygem
    gem install gitlab-development-kit
    # initialize a new contained environment
    gdk init gitlab
    # will clone and setup everything
    cd gitlab && gdk install
    # to execute GitLab on your local machine
    gdk run
    # to regenerate configuration files
    gdk reconfigure
    # to update all dependent repositories
    gdk update

    View Slide

  69. Questions?

    View Slide

  70. Thanks

    View Slide