Skip to content

Commit

Permalink
Harden CI against too long running jobs (TraceMachina#917)
Browse files Browse the repository at this point in the history
The Nix flake update in 8a63295 pinned `nixpkgs` to a commit where
`pkgs.clang` wasn't in the global Nix cache for MacOS. This caused
subsequent jobs to build Clang in CI, making those jobs run for several
hours.

We can't really predict whether packages are in the Nix store and
usually this isn't an issue. One potential explanation for Clang not
being in the global Nix store could be that a recent GHA incident caused
the global Nix cache to not be properly updated for a while.

This commit introduces timouts to all jobs to prevent this from
happening in the future. In other words, we'll now kill jobs if they
take too long to run in an attempt to keep build times reasonably low.
  • Loading branch information
aaronmondal authored May 15, 2024
1 parent f9e67aa commit ba7ed50
Show file tree
Hide file tree
Showing 19 changed files with 1,296 additions and 1,321 deletions.
1 change: 1 addition & 0 deletions .github/workflows/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
packages: write
id-token: write
security-events: write
timeout-minutes: 30
steps:

- name: Checkout
Expand Down
36 changes: 0 additions & 36 deletions .github/workflows/issues-notion-sync.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/lre.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
os: [ubuntu-22.04]
name: Local / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 45
steps:

- name: Checkout
Expand Down Expand Up @@ -46,6 +47,7 @@ jobs:
os: [large-ubuntu-22.04]
name: Remote / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 45
steps:
- name: Checkout
uses: >- # v4.1.1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/native-bazel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
os: [ubuntu-22.04, macos-13]
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:

- name: Checkout
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/native-cargo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
toolchain: [stable]
name: ${{ matrix.os }} / ${{ matrix.toolchain }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:

- name: Checkout
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/nix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
os: [ubuntu-22.04]
name: Bazel Dev / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 45
steps:

- name: Checkout
Expand Down Expand Up @@ -61,6 +62,7 @@ jobs:
os: [ubuntu-22.04, macos-13]
name: Cargo Dev / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 45
steps:
- name: Checkout
uses: >- # v4.1.1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ permissions: read-all
jobs:
pre-commit-checks:
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- name: Checkout
uses: >- # v4.1.1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sanitizers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
sanitizer: [asan]
name: ${{ matrix.sanitizer }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- uses: >- # v4.1.1
actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
permissions:
security-events: write
id-token: write

timeout-minutes: 5
steps:
- name: Checkout
uses: >- # v4.1.1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tagged_image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
permissions:
packages: write
id-token: write
timeout-minutes: 60
steps:

- name: Checkout
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/vale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
vale:
name: vale
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- name: Checkout
uses: >- # v4.1.1
Expand Down
18 changes: 9 additions & 9 deletions flake.lock

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

26 changes: 13 additions & 13 deletions local-remote-execution/generated-cc/cc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,18 @@ cc_toolchain_config(
coverage_link_flags = ["--coverage"],
cpu = "k8",
cxx_builtin_include_directories = [
"/nix/store/5l81qhzm4qhh5wici7r0vf2x9fk75a1b-clang-wrapper-18.1.5/resource-root/include",
"/nix/store/vqbgiwjvjbgypsfwgpdc78asxvx13lsm-clang-wrapper-18.1.5/resource-root/include",
"/nix/store/s3pvsv4as7mc8i2nwnk2hnsyi2qdj4bq-glibc-2.39-31-dev/include",
"/nix/store/5l81qhzm4qhh5wici7r0vf2x9fk75a1b-clang-wrapper-18.1.5/resource-root/share",
"/nix/store/ksrd9cylx4c47bbrk26rvj0054flm336-libcxx-18.1.5-dev/include/c++/v1",
"/nix/store/vqbgiwjvjbgypsfwgpdc78asxvx13lsm-clang-wrapper-18.1.5/resource-root/share",
"/nix/store/csml9b5w7z51yc7hxgd2ax4m6vj36iyq-libcxx-18.1.5-dev/include/c++/v1",
"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk",
],
cxx_flags = ["-std=c++14"],
dbg_compile_flags = ["-g"],
host_system_name = "x86_64-unknown-linux-gnu",
link_flags = [
"-fuse-ld=/nix/store/5l81qhzm4qhh5wici7r0vf2x9fk75a1b-clang-wrapper-18.1.5/bin/ld.mold",
"-B/nix/store/f6k90ipwgpiwh3dzbb3549nhsx28hc9g-customClang/bin",
"-fuse-ld=/nix/store/vqbgiwjvjbgypsfwgpdc78asxvx13lsm-clang-wrapper-18.1.5/bin/ld.mold",
"-B/nix/store/6fr9bp9drswk1azlcby44c97l9xiifbm-customClang/bin",
"-Wl,-no-as-needed",
"-Wl,-z,relro,-z,now",
],
Expand All @@ -147,18 +147,18 @@ cc_toolchain_config(
target_libc = "glibc_2.35",
target_system_name = "local",
tool_paths = {
"ar": "/nix/store/njz8bg77vy7jk3aq6bdnarcn6ilw4jjc-binutils-wrapper-2.41/bin/ar",
"ld": "/nix/store/njz8bg77vy7jk3aq6bdnarcn6ilw4jjc-binutils-wrapper-2.41/bin/ld",
"ar": "/nix/store/bmmczrsfycv4rradx0cy95vw0fwx9sm7-binutils-wrapper-2.41/bin/ar",
"ld": "/nix/store/bmmczrsfycv4rradx0cy95vw0fwx9sm7-binutils-wrapper-2.41/bin/ld",
"llvm-cov": "None",
"llvm-profdata": "None",
"cpp": "/usr/bin/cpp",
"gcc": "/nix/store/f6k90ipwgpiwh3dzbb3549nhsx28hc9g-customClang/bin/customClang",
"dwp": "/nix/store/njz8bg77vy7jk3aq6bdnarcn6ilw4jjc-binutils-wrapper-2.41/bin/dwp",
"gcc": "/nix/store/6fr9bp9drswk1azlcby44c97l9xiifbm-customClang/bin/customClang",
"dwp": "/nix/store/bmmczrsfycv4rradx0cy95vw0fwx9sm7-binutils-wrapper-2.41/bin/dwp",
"gcov": "None",
"nm": "/nix/store/njz8bg77vy7jk3aq6bdnarcn6ilw4jjc-binutils-wrapper-2.41/bin/nm",
"objcopy": "/nix/store/njz8bg77vy7jk3aq6bdnarcn6ilw4jjc-binutils-wrapper-2.41/bin/objcopy",
"objdump": "/nix/store/njz8bg77vy7jk3aq6bdnarcn6ilw4jjc-binutils-wrapper-2.41/bin/objdump",
"strip": "/nix/store/njz8bg77vy7jk3aq6bdnarcn6ilw4jjc-binutils-wrapper-2.41/bin/strip",
"nm": "/nix/store/bmmczrsfycv4rradx0cy95vw0fwx9sm7-binutils-wrapper-2.41/bin/nm",
"objcopy": "/nix/store/bmmczrsfycv4rradx0cy95vw0fwx9sm7-binutils-wrapper-2.41/bin/objcopy",
"objdump": "/nix/store/bmmczrsfycv4rradx0cy95vw0fwx9sm7-binutils-wrapper-2.41/bin/objdump",
"strip": "/nix/store/bmmczrsfycv4rradx0cy95vw0fwx9sm7-binutils-wrapper-2.41/bin/strip",
},
toolchain_identifier = "local",
unfiltered_compile_flags = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
This file is generated by cc_configure and contains builtin include directories
that /nix/store/f6k90ipwgpiwh3dzbb3549nhsx28hc9g-customClang/bin/customClang reported. This file is a dependency of every compilation action and
that /nix/store/6fr9bp9drswk1azlcby44c97l9xiifbm-customClang/bin/customClang reported. This file is a dependency of every compilation action and
changes to it will be reflected in the action cache key. When some of these
paths change, Bazel will make sure to rerun the action, even though none of
declared action inputs or the action commandline changes.

/nix/store/5l81qhzm4qhh5wici7r0vf2x9fk75a1b-clang-wrapper-18.1.5/resource-root/include
/nix/store/vqbgiwjvjbgypsfwgpdc78asxvx13lsm-clang-wrapper-18.1.5/resource-root/include
/nix/store/s3pvsv4as7mc8i2nwnk2hnsyi2qdj4bq-glibc-2.39-31-dev/include
/nix/store/5l81qhzm4qhh5wici7r0vf2x9fk75a1b-clang-wrapper-18.1.5/resource-root/share
/nix/store/ksrd9cylx4c47bbrk26rvj0054flm336-libcxx-18.1.5-dev/include/c++/v1
/nix/store/vqbgiwjvjbgypsfwgpdc78asxvx13lsm-clang-wrapper-18.1.5/resource-root/share
/nix/store/csml9b5w7z51yc7hxgd2ax4m6vj36iyq-libcxx-18.1.5-dev/include/c++/v1
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
4 changes: 2 additions & 2 deletions local-remote-execution/generated-cc/cc/cc_wrapper.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/nix/store/2vpxpm9jrrrh14wbqgd1x89m3i376s5b-bash/bin/bash
#!/nix/store/2qcpw337ayl2fgx0yylcb70gyr4751ri-bash/bin/bash
#
# Copyright 2015 The Bazel Authors. All rights reserved.
#
Expand All @@ -22,4 +22,4 @@ set -eu


# Call the C++ compiler
/nix/store/f6k90ipwgpiwh3dzbb3549nhsx28hc9g-customClang/bin/customClang "$@"
/nix/store/6fr9bp9drswk1azlcby44c97l9xiifbm-customClang/bin/customClang "$@"
Loading

0 comments on commit ba7ed50

Please sign in to comment.