1 of 87

From DIY to DTE

An Enterprise Experience

nx conf / 2023

2 of 87

Adrian Baran

Sr. Software Engineer @ Cisco

@AdrianBaran_

3 of 87

Monorepo (~150 projects)

apps

libs

4 of 87

build

lint

test

5 of 87

6 of 87

…yet?

7 of 87

~1h

my-important-feat-branch

8 of 87

build

lint

test

🤔

9 of 87

10 of 87

11 of 87

DIY

For each task…

12 of 87

Up to 75% reduction in time *

* All projects affected

13 of 87

14 of 87

Monorepo (~150 projects)

apps

libs

15 of 87

Monorepo (~150 projects)

apps

libs

400+ projects

16 of 87

[ Insert more containers here ]

DIY

For each task…

17 of 87

For each task…

[ Insert more containers here ]

DIY

18 of 87

DIY

60

For each task…

19 of 87

> npx nx run my-project-a:test

> NX Successfully ran target test for project my-project-a (20s)

> npx nx run my-project-b:test

> NX Successfully ran target test for project my-project-b (400s)

🙂

🥲

20 of 87

> npx nx run-many –-target=test --projects=my-project-a,my-project-c

> npx nx run-many –-target=test --projects=my-project-b

21 of 87

22 of 87

DIY

23 of 87

24 of 87

25 of 87

26 of 87

27 of 87

Binning

28 of 87

𝑥 times

DIY

29 of 87

DTE

30 of 87

31 of 87

32 of 87

33 of 87

Where we want to be… 🤔

34 of 87

35 of 87

Monorepo (~150 projects)

apps

libs

400+ projects

36 of 87

  1. To have a CI/CD pipeline that runs build, lint, and test using Nx DTE�
  2. Configure the DTE solution so that it outmatches the DIY solution in terms of performance and cost

MVP

37 of 87

> git checkout -b nx-dte-poc

38 of 87

> npx nx generate ci-workflow

What is your target CI provider? · circleci

How should we name your workflow? · CI

CREATE .circleci/config.yml

39 of 87

40 of 87

  • Same Docker image�
  • Install node_modules once�
  • Match options

DIY

DTE

41 of 87

42 of 87

43 of 87

👀

44 of 87

2) parallel level per task

lint: … --parallel=3

test: … --parallel=3

build: … --parallel=3

1) Number of agents

1

2

45 of 87

1

2

46 of 87

47 of 87

48 of 87

49 of 87

50 of 87

51 of 87

52 of 87

53 of 87

54 of 87

55 of 87

56 of 87

😓

57 of 87

58 of 87

1:1

DIY

DTE

59 of 87

60 of 87

> npx nx run-many –-target=test --projects=my-project-a,my-project-c

> npx nx run-many –-target=test --projects=my-project-b

61 of 87

62 of 87

install-node-modules

Nx Cloud Main

Nx Cloud Agent 1

Nx Cloud Agent 2

Nx Cloud Agent 4

Nx Cloud Agent 3

Nx Cloud Agent 5

test-my-project-b

63 of 87

64 of 87

65 of 87

66 of 87

67 of 87

  • To have a CI/CD pipeline that runs build, lint, and test using Nx DTE�
  • Configure the DTE solution so that it outmatches the DIY solution in terms of performance and cost

MVP

68 of 87

69 of 87

70 of 87

71 of 87

72 of 87

🏁

73 of 87

DIY DTE

Performance

74 of 87

For each task…

[ Insert more containers here ]

DIY

75 of 87

🥁

76 of 87

Resources Used

DTE ~75%*

* !== 75% reduction in costs

77 of 87

More tasks..?

78 of 87

  • To have a CI/CD pipeline that runs build, lint, and test using Nx DTE�
  • Configure the DTE solution so that it outmatches the DIY solution in terms of performance and cost

MVP

79 of 87

DTE > DIY

80 of 87

1. Short-term setup, long-term adaptation

81 of 87

2. DJ Patience

82 of 87

3. Your mileage may vary, but remember…

83 of 87

84 of 87

😓

85 of 87

86 of 87

Thank You

Adrian Baran

Sr. Software Engineer @ Cisco

@AdrianBaran_

87 of 87

Credits

  • “umf16a_096” by Drew Ressler via Rukes (slides 48, 49, 56, 57, 65, 71, 84)
  • “The Forest | Slap House || House Record” by HouseRecord via Pixabay (slides 49, 65, 85)
  • “To Hell With Vinyl” by Pixabay via Pixabay (slide 51)
  • GIF by HoneyLeo / MotionElements.com (slide 67)