Skip to content

Commit

Permalink
⬆️ Update nativelink commit (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmondal authored Nov 19, 2024
1 parent a8a26cc commit bf16e6a
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 86 deletions.
2 changes: 1 addition & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ build --remote_instance_name=main
try-import %workspace%/.bazelrc.ll

# Nix-generated flags for LRE.
try-import %workspace%/.bazelrc.lre
try-import %workspace%/lre.bazelrc

# Allow user-side customization.
try-import %workspace%/.bazelrc.user
Expand Down
45 changes: 7 additions & 38 deletions devtools/up.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let
nix = pkgs.nix;

# The specific commit to use
nativelinkCommit = "75105df746c626da76f74e412764e6755296a8ab";
nativelinkCommit = "481226be52a84ad5a6b990cc48e9f97512d8ccd2";

# Base URL for GitHub access
githubBaseUrl = "github:TraceMachina/nativelink/";
Expand All @@ -22,32 +22,19 @@ pkgs.writeShellScriptBin "up" ''
# Start the native service
${native}/bin/native up
# Wait for the gateway to be ready
${kubectl}/bin/kubectl wait --for=condition=Programmed --timeout=60s gateway eventlistener
# Allow an additional grace period for potential routes to set themselves up.
# TODO(aaronmondal): Find a better solution.
sleep 10
# Retrieve the event listener address
EVENTLISTENER=''$(${kubectl}/bin/kubectl get gtw eventlistener -o=jsonpath='{.status.addresses[0].value}')
# POST requests to the event listener
${curl}/bin/curl -v \
-H 'Content-Type: application/json' \
-d '{"flakeOutput": "${githubBaseUrl}${nativelinkCommit}#image"}' \
http://"''${EVENTLISTENER}":8080
${curl}/bin/curl -v \
-H 'Content-Type: application/json' \
-d '{"flakeOutput": "${githubBaseUrl}${nativelinkCommit}#nativelink-worker-lre-cc"}' \
http://"''${EVENTLISTENER}":8080
# Wait for the gateway to be ready
${kubectl}/bin/kubectl apply -k \
https://github.com/TraceMachina/nativelink//deploy/kubernetes-example?ref=${nativelinkCommit}
# Wait for PipelineRuns to start
until ${kubectl}/bin/kubectl get pipelinerun \
-l tekton.dev/pipeline=rebuild-nativelink | grep -q 'NAME'; do
echo "Waiting for PipelineRuns to start..."
sleep 0.1
sleep 1
done
# Wait for the pipeline to succeed
Expand All @@ -57,26 +44,8 @@ pkgs.writeShellScriptBin "up" ''
pipelinerun \
-l tekton.dev/pipeline=rebuild-nativelink
# Define kustomize directory and setup
KUSTOMIZE_DIR=''$(${git}/bin/git rev-parse --show-toplevel)
cat <<EOF > "''${KUSTOMIZE_DIR}"/kustomization.yaml
---
apiVersion: kustomize.config.k8s.io/v1beta1
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
EOF
# Use kustomize to set images
cd "''${KUSTOMIZE_DIR}" && ${kustomize}/bin/kustomize edit set image \
nativelink=localhost:5001/nativelink:"''$(${nix}/bin/nix eval ${githubBaseUrl}${nativelinkCommit}#image.imageTag --raw)" \
nativelink-worker-lre-cc=localhost:5001/nativelink-worker-lre-cc:"''$(${nix}/bin/nix eval ${githubBaseUrl}${nativelinkCommit}#nativelink-worker-lre-cc.imageTag --raw)"
# Apply the configuration
${kubectl}/bin/kubectl apply -k "''${KUSTOMIZE_DIR}"
# TODO(aaronmondal): Find a better solution.
sleep 10
# Monitor the deployment rollout
${kubectl}/bin/kubectl rollout status deploy/nativelink-cas
Expand Down
2 changes: 1 addition & 1 deletion examples/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ build --remote_instance_name=main
try-import %workspace%/../.bazelrc.ll

# Nix-generated flags for LRE.
try-import %workspace%/../.bazelrc.lre
try-import %workspace%/../lre.bazelrc

# Allow user-side customization.
try-import %workspace%/.bazelrc.user
4 changes: 2 additions & 2 deletions examples/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
inputs.flake-utils.follows = "flake-utils";
};
nativelink = {
url = "github:TraceMachina/nativelink/75105df746c626da76f74e412764e6755296a8ab";
url = "github:TraceMachina/nativelink/481226be52a84ad5a6b990cc48e9f97512d8ccd2";
inputs.flake-utils.follows = "flake-utils";
inputs.flake-parts.follows = "flake-parts";
inputs.pre-commit-hooks.follows = "pre-commit-hooks";
Expand Down Expand Up @@ -55,7 +55,7 @@
"x86_64-linux"
];
imports = [
inputs.nativelink.flakeModule
inputs.nativelink.flakeModule.local-remote-execution
inputs.rules_ll.flakeModule
];
perSystem =
Expand Down
69 changes: 30 additions & 39 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
};
nativelink = {
# Note: Keep this commit in sync with the LRE commit in `ll/init.bzl`.
url = "github:TraceMachina/nativelink/c42fd0d9f93b5f41f2df6d23d529ce40d1568c55";
url = "github:TraceMachina/nativelink/481226be52a84ad5a6b990cc48e9f97512d8ccd2";

# This repository provides the autogenerated LRE toolchains which are
# dependent on the nixpkgs version in the nativelink repository. To keep
Expand Down Expand Up @@ -56,7 +56,7 @@
];
imports = [
inputs.git-hooks.flakeModule
inputs.nativelink.flakeModule
inputs.nativelink.flakeModule.local-remote-execution
./flake-module.nix
];
perSystem =
Expand Down Expand Up @@ -123,6 +123,7 @@
pkgs.pulumi
pkgs.skopeo
pkgs.tektoncd-cli
pkgs.fluxcd
pkgs.kustomize
];
shellHook = ''
Expand Down
6 changes: 3 additions & 3 deletions ll/init.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ def _initialize_rules_ll_impl(_):
http_archive(
name = "local-remote-execution",
urls = [
"https://github.com/TraceMachina/nativelink/archive/c42fd0d9f93b5f41f2df6d23d529ce40d1568c55.zip",
"https://github.com/TraceMachina/nativelink/archive/481226be52a84ad5a6b990cc48e9f97512d8ccd2.zip",
],
integrity = "sha256-Mbj9ElJLpsgtESsLTOEFWNgmy3jqHBrb1IiH5PPctEs=",
integrity = "sha256-W65Ai9H1iuinfTVga/hvZegQGbSeLzqyEmrWXNOHpwE=",
# Note: Keep this in sync with `flake.nix` and `devtools/up.sh`.
strip_prefix = "nativelink-c42fd0d9f93b5f41f2df6d23d529ce40d1568c55/local-remote-execution",
strip_prefix = "nativelink-481226be52a84ad5a6b990cc48e9f97512d8ccd2/local-remote-execution",
)

http_archive(
Expand Down

0 comments on commit bf16e6a

Please sign in to comment.