Skip to content

Commit 21632b9

Browse files
committed
complete checkfor platform and arch if present on manifest
1 parent 2584990 commit 21632b9

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/components/core/compute/initialize.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,13 @@ export class ComputeInitializeHandler extends Handler {
141141
if (hasDockerImages) {
142142
const algoImage = getAlgorithmImage(task.algorithm)
143143
if (algoImage) {
144-
const validation: ValidateParams =
145-
await C2DEngineDocker.checkDockerImage(algoImage)
144+
const env = await this.getOceanNode()
145+
.getC2DEngines()
146+
.getExactComputeEnv(task.compute.env, ddo.chainId)
147+
const validation: ValidateParams = await C2DEngineDocker.checkDockerImage(
148+
algoImage,
149+
env.platform
150+
)
146151
if (!validation.valid) {
147152
return {
148153
stream: null,

src/utils/config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ function getDockerFreeComputeOptions(
401401
feeToken: ZeroAddress,
402402
chainId: 8996,
403403
free: true,
404-
platform: [{ architecture: os.machine(), os: os.platform() }]
404+
platform: { architecture: os.machine(), os: os.platform() }
405405
}
406406

407407
if (existsEnvironmentVariable(ENVIRONMENT_VARIABLES.DOCKER_FREE_COMPUTE, isStartup)) {
@@ -411,7 +411,7 @@ function getDockerFreeComputeOptions(
411411
) as ComputeEnvironmentBaseConfig
412412
doComputeEnvChecks([options])
413413
const env = { ...options } as ComputeEnvironment
414-
env.platform = [{ architecture: os.machine(), os: os.platform() }]
414+
env.platform = { architecture: os.machine(), os: os.platform() }
415415
return env
416416
} catch (error) {
417417
CONFIG_LOGGER.logMessageWithEmoji(
@@ -462,7 +462,7 @@ function getDockerComputeEnvironments(isStartup?: boolean): ComputeEnvironment[]
462462
doComputeEnvChecks(options)
463463
const envs = { ...options } as ComputeEnvironment[]
464464
envs.forEach((env) => {
465-
env.platform = [{ architecture: os.machine(), os: os.platform() }]
465+
env.platform = { architecture: os.machine(), os: os.platform() }
466466
})
467467
return envs
468468
} catch (error) {

0 commit comments

Comments
 (0)