Conversation
bfeb005 to
d4b45c1
Compare
|
Ping @patricklodder @AbcSxyZ 🚀 |
There was a problem hiding this comment.
A first review with some fix to do and details to discuss.
In my opinion, I wouldn't add many of those files and keep the following :
- gitian-build.sh
- 0001-Docker-apt-cacher.patch (temporary)
- dependencies.sh (at least his content)
- (No opinion about cirrus, so maybe)
And remove all other scripts about setups, licensing, readme.
To explain myself about setup script, all those scripts looks overkill, and I would be in favor to replace it by an appropriate documentation.
I understand the desire for automation, but it seems a lot of engineering to set up a couple of dependencies, who require few lines to copy-paste.
A documentation who can be structured like that :
Redirect to docker documentation
+ add an instruction for debian distros to add user in docker group
+ add a single line by os
# Debian based distributions
sudo apt [dep] ..
# Mac
brew [dep] ..
...
It will also reduce content of gitian-build.sh by removing setup instructions, the documentation about the feature.
It may allow us to keep a single script with his documentation. Do you think these scripts are worth it ?
Regarding documentation, I did not review it because I wanted to discuss this setup topic, but at least I think it should be moved under doc instead of contrib, to update gitian-building.md, and maybe some other file like https://github.com/dogecoin/dogecoin/blob/master/contrib/gitian-descriptors/README.md.
| @@ -0,0 +1,103 @@ | |||
| From f9aa17728860f64e963ee40f9a62e075c7c41a8e Mon Sep 17 00:00:00 2001 | |||
There was a problem hiding this comment.
As a reminder, we should create an issue to track evolution of the PR inside the devrandom repo. To remove this fix when the feature is released.
There was a problem hiding this comment.
The PR is already created: devrandom/gitian-builder#249
There was a problem hiding this comment.
I was more thinking about opening an issue on Dogecoin repository, as a reminder to fix and remove the patch when they include your PR.
I would wait a bit and maybe do this when this PR is merged, they may merge before.
|
@fmhc For the build from a commit, seem to work properly, but maybe binaries are not moved in the appropriate directory ? Wasn't able to find them on the host, I didn't investigate further in the container rn. @micaelmalta Were you able to build from a commit or didn't try ? Also, I have been waiting but did not get an answer :) What about my question on install scripts ? Would be great to discuss, to see your pov. |
|
I am currently working on a test descriptor to check it |
|
@fmhc @AbcSxyZ I fixed some issues here. @AbcSxyZ I really think the gitian-builder should be an independent repo from Dogecoin Core ... If we do so, the init scripts make more sense IMO. I remove the init script and moved into a dedicated folder on my repo https://github.com/micaelmalta/gitian-builder-dogecoin |
|
And think it as a standalone script inside the repository ? A script you can just download or copy to run the build. Thinking quickly about using the current repository, it may be a bit messy do it that way, you thought about it too ? You had "issue" with git right (can't find this discussion again) ? Not sure if we should explore something here. Personally, I'm really mitigated about using another repository, do not feel it's really needed. |
4a9f6f8 to
4797b01
Compare
|
I was able to successfully build from dogecoin/dogecoin and from my own repo with commit flag, working fine for me!
I thougth having it as a seperate repository would be nice as a single starting point, but this solution also works and i think its a great achievement for the dogecoin-core repo to enable "modern" docker-based development with this. guess its a general question if things should all be in the core or if dogecoin development should spread out over more repositories in the dogecoin project. In terms of documentation, a hint for = gpg key uid name could be useful to avoid someone spending time gathering that knowledge. I had a GPG key but only with my full name, not a short one, breaking the input argument and then i thought it was the key filename until i digged into the code and @michaelMALTA giving some hints on his repository, thanks for that 🚀 |
I'm not against using other repos sometime, but not for Gitian from my pov. I wouldn't be in favor of using another repo for a single script, and I think all install scripts are not needed, it's for me a lot of engineering for a couple of dependencies. I like automation, but I'm wondering if it's appropriate here :) |
4797b01 to
79d3959
Compare
@fmhc I added some documentation for the GNUGPG UID 🚀 |
|
@rnicoll @patricklodder @michilumin What do you think about this? Should we just have a single script in the Dogecoin core repo, or a separate repo? |
Scripts that are written for Dogecoin Core and aid the build process should imho go in contrib, together with all the other things that do that (like the scripts you wrote here). Scripts that are maintained outside of Dogecoin Core and are technically an external dependency, should not be maintained inside this repository; example: This makes sure that the repo stays on-topic and we do not over-burden ourselves with code maintenance from things that can be perfectly managed upstream. |
Thanks @patricklodder ! Should we then consider to move all the scripts from https://github.com/micaelmalta/gitian-builder-dogecoin including the automated init and the CI tests? |
Yes, but be careful with secrets... What I'd (ultimately) love to do with those scripts is:
|
|
I think dogecoin should evolve and have a doge core repo for real core reference stuff, as @patricklodder said, and room for some supported / community approved repos in the dogecoin project domain. When will we have 20 signers for a release? We must make the dev community more integrative imho |
dbf1783 to
5beea3a
Compare
patricklodder
left a comment
There was a problem hiding this comment.
Ran this a couple of times. Besides in-line comments, could you please revert the name change to the signing descriptors? Other than that, works neatly.
| +# DELETE ESM Files: W: Failed to fetch https://esm.ubuntu.com/ubuntu/dists/trusty-infra-security/main/binary-amd64/Packages Received HTTP code 403 from proxy after CONNECT | ||
| +RUN [ -f /etc/apt/sources.list.d/*esm*.list ] && rm /etc/apt/sources.list.d/*esm*.list |
There was a problem hiding this comment.
I think this should be:
- A separate .patch file because this is a separate issue (and may or may not be fixed upstream regardless of the apt cache patch)
- Conditional to only trigger on trusty because it's simply a fix for ubuntu depreciating the repository but not updating the docker image (see what I did for that earlier this year when we were building 1.14.3 at patricklodder/gitian-builder@de43391). Another image could have a fully functional esm source.
| EOF | ||
|
|
||
| - docker build --pull -f $OUT.Dockerfile -t $OUT . | ||
| + docker build --network host --pull -f $OUT.Dockerfile -t $OUT . |
There was a problem hiding this comment.
why change to host network? (also below in libexec/start-target)
| @@ -0,0 +1,22 @@ | |||
| The MIT License (MIT) | |||
There was a problem hiding this comment.
MIT License is already listed on the top-level. No need to add it here again. Suggest to remove this file
| <h1 align="center"> | ||
| Dogecoin Core [DOGE, Ð] | ||
| <br/><br/> | ||
| <img src="https://static.tumblr.com/ppdj5y9/Ae9mxmxtp/300coin.png" alt="Dogecoin" width="300"/> | ||
| </h1> | ||
|
|
There was a problem hiding this comment.
This feels kind of redundant.
There was a problem hiding this comment.
What about instructions in https://github.com/dogecoin/dogecoin/blob/master/doc/gitian-building.md ?
Contrib folders have README but there is also some gitian instruction in doc. Those instructions in doc are outdated and do not work anymore. Where gitian instructions should go to avoid duplicate information, following DRY ?
Keep the contrib/gitian-builder README and add a link to it from the doc, maybe near a release process explanation ? And removing https://github.com/dogecoin/dogecoin/tree/master/doc/gitian-building folder with pictures + https://github.com/dogecoin/dogecoin/blob/master/doc/gitian-building.md ?
There was a problem hiding this comment.
I'm okay with the readme, just the branding feels redundant.
There was a problem hiding this comment.
Where the gitian instructions should go ? Docs or contrib ?
There was a problem hiding this comment.
Both. This readme should describe this script. The document in doc/ should describe the generic process regardless of this script but can mention and link it.
| 2. Generate GPG key | ||
|
|
||
| https://docs.github.com/en/github/authenticating-to-github/managing-commit-signature-verification/generating-a-new-gpg-key |
There was a problem hiding this comment.
This has some implications towards how the pgp key for signing can be stored. Can we make this less intrusive towards security by doing the externally signed flavor?
|
|
||
| Dogecoin Core is released under the terms of the MIT license. See COPYING for more information or see https://opensource.org/licenses/MIT. | ||
|
|
||
| ## OTHER CREDITS |
There was a problem hiding this comment.
Are those credit useful ? Can reduce file content.
Do you mind @patricklodder ?
There was a problem hiding this comment.
Yeah since the top level is already MIT, I would only add specific license info if there is a need to use a different license than MIT.
There was a problem hiding this comment.
I was speaking about the following credits :
## OTHER CREDITS
https://github.com/patricklodder
https://gist.github.com/patricklodder/88d6c4e3406db840963f85d95ceb44fe
I don't understand what you said about the license, why are you speaking about a different type of license ? No specific ressources in the folder is using another license right ? Couldn't we remove license info too ?
There was a problem hiding this comment.
Sorry, my bad. Yeah credits can go, license can go.
|
|
||
| ## TROUBLESHOOT | ||
|
|
||
| ### DOCKER ERROR |
There was a problem hiding this comment.
Do you think it's really useful to add this error ? It's more concerning some docker trouble shoot with rights, something that may be outside the scope here.
We may expect they will google their mistake, I think having documentation to anticipate potential error (at least those who do not concern dogecoin core) may add some unnecessary content.
Imagine we include also the #2337 with a Docker implementation to run nodes, should we add this info there also ?
|
|
||
| git fetch origin 9e97a4d5038cd61215f5243a37c06fa1734a276e # LAST VERSION TESTED | ||
| git reset --hard FETCH_HEAD | ||
| git am < "$dirName"/patches/0001-Docker-apt-cacher.patch |
There was a problem hiding this comment.
Using a fresh install, patch fail if git email is not configured using something like git config --global user.email "you@example.com".
| echo "" | ||
| echo "Compiling ${VERSION} ${descriptor}" | ||
| echo "" | ||
| ./bin/gbuild -j "$proc" -m "$mem" --commit dogecoin="$COMMIT" --url dogecoin="$url" ../gitian-descriptors/gitian-"$descriptor".yml || exit 1 |
There was a problem hiding this comment.
Don't know what did you do with all of your dependencies scripts, info were probably there, but looks like some are missing now.
Need ruby to run gbuild. Is it missing some prerequisites from devrandom/gitian-builder, maybe only ruby needed here ?
|
I will try to improve the documentation for this topic in the following days, I'm going back into this PR. @patricklodder @rnicoll do you think there is still any relevant information from the current gitian build guide ? |
No. Per the compile-time error in depends under gcc 7 that we found in #2501 by comparing docker with lxc output, we absolutely need more than just docker and we need to perform amendments to this script after we merge something. |
| wget $1 -O $(basename -- $1) | ||
| } | ||
|
|
||
| function process_file() { |
There was a problem hiding this comment.
I just suggest some improvement, I think the process_file can be simplified in multiple ways, to finally keep a single function. Remove some extra content (like check_file echos), and make it easier to read by reducing the number of command substitution.
It's to keep it here as reminder, I may suggest a PR soon, but by trying to simplify the code of this file I ended up with :
function process_file() {
local filename=$(basename $1)
# Download file if not available
if [[ ! -f $filename ]]; then
wget $1
fi
# Verify file signature
echo "$2 $filename" | sha256sum -c --status
if [ $? != 0 ]; then
echo "$(basename $0): Signature for $filename don't match."
exit 1
fi
}By using something similar, the entire behavior in one function, don't you think we can add this to gitian-build.sh to keep a single file ?
P.S.: If a file is already available but do not match sha256sum, I avoid overwriting the file like it was in your code. Design choice, avoid re-downloading.
So the script should be able to run on docker, lxc and kvm ? The suggested script is entirely removing kvm & lxc reference. |
Also VMWare/vagrant is not implemented. But I don't mind if in an initial iteration this script just does Docker - just have to undelete the original script. But we cannot spot supply chain attacks on Docker (or docker images) if only we compare docker-built hashes against each other and never check against anything else. I chose to use Docker exactly because @rnicoll used to use lxc. If he would now switch to Docker, it means I'll have to switch to one of the others (most likely lxc, because that is the least obtrusive to use.) |
|
New PR built on top of this one, see #2579. |
Fix issues of Dogecoin folder getting old files and never cleaned
5beea3a to
70f3a64
Compare
- undelete & update previous script - update description + comments - reorganize help menu of gitian-build.sh - rewrite option explanation for --sign with gpg - remove docker reference from setup option - update documentation - re-enable external signing - re-enable apt cacher and use apt cacher by default - switch from trusty to bionic - remove gpg key verification + display message for detached signature - revert script name change for sign descriptors - list pgp in required dependencies + remove apache
|
Merged with #2973! Many thanks! ❤️ |
- undelete & update previous script - update description + comments - reorganize help menu of gitian-build.sh - rewrite option explanation for --sign with gpg - remove docker reference from setup option - update documentation - re-enable external signing - re-enable apt cacher and use apt cacher by default - switch from trusty to bionic - remove gpg key verification + display message for detached signature - revert script name change for sign descriptors - list pgp in required dependencies + remove apache
- undelete & update previous script - update description + comments - reorganize help menu of gitian-build.sh - rewrite option explanation for --sign with gpg - remove docker reference from setup option - update documentation - re-enable external signing - re-enable apt cacher and use apt cacher by default - switch from trusty to bionic - remove gpg key verification + display message for detached signature - revert script name change for sign descriptors - list pgp in required dependencies + remove apache


No description provided.