2026-03-16 15:33:40 -07:00
|
|
|
/**
|
|
|
|
|
* @license
|
|
|
|
|
* Copyright 2026 Google LLC
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import { GceCosProvider } from './GceCosProvider.ts';
|
2026-03-23 11:15:57 -07:00
|
|
|
import type { WorkerProvider } from './BaseProvider.ts';
|
|
|
|
|
import path from 'node:path';
|
|
|
|
|
import { fileURLToPath } from 'node:url';
|
2026-03-16 15:33:40 -07:00
|
|
|
|
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
2026-03-16 20:03:42 -07:00
|
|
|
const REPO_ROOT = path.resolve(__dirname, '../../../../..');
|
2026-03-16 15:33:40 -07:00
|
|
|
|
|
|
|
|
export class ProviderFactory {
|
2026-03-23 11:15:57 -07:00
|
|
|
static getProvider(config: {
|
|
|
|
|
projectId: string;
|
|
|
|
|
zone: string;
|
|
|
|
|
instanceName: string;
|
|
|
|
|
}): WorkerProvider {
|
2026-03-16 15:33:40 -07:00
|
|
|
// Currently we only have GceCosProvider, but this is where we'd branch
|
2026-03-23 11:15:57 -07:00
|
|
|
return new GceCosProvider(
|
|
|
|
|
config.projectId,
|
|
|
|
|
config.zone,
|
|
|
|
|
config.instanceName,
|
|
|
|
|
REPO_ROOT,
|
|
|
|
|
);
|
2026-03-16 15:33:40 -07:00
|
|
|
}
|
|
|
|
|
}
|