hejops / ztp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Zero to Production

Ch 0

  • cloud-native applications must have high availability (distributed), and handle dynamic workloads (elastic)

  • TDD and CI will be important

  • type system should make undesirable states difficult or impossible to represent

  • code must be expressive enough to solve the problem, but flexible enough to be allowed to evolve; run first, optimise later

Ch 1

  • installation, tooling, CI
  • inner development loop: write, compile, run, test
  1. faster linking with lld:

    # Arch: `sudo pacman -S lld clang`
    # Cargo.toml
    [target.x86_64-unknown-linux-gnu]
    rustflags = ["-C", "linker=clang", "-C", "link-arg=-fuse-ld=lld"]
  2. project watcher:

    cargo install cargo-watch
    cargo watch -x test -x run
  3. code coverage:

     cargo install cargo-tarpaulin
     cargo tarpaulin --ignore-tests
  4. linting:

     rustup component add clippy
     cargo clippy
     cargo clippy -- -D warnings
  5. formatting:

     rustup component add rustfmt
     cargo fmt
     cargo fmt -- --check
  6. security:

     cargo install cargo-audit
     cargo audit

Ch 5

  • "Production environments [focus on] running our software to make it available to our users. Anything that is not strictly related to that goal is either a waste of resources, at best, or a security liability, at worst."

  • Virtualisation (Docker) allows you to use a self-contained environment and get away with saying "it works on my machine" when you deploy. Hosting (DigitalOcean) lets you actually deploy the thing.

About


Languages

Language:Rust 94.4%Language:Dockerfile 2.4%Language:Shell 2.1%Language:HTML 0.8%Language:PLpgSQL 0.3%