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: up node memory during docker build #2810

Merged
merged 2 commits into from
May 14, 2024
Merged

Conversation

joergkiesewetter
Copy link
Contributor

applying the same change as on #2802, but on main branch

(cherry picked from commit 31e0a4b)

Copy link

changeset-bot bot commented May 10, 2024

⚠️ No Changeset found

Latest commit: 1c5ed43

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@holic holic changed the title increasing node memory to be able to build the store-sync package (main) build: up node memory during docker build May 10, 2024
Dockerfile Outdated
Comment on lines 45 to 46
ENV NODE_OPTIONS=--max-old-space-size=4096
RUN pnpm run -r build
Copy link
Member

Choose a reason for hiding this comment

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

do you know ENV sticks around in the docker container? as in running the indexer would use 4gb memory too?

Copy link
Member

Choose a reason for hiding this comment

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

https://docs.docker.com/reference/dockerfile/#env

The ENV instruction sets the environment variable to the value . This value will be in the environment for all subsequent instructions in the build stage and can be replaced inline in many as well.

sounds like just during build?

Copy link
Member

Choose a reason for hiding this comment

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

but also seeing

If an environment variable is only needed during build, and not in the final image, consider setting a value for a single command instead:

so I wonder if we use this instead:

RUN NODE_OPTIONS=--max-old-space-size=4096 pnpm run -r build

@joergkiesewetter
Copy link
Contributor Author

ok, changed it. For me, the build works like this, as well. I will also do a PR to change it in the "historical_indexer"-branch

Copy link
Member

@holic holic left a comment

Choose a reason for hiding this comment

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

thanks!

@holic holic merged commit f03a179 into latticexyz:main May 14, 2024
11 of 12 checks passed
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.

2 participants