Skip to content

Commit f64283d

Browse files
authored
Merge pull request #6611 from IntersectMBO/bench/profiles
wb | workbench cleanup, static Make targets, advance genesis
2 parents 87bd1cc + 57a7d44 commit f64283d

24 files changed

Lines changed: 56061 additions & 29277 deletions

File tree

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ generation workload -- using the `workbench` environment:
113113
Nix or downloaded from Hydra CI cache directly.
114114
- `-prof` and `-profnix` suffixes -- same as both before, but all
115115
binaries will be built such that GHC profiling is enabled.
116-
- ...there are other modes as per
117-
[lib.mk](https://github.com/intersectmbo/cardano-node/tree/master/lib.mk#L34-L44)
116+
- ...there are other modes (`-auto`, `-autostay`, `-autonix`, `-nomadexec`, ...); see
117+
[nix/workbench/lib.mk](https://github.com/intersectmbo/cardano-node/blob/master/nix/workbench/lib.mk)
118118

119119
3. Enter the workbench shell for the chosen profile & mode:
120120
`make <PROFILE-NAME>` or `make <PROFILE-NAME>-<SUFFIX>` (when there

Makefile

Lines changed: 25 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,11 @@
11
help: ## Print documentation
2-
@{ grep -hE '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST); echo -e '$(EXTRA_HELP)'; } | sed 's/^ //' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-33s\033[0m %s\n", $$1, $$2}'
2+
@grep -hE '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sed 's/^ //' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-33s\033[0m %s\n", $$1, $$2}'
33

4-
include lib.mk
54
include nix.mk
65

76
PROJECT_NAME = cardano-node
87
NUM_PROC = $(nproc --all)
98

10-
PROFILE ?= default
11-
## One of: shelley allegra mary alonzo babbage conway dijkstra
12-
ERA ?= conway
13-
BACKEND ?= supervisor
14-
REV ?= master
15-
ITER ?=
16-
BATCH ?=
17-
ARGS ?=
18-
CMD ?=
19-
RUN ?=
20-
219
lint hlint: ## Run the CI version of hlint
2210
nix build --no-link '.#checks/hlint' --cores 0
2311
haddock-hoogle haddocks hoogle:
@@ -50,66 +38,46 @@ trace-schemas-validate: ## Validate trace message schemas against meta.schema.js
5038
nix run .#validate-trace-schemas
5139

5240
###
53-
### Workbench
41+
### Workbench: cluster shells
5442
###
43+
## `make shell` (and -nix/-prof/-dev) opens a workbench dev shell for $(PROFILE) -- the usual
44+
## entry point (below). `make <profile>[-VARIANT]` are per-profile aliases; `make ps` lists
45+
## profile names. Targets, flags and the (generated) profile lists all live in
46+
## nix/workbench/lib.mk (which pulls in profiles.mk itself).
47+
include nix/workbench/lib.mk
48+
49+
## Dev shells -- the usual entry point; each runs $(WB_ENTER) (defined in nix/workbench/lib.mk).
50+
shell: ## workbench dev shell for PROFILE (cabal build-on-demand); vars: PROFILE ERA BACKEND CMD RUN
51+
$(WB_ENTER)
52+
shell-nix: ## like shell, but run the Nix-store binary
53+
$(WB_ENTER) --arg useCabalRun false
54+
shell-prof: ## like shell, profiled build, run with -hT
55+
$(WB_ENTER) --arg profiledBuild true --arg profilingType '"space-heap"'
56+
shell-dev:
57+
$(WB_ENTER)
58+
.PHONY: shell shell-nix shell-prof shell-dev
59+
60+
## CI entrypoints (drive the generated variant targets + Nix ci-test):
5561
workbench-ci: workbench-ci-test ci-test-auto ci-test-autonix
5662
CI_TARGETS := hlint workbench-ci haddock-hoogle
5763
ci: ci-report ci-targets
5864
ci-report:
5965
@echo -e "\033[34mGoals under test\033[0m: \033[33m$(CI_TARGETS)\033[0m"
6066
ci-targets: $(CI_TARGETS)
6167

62-
workbench-internals-walkthrough:
63-
emn nix/workbench/doc.org
64-
65-
##
66-
## Base targets:
67-
##
68-
shell: ## Nix shell, (workbench from /nix/store), vars: PROFILE, ERA, CMD, RUN
69-
nix-shell -A 'workbench-shell' --max-jobs 8 --cores 0 --show-trace --argstr profileName ${PROFILE} --argstr eraName ${ERA} --argstr backendName ${BACKEND} ${ARGS} ${if ${CMD},--command "${CMD}"} ${if ${RUN},--run "${RUN}"}
70-
shell-dev shell-prof shell-nix: shell
71-
shell-nix: ARGS += --arg 'useCabalRun' false ## Nix shell, (workbench from Nix store), vars: PROFILE, CMD, RUN
72-
shell-prof: ARGS += --arg 'profiledBuild' true --arg 'profilingType' '"space-heap"' ## Nix shell, everything Haskell built profiled and run with `-hT`.
73-
74-
analyse: RUN := wb analyse std ${TAG}
75-
analyse: shell
76-
77-
list-profiles: ## List workbench profiles
78-
nix build .#all-profiles-json && cat result
79-
show-profile: ## NAME=profile-name
80-
@test -n "${NAME}" || { echo 'HELP: to specify profile to show, add NAME=profle-name' && exit 1; }
81-
nix build .#all-profiles-json --json --option substitute false | jq '.[0].outputs.out' -r | xargs jq ".\"${NAME}\" | if . == null then error(\"\n###\n### Error: unknown profile: ${NAME} Please consult: make list-profiles\n###\") else . end"
82-
ps: ## Plain-text list of profiles
83-
@nix build .#workbench.profile-names-json --json | jq '.[0].outputs.out' -r | xargs jq '.[]' --raw-output
84-
85-
##
86-
## Profile-based cluster shells (autogenerated targets)
87-
##
88-
## wb_profiles.mk is autogenerated by `cardano-profile lib-make`. It contains all known profile families and flavours (minus the era, backend and shell type suffixes).
89-
## After adding or removing profile definitions in `cardano-profile`, you'll probably want to also commit a regenerated version of that file.
90-
##
91-
include wb_profiles.mk
92-
93-
$(eval $(call define_profile_targets, $(LOCAL_PROFILES)))
94-
$(eval $(call define_profile_targets_nomadcloud,$(CLOUD_PROFILES)))
95-
96-
# Dynamic local/supervisor profile targets.
97-
playground-%:
98-
nix-shell -A 'workbench-shell' --max-jobs 8 --cores 0 --show-trace --argstr profileName $* --argstr eraName ${ERA} --argstr backendName supervisor
99-
10068
###
10169
### Misc
10270
###
103-
clean-profile proclean:
104-
rm -f *.html *.prof *.hp *.stats *.eventlog
105-
10671
clean: clean-profile
107-
rm -rf logs/ socket/ cluster.*
10872

10973
full-clean: clean
11074
rm -rf db dist-newstyle $(shell find . -name '*~' -or -name '*.swp')
11175

11276
cls:
11377
echo -en "\ec"
11478

115-
.PHONY: cabal-hashes clean cli cls cluster-profiles help node run-test shell shell-dev stylish-haskell $(LOCAL_PROFILES) workbench-ci-test
79+
.PHONY: help lint hlint host-hlint haddock-hoogle stylish-haskell cabal-hashes cli node \
80+
trace-documentation trace-schemas-regenerate trace-schemas-overrides-check \
81+
trace-schemas-overrides-coverage trace-schemas-validate \
82+
workbench-ci ci ci-report ci-targets \
83+
clean full-clean cls

0 commit comments

Comments
 (0)