From ebecd787e2740143225eac4537392f6ca88882eb Mon Sep 17 00:00:00 2001 From: Marcus Date: Thu, 5 Dec 2024 14:38:32 -0800 Subject: [PATCH] Move to top-level dir --- .github/workflows/main.yml | 8 ++++---- README.md | 2 +- deployment-examples/docker-compose/README.md | 8 ++++---- deployment-examples/docker-compose/docker-compose.yml | 6 +++--- examples/README.md | 7 +++++++ .../chromium-example/build_chromium_tests.sh | 0 {deploy => examples}/chromium-example/kustomization.yaml | 0 {deploy => examples/deploy}/dev/kustomization.yaml | 0 .../deploy}/kubernetes-example/kustomization.yaml | 0 local-remote-execution/README.md | 6 +++--- run_integration_tests.sh | 2 +- tools/pre-commit-hooks.nix | 2 +- .../src/content/docs/docs/introduction/on-prem.mdx | 2 +- web/platform/starlight.conf.ts | 6 +++--- 14 files changed, 28 insertions(+), 21 deletions(-) create mode 100644 examples/README.md rename {deploy => examples}/chromium-example/build_chromium_tests.sh (100%) rename {deploy => examples}/chromium-example/kustomization.yaml (100%) rename {deploy => examples/deploy}/dev/kustomization.yaml (100%) rename {deploy => examples/deploy}/kubernetes-example/kustomization.yaml (100%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ff698c82c..35d3ccb43 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 ' \ @@ -191,7 +191,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..1a257024f 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 in the [Docs](https://nativelink.com/docs/examples/kubernetes). ### 📦 Prebuilt images diff --git a/deployment-examples/docker-compose/README.md b/deployment-examples/docker-compose/README.md index 775c470c6..cb37e75c1 100644 --- a/deployment-examples/docker-compose/README.md +++ b/deployment-examples/docker-compose/README.md @@ -32,7 +32,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 @@ -45,7 +45,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:-} @@ -78,7 +78,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:-} @@ -104,7 +104,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/deployment-examples/docker-compose/docker-compose.yml index 60af6bc22..438be5dc3 100644 --- a/deployment-examples/docker-compose/docker-compose.yml +++ b/deployment-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/examples/README.md b/examples/README.md new file mode 100644 index 000000000..929971d7b --- /dev/null +++ b/examples/README.md @@ -0,0 +1,7 @@ +# Examples + +In this directory, we've included a few examples for how to deploy NativeLink for [Chromium](./chromium-example/), [`docker-compose`](./docker-compose/), and [Terraform](./terraform/). + +It's important to note that these aren't production deployments. If you are looking to transition to Production, please join the [Slack](https://join.slack.com/t/nativelink/shared_invite/zt-281qk1ho0-krT7HfTUIYfQMdwflRuq7A) where you can ask more questions. + +🚀 Happy Coding! 🚀 diff --git a/deploy/chromium-example/build_chromium_tests.sh b/examples/chromium-example/build_chromium_tests.sh similarity index 100% rename from deploy/chromium-example/build_chromium_tests.sh rename to examples/chromium-example/build_chromium_tests.sh diff --git a/deploy/chromium-example/kustomization.yaml b/examples/chromium-example/kustomization.yaml similarity index 100% rename from deploy/chromium-example/kustomization.yaml rename to examples/chromium-example/kustomization.yaml diff --git a/deploy/dev/kustomization.yaml b/examples/deploy/dev/kustomization.yaml similarity index 100% rename from deploy/dev/kustomization.yaml rename to examples/deploy/dev/kustomization.yaml diff --git a/deploy/kubernetes-example/kustomization.yaml b/examples/deploy/kubernetes-example/kustomization.yaml similarity index 100% rename from deploy/kubernetes-example/kustomization.yaml rename to examples/deploy/kubernetes-example/kustomization.yaml 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 77620b080..17b13681c 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/introduction/on-prem.mdx b/web/platform/src/content/docs/docs/introduction/on-prem.mdx index 406d81933..d6b648f5f 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**](/docs/deployment-examples/on-prem-overview): +- [**On-Prem Example Deployments**](/docs/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`, }, ], },