From 2d828eb0a360257292d63452970840f4397f910c Mon Sep 17 00:00:00 2001 From: Marcus Date: Sun, 10 Nov 2024 00:56:24 -0800 Subject: [PATCH] Ensures Top-Level Examples Directory --- .github/workflows/main.yml | 8 ++++---- README.md | 2 +- .../chromium}/build_chromium_tests.sh | 0 .../chromium}/kustomization.yaml | 0 .../docker-compose/Dockerfile | 0 .../docker-compose/README.md | 8 ++++---- .../docker-compose/docker-compose.yml | 6 +++--- .../docker-compose/example-do-not-use-in-prod-key.pem | 0 .../docker-compose/example-do-not-use-in-prod-rootca.crt | 0 .../docker-compose/local-storage-cas.json | 0 .../docker-compose/scheduler.json | 0 .../docker-compose/worker.json | 0 flake.nix | 2 +- local-remote-execution/README.md | 6 +++--- run_integration_tests.sh | 2 +- tools/pre-commit-hooks.nix | 2 +- .../content/docs/docs/deployment-examples/chromium.mdx | 2 +- .../content/docs/docs/deployment-examples/kubernetes.mdx | 2 +- .../src/content/docs/docs/introduction/on-prem.mdx | 2 +- web/platform/starlight.conf.ts | 6 +++--- 20 files changed, 24 insertions(+), 24 deletions(-) rename {deploy/chromium-example => examples/chromium}/build_chromium_tests.sh (100%) rename {deploy/chromium-example => examples/chromium}/kustomization.yaml (100%) rename {deployment-examples => examples}/docker-compose/Dockerfile (100%) rename {deployment-examples => examples}/docker-compose/README.md (94%) rename {deployment-examples => examples}/docker-compose/docker-compose.yml (91%) rename {deployment-examples => examples}/docker-compose/example-do-not-use-in-prod-key.pem (100%) rename {deployment-examples => examples}/docker-compose/example-do-not-use-in-prod-rootca.crt (100%) rename {deployment-examples => examples}/docker-compose/local-storage-cas.json (100%) rename {deployment-examples => examples}/docker-compose/scheduler.json (100%) rename {deployment-examples => examples}/docker-compose/worker.json (100%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f2448dd7c..f72421910 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -129,7 +129,7 @@ jobs: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 with: context: . - file: ./deployment-examples/docker-compose/Dockerfile + file: ./examples/docker-compose/Dockerfile build-args: | OPT_LEVEL=opt OS_VERSION=${{ matrix.os_version }} @@ -142,7 +142,7 @@ jobs: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 with: context: . - file: ./deployment-examples/docker-compose/Dockerfile + file: ./examples/docker-compose/Dockerfile build-args: | OPT_LEVEL=opt OS_VERSION=${{ matrix.os_version }} @@ -153,7 +153,7 @@ jobs: - name: Compile NativeLink with NativeLink run: | mkdir -p ~/.cache && \ - cd deployment-examples/docker-compose && \ + cd examples/docker-compose && \ (docker-compose up -d || docker compose up -d) && \ cd ../../ && \ docker run --rm --net=host -w /root/nativelink -v $PWD:/root/nativelink trace_machina/nativelink:builder sh -c ' \ @@ -193,7 +193,7 @@ jobs: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 with: context: . - file: ./deployment-examples/docker-compose/Dockerfile + file: ./examples/docker-compose/Dockerfile build-args: | OPT_LEVEL=fastbuild OS_VERSION=${{ matrix.os_version }} diff --git a/README.md b/README.md index ca310c732..00334deed 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ To start, you can deploy NativeLink as a Docker image (as shown below) or by usi The setups below are **production-grade** installations. See the [contribution docs](https://nativelink.com/docs/contribute/nix/) for instructions on how to build from source with [Bazel](https://nativelink.com/docs/contribute/bazel/), [Cargo](https://nativelink.com/docs/contribute/cargo/), and [Nix](https://nativelink.com/docs/contribute/nix/). -You can find a few example deployments in the [Docs](https://nativelink.com/docs/deployment-examples/kubernetes). +You can find a few example deployments for Docker, Terraform, and Chromium in the [Docs](https://www.nativelink.com/docs/deployment-examples/on-prem-overview). ### 📦 Prebuilt images diff --git a/deploy/chromium-example/build_chromium_tests.sh b/examples/chromium/build_chromium_tests.sh similarity index 100% rename from deploy/chromium-example/build_chromium_tests.sh rename to examples/chromium/build_chromium_tests.sh diff --git a/deploy/chromium-example/kustomization.yaml b/examples/chromium/kustomization.yaml similarity index 100% rename from deploy/chromium-example/kustomization.yaml rename to examples/chromium/kustomization.yaml diff --git a/deployment-examples/docker-compose/Dockerfile b/examples/docker-compose/Dockerfile similarity index 100% rename from deployment-examples/docker-compose/Dockerfile rename to examples/docker-compose/Dockerfile diff --git a/deployment-examples/docker-compose/README.md b/examples/docker-compose/README.md similarity index 94% rename from deployment-examples/docker-compose/README.md rename to examples/docker-compose/README.md index 4ed93cb8f..f86befc91 100644 --- a/deployment-examples/docker-compose/README.md +++ b/examples/docker-compose/README.md @@ -33,7 +33,7 @@ bazel test //... \ ## Instances All instances use the same Docker image, `trace_machina/nativelink:latest`, -built from the `Dockerfile` located at `./deployment-examples/docker-compose/Dockerfile`. +built from the `Dockerfile` located at `./examples/docker-compose/Dockerfile`. ### CAS @@ -46,7 +46,7 @@ NativeLink system. It's configured in the `docker-compose.yml` file under the image: trace_machina/nativelink:latest build: context: ../.. - dockerfile: ./deployment-examples/docker-compose/Dockerfile + dockerfile: ./examples/docker-compose/Dockerfile network: host args: - ADDITIONAL_SETUP_WORKER_CMD=${ADDITIONAL_SETUP_WORKER_CMD:-} @@ -79,7 +79,7 @@ the `docker-compose.yml` file under the nativelink_scheduler service. image: trace_machina/nativelink:latest build: context: ../.. - dockerfile: ./deployment-examples/docker-compose/Dockerfile + dockerfile: ./examples/docker-compose/Dockerfile network: host args: - ADDITIONAL_SETUP_WORKER_CMD=${ADDITIONAL_SETUP_WORKER_CMD:-} @@ -105,7 +105,7 @@ Worker instances are responsible for executing tasks. They're configured in the image: trace_machina/nativelink:latest build: context: ../.. - dockerfile: ./deployment-examples/docker-compose/Dockerfile + dockerfile: ./examples/docker-compose/Dockerfile network: host args: - ADDITIONAL_SETUP_WORKER_CMD=${ADDITIONAL_SETUP_WORKER_CMD:-} diff --git a/deployment-examples/docker-compose/docker-compose.yml b/examples/docker-compose/docker-compose.yml similarity index 91% rename from deployment-examples/docker-compose/docker-compose.yml rename to examples/docker-compose/docker-compose.yml index 60af6bc22..438be5dc3 100644 --- a/deployment-examples/docker-compose/docker-compose.yml +++ b/examples/docker-compose/docker-compose.yml @@ -19,7 +19,7 @@ services: image: trace_machina/nativelink:latest build: context: ../.. - dockerfile: ./deployment-examples/docker-compose/Dockerfile + dockerfile: ./examples/docker-compose/Dockerfile network: host args: - ADDITIONAL_SETUP_WORKER_CMD=${ADDITIONAL_SETUP_WORKER_CMD:-} @@ -38,7 +38,7 @@ services: image: trace_machina/nativelink:latest build: context: ../.. - dockerfile: ./deployment-examples/docker-compose/Dockerfile + dockerfile: ./examples/docker-compose/Dockerfile network: host args: - ADDITIONAL_SETUP_WORKER_CMD=${ADDITIONAL_SETUP_WORKER_CMD:-} @@ -57,7 +57,7 @@ services: image: trace_machina/nativelink:latest build: context: ../.. - dockerfile: ./deployment-examples/docker-compose/Dockerfile + dockerfile: ./examples/docker-compose/Dockerfile network: host args: - ADDITIONAL_SETUP_WORKER_CMD=${ADDITIONAL_SETUP_WORKER_CMD:-} diff --git a/deployment-examples/docker-compose/example-do-not-use-in-prod-key.pem b/examples/docker-compose/example-do-not-use-in-prod-key.pem similarity index 100% rename from deployment-examples/docker-compose/example-do-not-use-in-prod-key.pem rename to examples/docker-compose/example-do-not-use-in-prod-key.pem diff --git a/deployment-examples/docker-compose/example-do-not-use-in-prod-rootca.crt b/examples/docker-compose/example-do-not-use-in-prod-rootca.crt similarity index 100% rename from deployment-examples/docker-compose/example-do-not-use-in-prod-rootca.crt rename to examples/docker-compose/example-do-not-use-in-prod-rootca.crt diff --git a/deployment-examples/docker-compose/local-storage-cas.json b/examples/docker-compose/local-storage-cas.json similarity index 100% rename from deployment-examples/docker-compose/local-storage-cas.json rename to examples/docker-compose/local-storage-cas.json diff --git a/deployment-examples/docker-compose/scheduler.json b/examples/docker-compose/scheduler.json similarity index 100% rename from deployment-examples/docker-compose/scheduler.json rename to examples/docker-compose/scheduler.json diff --git a/deployment-examples/docker-compose/worker.json b/examples/docker-compose/worker.json similarity index 100% rename from deployment-examples/docker-compose/worker.json rename to examples/docker-compose/worker.json diff --git a/flake.nix b/flake.nix index f9f70a972..336105c33 100644 --- a/flake.nix +++ b/flake.nix @@ -240,7 +240,7 @@ build-chromium-tests = pkgs.writeShellScriptBin "build-chromium-tests" - ./deploy/chromium-example/build_chromium_tests.sh; + ./examples/chromium/build_chromium_tests.sh; docs = pkgs.callPackage ./tools/docs.nix {rust = stable-rust.default;}; diff --git a/local-remote-execution/README.md b/local-remote-execution/README.md index f3c06f7b2..8066cd7e7 100644 --- a/local-remote-execution/README.md +++ b/local-remote-execution/README.md @@ -192,7 +192,7 @@ Let's use NativeLink's Kubernetes example to verify that the setup worked. ## 🚢 Testing with local K8s Start the cluster and set up NativeLink in an LRE configuration. For details on -this refer to the [Kubernetes example](https://github.com/tracemachina/nativelink/tree/main/deployment-examples/kubernetes): +this refer to the [Kubernetes example](https://github.com/tracemachina/nativelink/tree/main/examples/kubernetes): > [!TIP] > NativeLink's `native` CLI tool is self-contained and can be imported into @@ -243,8 +243,8 @@ kind: Kustomization bases: resources: - - https://github.com/TraceMachina/nativelink//deployment-examples/kubernetes/base - - https://raw.githubusercontent.com/TraceMachina/nativelink/main/deployment-examples/kubernetes/worker-lre-cc.yaml + - https://github.com/TraceMachina/nativelink//examples/kubernetes/base + - https://raw.githubusercontent.com/TraceMachina/nativelink/main/examples/kubernetes/worker-lre-cc.yaml EOF diff --git a/run_integration_tests.sh b/run_integration_tests.sh index 4329d10a9..ebd32325c 100755 --- a/run_integration_tests.sh +++ b/run_integration_tests.sh @@ -64,7 +64,7 @@ if [[ "${#TEST_PATTERNS[@]}" -eq 0 ]]; then fi SELF_DIR=$(realpath $(dirname $0)) -cd "$SELF_DIR/deployment-examples/docker-compose" +cd "$SELF_DIR/examples/docker-compose" export UNDER_TEST_RUNNER=1 diff --git a/tools/pre-commit-hooks.nix b/tools/pre-commit-hooks.nix index e690341ae..f62fe05b1 100644 --- a/tools/pre-commit-hooks.nix +++ b/tools/pre-commit-hooks.nix @@ -47,7 +47,7 @@ in { excludes ++ [ # Integration testfiles not intended for production. - "deployment-examples/docker-compose/example-do-not-use-in-prod-key.pem" + "examples/docker-compose/example-do-not-use-in-prod-key.pem" "kubernetes/components/insecure-certs/example-do-not-use-in-prod-key.pem" ]; enable = true; diff --git a/web/platform/src/content/docs/docs/deployment-examples/chromium.mdx b/web/platform/src/content/docs/docs/deployment-examples/chromium.mdx index 021512c19..6c3c75d84 100644 --- a/web/platform/src/content/docs/docs/deployment-examples/chromium.mdx +++ b/web/platform/src/content/docs/docs/deployment-examples/chromium.mdx @@ -96,7 +96,7 @@ The `build-chromium-tests` command simplifies the setup described in After preparing the requirements, it runs a Reclient build against the cluster. :::note -See [`deploy/chromium-example/build_chromium_tests.sh`](https://github.com/TraceMachina/nativelink/blob/main/deploy/chromium-example/build_chromium_tests.sh) +See [`examples/chromium/build_chromium_tests.sh`](https://github.com/TraceMachina/nativelink/blob/main/examples/chromium/build_chromium_tests.sh) for the script contents. ::: diff --git a/web/platform/src/content/docs/docs/deployment-examples/kubernetes.mdx b/web/platform/src/content/docs/docs/deployment-examples/kubernetes.mdx index 3fd7c6417..bc167798c 100644 --- a/web/platform/src/content/docs/docs/deployment-examples/kubernetes.mdx +++ b/web/platform/src/content/docs/docs/deployment-examples/kubernetes.mdx @@ -47,7 +47,7 @@ Next, deploy NativeLink to the cluster: ```bash kubectl apply -k \ - https://github.com/TraceMachina/nativelink//deploy/kubernetes-example + https://github.com/TraceMachina/nativelink/deploy/kubernetes-example ``` :::danger diff --git a/web/platform/src/content/docs/docs/introduction/on-prem.mdx b/web/platform/src/content/docs/docs/introduction/on-prem.mdx index 501d1bf31..0c18ab305 100644 --- a/web/platform/src/content/docs/docs/introduction/on-prem.mdx +++ b/web/platform/src/content/docs/docs/introduction/on-prem.mdx @@ -21,7 +21,7 @@ To get started with running NativeLink on-premises, we recommend taking a look at our example deployments and NativeLink configurations that may suit your needs. -- [**On-Prem Example Deployments**](/deployment-examples/on-prem-overview): +- [**On-Prem Example Deployments**](/examples/on-prem-overview): This section provides several examples of deploying NativeLink to an on-premises Kubernetes setup. These examples aren't intended for production use, but rather to serve as basic, illustrative guides for using NativeLink diff --git a/web/platform/starlight.conf.ts b/web/platform/starlight.conf.ts index c42c116c8..e33feca06 100644 --- a/web/platform/starlight.conf.ts +++ b/web/platform/starlight.conf.ts @@ -114,15 +114,15 @@ export const starlightConfig = { items: [ { label: "On-Prem Overview", - link: `${docsRoot}/deployment-examples/on-prem-overview`, + link: `${docsRoot}/examples/on-prem-overview`, }, { label: "Kubernetes", - link: `${docsRoot}/deployment-examples/kubernetes`, + link: `${docsRoot}/examples/kubernetes`, }, { label: "Chromium", - link: `${docsRoot}/deployment-examples/chromium`, + link: `${docsRoot}/examples/chromium`, }, ], },