From 9bb1824d279755ee5435b66c760d601dbe130dc5 Mon Sep 17 00:00:00 2001 From: Samuel Ainsworth Date: Thu, 2 Nov 2023 17:04:45 -0700 Subject: [PATCH] add easimon/maximize-build-space See https://github.com/NixOS/nixpkgs/issues/264499#issuecomment-1787288620 for context. --- .github/workflows/upkeep.yml | 175 +++++++++++++++++++++++++++++++++++ upkeep.dhall | 90 +++++++++++------- 2 files changed, 230 insertions(+), 35 deletions(-) diff --git a/.github/workflows/upkeep.yml b/.github/workflows/upkeep.yml index 0e8e75d..8476e67 100644 --- a/.github/workflows/upkeep.yml +++ b/.github/workflows/upkeep.yml @@ -3,6 +3,13 @@ jobs: augmax: runs-on: ubuntu-latest steps: + - uses: "easimon/maximize-build-space@master" + with: + remove-android: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + remove-dotnet: 'true' + remove-haskell: 'true' - run: lscpu - uses: "cachix/install-nix-action@v22" with: @@ -47,6 +54,13 @@ jobs: einops: runs-on: ubuntu-latest steps: + - uses: "easimon/maximize-build-space@master" + with: + remove-android: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + remove-dotnet: 'true' + remove-haskell: 'true' - run: lscpu - uses: "cachix/install-nix-action@v22" with: @@ -91,6 +105,13 @@ jobs: flax: runs-on: ubuntu-latest steps: + - uses: "easimon/maximize-build-space@master" + with: + remove-android: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + remove-dotnet: 'true' + remove-haskell: 'true' - run: lscpu - uses: "cachix/install-nix-action@v22" with: @@ -135,6 +156,13 @@ jobs: ipython: runs-on: ubuntu-latest steps: + - uses: "easimon/maximize-build-space@master" + with: + remove-android: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + remove-dotnet: 'true' + remove-haskell: 'true' - run: lscpu - uses: "cachix/install-nix-action@v22" with: @@ -179,6 +207,13 @@ jobs: jax: runs-on: ubuntu-latest steps: + - uses: "easimon/maximize-build-space@master" + with: + remove-android: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + remove-dotnet: 'true' + remove-haskell: 'true' - run: lscpu - uses: "cachix/install-nix-action@v22" with: @@ -223,6 +258,13 @@ jobs: jaxlib: runs-on: ubuntu-latest steps: + - uses: "easimon/maximize-build-space@master" + with: + remove-android: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + remove-dotnet: 'true' + remove-haskell: 'true' - run: lscpu - uses: "cachix/install-nix-action@v22" with: @@ -267,6 +309,13 @@ jobs: jaxlib-bin: runs-on: ubuntu-latest steps: + - uses: "easimon/maximize-build-space@master" + with: + remove-android: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + remove-dotnet: 'true' + remove-haskell: 'true' - run: lscpu - uses: "cachix/install-nix-action@v22" with: @@ -311,6 +360,13 @@ jobs: jaxlibWithCuda: runs-on: ubuntu-latest steps: + - uses: "easimon/maximize-build-space@master" + with: + remove-android: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + remove-dotnet: 'true' + remove-haskell: 'true' - run: lscpu - uses: "cachix/install-nix-action@v22" with: @@ -355,6 +411,13 @@ jobs: matplotlib: runs-on: ubuntu-latest steps: + - uses: "easimon/maximize-build-space@master" + with: + remove-android: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + remove-dotnet: 'true' + remove-haskell: 'true' - run: lscpu - uses: "cachix/install-nix-action@v22" with: @@ -399,6 +462,13 @@ jobs: optax: runs-on: ubuntu-latest steps: + - uses: "easimon/maximize-build-space@master" + with: + remove-android: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + remove-dotnet: 'true' + remove-haskell: 'true' - run: lscpu - uses: "cachix/install-nix-action@v22" with: @@ -443,6 +513,13 @@ jobs: pandas: runs-on: ubuntu-latest steps: + - uses: "easimon/maximize-build-space@master" + with: + remove-android: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + remove-dotnet: 'true' + remove-haskell: 'true' - run: lscpu - uses: "cachix/install-nix-action@v22" with: @@ -487,6 +564,13 @@ jobs: plexamp: runs-on: ubuntu-latest steps: + - uses: "easimon/maximize-build-space@master" + with: + remove-android: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + remove-dotnet: 'true' + remove-haskell: 'true' - run: lscpu - uses: "cachix/install-nix-action@v22" with: @@ -537,6 +621,13 @@ jobs: plotly: runs-on: ubuntu-latest steps: + - uses: "easimon/maximize-build-space@master" + with: + remove-android: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + remove-dotnet: 'true' + remove-haskell: 'true' - run: lscpu - uses: "cachix/install-nix-action@v22" with: @@ -581,6 +672,13 @@ jobs: spotify: runs-on: ubuntu-latest steps: + - uses: "easimon/maximize-build-space@master" + with: + remove-android: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + remove-dotnet: 'true' + remove-haskell: 'true' - run: lscpu - uses: "cachix/install-nix-action@v22" with: @@ -642,6 +740,13 @@ jobs: tensorflow: runs-on: ubuntu-latest steps: + - uses: "easimon/maximize-build-space@master" + with: + remove-android: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + remove-dotnet: 'true' + remove-haskell: 'true' - run: lscpu - uses: "cachix/install-nix-action@v22" with: @@ -686,6 +791,13 @@ jobs: tensorflow-bin: runs-on: ubuntu-latest steps: + - uses: "easimon/maximize-build-space@master" + with: + remove-android: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + remove-dotnet: 'true' + remove-haskell: 'true' - run: lscpu - uses: "cachix/install-nix-action@v22" with: @@ -730,6 +842,13 @@ jobs: tensorflow-datasets: runs-on: ubuntu-latest steps: + - uses: "easimon/maximize-build-space@master" + with: + remove-android: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + remove-dotnet: 'true' + remove-haskell: 'true' - run: lscpu - uses: "cachix/install-nix-action@v22" with: @@ -774,6 +893,13 @@ jobs: torch: runs-on: ubuntu-latest steps: + - uses: "easimon/maximize-build-space@master" + with: + remove-android: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + remove-dotnet: 'true' + remove-haskell: 'true' - run: lscpu - uses: "cachix/install-nix-action@v22" with: @@ -818,6 +944,13 @@ jobs: torch-bin: runs-on: ubuntu-latest steps: + - uses: "easimon/maximize-build-space@master" + with: + remove-android: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + remove-dotnet: 'true' + remove-haskell: 'true' - run: lscpu - uses: "cachix/install-nix-action@v22" with: @@ -862,6 +995,13 @@ jobs: torchvision: runs-on: ubuntu-latest steps: + - uses: "easimon/maximize-build-space@master" + with: + remove-android: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + remove-dotnet: 'true' + remove-haskell: 'true' - run: lscpu - uses: "cachix/install-nix-action@v22" with: @@ -906,6 +1046,13 @@ jobs: tqdm: runs-on: ubuntu-latest steps: + - uses: "easimon/maximize-build-space@master" + with: + remove-android: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + remove-dotnet: 'true' + remove-haskell: 'true' - run: lscpu - uses: "cachix/install-nix-action@v22" with: @@ -950,6 +1097,13 @@ jobs: vscode: runs-on: ubuntu-latest steps: + - uses: "easimon/maximize-build-space@master" + with: + remove-android: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + remove-dotnet: 'true' + remove-haskell: 'true' - run: lscpu - uses: "cachix/install-nix-action@v22" with: @@ -1001,6 +1155,13 @@ jobs: vscodium: runs-on: ubuntu-latest steps: + - uses: "easimon/maximize-build-space@master" + with: + remove-android: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + remove-dotnet: 'true' + remove-haskell: 'true' - run: lscpu - uses: "cachix/install-nix-action@v22" with: @@ -1052,6 +1213,13 @@ jobs: wandb: runs-on: ubuntu-latest steps: + - uses: "easimon/maximize-build-space@master" + with: + remove-android: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + remove-dotnet: 'true' + remove-haskell: 'true' - run: lscpu - uses: "cachix/install-nix-action@v22" with: @@ -1114,6 +1282,13 @@ jobs: yapf: runs-on: ubuntu-latest steps: + - uses: "easimon/maximize-build-space@master" + with: + remove-android: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + remove-dotnet: 'true' + remove-haskell: 'true' - run: lscpu - uses: "cachix/install-nix-action@v22" with: diff --git a/upkeep.dhall b/upkeep.dhall index e190576..34929ce 100644 --- a/upkeep.dhall +++ b/upkeep.dhall @@ -1,23 +1,16 @@ let WithClause = - { Type = - { extra_nix_config : Optional Text - , nix_path : Optional Text - , path : Optional Text - , repository : Optional Text - , token : Optional Text - , name : Optional Text - , authToken : Optional Text + < InstallNix : { extra_nix_config : Text, nix_path : Text } + | Cachix : { name : Text, authToken : Text } + | Checkout : + { path : Text, repository : Optional Text, token : Optional Text } + | MaximizeBuildSpace : + { remove-dotnet : Text + , remove-android : Text + , remove-haskell : Text + , remove-codeql : Text + , remove-docker-images : Text } - , default = - { extra_nix_config = None Text - , nix_path = None Text - , path = None Text - , repository = None Text - , token = None Text - , name = None Text - , authToken = None Text - } - } + > let Step = { Type = @@ -25,7 +18,7 @@ let Step = , name : Optional Text , run : Optional Text , uses : Optional Text - , `with` : Optional WithClause.Type + , `with` : Optional WithClause , working-directory : Optional Text } , default = @@ -33,7 +26,7 @@ let Step = , name = None Text , run = None Text , uses = None Text - , `with` = None WithClause.Type + , `with` = None WithClause , working-directory = None Text } } @@ -41,10 +34,12 @@ let Step = let installNix = Step::{ , uses = Some "cachix/install-nix-action@v22" - , `with` = Some WithClause::{ - , extra_nix_config = Some "experimental-features = nix-command flakes" - , nix_path = Some "nixpkgs=channel:nixos-unstable" - } + , `with` = Some + ( WithClause.InstallNix + { extra_nix_config = "experimental-features = nix-command flakes" + , nix_path = "nixpkgs=channel:nixos-unstable" + } + ) } let nixInfo = @@ -57,18 +52,26 @@ let checkoutNixpkgsUpkeep = Step::{ , name = Some "Checkout nixpkgs-upkeep" , uses = Some "actions/checkout@v3" - , `with` = Some WithClause::{ path = Some "nixpkgs-upkeep" } + , `with` = Some + ( WithClause.Checkout + { path = "nixpkgs-upkeep" + , token = None Text + , repository = None Text + } + ) } let checkoutNixpkgs = Step::{ , name = Some "Checkout nixpkgs" , uses = Some "actions/checkout@v3" - , `with` = Some WithClause::{ - , path = Some "nixpkgs" - , repository = Some "NixOS/nixpkgs" - , token = Some "\${{ secrets.GH_TOKEN }}" - } + , `with` = Some + ( WithClause.Checkout + { path = "nixpkgs" + , repository = Some "NixOS/nixpkgs" + , token = Some "\${{ secrets.GH_TOKEN }}" + } + ) } let checkVersion = @@ -127,14 +130,31 @@ let Job = let cachix = Step::{ , uses = Some "cachix/cachix-action@v12" - , `with` = Some WithClause::{ - , name = Some "ploop" - , authToken = Some "\${{ secrets.CACHIX_AUTH_TOKEN }}" - } + , `with` = Some + ( WithClause.Cachix + { name = "ploop" + , authToken = "\${{ secrets.CACHIX_AUTH_TOKEN }}" + } + ) + } + +let maximize-build-space = + Step::{ + , uses = Some "easimon/maximize-build-space@master" + , `with` = Some + ( WithClause.MaximizeBuildSpace + { remove-dotnet = "true" + , remove-android = "true" + , remove-haskell = "true" + , remove-codeql = "true" + , remove-docker-images = "true" + } + ) } let intro = - [ Step::{ run = Some "lscpu" } + [ maximize-build-space + , Step::{ run = Some "lscpu" } , installNix , nixInfo , cachix