Skip to content

implement soft memory limit for docker to use when invoking cpp2v - #103

Open
simon-skylabs wants to merge 1 commit into
mainfrom
simon/cpp2v-docker-mem-cap
Open

simon-skylabs wants to merge 1 commit into
mainfrom
simon/cpp2v-docker-mem-cap

Conversation

@simon-skylabs

Copy link
Copy Markdown
Contributor

No description provided.

@skylabs-ai-ci

skylabs-ai-ci Bot commented Jul 13, 2026

Copy link
Copy Markdown

CI summary (Details)

Active Repos

Repo Job Branch Job Commit Branch Tip Base branch Base commit PR
fmdeps/brick-libcpp/ simon/cpp2v-docker-mem-cap 3fb1582 ca50e7c main 2b9fd6e #103

Passive Repos

Repo Job Branch Job Commit
./ main f50d261
fmdeps/BRiCk/ main 1a4e474
fmdeps/auto/ main 58eae4b
fmdeps/auto-docs/ main f3ece99
bluerock/NOVA/ skylabs-proof 488788c
bluerock/bhv/ skylabs-main ee95a75
fmdeps/ci/ main 555a549
vendored/elpi/ skylabs-master c0b9653
vendored/flocq/ skylabs-master cf9cc84
fmdeps/fm-tools/ main 70842c3
psi/protos/ main 8fe3e7c
psi/backend/ main 8f2a32f
psi/ide/ main 6b596cf
psi/data/ main 8cd3ea7
vendored/rocq/ skylabs-master bef7df5
fmdeps/rocq-agent-toolkit/ main 53d9eb0
vendored/rocq-elpi/ skylabs-master be1ffc5
vendored/rocq-equations/ skylabs-main d1f944a
vendored/rocq-ext-lib/ skylabs-master a31ad69
vendored/rocq-iris/ skylabs-master a7af9f7
vendored/rocq-lsp/ skylabs-main 64ef78a
vendored/rocq-stdlib/ skylabs-master 00897b3
vendored/rocq-stdpp/ skylabs-master 0c5e505
fmdeps/skylabs-fm/ main 133e53a
vendored/vsrocq/ skylabs-main ee79e7a

Performance

Relative Master MR Change Filename
+0.00% 140849.7 140849.7 +0.0 total
+0.00% 33024.2 33024.2 +0.0 ├ translation units
+0.00% 107825.5 107825.5 +0.0 └ proofs and tests
Full Results
Relative Master MR Change Filename
+0.00% 140849.7 140849.7 +0.0 total
+0.00% 33024.2 33024.2 +0.0 ├ translation units
+0.00% 107825.5 107825.5 +0.0 └ proofs and tests

Comment thread dune.disabled
(../cpp2v_docker as cpp2v))
(env-vars
; (CPP2V_DOCKER_ENABLED "if-libstdc++")
(CPP2V_DOCKER_MEM_CAP=5GB)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this belongs to the user environment, not the static config...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I thought I'd provide a sensible default or any easy way to turn it on. We could comment it out and let the user uncomment and change it they want.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd rather keep customizations out of dune as far as possible, so there's less to merge. People can export CPP2V_DOCKER_MEM_CAP=5GB in their normal configs if they want to. Having to configure it twice in dune syntax, and merge customizations with upstream changes, seems a bit too much.

Ideally, dune should either not exist or coincide with dune.disabled. Not sure about "if-libstdc++".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

And I think the only sensible default is off — "wait for ~5GB free to start cpp2v" makes some sense, but if I give 40GB to Docker, that means CPP2V_DOCKER_MEM_CAP should be 35GB.

Anyway, I wanted to approve and merging this for now ASAP, but I noticed other things that need tweaking.

exit 2
fi
while true; do
used_mem=$(docker stats --no-stream --format "{{.MemUsage}}" | awk '{print $1}' | head -n 1 | units)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is printing the memory usage of the first container in the list. That can't be good.

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