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

Polish cloud docs for Bazel and Pants #1152

Merged
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
3 changes: 3 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ BasedOnStyles = alex, Vale, Microsoft, write-good
# Ignore code blocks in Starlight's TabItems.
BlockIgnores = (?s)(<TabItem.*?>.*?```.*?```.*?</TabItem>)

# Ignore filesnames and director names in tree visualizations.
BlockIgnores = (?s)(<FileTree>.*?</FileTree>)

# Too harsh. The `write-good.Passive` check already covers many cases.
write-good.E-Prime = NO

Expand Down
28 changes: 0 additions & 28 deletions docs/src/content/docs/nativelink-cloud/Bazel.mdx

This file was deleted.

32 changes: 0 additions & 32 deletions docs/src/content/docs/nativelink-cloud/Pants.mdx

This file was deleted.

44 changes: 44 additions & 0 deletions docs/src/content/docs/nativelink-cloud/bazel.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: "Bazel Cloud Quickstart"
description: "Connect your Bazel project to NativeLink Cloud"
pagefind: true
---

This guide shows how to connect your [Bazel](https://bazel.build/) project to
[NativeLink Cloud](https://app.nativelink.com).

import { Steps } from "@astrojs/starlight/components";
import { FileTree } from "@astrojs/starlight/components";

<Steps>

1. If you can't find a `.bazelrc` file create one in your project root:

<FileTree>
- project/
- WORKSPACE.bazel
- MODULE.bazel
- BUILD.bazel
- **.bazelrc**
</FileTree>

2. Copy the following lines into your `.bazelrc`:

```bash
# .bazelrc
build --remote_cache=[CLAIM_CAS_URL]
build --remote_header=x-nativelink-api-key=[API_KEY]
build --remote_timeout=600
build --bes_backend=[CLAIM_BES_URL]
build --bes_header=x-nativelink-api-key=[API_KEY]
build --remote_timeout=600
```

:::note
Fill in the `CLAIM_CAS_URL`, `CLAIM_BES_URL` and `API_KEY` from [NativeLink Cloud](https://app.nativelink.com).
:::

3. Run a Bazel build and you'll see remote cache use on the
[Dashboard](https://app.nativelink.com) page.

</Steps>
51 changes: 51 additions & 0 deletions docs/src/content/docs/nativelink-cloud/pants.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: "Pants Cloud Quickstart"
description: "Connect your Pants project to NativeLink Cloud"
pagefind: true
---

This guide shows how to connect your [Pantsbuild](https://www.pantsbuild.org/)
project to [NativeLink Cloud](https://app.nativelink.com).

import { Steps } from "@astrojs/starlight/components";
import { FileTree } from "@astrojs/starlight/components";

<Steps>

1. If you can't find a `pants.toml` file, create one in the root directory of
your Pantsbuild project:

<FileTree>
- project/
- get-pants.sh
- BUILD
- **pants.toml**
</FileTree>

2. Copy the following lines into your `pants.toml`:

```toml
# pants.toml
[GLOBAL]
remote_cache_read = true
remote_cache_write = true
remote_store_address = "[REMOTE_STORE_ADDRESS]"

[GLOBAL.remote_store_headers]
x-nativelink-api-key = "[API_KEY]"
```

:::note
Fill in the `REMOTE_STORE_ADDRESS` and `API_KEY` from the [NativeLink Cloud](https://app.nativelink.com).
:::

3. Run a pants build with the following flags:

```bash
pants --no-pantsd --level=trace --no-local-cache test ::
```

4. You'll see remote cache use on the [Dashboard](https://app.nativelink.com)
page.

</Steps>