mirror of
https://github.com/docker/build-push-action.git
synced 2025-05-08 22:49:29 +02:00
*: teach action to hot load sticky disks
This change teaches the build push action to request a stickydisk every time it runs. Once the SD is hotloaded the VM will mount the buildkit root dir and starts buildkitd.
This commit is contained in:
parent
6f9ad79a61
commit
3b1df39d5d
8 changed files with 337 additions and 166 deletions
|
@ -1,11 +1,11 @@
|
|||
import * as core from '@actions/core';
|
||||
import * as handlebars from 'handlebars';
|
||||
|
||||
import {Build} from '@docker/actions-toolkit/lib/buildx/build';
|
||||
import {Context} from '@docker/actions-toolkit/lib/context';
|
||||
import {GitHub} from '@docker/actions-toolkit/lib/github';
|
||||
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
|
||||
import {Util} from '@docker/actions-toolkit/lib/util';
|
||||
import { Build } from '@docker/actions-toolkit/lib/buildx/build';
|
||||
import { Context } from '@docker/actions-toolkit/lib/context';
|
||||
import { GitHub } from '@docker/actions-toolkit/lib/github';
|
||||
import { Toolkit } from '@docker/actions-toolkit/lib/toolkit';
|
||||
import { Util } from '@docker/actions-toolkit/lib/util';
|
||||
import * as path from 'path';
|
||||
|
||||
export interface Inputs {
|
||||
|
@ -48,35 +48,35 @@ export async function getInputs(): Promise<Inputs> {
|
|||
return {
|
||||
'add-hosts': Util.getInputList('add-hosts'),
|
||||
allow: Util.getInputList('allow'),
|
||||
annotations: Util.getInputList('annotations', {ignoreComma: true}),
|
||||
attests: Util.getInputList('attests', {ignoreComma: true}),
|
||||
'build-args': Util.getInputList('build-args', {ignoreComma: true}),
|
||||
'build-contexts': Util.getInputList('build-contexts', {ignoreComma: true}),
|
||||
annotations: Util.getInputList('annotations', { ignoreComma: true }),
|
||||
attests: Util.getInputList('attests', { ignoreComma: true }),
|
||||
'build-args': Util.getInputList('build-args', { ignoreComma: true }),
|
||||
'build-contexts': Util.getInputList('build-contexts', { ignoreComma: true }),
|
||||
builder: core.getInput('builder'),
|
||||
'cache-from': Util.getInputList('cache-from', {ignoreComma: true}),
|
||||
'cache-to': Util.getInputList('cache-to', {ignoreComma: true}),
|
||||
'cache-from': Util.getInputList('cache-from', { ignoreComma: true }),
|
||||
'cache-to': Util.getInputList('cache-to', { ignoreComma: true }),
|
||||
'cgroup-parent': core.getInput('cgroup-parent'),
|
||||
context: core.getInput('context') || Context.gitContext(),
|
||||
file: core.getInput('file'),
|
||||
labels: Util.getInputList('labels', {ignoreComma: true}),
|
||||
labels: Util.getInputList('labels', { ignoreComma: true }),
|
||||
load: core.getBooleanInput('load'),
|
||||
network: core.getInput('network'),
|
||||
'no-cache': core.getBooleanInput('no-cache'),
|
||||
'no-cache-filters': Util.getInputList('no-cache-filters'),
|
||||
outputs: Util.getInputList('outputs', {ignoreComma: true, quote: false}),
|
||||
outputs: Util.getInputList('outputs', { ignoreComma: true, quote: false }),
|
||||
platforms: Util.getInputList('platforms'),
|
||||
provenance: Build.getProvenanceInput('provenance'),
|
||||
pull: core.getBooleanInput('pull'),
|
||||
push: core.getBooleanInput('push'),
|
||||
sbom: core.getInput('sbom'),
|
||||
secrets: Util.getInputList('secrets', {ignoreComma: true}),
|
||||
secrets: Util.getInputList('secrets', { ignoreComma: true }),
|
||||
'secret-envs': Util.getInputList('secret-envs'),
|
||||
'secret-files': Util.getInputList('secret-files', {ignoreComma: true}),
|
||||
'secret-files': Util.getInputList('secret-files', { ignoreComma: true }),
|
||||
'shm-size': core.getInput('shm-size'),
|
||||
ssh: Util.getInputList('ssh'),
|
||||
tags: Util.getInputList('tags'),
|
||||
target: core.getInput('target'),
|
||||
ulimit: Util.getInputList('ulimit', {ignoreComma: true}),
|
||||
ulimit: Util.getInputList('ulimit', { ignoreComma: true }),
|
||||
'github-token': core.getInput('github-token'),
|
||||
nofallback: core.getBooleanInput('nofallback')
|
||||
};
|
||||
|
@ -310,8 +310,6 @@ export const tlsRootCaCertificatePath = '/tmp/blacksmith_root_ca_certificate.pem
|
|||
|
||||
export async function getRemoteBuilderArgs(name: string, builderUrl: string): Promise<Array<string>> {
|
||||
const args: Array<string> = ['create', '--name', name, '--driver', 'remote'];
|
||||
// Add TLS paths as driver options
|
||||
args.push('--driver-opt', `key=${tlsClientKeyPath},cert=${tlsClientCaCertificatePath},cacert=${tlsRootCaCertificatePath}`);
|
||||
|
||||
// TODO(aayush): Instead of hardcoding the platform, we should fail the build if the platform is
|
||||
// unsupported.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue