remote-apis
ccache
remote-apis | ccache | |
---|---|---|
5 | 28 | |
300 | 2,178 | |
0.3% | 1.6% | |
5.8 | 9.4 | |
15 days ago | 3 days ago | |
Starlark | C++ | |
Apache License 2.0 | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
remote-apis
-
Mozilla sccache: cache with cloud storage
In the case of the Remote Execution/Cache API used by Bazel among others[1] at least, it's a bit more detailed. There's an "ActionCache" and an actual content-addressed cache that just stores blobs ("ContentAddressableStorage"). When you run a `gcc -O2 foo.c -o foo.o` command (locally or remotely; doesn't matter), you upload an "Action" into the action cache, which basically said "This command was run. As a result it had this stderr, stdout, error code, and these input files read and output files written." The input and output files are then referenced by the hash of their contents, in this case.
Most importantly you can look up an action in the ActionCache without actually running it. So now when another person comes by and runs the same build command, they say "Has this Action, with these inputs, been run before?" and the server can say "Yes, and the output is a file identified by hash XYZ" where XYZ is the hash of foo.o
So realistically you always some mix of "input content hashing" and "output content hashing" (the second being the definition of 'content addressable'.)
[1] https://github.com/bazelbuild/remote-apis/blob/main/build/ba...
-
Distcc: A fast, free distributed C/C++ compiler
Not only it's distributed like distcc, Bazel also provide sandboxing to ensure that environment factors does not affect the build/test results. This might not mean much for smaller use cases, but at scale with different compiler toolchains targeting different OS and CPU Architecture, the sandbox helps a ton in keeping your cache accurate.
On top of it, the APIs Bazel uses to communicate with the remote execution environment is standardized and adopted by other build tools with multiple server implementation to match it. Looking into https://github.com/bazelbuild/remote-apis/#clients, you could see big players are involved: Meta, Twitter, Chromium project, Bloomberg while there are commercial supports for some server implementations.
Finally, on top of C/C++, Bazel also supports these remote compilation / remote test execution for Go, Java, Rust, JS/TS etc... Which matters a lot for many enterprise users.
Disclaimer: I work for https://www.buildbuddy.io/ which provides one of the remote execution server implementation and I am a contributor to Bazel.
-
When to Use Bazel?
Regardless of whether you should use Bazel or not, my hope is that any future build systems attempt to adopt Bazel's remote execution protocol (or at least a protocol that is similar in spirit):
https://github.com/bazelbuild/remote-apis
In my opinion the protocol is fairly well designed.
-
Programming Breakthroughs We Need
> The thing I really would like to see is a smarter CI system. Caching of build outputs, so you don't have to rebuild the world from scratch every time. Distributed execution of tests and compilation, so you are not bottle-necked by one machine.
This is already achievable nowadays using Bazel (https://bazel.build) as a build system. It uses a gRPC based protocol for offloading/caching the actual build on a build cluster (https://github.com/bazelbuild/remote-apis). I am the author of one of the Open Source build cluster implementations (Buildbarn).
-
Distributed Cloud Builds for Everyone
Very nice! I really like the ease-of-use of this, as well as the scale-to-zero costs. That's a tricky thing to achieve. Seems like it could become a standard path to ease the migration from local to remote builds.
If the author is interested in standardizing the same, I'd suggest implementing the REAPI protocol (https://github.com/bazelbuild/remote-apis). It should be amenable to implementing on a Lambda-esque back-end, and is already standard amongst most tools doing Remote Execution (including Bazel! Bazel+llama could be fun). And equally, it's totally usable by a distcc-esque distribution tool (recc[1] is one example) - that's also what Android is doing before they finish migrating to Bazel ([2], sadly not yet oss'd).
The main interesting challenge I expect this project to hit is going to be worker-local caching: for compilation actions it's not too bad to skip assuming the compiler is built into the container environment, but if branching out into either hermetic toolchains or data-heavy action types (like linking), fetching all bytes to the ephemeral worker anew each time may prove to be prohibitive. On the other hand, that might be a nice transition point to switch to persistent workers: use a lambda backed solution for the scale-to-0 case, and switch execution stacks under the hood to something based on reused VMs when hitting sufficient scale that persistent executors start to win out.
(Disclaimer: I TL'd the creation of this API, and Google implementation of the same).
[1] https://gitlab.com/BuildGrid/recc
[2] https://opensource.googleblog.com/2020/11/welcome-android-op...
ccache
-
Deep Learning with “AWS Graviton2 + NVIDIA Tensor T4G” for as low as free* with CUDA 12.2
# Download and install ccache for faster compilation wget https://github.com/ccache/ccache/releases/download/v4.8.3/ccache-4.8.3.tar.xz tar -xf ccache-4.8.3.tar.xz pushd ccache-4.8.3 cmake . make -j $CPUS make install popd # Install NumPy, a dependency for PyTorch dnf install -y numpy # Install Python typing extensions for better type-checking sudo -u ec2-user pip3 install typing-extensions # Clone PyTorch repository and install from source git clone --recursive https://github.com/pytorch/pytorch.git pushd pytorch python3 setup.py install popd # Refresh the dynamic linker run-time bindings ldconfig # Install additional Python libraries for PyTorch sudo -u ec2-user pip3 install sympy filelock fsspec networkx
-
This isn’t the way to speed up Rust compile times
> What can I use to cache with MSVC that isn't Incredibuild?
Ccache works, but if you use the Visual Studio C++ compiler you need to configure your build to be cacheable.
https://github.com/ccache/ccache/wiki/MS-Visual-Studio
-
Flutter or React Native
That ecosystem now is too young. All these things must be configured by an automatic installer. Packages and pods need to be tested before release, etc. Previous was 80 min compilation time of the Firestore package. Solved with https://ccache.dev/. But why Dart developers must know, how to install and configure object cache for C++ compilers?
-
Distcc: A fast, free distributed C/C++ compiler
Related
https://github.com/icecc/icecream - another option that does what distcc does, but aimed at a somewhat different use case.
https://ccache.dev/ - a similar idea but provides caching of build outputs instead of distributing builds. You can use it together with distcc to achieve even better performance.
- Debugging the QtCreator
- How to avoid compiling whole C++ project every time using Github actions?
-
Boring Python: Code Quality
> All those big changes introduce commits that make git bisect generally slower.
Bisection search is log2(n) so doubling the number of commits should only add one more bisection step, yes?
> Which might be awful if you also have some C code to recompile at every step of bisecting.
That reminds me, I've got to try out ccache (https://ccache.dev/ ) for my project. My full compile is one minute, but the three files that take longest to compiler rarely change.
-
Ccache – a fast C/C++ compiler cache
I worked with the internals of this some 16 years ago, maintaining a customized version at Zeugma Systems. Some change of mine was reworked by someone and upstreamed:
https://github.com/ccache/ccache/commit/e8354384f67bc733bea5...
What are some alternatives?
dylint - Run Rust lints from dynamic libraries
sccache - Sccache is a ccache-like tool. It is used as a compiler wrapper and avoids compilation when possible. Sccache has the capability to utilize caching in remote storage environments, including various cloud storage options, or alternatively, in local storage.
bazel-gba-example - Bazel GBA (Game Boy Advance) Example
buildcache - A build cache
llama
Redis - Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes, Streams, HyperLogLogs, Bitmaps.
MyDef - Programming in the next paradigm -- your way
linux-tkg - linux-tkg custom kernels
bazel-buildfarm - Bazel remote caching and execution service
icecream - Distributed compiler with a central scheduler to share build load
embedded-postgres-binaries - Lightweight bundles of PostgreSQL binaries with reduced size intended for testing purposes.
setup-gcc - GitHub action to set up GCC