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

build images locally #72

Open
samlaf opened this issue Sep 16, 2024 · 4 comments
Open

build images locally #72

samlaf opened this issue Sep 16, 2024 · 4 comments

Comments

@samlaf
Copy link

samlaf commented Sep 16, 2024

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
Copy link
Contributor

tedim52 commented Sep 16, 2024

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
Copy link
Contributor

tedim52 commented Sep 17, 2024

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

github-merge-queue bot pushed a commit to kurtosis-tech/kurtosis that referenced this issue Sep 18, 2024
## Description
Users trying to use `ImageBuildSpec` to build images inside their
packages have repositories greater than 100MB. Image building in
Kurtosis requires that the entire build context is within the package,
and thus gets uploaded into the APIContainer where the validation step
that builds images is done.

This PR increases the upload limit of the compression / upload library
to account for larger repositorie (2GB)

## Is this change user facing?
YES

## References (if applicable)
ethpandaops/optimism-package#72
@samlaf
Copy link
Author

samlaf commented Sep 20, 2024

@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
Copy link
Contributor

tedim52 commented Sep 20, 2024

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

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

No branches or pull requests

2 participants