ethpandaops / optimism-package

A kurtosis package for deploying an optimistic rollup
39 stars 24 forks source link

build images locally #72

Open samlaf opened 1 month ago

samlaf commented 1 month ago

the docker-compose devnet in the optimism monorepo has an option to rebuild images when deploying the devnet, which helps with devex.

This kurtosis devnet currently does not have this possibility. It pulls the images from the google image repo.

Kurtosis has ImageBuildSpec to build images from a dockerfile. This could be used to build images before deploying them to the enclave. I tried 2 options that both failed.

1. Install optimism monorepo as a submodule

This way we'd have access to the Dockerfile. However, I get this error saying that kurtosis package has to be < 100MB. image

2. Point to a Dockerfile outside of Kurtosis package

This also doesn't seem to be allowed. image

tedim52 commented 1 month ago

Hey @samlaf , Option 1 is the way to go - I can adjust this limit to get around the error - want to make sure, what's the size of the repository/code that's needed to build the image or ballpark? I believe we set the image lower to prevent large build directories like node_modules from getting uploaded into the container but I can increase it

tedim52 commented 1 month ago

I've made a PR here to increase the upload limit. I tested this out on the optimism monorepo by placing a package(main.star, kurtosis.yml) at the base of the repo and then adding this code in main.star to build one of the images in the repository:

def run(plan, args):
    plan.add_service(
        name="l1",
        config=ServiceConfig(
            image=ImageBuildSpec(
                image_name="op-bedrock-l1:dev",
                build_context_dir="./ops-bedrock",
                build_file="Dockerfile.l1",
            )
        )
    )
Screenshot 2024-09-16 at 9 06 14 PM
samlaf commented 1 month ago

@tedim52 thanks for this! Dumb question... how do I install (or build from source) the latest version of kurtosis to get access to the increased max upload size? Can't find instructions anywhere.

Haven't used nix before, and nix build . doesn't work. nix develop works but do I really have to do everything in this shell? Is there not a way to install from source?

tedim52 commented 1 month ago

completely forgot to release this earlier this week after merging, once 1.3.0 is merged, a brew upgrade kurtosis-cli should work or if you're using the nix shell now, I suggest installing latest binary with brew install kurtosistech/kurtosis-cli