Skip to content

Commit 1c0ae65

Browse files
authored
feat!: allow specifying the parallelism limit for buildkit (#41)
1 parent 5a599cf commit 1c0ae65

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ on:
1919
description: 'The service name to build'
2020
required: true
2121
type: string
22-
ENABLE_LIMIT_BUILDKIT_PARALLELISM:
22+
BUILDKIT_MAX_PARALLELISM:
2323
description: 'Enable buildkit parallelism limit to decrease resource usage. Default is true'
2424
required: false
25-
type: boolean
26-
default: true
25+
type: number
26+
default: 0
2727
RUNNER_WORKFLOW_LABEL:
2828
description: 'The label of the runner workflow to run'
2929
required: false
@@ -131,10 +131,10 @@ jobs:
131131
tutor picasso run-extra-commands
132132
133133
- name: Limit build parallelism to decrease resource usage
134-
if: ${{ inputs.ENABLE_LIMIT_BUILDKIT_PARALLELISM }}
134+
if: ${{ inputs.BUILDKIT_MAX_PARALLELISM }}
135135
run: |
136136
echo "[worker.oci]
137-
max-parallelism = 3" > buildkit.toml
137+
max-parallelism = ${{ inputs.BUILDKIT_MAX_PARALLELISM }}" > buildkit.toml
138138
docker buildx create --use --node=limitparallelsteps --driver=docker-container --config=./buildkit.toml
139139
140140
- name: Configure AWS credentials

README.rst

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ Before using the workflow, ensure that you have set up the following configurati
8484
- The service name to build, e.g., ``openedx``. This can be any service recognized by the tutor ecosystem.
8585
- string
8686
- Input
87-
* - ENABLE_LIMIT_BUILDKIT_PARALLELISM (Optional)
88-
- Enables limiting parallelism with buildkit to decrease resource consumption for those setups with low-powered machines. Default is ``true``.
89-
- boolean
87+
* - BUILDKIT_MAX_PARALLELISM (Optional)
88+
- Configure the maximum parallelism for your builds. Default is ``0`` (no limit).
89+
- number
9090
- Input
9191
* - RUNNER_WORKFLOW_LABEL (Optional)
9292
- The label of the runner workflow to use. Default is ``ubuntu-24.04``.
@@ -128,6 +128,18 @@ To use the Picasso Workflow, follow these steps:
128128

129129
3. You can also set up a custom trigger for the workflow based on your project requirements.
130130

131+
..
132+
133+
**Note**
134+
135+
When attempting to build an MFE image it might be possible to exhaust the resources
136+
on the GitHub runner. You can specify a lower value of ``BUILDKIT_MAX_PARALLELISM``
137+
to reduce the amount of resources used, if that isn't enough you can use a
138+
different runner (e.g. a hosted `large runner`_) via the
139+
``RUNNER_WORKFLOW_LABEL`` input.
140+
141+
.. _large runner: https://docs.github.com/en/actions/using-github-hosted-runners/using-larger-runners
142+
131143
Getting Help
132144
************
133145

0 commit comments

Comments
 (0)