-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decouple automated K8s deployments (#1531)
This change allows deploying nativelink in various new configurations, including cache-only and multi-toolchain setups. The new setup is significantly more modular and lets us add and remove toolchains at runtime. Includes a reordering of the deployment logic to ensure that Alerts get deployed before the GitRepository that triggers them. For demo and CI this comes at the cost of an additional dummy GitRepository. This tradeoff seems well worth it as the previous ordering was entirely wrong and unreliable. Fixes the flakiness of the LRE workflow where it often gets stuck in the `Waiting for Tekton pipelines` loop.
- Loading branch information
1 parent
8782c0b
commit a0ca341
Showing
41 changed files
with
532 additions
and
299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,9 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
components: | ||
- ../../kubernetes/components/operator | ||
|
||
patches: | ||
- patch: |- | ||
- op: replace | ||
path: /spec/path | ||
value: ./kubernetes/overlays/chromium | ||
target: | ||
kind: Kustomization | ||
name: nativelink | ||
- patch: |- | ||
- op: replace | ||
path: /spec/eventMetadata/flakeOutput | ||
value: github:TraceMachina/nativelink#nativelink-worker-siso-chromium | ||
target: | ||
kind: Alert | ||
name: nativelink-worker-alert | ||
resources: | ||
- ../../kubernetes/resources/flux | ||
- ../../kubernetes/resources/nativelink-core | ||
- ../../kubernetes/resources/gateway-routes | ||
- ../../kubernetes/workers/resources/worker-init | ||
- ../../kubernetes/workers/resources/siso-chromium |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,9 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
components: | ||
- ../../kubernetes/components/operator | ||
|
||
patches: | ||
- patch: |- | ||
- op: replace | ||
path: /spec/path | ||
value: ./kubernetes/overlays/lre | ||
target: | ||
kind: Kustomization | ||
name: nativelink | ||
- patch: |- | ||
- op: replace | ||
path: /spec/eventMetadata/flakeOutput | ||
value: github:TraceMachina/nativelink#nativelink-worker-lre-cc | ||
target: | ||
kind: Alert | ||
name: nativelink-worker-alert | ||
resources: | ||
- ../../kubernetes/resources/flux | ||
- ../../kubernetes/resources/nativelink-core | ||
- ../../kubernetes/resources/gateway-routes | ||
- ../../kubernetes/workers/resources/worker-init | ||
- ../../kubernetes/workers/resources/lre-cc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
resources: | ||
- ../../kubernetes/nativelink | ||
- ../../kubernetes/workers/lre-cc | ||
- ../../kubernetes/resources/gateway-routes | ||
|
||
# Note: This deployment is mainly intended for documentation purposes. If you | ||
# intend to use it you'll need to provide image tags here. | ||
# | ||
# NativeLink doesn't support a "latest" tag or similar for reproducibility | ||
# reasons. For the latest tags see: | ||
# https://github.com/orgs/TraceMachina/packages?repo_name=nativelink | ||
# | ||
# See the lre overlay for a setup that autodetects these tags and automatically | ||
# stays in sync with main. See the `../deploy/dev` directory for development | ||
# setups. | ||
images: | ||
- name: nativelink | ||
newName: ghcr.io/TraceMachina/nativelink | ||
newTag: TODO | ||
- name: nativelink-worker-init | ||
newName: ghcr.io/TraceMachina/nativelink-worker-init | ||
newTag: TODO | ||
- name: nativelink-worker-lre-cc | ||
newName: ghcr.io/TraceMachina/nativelink-worker-lre-cc | ||
newTag: TODO |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
apiVersion: notification.toolkit.fluxcd.io/v1beta3 | ||
kind: Alert | ||
metadata: | ||
name: nativelink-alert | ||
namespace: default | ||
spec: | ||
eventSeverity: info | ||
eventSources: | ||
- kind: GitRepository | ||
name: '*' | ||
namespace: default | ||
providerRef: | ||
name: nativelink-webhook | ||
eventMetadata: | ||
flakeOutput: ${PLACEHOLDER_FLAKE_OUTPUT} | ||
configMapName: ${PLACEHOLDER_CONFIG_MAP_NAME} |
3 changes: 2 additions & 1 deletion
3
...ponents/gateway-routes/kustomization.yaml → ...etes/components/alerts/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
--- | ||
apiVersion: kustomize.config.k8s.io/v1alpha1 | ||
kind: Component | ||
|
||
resources: | ||
- routes.yaml | ||
- alert.yaml |
22 changes: 22 additions & 0 deletions
22
kubernetes/components/kustomization/flux-kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
apiVersion: kustomize.toolkit.fluxcd.io/v1 | ||
kind: Kustomization | ||
metadata: | ||
name: nativelink | ||
namespace: default | ||
spec: | ||
interval: 2m | ||
path: PLACEHOLDER_NATIVELINK_KUSTOMIZATION | ||
prune: true | ||
force: true | ||
retryInterval: 20s | ||
targetNamespace: default | ||
wait: true | ||
sourceRef: | ||
kind: GitRepository | ||
name: nativelink | ||
namespace: default | ||
postBuild: | ||
substituteFrom: | ||
- kind: ConfigMap | ||
name: nativelink-image-tags |
4 changes: 3 additions & 1 deletion
4
...es/components/operator/kustomization.yaml → ...mponents/kustomization/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
--- | ||
apiVersion: kustomize.config.k8s.io/v1alpha1 | ||
kind: Component | ||
|
||
resources: | ||
- flux-config.yaml | ||
- flux-kustomization.yaml |
Oops, something went wrong.