-
Notifications
You must be signed in to change notification settings - Fork 7
Enable Bazel disk cache by default to speed up repeated builds #77
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: MTomBosch <marko.tomljenovic@etas.com>
| echo "Bazel Cache: Configuring Bazel disk cache retention time (60 days)..." | ||
| echo "common --experimental_disk_cache_gc_max_age=60d" >> ~/.bazelrc | ||
| echo "Bazel Cache: Configuring Bazel disk cache max size (50 GB)..." | ||
| echo "common --experimental_disk_cache_gc_max_size=50G" >> ~/.bazelrc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does that work with every github runner?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this was meant for local usage. But indeed it might break workflows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FScholPer Not complaining just asking: How would this break the runner? If the runner uses the container then the container will be the runtime environment environment for the job and in the container I am quite sure the file path ~/.bazelrc is accessible. Or do you mean that the ~ cannot be resolved to the proper home folder location?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the on_create_command to my knowledge is only executed in vscode when choosing the bazel feature to be used. The original/raw container does not even have the bazel stuff in it.
Or can the GHA runner also make use of this devcontainer "feature" functionality too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tools installed via devcontainer features are available. However at least with a simple docker run the startup scripts of these features are not executed:
lure9428@del02614 ~ [1]> docker run ghcr.io/eclipse-score/devcontainer:local-amd64 bash -c "ls -lha /home/vscode/"
total 32K
drwxr-x--- 1 vscode vscode 4.0K Feb 2 10:51 .
drwxr-xr-x 1 root root 4.0K Feb 2 09:41 ..
-rw-r--r-- 1 vscode vscode 220 Mar 31 2024 .bash_logout
-rw-r--r-- 1 vscode vscode 5.8K Feb 2 09:41 .bashrc
drwxr-xr-x 4 vscode vscode 4.0K Feb 2 10:51 .cache
drwxr-xr-x 2 vscode vscode 4.0K Feb 2 09:41 .config
-rw-r--r-- 1 vscode vscode 807 Mar 31 2024 .profile
lure9428@del02614 ~> docker run ghcr.io/eclipse-score/devcontainer:local-amd64 bash -c "ls -lha /home/vscode/.cache/bazel"
total 12K
drwxr-xr-x 3 vscode vscode 4.0K Feb 2 10:51 .
drwxr-xr-x 4 vscode vscode 4.0K Feb 2 10:51 ..
drwxr-xr-x 4 vscode vscode 4.0K Feb 2 10:51 _bazel_vscode
lure9428@del02614 ~> docker run ghcr.io/eclipse-score/devcontainer:local-amd64 bash -c "type bazel"
bazel is /usr/bin/bazelThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the concern is that the settings might increase disk usage of bazel in runners. I tend to believe that at the moment bazels disk usage is unbounded and with this change I hope that with these settings the size of the bazel cache is limited.
(.ide_support.venv) vscode ➜ /workspaces/score_inc_someip_gateway (add-pre-commit-hooks) $ du -hs /var/cache/bazel/
80G /var/cache/bazel/There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want the full devcontainer running you can do it like this:
devcontainer/.github/workflows/ci.yaml
Line 47 in c17061b
| uses: devcontainers/ci@v0.3 |
This should only make use of the image: https://github.com/eclipse-score/reference_integration/blob/a1e29b78844b6258eb6692aabbf349cc83d1f945/.github/workflows/build_and_test_ebclfsa.yml#L32-L33
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the concern is that the settings might increase disk usage of bazel in runners. I tend to believe that at the moment bazels disk usage is unbounded and with this change I hope that with these settings the size of the bazel cache is limited.
(.ide_support.venv) vscode ➜ /workspaces/score_inc_someip_gateway (add-pre-commit-hooks) $ du -hs /var/cache/bazel/ 80G /var/cache/bazel/
That was my concern. Clarified.
Note that we only have 14GB space. Sometimes thats not even enough for the toolchains. See https://github.com/eclipse-score/more-disk-space/
No description provided.