mirror of
				https://github.com/docker/build-push-action.git
				synced 2025-11-04 00:10:55 +00:00 
			
		
		
		
	src: disable native multi-arch builds
This commit is contained in:
		
					parent
					
						
							
								aa05aa4d9f
							
						
					
				
			
			
				commit
				
					
						6fd13769ac
					
				
			
		
					 3 changed files with 6 additions and 10 deletions
				
			
		
							
								
								
									
										2
									
								
								dist/index.js
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/index.js
									
										
									
										generated
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										2
									
								
								dist/index.js.map
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/index.js.map
									
										
									
										generated
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| 
						 | 
					@ -225,10 +225,11 @@ const buildkitdTimeoutMs = 30000;
 | 
				
			||||||
export async function startAndConfigureBuildkitd(parallelism: number, platforms?: string[]): Promise<string> {
 | 
					export async function startAndConfigureBuildkitd(parallelism: number, platforms?: string[]): Promise<string> {
 | 
				
			||||||
  // For multi-platform builds, we need to use the tailscale IP
 | 
					  // For multi-platform builds, we need to use the tailscale IP
 | 
				
			||||||
  let buildkitdAddr = BUILDKIT_DAEMON_ADDR;
 | 
					  let buildkitdAddr = BUILDKIT_DAEMON_ADDR;
 | 
				
			||||||
 | 
					  const nativeMultiPlatformBuildsEnabled = false && (platforms?.length ?? 0 > 1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // If we are doing a multi-platform build, we need to join the tailnet and bind buildkitd to the tailscale IP.
 | 
					  // If we are doing a multi-platform build, we need to join the tailnet and bind buildkitd to the tailscale IP.
 | 
				
			||||||
  // We do this so that the remote VM can join the same buildkitd cluster as a worker.
 | 
					  // We do this so that the remote VM can join the same buildkitd cluster as a worker.
 | 
				
			||||||
  if (platforms && platforms.length > 1) {
 | 
					  if (nativeMultiPlatformBuildsEnabled) {
 | 
				
			||||||
    await joinTailnet();
 | 
					    await joinTailnet();
 | 
				
			||||||
    const tailscaleIP = await getTailscaleIP();
 | 
					    const tailscaleIP = await getTailscaleIP();
 | 
				
			||||||
    if (!tailscaleIP) {
 | 
					    if (!tailscaleIP) {
 | 
				
			||||||
| 
						 | 
					@ -241,11 +242,6 @@ export async function startAndConfigureBuildkitd(parallelism: number, platforms?
 | 
				
			||||||
  const addr = await startBuildkitd(parallelism, buildkitdAddr);
 | 
					  const addr = await startBuildkitd(parallelism, buildkitdAddr);
 | 
				
			||||||
  core.debug(`buildkitd daemon started at addr ${addr}`);
 | 
					  core.debug(`buildkitd daemon started at addr ${addr}`);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (platforms && platforms.length > 1) {
 | 
					 | 
				
			||||||
    // TODO(adityamaru): Queue docker job for multi-platform build with a well known tailscale hostname.
 | 
					 | 
				
			||||||
    // TODO(adityamaru): Wait until the VM joins the tailnet.
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  // Check that buildkit instance is ready by querying workers for up to 30s
 | 
					  // Check that buildkit instance is ready by querying workers for up to 30s
 | 
				
			||||||
  const startTimeBuildkitReady = Date.now();
 | 
					  const startTimeBuildkitReady = Date.now();
 | 
				
			||||||
  const timeoutBuildkitReady = buildkitdTimeoutMs;
 | 
					  const timeoutBuildkitReady = buildkitdTimeoutMs;
 | 
				
			||||||
| 
						 | 
					@ -255,7 +251,7 @@ export async function startAndConfigureBuildkitd(parallelism: number, platforms?
 | 
				
			||||||
      const {stdout} = await execAsync(`sudo buildctl --addr ${addr} debug workers`);
 | 
					      const {stdout} = await execAsync(`sudo buildctl --addr ${addr} debug workers`);
 | 
				
			||||||
      const lines = stdout.trim().split('\n');
 | 
					      const lines = stdout.trim().split('\n');
 | 
				
			||||||
      // For multi-platform builds, we need at least 2 workers
 | 
					      // For multi-platform builds, we need at least 2 workers
 | 
				
			||||||
      const requiredWorkers = platforms && platforms.length > 1 ? 2 : 1;
 | 
					      const requiredWorkers = nativeMultiPlatformBuildsEnabled ? 2 : 1;
 | 
				
			||||||
      if (lines.length > requiredWorkers) {
 | 
					      if (lines.length > requiredWorkers) {
 | 
				
			||||||
        core.info(`Found ${lines.length - 1} workers, required ${requiredWorkers}`);
 | 
					        core.info(`Found ${lines.length - 1} workers, required ${requiredWorkers}`);
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
| 
						 | 
					@ -270,7 +266,7 @@ export async function startAndConfigureBuildkitd(parallelism: number, platforms?
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    const {stdout} = await execAsync(`sudo buildctl --addr ${addr} debug workers`);
 | 
					    const {stdout} = await execAsync(`sudo buildctl --addr ${addr} debug workers`);
 | 
				
			||||||
    const lines = stdout.trim().split('\n');
 | 
					    const lines = stdout.trim().split('\n');
 | 
				
			||||||
    const requiredWorkers = platforms && platforms.length > 1 ? 2 : 1;
 | 
					    const requiredWorkers = nativeMultiPlatformBuildsEnabled ? 2 : 1;
 | 
				
			||||||
    if (lines.length <= requiredWorkers) {
 | 
					    if (lines.length <= requiredWorkers) {
 | 
				
			||||||
      throw new Error(`buildkit workers not ready after ${buildkitdTimeoutMs}ms timeout. Found ${lines.length - 1} workers, required ${requiredWorkers}`);
 | 
					      throw new Error(`buildkit workers not ready after ${buildkitdTimeoutMs}ms timeout. Found ${lines.length - 1} workers, required ${requiredWorkers}`);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue