Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile: pass docker build arguments #4212

Merged
merged 1 commit into from
May 21, 2022
Merged

Makefile: pass docker build arguments #4212

merged 1 commit into from
May 21, 2022

Conversation

battlmonstr
Copy link
Contributor

@battlmonstr battlmonstr commented May 19, 2022

Dockerfile requires some --build-arg options.
Fix "docker" target to pass them.
Fix GIT_TAG to reflect the most recent tag related to HEAD, instead of an unrelated most recent tag.
Use it as the image VERSION.

Image tags need to be passed explicitly if needed:

DOCKER_FLAGS='-t erigon:latest' make docker

The rev-list usage wasn't correct, because in some cases the resulting GIT_TAG could be totally unrelated to the GIT_COMMIT we are building from. The describe logic is that it takes HEAD (or whatever you pass it), and follows the parent commit chain until it reaches some tag. The output is <T>-<N>-<S> where T is the found tag, N is the number of commits between T and HEAD, and S is the HEAD SHA. e.g. v2021.10.03-1119-g70c3aedf9. Also the output is simply T if N = 0.
The output will be <T>-<N>-<S>-dirty or <T>-dirty if you have uncomitted changes in the working tree when building, e.g. v2021.10.03-1119-g70c3aedf9-dirty.

@battlmonstr battlmonstr requested a review from AskAlexSharov May 19, 2022 15:47
@battlmonstr battlmonstr marked this pull request as draft May 19, 2022 15:47
Dockerfile requires some --build-arg options.
Fix "docker" target to pass them.
Fix GIT_TAG to reflect the most recent tag related to HEAD, instead of an unrelated most recent tag.
Use it as the image VERSION.

Image tags need to be passed explicitly if needed:

    DOCKER_FLAGS='-t erigon:latest' make docker
@battlmonstr battlmonstr marked this pull request as ready for review May 19, 2022 16:20
@@ -3,7 +3,7 @@ GOBIN = $(CURDIR)/build/bin

GIT_COMMIT ?= $(shell git rev-list -1 HEAD)
GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
GIT_TAG ?= $(shell git describe --tags `git rev-list --tags="v*" --max-count=1`)
GIT_TAG ?= $(shell git describe --tags --dirty)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: mdbx using next snippet: git describe --tags --long --dirty=-dirty "--match=v[0-9]*"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you try to fix this one also? #3779

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, now I remember why we using rev-list: because Ubuntu 18.04 has git of version which doesn't support --dirty flag

Copy link
Contributor Author

@battlmonstr battlmonstr May 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a --match argument makes sense.

Updated PR description.

@AlexeyAkhunov AlexeyAkhunov merged commit 54cf932 into devel May 21, 2022
@AlexeyAkhunov AlexeyAkhunov deleted the dockerci branch May 21, 2022 09:21
AlexeyAkhunov added a commit that referenced this pull request May 21, 2022
* allow --syncmode=snap for bor-mainnnet (#4206)

* save

* save

* allow --syncmode=snap for bor-mainnnet #4206

* allow snap sync for mumbai chain (#4208)

* save

* mumbai

* Bor: GetTransactionReceipt (#4209)

* fixed miner.sigfile option (#4210)

* Snap: reduced memory footprint on building huffman table (#4214)

* save

* save

* save

* save

* Remove dependency on leveldb (#4213)

* save

* save

* save

* save

* save

* save

* methods to read single txn by txnID (#4215)

* It's safe now to open snapshots at app start (#4216)

* removed obsolete trie variant (#4172)

* up gods lib version (#4217)

* Fix `rpc.BlockNumberOrHash` unmarshaling (#4218)

* add test

* fix unmarshaling bug

Co-authored-by: Igor Mandrigin <[email protected]>

* return err on invalid syncmode (#4219)

* save

* save

* save

* fixed kiln bug (#4221)

* Clean headers pointers when removing links (#4222)

* Clean headers pointers when removing links

* Replace the lock

Co-authored-by: Alexey Sharp <[email protected]>

* Makefile: pass docker build arguments (#4212)

Dockerfile requires some --build-arg options.
Fix "docker" target to pass them.
Fix GIT_TAG to reflect the most recent tag related to HEAD, instead of an unrelated most recent tag.
Use it as the image VERSION.

Image tags need to be passed explicitly if needed:

    DOCKER_FLAGS='-t erigon:latest' make docker

* Update erigon-lib and version

Co-authored-by: Alex Sharov <[email protected]>
Co-authored-by: Giulio rebuffo <[email protected]>
Co-authored-by: Artem Tsebrovskiy <[email protected]>
Co-authored-by: Igor Mandrigin <[email protected]>
Co-authored-by: Igor Mandrigin <[email protected]>
Co-authored-by: Alexey Sharp <[email protected]>
Co-authored-by: battlmonstr <[email protected]>
AlexeyAkhunov added a commit that referenced this pull request May 21, 2022
* allow --syncmode=snap for bor-mainnnet (#4206)

* save

* save

* allow --syncmode=snap for bor-mainnnet #4206

* allow snap sync for mumbai chain (#4208)

* save

* mumbai

* Bor: GetTransactionReceipt (#4209)

* fixed miner.sigfile option (#4210)

* Snap: reduced memory footprint on building huffman table (#4214)

* save

* save

* save

* save

* Remove dependency on leveldb (#4213)

* save

* save

* save

* save

* save

* save

* methods to read single txn by txnID (#4215)

* It's safe now to open snapshots at app start (#4216)

* removed obsolete trie variant (#4172)

* up gods lib version (#4217)

* Fix `rpc.BlockNumberOrHash` unmarshaling (#4218)

* add test

* fix unmarshaling bug

Co-authored-by: Igor Mandrigin <[email protected]>

* return err on invalid syncmode (#4219)

* save

* save

* save

* fixed kiln bug (#4221)

* Clean headers pointers when removing links (#4222)

* Clean headers pointers when removing links

* Replace the lock

Co-authored-by: Alexey Sharp <[email protected]>

* Makefile: pass docker build arguments (#4212)

Dockerfile requires some --build-arg options.
Fix "docker" target to pass them.
Fix GIT_TAG to reflect the most recent tag related to HEAD, instead of an unrelated most recent tag.
Use it as the image VERSION.

Image tags need to be passed explicitly if needed:

    DOCKER_FLAGS='-t erigon:latest' make docker

* More header download diagnostics (#4224)

Co-authored-by: Alexey Sharp <[email protected]>

* Clean anchors, forward sort of headers (#4225)

Co-authored-by: Alexey Sharp <[email protected]>

Co-authored-by: Alex Sharov <[email protected]>
Co-authored-by: Giulio rebuffo <[email protected]>
Co-authored-by: Artem Tsebrovskiy <[email protected]>
Co-authored-by: Igor Mandrigin <[email protected]>
Co-authored-by: Igor Mandrigin <[email protected]>
Co-authored-by: Alexey Sharp <[email protected]>
Co-authored-by: battlmonstr <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants