Skip to content

docker: Support pregenerated keys in docker private networks#5735

Merged
gmalouf merged 1 commit intoalgorand:masterfrom
winder:will/docker-pregen
Sep 21, 2023
Merged

docker: Support pregenerated keys in docker private networks#5735
gmalouf merged 1 commit intoalgorand:masterfrom
winder:will/docker-pregen

Conversation

@winder
Copy link
Copy Markdown
Contributor

@winder winder commented Sep 12, 2023

Summary

Docker changes:

  • Detect participation keys at the /etc/algorand/keys directory.
  • If a private network is going to be started, use that directory if there are keys.
  • README updates describing how the feature is used.

#5699

Test Plan

Pregenerate keys with goal:
goal network pregen -t some_template.json -p pregen

Pregenerate keys with docker:

docker run --rm -it \
    -v /path/to/your/template.json:/etc/algorand/template.json \
    -v $(pwd)/pregen:/algod/pregen \
    --entrypoint "/node/bin/goal" \
    algorand/algod:nightly network pregen -t /etc/algorand/template.json -p /algod/pregen

Build the image (from root dir):

docker build \
    -t wwinder/algod:pregen-test  \
    --build-arg CHANNEL=nightly \
    --build-arg TARGETARCH=amd64 --no-cache \
    . 

Run (mounting the template and pregen directory):

docker run --rm -it --name algod-pregen-run \
    -v /path/to/your/template.json:/etc/algorand/template.json \
    -v $(pwd)/pregen:/etc/algorand/keys \
    wwinder/algod:pregen-test

On my machine, I used a template.json with 10 million keys. Pregen took nearly 20 minutes. The network start was almost instantaneous.

@winder winder self-assigned this Sep 12, 2023
@winder winder marked this pull request as ready for review September 12, 2023 13:40
@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 12, 2023

Codecov Report

Merging #5735 (ddc6c7c) into master (527d2c5) will increase coverage by 1.08%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #5735      +/-   ##
==========================================
+ Coverage   54.49%   55.57%   +1.08%     
==========================================
  Files         476      476              
  Lines       66853    66853              
==========================================
+ Hits        36429    37156     +727     
+ Misses      27876    27177     -699     
+ Partials     2548     2520      -28     
Files Changed Coverage Δ
cmd/goal/network.go 15.95% <ø> (ø)

... and 41 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Copy Markdown
Contributor

@onetechnical onetechnical left a comment

Choose a reason for hiding this comment

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

The changes here look fine, but I didn't actually run them to verify the keys install properly.

@gmalouf gmalouf merged commit 4ef2410 into algorand:master Sep 21, 2023
@winder winder deleted the will/docker-pregen branch September 21, 2023 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants