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

infra: implementation of Curio+Lotus deployment for PDP #45

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

frrist
Copy link
Member

@frrist frrist commented Mar 11, 2025

See top level README.md and services/README.md for details.

Addresses storacha/project-tracking#334

Copy link
Member

@hannahhoward hannahhoward left a comment

Choose a reason for hiding this comment

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

left comments but only blocking request is please add a project tag to resources (see indexing service for example)

# Place the final binary somewhere globally accessible
# The actual compiled binary is typically `curio` in the project root
cd /tmp
#curl -o curio -L "https://bafybeibu66ysikactrnccubi2u2g3wsbvgtp4rqpxzzobdwa62y5lm2vye.ipfs.w3s.link/ipfs/bafybeibu66ysikactrnccubi2u2g3wsbvgtp4rqpxzzobdwa62y5lm2vye/curio"
Copy link
Member

Choose a reason for hiding this comment

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

assuming this is not a cross platform binary, do we set ourselves up for a future issue where we change the machine architecture but forget to recompile and add a new binary?

Copy link
Member Author

Choose a reason for hiding this comment

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

Mostly answered in my comment above. Yes we set ourselves up for future issues if we change the machine architecture. If we feel this is all too gross I can fork the curio repo, and build from source using my fork.

#!/usr/bin/env bash
#set -euxo pipefail

# Clone & checkout pinned version
Copy link
Member

Choose a reason for hiding this comment

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

was there an intent to clone from source at some point?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah... sorry this became a bit of a mess with the commenting out.

Initially, I was building curio from source since the project doesn't offer pre-built binaries for the calibration network 😞. In the future, I expect we'll need to build from source when deploying on calibration net, or maintain our own distribution of binaries since building from source is (very) slow.

During development of this, I realized that changes were required to curio - for use with terraform it needs a non-interactive command to initialize itself. I wrote such a command, but was unable to gain write access to the main repo, and didn't feel like forking, so I just built the binary on my local (x86) machine and uploaded it to storacha.

In summary: we download a binary directly because it's much faster than building from source, and the curio code requires modification that are not landed in the main repo.
(I am not sure how much longer we'll keep curio around, so I chose something quick and dirty here to keep moving forward)

# Place the final binary somewhere globally accessible
# The actual compiled binary is typically `curio` in the project root
cd /tmp
#curl -o curio -L "https://bafybeibu66ysikactrnccubi2u2g3wsbvgtp4rqpxzzobdwa62y5lm2vye.ipfs.w3s.link/ipfs/bafybeibu66ysikactrnccubi2u2g3wsbvgtp4rqpxzzobdwa62y5lm2vye/curio"
Copy link
Member

Choose a reason for hiding this comment

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

why leave this commented out curl to a different hash in?

Copy link
Member Author

Choose a reason for hiding this comment

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

Will remove commented hash, it's no longer needed.

# Place the final binary somewhere globally accessible
# The actual compiled binary is typically `lotus` in the project root
cd /tmp
curl -o lotus -L "https://bafybeiha6lzzyafpnnccq73w7xni2i6otmnllxsliuopbfea2h3uywcnku.ipfs.w3s.link/ipfs/bafybeiha6lzzyafpnnccq73w7xni2i6otmnllxsliuopbfea2h3uywcnku/lotus"
Copy link
Member

Choose a reason for hiding this comment

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

see again potential fickleness should the machine architecture change

Copy link
Member Author

Choose a reason for hiding this comment

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

Similar to Curio, lotus doesn't offer pre-built binaries for calibration network and I was annoyed with waiting around for the binary to be built, so I built one locally and then uploaded. If we prefer, I can uncomment the above code and build from source to be safer.


# Download snapshot with aria2c
# Note: '-o' sets output filename
aria2c -x5 "${LOTUS_SNAPSHOT_URL}" -o snapshot.car.zst
Copy link
Member

Choose a reason for hiding this comment

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

what's the startup time on downloading this?

Copy link
Member Author

Choose a reason for hiding this comment

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

about 2 mins to download, then ~5mins to import on line 13 below. Worth noting this script is called by a OneShot service file lotus-prestart.service so this setup will only happen once, regardless of system restarts.


user_data = local.cloud_init

tags = {
Copy link
Member

Choose a reason for hiding this comment

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

can you add a project tag please to this and other resources? I recommend pdp-node

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.

Implement IAC via terraform to spin up PDP enabled Lotus+Curio Stack
2 participants