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

Download actor bundles at runtime #3614

Closed
2 of 7 tasks
LesnyRumcajs opened this issue Oct 19, 2023 · 5 comments
Closed
2 of 7 tasks

Download actor bundles at runtime #3614

LesnyRumcajs opened this issue Oct 19, 2023 · 5 comments

Comments

@LesnyRumcajs
Copy link
Member

LesnyRumcajs commented Oct 19, 2023

Issue summary

Background

This PR #3276 moved runtime actor downloads to compile-time. At the moment, the actor bundle sits in the git lfs (#3360). With every new actors' bundle, we need to update it (append new bundles). Until the last upgrade, the bundle size was only ~2.3MB. The NV21 bundle (which is still missing a bundle for mainnet) is almost 8 MB.

Problem

crates.io has a hard limit of 10 MB enforced during cargo publish (at the push stage, so our dry-run wouldn't catch it). With the new bundles, we exceed this limit

error: failed to publish to registry at https://crates.io/

Caused by:
  the remote server responded with an error: max upload size is: 10485760

We still want to push to crates.io.

Solution

Move downloading all-in-one bundle to runtime. Theoretically, we could do it at the build stage, but cargo publish wouldn't accept it. We should store the all-in-one bundle in:

  • GH releases
  • DO or CF R2 as backup if GH is down
    Use that endpoint to download the bundle at Forest startup.

Also, we have to publish unreleased forest versions (so far it's only 0.14.0).

Acceptance criteria

  • All-in-one bundle is stored GH assets as part of a release
  • All-in-one bundle is automatically added to the release (release workflow needs to be modified)
  • All-in-one bundle is mirrored either in DO or CF R2 (preferably, automatically)
  • Forest downloads the bundle at startup. If GH is down, it downloads from the mirror.
  • The bundle is stored in Forest data directory. Forest must not re-download it if it was already downloaded.
  • git-lfs asset is removed
  • All Forest releases that weren't published on crates.io are released.

Other information and links

@LesnyRumcajs
Copy link
Member Author

LesnyRumcajs commented Oct 23, 2023

Instead of hosting the all-in-one bundle, I currently implemented downloading the bundles from GH (built-in-actors releases) and, alternatively, DO. The all-in-one file is not cached anywhere - it's in the DB and checked at startup that all manifests sit there.

The downside of this approach is that at startup, the user has to download significantly more (the actor bundles are not compressed). Also, in a DB cleanup, they have to re-download it.
The upside is that we have less code to manage and fewer lingering files in the data directory or some other cache.

@aatifsyed
Copy link
Contributor

aatifsyed commented Oct 24, 2023

Theoretically, we could do it at the build stage, but cargo publish wouldn't accept it.

It's not clear to me that cargo-publish would reject this. I still don't think we should do it, but a crate is allowed to dial the web in build.rs

@aatifsyed
Copy link
Contributor

Is there a way to eagerly cache the required bundles?
forest-tool cache-bundles or something?

If I'm trying to run forest before e.g not having internet, can I know I won't need it?

@LesnyRumcajs
Copy link
Member Author

Is there a way to eagerly cache the required bundles? forest-tool cache-bundles or something?

If I'm trying to run forest before e.g not having internet, can I know I won't need it?

❯ forest --chain calibnet --encrypt-keystore false --exit-after-init

@LesnyRumcajs
Copy link
Member Author

Done in #3622 and #3658

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants