Slide 1

Slide 1 text

Shorten the dev loop with mirrord Mehul Arora swe @ MetalBear, CS @ McmasterU

Slide 2

Slide 2 text

01 Early Stage Startup The Honeymoon Phase

Slide 3

Slide 3 text

02 30+ Person Startup Early Stage Startup

Slide 4

Slide 4 text

03 POV: you are working on a new feature Days Work log Mood 1 Write some new code 😊 2 Local testing 😊 3 Open PR, nitpicks πŸ™‚ 4 Staging, NullPointerException, rollback 😐 5 Fix, open PR, redeploy 😐 Days Work log Mood 7 Back to day 1, new tasks, your feature is in backlog πŸ˜– 8 You are fixing the bug, and you are focusing on a new task 😠 6 Your mate Adam, just deployed a version to staging which crashed yours 😒

Slide 5

Slide 5 text

04 The Dev Cycle

Slide 6

Slide 6 text

05 Why does code fail in staging?

Slide 7

Slide 7 text

06 How to shorten this loop with mirrord? ● mirrord lets you run local processes in the context of your cloud environment. ● you can access microservices, databases, queues, and managed services, all without leaving the local setup you know.

Slide 8

Slide 8 text

07 Mirroring Traffic 🚦 mirrord’s default mode for traffic is set to mirroring - meaning a copy of TCP traffic on a port will be sent to you locally

Slide 9

Slide 9 text

08 Mirroring Traffic 🚦

Slide 10

Slide 10 text

09 It’s not a crime to steal sometimes You can steal traffic instead of mirroring it, which means that any response from your remote app is completely ignored and your local app will respond! { "accept_invalid_certificates": false, "feature": { "network": { "incoming": "steal", "outgoing": true }, "fs": "read", "env": true } }

Slide 11

Slide 11 text

11 Fine graining your incoming traffic in steal mode - HTTP filters You can filter traffic by HTTP headers and paths. For example, you want your local process to only respond to a particular end-point like /api/v1/test or just by headers: { "feature": { "network": { "incoming": { "mode": "steal", "http_filter": { "header_filter": "service-log: true" } } } } } { "feature": { "network": { "incoming": { "mode": "steal", "http_filter": { "path_filter": "api/v1" } } } } }

Slide 12

Slide 12 text

12 Accessing the file system To access a file that exists on the remote or a file that exists locally, you can fine tune your access through different modes on file operations and by setting read/write only access on various paths. mirrord exec -t pod/logger -- cat /app/output.txt

Slide 13

Slide 13 text

12 Accessing the file system Using a local utility Accessing remote files

Slide 14

Slide 14 text

13 Remote environment variables? No problem when you run a local process in the context of remote environment it means that environment variables present in the remote pod will be loaded into the local process. For example, if you want your local process to access a remote database, the connection string configured in the remote pod’s environment variable can be used by your local process.

Slide 15

Slide 15 text

14 Resolving DNS πŸ” mirrord can resolve DNS through your remote pod, which means if your local process needs access to a service, the DNS request will be resolved in the context of your remote pod/cluster. K8S connectivity for local utils Resolving DNS locally

Slide 16

Slide 16 text

15 Making sense of everything With the ability to toggle on/off these features one can seamlessly debug their local process: - Without having to run your entire deployment locally - Without going through CI and deployment - Without deploying untested code to the cloud environment - the stable version of the code is still running in the cluster and handling requests When running with mirrord, you get access to TCP/UDP traffic, Unix streams, Environment Variables, DNS resolution and the Filesystem.

Slide 17

Slide 17 text

23 Thank you! Feel free to reach out to me at - [email protected] or [email protected]