Compare commits

...

22 Commits

Author SHA1 Message Date
Daniel Amar 00b2b44140
Merge 80d22c042f into 2c8bcdab54 2025-08-08 15:43:18 +09:00
CrazyMax 2c8bcdab54
Merge pull request #439 from crazy-max/fix-yarn-cfg
fix yarn config
2025-08-07 10:39:23 +02:00
CrazyMax 1051acaba6
fix yarn config
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-08-07 10:23:38 +02:00
CrazyMax e8cd182ec7
Merge pull request #438 from crazy-max/update-yarn
update yarn to 4.9.2
2025-08-07 10:22:33 +02:00
CrazyMax 8c5c87276d
update yarn to 4.9.2
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-08-07 10:20:28 +02:00
CrazyMax 90fa7ac870
Merge pull request #437 from crazy-max/update-dev-deps
update dev dependencies
2025-08-07 10:16:55 +02:00
CrazyMax 7ebadadf6b
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-08-07 10:15:01 +02:00
CrazyMax ee3eb2f3a4
update dev dependencies
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-08-07 10:10:07 +02:00
CrazyMax c65d441f38
Merge pull request #436 from docker/dependabot/npm_and_yarn/brace-expansion-1.1.12
build(deps): bump brace-expansion from 1.1.11 to 1.1.12
2025-08-06 18:16:03 +02:00
CrazyMax da183f8ca3
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-08-06 18:10:56 +02:00
dependabot[bot] f7a6c723e1
build(deps): bump brace-expansion from 1.1.11 to 1.1.12
Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) from 1.1.11 to 1.1.12.
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/1.1.11...v1.1.12)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 1.1.12
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-06 15:41:35 +00:00
CrazyMax 8424fa0070
Merge pull request #435 from docker/dependabot/npm_and_yarn/undici-5.29.0
build(deps): bump undici from 5.28.4 to 5.29.0
2025-08-06 17:39:23 +02:00
CrazyMax c52693d481
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-08-06 17:36:57 +02:00
dependabot[bot] 5efa6e34fd
build(deps): bump undici from 5.28.4 to 5.29.0
Bumps [undici](https://github.com/nodejs/undici) from 5.28.4 to 5.29.0.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.28.4...v5.29.0)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 5.29.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-06 15:16:14 +00:00
CrazyMax 774224adf6
Merge pull request #434 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.63.0
build(deps): bump @docker/actions-toolkit from 0.62.1 to 0.63.0
2025-08-06 14:53:17 +02:00
CrazyMax 5d221e8956
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-08-06 14:49:38 +02:00
dependabot[bot] 68163b97ca
build(deps): bump @docker/actions-toolkit from 0.62.1 to 0.63.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.62.1 to 0.63.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.62.1...v0.63.0)

---
updated-dependencies:
- dependency-name: "@docker/actions-toolkit"
  dependency-version: 0.63.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-06 12:11:23 +00:00
