Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions src/components/c2d/compute_engine_docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,13 @@ export class C2DEngineDocker extends C2DEngine {
if (job.status === C2DStatusNumber.JobStarted) {
// pull docker image
try {
await this.docker.pull(job.containerImage)
const pullStream = await this.docker.pull(job.containerImage)
await new Promise((resolve, reject) => {
this.docker.modem.followProgress(pullStream, (err, res) => {
if (err) return reject(err)
resolve(res)
})
})
} catch (err) {
CORE_LOGGER.error(
`Unable to pull docker image: ${job.containerImage}: ${err.message}`
Expand Down Expand Up @@ -437,20 +443,18 @@ export class C2DEngineDocker extends C2DEngine {
Volumes: mountVols,
HostConfig: hostConfig
}
// TO DO - fix the following

if (job.algorithm.meta.container.entrypoint) {
const newEntrypoint = job.algorithm.meta.container.entrypoint.replace(
'$ALGO',
'data/transformations/algorithm'
)
containerInfo.Entrypoint = newEntrypoint.split(' ')
}

try {
const container = await this.docker.createContainer(containerInfo)
console.log(container)
const containerId = container.id

if (job.algorithm.meta.container.entrypoint) {
const newEntrypoint = job.algorithm.meta.container.entrypoint.replace(
'$ALGO',
containerId + '/data/transformations/algorithm'
)
containerInfo.Entrypoint = newEntrypoint
}
job.status = C2DStatusNumber.Provisioning
job.statusText = C2DStatusText.Provisioning
await this.db.updateJob(job)
Expand Down
2 changes: 1 addition & 1 deletion src/utils/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ function getDockerFreeComputeOptions(
maxJobs: 1,
consumerAddress: '',
storageExpiry: 600,
maxJobDuration: 30,
maxJobDuration: 600, // 10 minutes
feeToken: ZeroAddress,
chainId: 8996,
free: true,
Expand Down