Quickstart
๐ฆ Installing with Cargoโ
Install or Update Rust
- Install
- Update
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup update
cargo install --git https://github.com/TraceMachina/nativelink --tag v0.3.0
โ๏ธ Configurationโ
The nativelink
executable reads a JSON file as it's only parameter,
--config
. See the configuration docs
for more details and examples.
To grab the example in your current working directory, run:
curl -O https://raw.githubusercontent.com/TraceMachina/nativelink/main/nativelink-config/examples/basic_cas.json
๐ Start NativeLinkโ
nativelink basic_cas.json
๐งช Evaluating NativeLinkโ
note
If Bazel is not installed follow the instructions below based on your machine.
- Linux
- Docker-ARM
- Docker-x86
- MacOS
apt install -y gcc g++ lld python3 curl
sudo apt update && sudo apt install bazel
# Verify the installation.
bazel --version
# The commands for creating docker containers can fill up space very quickly when run frequently.
# If `apt update` throws an out of space error you can run `docker system prune`
# to free up space. Be careful to make sure it's not removing any containers/images you want to keep.
docker run -it --name=NL -v $(pwd):/nativelink ubuntu:latest
# If above has already been run or trying to start in new terminal:
docker exec -it NL sh
apt update
apt install apt-transport-https curl gnupg
# Download the Bazel binary for ARM Linux.
curl -LO https://github.com/bazelbuild/bazel/releases/download/6.4.0/bazel-6.4.0-linux-arm64
# Make the binary executable.
chmod +x bazel-6.4.0-linux-arm64
# Move the binary to a directory in your PATH.
mv bazel-6.4.0-linux-arm64 /usr/local/bin/bazel
# Verify the installation.
bazel --version
# The commands for creating docker containers can fill up space very quickly
# when run frequently. If `apt update` throws an out of space error you can
# run `docker system prune` to free up space. Be careful to make sure it's
# not removing any containers/images you want to keep.
docker run -it --name=NL -v $(pwd):/nativelink ubuntu:latest
# If above has already been run or trying to start in new terminal:
docker exec -it NL sh
apt update
apt install apt-transport-https curl gnupg
# Download the Bazel binary for x86 Linux.
curl -LO https://github.com/bazelbuild/bazel/releases/download/6.4.0/bazel-6.4.0-linux-x86_64
# Make the binary executable.
chmod +x bazel-6.4.0-linux-x86_64
# Move the binary to a directory in your PATH.
mv bazel-6.4.0-linux-x86_64 /usr/local/bin/bazel
# Verify the installation.
bazel --version
# It is recommended to use x86 Docker for Intel Macs and ARM Docker for Silicon Macs.
/bin/sh -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install bazel
# Verify the installation.
bazel --version
Once you've built NativeLink and have an instance running with the
basic_cas.json
configuration, launch a separate terminal session and run the
following command to connect the running server launched above to Bazel or
another RBE client:
bazel test //... \
--remote_instance_name=main \
--remote_cache=grpc://127.0.0.1:50051 \
--remote_executor=grpc://127.0.0.1:50051 \
--remote_default_exec_properties=cpu_count=1
For Windows sh;
bazel test //... `
--remote_instance_name=main `
--remote_cache=grpc://127.0.0.1:50051 `
--remote_executor=grpc://127.0.0.1:50051 `
--remote_default_exec_properties=cpu_count=1
This causes Bazel to run the commands through an all-in-one CAS
, scheduler
and worker
.
๐ Tada ๐ NativeLink is working.