Skip to content

Commit

Permalink
fix: Docker build for compressor (matter-labs#2874)
Browse files Browse the repository at this point in the history
## What ❔

Pass CUDA_ARCH to compressor image build.

## Why ❔

<!-- Why are these changes done? What goal do they contribute to? What
are the principles behind them? -->
<!-- Example: PR templates ensure PR reviewers, observers, and future
iterators are in context about the evolution of repos. -->

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ ] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `zk fmt` and `zk lint`.
  • Loading branch information
Artemka374 authored Sep 13, 2024
1 parent 23cdda7 commit 32889be
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions infrastructure/zk/src/docker.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command } from 'commander';
import {Command} from 'commander';
import * as utils from 'utils';

const IMAGES = [
Expand Down Expand Up @@ -31,7 +31,7 @@ async function dockerCommand(
dockerOrg: string = 'matterlabs'
) {
// Generating all tags for containers. We need 2 tags here: SHA and SHA+TS
const { stdout: COMMIT_SHORT_SHA }: { stdout: string } = await utils.exec('git rev-parse --short HEAD');
const {stdout: COMMIT_SHORT_SHA}: { stdout: string } = await utils.exec('git rev-parse --short HEAD');
// COMMIT_SHORT_SHA returns with newline, so we need to trim it
const imageTagShaTS: string = process.env.IMAGE_TAG_SUFFIX
? process.env.IMAGE_TAG_SUFFIX
Expand Down Expand Up @@ -114,7 +114,7 @@ async function _build(image: string, tagList: string[], dockerOrg: string, platf
if (platform != '') {
buildArgs += `--platform=${platform} `;
}
if (image === 'prover-gpu-fri') {
if (image === 'prover-gpu-fri' || image == 'proof-fri-gpu-compressor') {
const cudaArch = process.env.CUDA_ARCH;
buildArgs += `--build-arg CUDA_ARCH='${cudaArch}' `;
}
Expand All @@ -126,6 +126,8 @@ async function _build(image: string, tagList: string[], dockerOrg: string, platf
}
buildArgs += extraArgs;

console.log("Build args: ", buildArgs);

const buildCommand =
`DOCKER_BUILDKIT=1 docker buildx build ${tagsToBuild}` +
(buildArgs ? ` ${buildArgs}` : '') +
Expand Down

0 comments on commit 32889be

Please sign in to comment.