Skip to content

Commit

Permalink
Add option for freeing disk space to sdk build and bridge upgrade (#1057
Browse files Browse the repository at this point in the history
)

Some of the workflows on larger providers like aws started failing
because they're running out of disk space (again.. sigh). Examples are:
- pulumi/pulumi-aws#4379
-
https://github.com/pulumi/pulumi-aws/actions/runs/10421649189/job/28864324845

This change adds a new configuration parameter
(`freeDiskSpaceBeforeSdkBuild`) to free the disk space before SDK
builds. Additionally it also adds the disk space cleaning to the
upgrade-bridge workflow.

We should also explore using bigger runners, but this might be cost
prohibitive (AWS alone had ~1.1k build hours within the last month,
which would amount to ~1k$ for a larger runner).
  • Loading branch information
flostadler authored Aug 19, 2024
1 parent 3c0d512 commit cb25dbd
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ freeDiskSpaceBeforeBuild: false
# Set to true to clear disk space before running test jobs.
freeDiskSpaceBeforeTest: false

# Set to true to clear disk space before running sdk build jobs.
freeDiskSpaceBeforeSdkBuild: false

# Used for centrally managing tool versions.
# This is not currently overridden by any providers: https://github.com/search?q=org%3Apulumi+path%3A.ci-mgmt.yaml+%22toolVersions%22&type=code
toolVersions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ jobs:
- go
- java
steps:
#{{- if .Config.freeDiskSpaceBeforeSdkBuild }}#
# Run as first step so we don't delete things that have just been installed
- name: Free Disk Space (Ubuntu)
uses: #{{ .Config.actionVersions.freeDiskSpace }}#
with:
tool-cache: false
swap-storage: false
#{{- end }}#
- name: Checkout Repo
uses: #{{ .Config.actionVersions.checkout }}#
#{{- if .Config.checkoutSubmodules }}#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ jobs:
name: upgrade-provider
runs-on: #{{ if .Config.runner.buildSdk }}##{{- .Config.runner.buildSdk }}##{{ else }}##{{- .Config.runner.default }}##{{ end }}#
steps:
#{{- if .Config.freeDiskSpaceBeforeBuild }}#
# Run as first step so we don't delete things that have just been installed
- name: Free Disk Space (Ubuntu)
uses: #{{ .Config.actionVersions.freeDiskSpace }}#
with:
tool-cache: false
swap-storage: false
#{{- end }}#
- name: Call upgrade provider action
if: github.event_name == 'workflow_dispatch'
uses: #{{ .Config.actionVersions.upgradeProviderAction }}#
Expand Down
1 change: 1 addition & 0 deletions provider-ci/test-providers/aws/.ci-mgmt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ env:
makeTemplate: bridged
checkoutSubmodules: true
freeDiskSpaceBeforeBuild: true
freeDiskSpaceBeforeSdkBuild: true
freeDiskSpaceBeforeTest: true
# TODO: remove XrunUpstreamTools flag after work to add docs replacement strategies to resources.go is completed
# Tracked in in https://github.com/pulumi/pulumi-aws/issues/2757
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ jobs:
- go
- java
steps:
# Run as first step so we don't delete things that have just been installed
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
with:
tool-cache: false
swap-storage: false
- name: Checkout Repo
uses: actions/checkout@v4
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ jobs:
name: upgrade-provider
runs-on: ubuntu-latest
steps:
# Run as first step so we don't delete things that have just been installed
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
with:
tool-cache: false
swap-storage: false
- name: Call upgrade provider action
if: github.event_name == 'workflow_dispatch'
uses: pulumi/pulumi-upgrade-provider-action@v0.0.12
Expand Down

0 comments on commit cb25dbd

Please sign in to comment.