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

[Breaking] Rename cas executable to nativelink #573

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ exports_files(
)

rust_binary(
name = "cas",
name = "nativelink",
srcs = [
"src/bin/cas.rs",
"src/bin/nativelink.rs",
],
deps = [
"//nativelink-config",
Expand Down
2 changes: 1 addition & 1 deletion Cargo.Bazel.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"checksum": "0be5c6bdda6a845c2a3f88a87531d6fbf7945f34dd6b57472f3447776367ef3c",
"checksum": "668f99242a0de85cd44405f6f026db36e97a04f938f4be4b54e160f75801dd2a",
"crates": {
"addr2line 0.21.0": {
"name": "addr2line",
Expand Down
7 changes: 1 addition & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# This file is automatically generated from `tools/build_cargo_manifest.py`.
# If you want to add a dependency add it to `tools/cargo_shared.bzl`
# then run `python tools/build_cargo_manifest.py`.
# Do not edit this file directly.

[workspace]
resolver = "2"

Expand All @@ -16,7 +11,7 @@ lto = true
opt-level = 3

[[bin]]
name = "cas"
name = "nativelink"
aaronmondal marked this conversation as resolved.
Show resolved Hide resolved

[dependencies]
nativelink-error = { path = "nativelink-error" }
Expand Down
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ cargo install --git https://github.com/TraceMachina/nativelink

### ⚙️ Configuration

The `cas` executable reads a JSON file as it's only parameter, `--config`. See [nativelink-config](./nativelink-config/examples/basic_cas.json)
The `nativelink` executable reads a JSON file as it's only parameter,
`--config`. See [nativelink-config](./nativelink-config/examples/basic_cas.json)
for more details and examples.

To grab the example in your current working directory, run:
Expand All @@ -37,7 +38,7 @@ curl -O https://raw.githubusercontent.com/TraceMachina/nativelink/main/nativelin
### Start Native Link

```bash
cas basic_cas.json
nativelink basic_cas.json
```

## 🧪 Evaluating Native Link
Expand Down Expand Up @@ -103,21 +104,21 @@ nix run github:TraceMachina/nativelink/<revision> ./basic_cas.json
> This build supports Nix/direnv which provides Bazel but no C++ toolchain
> (yet).

The following commands place an executable in `./bazel-bin/cas/cas` and start
the service:
The following commands places an executable in `./bazel-bin/nativelink` and
starts the service:

```sh
# Unoptimized development build on Unix
bazel run cas -- ./nativelink-config/examples/basic_cas.json
bazel run nativelink -- ./nativelink-config/examples/basic_cas.json

# Optimized release build on Unix
bazel run -c opt cas -- ./nativelink-config/examples/basic_cas.json
bazel run -c opt nativelink -- ./nativelink-config/examples/basic_cas.json

# Unoptimized development build on Windows
bazel run --config=windows cas -- ./nativelink-config/examples/basic_cas.json
bazel run --config=windows nativelink -- ./nativelink-config/examples/basic_cas.json

# Optimized release build on Windows
bazel run --config=windows -c opt cas -- ./nativelink-config/examples/basic_cas.json
bazel run --config=windows -c opt nativelink -- ./nativelink-config/examples/basic_cas.json
```

## 🦀 Building with Cargo
Expand All @@ -133,10 +134,10 @@ bazel run --config=windows -c opt cas -- ./nativelink-config/examples/basic_cas.

```bash
# Unoptimized development build
cargo run --bin cas -- ./nativelink-config/examples/basic_cas.json
cargo run --bin nativelink -- ./nativelink-config/examples/basic_cas.json

# Optimized release build
cargo run --release --bin cas -- ./nativelink-config/examples/basic_cas.json
cargo run --release --bin nativelink -- ./nativelink-config/examples/basic_cas.json
```

## 🚀 Example Deployments
Expand Down
4 changes: 2 additions & 2 deletions deployment-examples/docker-compose/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ WORKDIR /root/nativelink
ADD . .
ARG OPT_LEVEL
ARG ADDITIONAL_BAZEL_FLAGS
RUN bazel build -c ${OPT_LEVEL} ${ADDITIONAL_BAZEL_FLAGS} cas && \
cp ./bazel-bin/cas /root/nativelink-bin
RUN bazel build -c ${OPT_LEVEL} ${ADDITIONAL_BAZEL_FLAGS} nativelink && \
cp ./bazel-bin/nativelink /root/nativelink-bin

# Go back to a fresh ubuntu container and copy only the compiled binary.
FROM ubuntu:${OS_VERSION} as final
Expand Down
2 changes: 1 addition & 1 deletion deployment-examples/kubernetes/worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
- name: worker-config
mountPath: /worker.json
subPath: worker.json
command: ["/bin/cas"]
command: ["/bin/nativelink"]
args: ["/worker.json"]
volumes:
- name: worker-config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ resource "google_compute_instance" "build_instance" {
cd /tmp/nativelink &&
tar xvf /tmp/file.tar.gz &&
. ~/.cargo/env &&
cargo build --release --bin cas &&
sudo mv /tmp/nativelink/target/release/cas /usr/local/bin/nativelink &&
cargo build --release --bin nativelink &&
sudo mv /tmp/nativelink/target/release/nativelink /usr/local/bin/nativelink &&
`` &&
cd /tmp/nativelink/deployment-examples/terraform/experimental_GCP/module/scripts &&
sudo mv ./bb_browser_config.json /root/bb_browser_config.json &&
Expand Down
4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
apps = {
default = {
type = "app";
program = "${nativelink}/bin/cas";
program = "${nativelink}/bin/nativelink";
};
};
packages = {
Expand All @@ -106,7 +106,7 @@
pkgs.dockerTools.caCertificates
];
config = {
Entrypoint = ["/bin/cas"];
Entrypoint = ["/bin/nativelink"];
Labels = {
"org.opencontainers.image.description" = "An RBE compatible, high-performance cache and remote executor.";
"org.opencontainers.image.documentation" = "https://github.com/TraceMachina/nativelink";
Expand Down
File renamed without changes.