@@ -225,10 +225,11 @@ const buildkitdTimeoutMs = 30000;
225225export async function startAndConfigureBuildkitd ( parallelism : number , platforms ?: string [ ] ) : Promise < string > {
226226 // For multi-platform builds, we need to use the tailscale IP
227227 let buildkitdAddr = BUILDKIT_DAEMON_ADDR ;
228+ const nativeMultiPlatformBuildsEnabled = false && ( platforms ?. length ?? 0 > 1 ) ;
228229
229230 // If we are doing a multi-platform build, we need to join the tailnet and bind buildkitd to the tailscale IP.
230231 // We do this so that the remote VM can join the same buildkitd cluster as a worker.
231- if ( platforms && platforms . length > 1 ) {
232+ if ( nativeMultiPlatformBuildsEnabled ) {
232233 await joinTailnet ( ) ;
233234 const tailscaleIP = await getTailscaleIP ( ) ;
234235 if ( ! tailscaleIP ) {
@@ -241,11 +242,6 @@ export async function startAndConfigureBuildkitd(parallelism: number, platforms?
241242 const addr = await startBuildkitd ( parallelism , buildkitdAddr ) ;
242243 core . debug ( `buildkitd daemon started at addr ${ addr } ` ) ;
243244
244- if ( platforms && platforms . length > 1 ) {
245- // TODO(adityamaru): Queue docker job for multi-platform build with a well known tailscale hostname.
246- // TODO(adityamaru): Wait until the VM joins the tailnet.
247- }
248-
249245 // Check that buildkit instance is ready by querying workers for up to 30s
250246 const startTimeBuildkitReady = Date . now ( ) ;
251247 const timeoutBuildkitReady = buildkitdTimeoutMs ;
@@ -255,7 +251,7 @@ export async function startAndConfigureBuildkitd(parallelism: number, platforms?
255251 const { stdout} = await execAsync ( `sudo buildctl --addr ${ addr } debug workers` ) ;
256252 const lines = stdout . trim ( ) . split ( '\n' ) ;
257253 // For multi-platform builds, we need at least 2 workers
258- const requiredWorkers = platforms && platforms . length > 1 ? 2 : 1 ;
254+ const requiredWorkers = nativeMultiPlatformBuildsEnabled ? 2 : 1 ;
259255 if ( lines . length > requiredWorkers ) {
260256 core . info ( `Found ${ lines . length - 1 } workers, required ${ requiredWorkers } ` ) ;
261257 break ;
@@ -270,7 +266,7 @@ export async function startAndConfigureBuildkitd(parallelism: number, platforms?
270266 try {
271267 const { stdout} = await execAsync ( `sudo buildctl --addr ${ addr } debug workers` ) ;
272268 const lines = stdout . trim ( ) . split ( '\n' ) ;
273- const requiredWorkers = platforms && platforms . length > 1 ? 2 : 1 ;
269+ const requiredWorkers = nativeMultiPlatformBuildsEnabled ? 2 : 1 ;
274270 if ( lines . length <= requiredWorkers ) {
275271 throw new Error ( `buildkit workers not ready after ${ buildkitdTimeoutMs } ms timeout. Found ${ lines . length - 1 } workers, required ${ requiredWorkers } ` ) ;
276272 }
0 commit comments