CrazyMax ae7d6893e8
Merge pull request #432 from docker/dependabot/npm_and_yarn/form-data-2.5.5
build(deps): bump form-data from 2.5.1 to 2.5.5
2025-08-05 18:32:27 +02:00
dependabot[bot] ac3a803dd3
build(deps): bump form-data from 2.5.1 to 2.5.5
Bumps [form-data](https://github.com/form-data/form-data) from 2.5.1 to 2.5.5.
- [Release notes](https://github.com/form-data/form-data/releases)
- [Changelog](https://github.com/form-data/form-data/blob/v2.5.5/CHANGELOG.md)
- [Commits](https://github.com/form-data/form-data/compare/v2.5.1...v2.5.5)

---
updated-dependencies:
- dependency-name: form-data
  dependency-version: 2.5.5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-21 23:14:41 +00:00
Daniel Amar 80d22c042f
remove retry only on certain errors. maxRetries set to 3 instead of 5. 2025-05-27 13:53:26 -04:00
Daniel Amar 66d7daabf8
Add timeout control to prevent long waits during buildkit initialization
Signed-off-by: Daniel Amar <daniel.amar@onepeloton.com>
2025-05-05 17:09:29 -04:00
Daniel Amar bc3c5abd64
Add retry mechanism with exponential backoff for buildkit bootstrap
Signed-off-by: Daniel Amar <daniel.amar@onepeloton.com>
2025-05-05 17:09:29 -04:00
8 changed files with 2518 additions and 2737 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,9 @@
# https://yarnpkg.com/configuration/yarnrc
compressionLevel: mixed
enableGlobalCache: false
enableHardenedMode: true
logFilters:
- code: YN0013
level: discard
@ -5,9 +11,7 @@ logFilters:
level: discard
- code: YN0076
level: discard
- code: YN0086
level: discard
nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"

42
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

2
dist/sourcemap-register.js generated vendored

File diff suppressed because one or more lines are too long

View File

@ -23,27 +23,27 @@
],
"author": "Docker Inc.",
"license": "Apache-2.0",
"packageManager": "yarn@3.6.3",
"packageManager": "yarn@4.9.2",
"dependencies": {
"@actions/core": "^1.11.1",
"@docker/actions-toolkit": "^0.62.1",
"@docker/actions-toolkit": "^0.63.0",
"js-yaml": "^4.1.0"
},
"devDependencies": {
"@types/js-yaml": "^4.0.9",
"@types/node": "^20.12.12",
"@types/node": "^20.19.9",
"@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^7.9.0",
"@typescript-eslint/parser": "^7.9.0",
"@vercel/ncc": "^0.38.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^28.5.0",
"eslint-plugin-prettier": "^5.1.3",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"@vercel/ncc": "^0.38.3",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.2",
"eslint-plugin-jest": "^28.14.0",
"eslint-plugin-prettier": "^5.5.4",
"jest": "^29.7.0",
"prettier": "^3.2.5",
"ts-jest": "^29.1.2",
"prettier": "^3.6.2",
"ts-jest": "^29.4.1",
"ts-node": "^10.9.2",
"typescript": "^5.4.5"
"typescript": "^5.9.2"
}
}

View File

@ -17,6 +17,37 @@ import {ContextInfo} from '@docker/actions-toolkit/lib/types/docker/docker';
import * as context from './context';
import * as stateHelper from './state-helper';
/**
* Retry a function with exponential backoff
*/
async function retryWithBackoff<T>(
operation: () => Promise<T>,
maxRetries: number = 3,
initialDelay: number = 1000,
maxDelay: number = 10000,
shouldRetry: (error: Error) => boolean = () => true
): Promise<T> {
let retries = 0;
let delay = initialDelay;
while (true) {
try {
return await operation();
} catch (error) {
if (retries >= maxRetries || !shouldRetry(error)) {
throw error;
}
retries++;
core.info(`Retry ${retries}/${maxRetries} after ${delay}ms due to: ${error.message}`);
await new Promise(resolve => setTimeout(resolve, delay));
// Exponential backoff with jitter
delay = Math.min(delay * 2, maxDelay) * (0.8 + Math.random() * 0.4);
}
}
}
actionsToolkit.run(
// main
async () => {
@ -175,13 +206,40 @@ actionsToolkit.run(
await core.group(`Booting builder`, async () => {
const inspectCmd = await toolkit.buildx.getCommand(await context.getInspectArgs(inputs, toolkit));
await Exec.getExecOutput(inspectCmd.command, inspectCmd.args, {
ignoreReturnCode: true
}).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
throw new Error(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error');
}
});
try {
await retryWithBackoff(
async () => {
// Create a promise that will timeout after 15 seconds
const timeoutPromise = new Promise<never>((_, reject) => {
setTimeout(() => {
reject(new Error('Timeout exceeded while waiting for buildkit to initialize'));
}, 15000); // 15 second timeout
});
// Create the actual command execution promise
const execPromise = Exec.getExecOutput(inspectCmd.command, inspectCmd.args, {
ignoreReturnCode: true
}).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
throw new Error(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error');
}
return res;
});
// Race the timeout against the actual command
// If the command takes too long, we'll get the timeout error instead
return Promise.race([execPromise, timeoutPromise]);
},
3, // maxRetries - retry up to 3 times for buildkit initialization
1000, // initialDelay - start with 1 second
15000 // maxDelay - cap at 15 seconds
);
} catch (error) {
// Log the warning but continue - this matches current behavior where builds still succeed
core.warning(`Failed to bootstrap builder after multiple retries: ${error.message}`);
core.warning('Continuing execution as buildkit daemon may initialize later');
}
});
if (inputs.install) {

4558
yarn.lock

File diff suppressed because it is too large Load Diff