Skip to content

bug: audioWaveform extension breaks apt-get install for next extensions when building the docker image #1334

Closed

Description

@ThibautCuchet

Provide environment information

  • System:
    • OS: macOS 15.0
    • CPU: (8) arm64 Apple M3
    • Memory: 95.38 MB / 16.00 GB
    • Shell: 5.9 - /bin/zsh
  • Binaries:
    • Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node
    • npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm
    • pnpm: 8.15.5 - ~/.nvm/versions/node/v20.11.1/bin/pnpm
    • bun: 1.1.24 - /opt/homebrew/bin/bun

Describe the bug

The audioWaveform extension breaks the package installation (apt-get install) for the following extensions.

Reproduction repo

https://github.com/ThibautCuchet/trigger.dev/tree/issue-audiowaveform

To reproduce

In references/v3-catalog/trigger.config.ts, I added a debug extension after audioWaveform :

      audioWaveform(),
      {
        name: "debug",
        onBuildComplete: (ctx) => {
          ctx.addLayer({
            id: "debug",
            image: {
              instructions: ["RUN apt-get update", "RUN apt-get install -y curl"],
            }
          })
        }
      },

Running pnpm exec trigger deploy --profile local --self-hosted, will raise an error during the build of the docker image :

Containerfile:8
--------------------
6 |     RUN rm audiowaveform*.deb
7 |     RUN apt-get update
8 | >>> RUN apt-get install -y curl
9 |
10 |     ENV DEBIAN_FRONTEND=noninteractive
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get install -y curl" did not complete successfully: exit code: 100

Moving the debug extension before audioWaveform, doens't have this bug :

      {
        name: "debug",
        onBuildComplete: (ctx) => {
          ctx.addLayer({
            id: "debug",
            image: {
              instructions: ["RUN apt-get update", "RUN apt-get install -y curl"],
            }
          })
        }
      },
      audioWaveform(),

Additional information

This error breaks the deployment of references/v3-catalog in production because the new puppeteer extension needs to install packages.

------
Containerfile:7
--------------------
5 |     RUN dpkg -i audiowaveform_1.10.1-1-12_amd64.deb || true
6 |     RUN rm audiowaveform*.deb
7 | >>> RUN apt-get update && apt-get install curl gnupg -y   && curl --location --silent https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -   && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'   && apt-get update   && apt-get install google-chrome-stable -y --no-install-recommends   && rm -rf /var/lib/apt/lists/*
8 |
9 |     ENV DEBIAN_FRONTEND=noninteractive
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get update && apt-get install curl gnupg -y   && curl --location --silent https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -   && sh -c 'echo \"deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main\" >> /etc/apt/sources.list.d/google.list'   && apt-get update   && apt-get install google-chrome-stable -y --no-install-recommends   && rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 100

Activity

  1. nicktrn commented on Sep 20, 2024

    @nicktrn
    Collaborator

    Yep, order is currently important with the audiowaveform extension as it needs an apt-get --fix-broken install before any other apt calls. Need to figure out a better solution here. Thanks for flagging!

  2. ThibautCuchet commented on Sep 20, 2024

    @ThibautCuchet
    ContributorAuthor

    @nicktrn I just open a PR to fix this

  3. nicktrn commented on Sep 20, 2024

    @nicktrn
    Collaborator

    Thanks, we may go with that for now. Ideally, I think we should aggregate all apt steps into one to decrease build time, improve caching, etc. But that's a much more extensive change of course.

  4. ThibautCuchet commented on Sep 20, 2024

    @ThibautCuchet
    ContributorAuthor

    Shouldn’t the pkgs property be used for the dependencies of the instructions and be executed earlier in the Dockerfile? Or alternatively, add a new prop.

    const baseInstructions = (options.image?.instructions || []).join("\n");
    const packages = Array.from(new Set(DEFAULT_PACKAGES.concat(options.image?.pkgs || []))).join(

    ${baseInstructions}
    ENV DEBIAN_FRONTEND=noninteractive
    RUN apt-get update && apt-get --fix-broken install -y && apt-get install -y --no-install-recommends ${packages} && apt-get clean && rm -rf /var/lib/apt/lists/*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions