Skip to content

Commit

Permalink
feat(stacks.api/addons/arc): use custom arc runner image
Browse files Browse the repository at this point in the history
Signed-off-by: Braden Mars <bradenmars@bradenmars.me>
  • Loading branch information
BradenM committed Sep 21, 2023
1 parent 42e689d commit d193080
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
32 changes: 25 additions & 7 deletions packages/stacks/api/src/addons/arc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,15 +363,16 @@ export class ARCScaleSet extends blueprints.HelmAddOn {

const initCommands = [
'sudo chown -R runner:docker /home/runner',
'cp -r /runnertmp/* /home/runner/',
'mkdir -p /home/runner/externals',
'cp -r /home/runner/* /runner/',
'mkdir -p /runner/externals',
'(mv /home/runner/externalstmp/* /home/runner/externals/ || true)',
'(mv /runnertmp/* /home/runner/externals/ || true)',
'(sudo mv /runnertmp/* /home/runner/externals/ || true)',
'sudo chown -R runner:docker /home/runner',
'sudo chown -R runner:docker /runner || true',
'sudo chown -R runner:docker /tmp || true',
]

const volumeMounts = [
this.templateVolumeMounts[ScaleSetVolumes.RUNNER],
this.templateVolumeMounts[ScaleSetVolumes.WORK],
this.templateVolumeMounts[ScaleSetVolumes.TMP],
]
Expand Down Expand Up @@ -423,20 +424,37 @@ export class ARCScaleSet extends blueprints.HelmAddOn {
},
},
],
volumeMounts,
volumeMounts: [
...volumeMounts,
{
...this.templateVolumeMounts[ScaleSetVolumes.RUNNER],
mountPath: '/runner',
},
],
},
],
}

const dindCommand = [
"sudo sed -i 's#startup.sh#/home/runner/run.sh#g' /usr/bin/entrypoint-dind.sh",
'/usr/bin/entrypoint-dind.sh',
]

const runner = {
containers: [
{
name: ScaleSetContainer.RUNNER,
image: runnerImage,
imagePullPolicy: 'IfNotPresent',
command: ['/home/runner/run.sh'],
command: this.options.useDindRunner
? ['bash', '-c', dindCommand.join(' && ')]
: ['/home/runner/run.sh'],
env,
volumeMounts,
volumeMounts: [
this.templateVolumeMounts[ScaleSetVolumes.RUNNER],
this.templateVolumeMounts[ScaleSetVolumes.DIND_CERT],
...volumeMounts,
],
},
],
}
Expand Down
2 changes: 1 addition & 1 deletion packages/stacks/api/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const pipeline = Pipeline.builder({
runnerScaleSetName: 'crisiscleanup-arc',
githubConfigSecret: 'arc-github-credentials',
containerImages: builderConfig.apiStack!.arc.images,
useDindRunner: true,
useDindRunner: false,
}),
)
.addOns(
Expand Down

0 comments on commit d193080

Please sign in to comment.