Improve Makefile #389
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#389
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Our current Makefile should be optimized for parallel execution. This means that building our project can take longer than necessary. In order to improve our build times, we need to update the Makefile to support parallel execution using the -j flag.
The updated Makefile should meet the following requirements:
TrueCloudLab/frostfs-dev-env#76 introduced new tag for images that uses
git.frostfs.info/TrueCloudLab/frostfs
asHUB_IMAGE
, see packages.However this repo does not contain corresponding changes in Makefile:
HUB_IMAGE ?= truecloudlab/frostfs
/cc @achuprov
What are our goals here?
I see several possible avenues for improvement, but it does not look like current Makefile is causing a significant time waste:
make all
in this repo took 1m18smake all
after adding a couple of newlines to each*.go
file took 18s: caches provided by go tool seem to work as expectedrm bin/*
took 6s, again thanks to go toolmake -j
would not improve our explicitly sequential CI buildsSo I don't think that parallelizing the build should be our top priority.
Instead I think we should focus on:
Improving CI run times
$GOPATH/pkg/mod
should shave off 10s+ of each build, maybe moreNumbers don't look impressive (this step is attributed to only 3-5s of CI time in logs), but my intuition says this may shave off much more than that from the "Set up job" stage. Need to confirm this intuition with tests, of course.
Improving Makefile maintainability
This would allow us to sync common
*.mk
files between TrueCloudLab repos and to distribute Makefile updates to all repos in a sane manner.ONESHELL
or at least introduce.SHELLFLAGS = -euo pipefail -c
to mitigate the worst of ONESHELL side effects. Without this we can never be sure that exit code 0 from make means that there were no errorsI would also like to ask for clarification regarding the point from OP:
Do you mean separate as in separate from source code, like we have
bin/$EXE
now? Or separate as in separate from all previous builds, likebin/${GIT_REVISION}+${HASH_OF_WORKTREE_CHANGES}/$EXE
?My main goal is pure aesthetics and conforming to community standards (needs to be defined).
The second one is readability and maintainability.
Regarding CI -- optimisations are always welcome.