invoke-ai / InvokeAI

Invoke is a leading creative engine for Stable Diffusion models, empowering professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry leading WebUI, and serves as the foundation for multiple commercial products.
https://invoke-ai.github.io/InvokeAI/
Apache License 2.0
23.7k stars 2.43k forks source link

[bug]: docker compose up fails because of npm install #5258

Closed Reezlaw closed 10 months ago

Reezlaw commented 11 months ago

Is there an existing issue for this?

OS

Linux

GPU

cuda

VRAM

24

What version did you experience this issue on?

3.4.0

What happened?

When trying to install with docker compose up in the docker folder, the build exits with an error caused by npm install. Full output below

Screenshots

No response

Additional context

[+] Running 1/1 ! invokeai Warning 1.9s [+] Building 316.5s (22/30) docker:default => [invokeai internal] load .dockerignore 0.0s => => transferring context: 151B 0.0s => [invokeai internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 3.94kB 0.0s => [invokeai] resolve image config for docker.io/docker/dockerfile:1.4 1.1s => CACHED [invokeai] docker-image://docker.io/docker/dockerfile:1.4@sha256:9ba7531bd80fb0a858632727cf7a112fbfd19b17e94c4e84ced81e24ef1a0dbc 0.0s => [invokeai internal] load metadata for docker.io/library/ubuntu:23.04 1.0s => [invokeai internal] load metadata for docker.io/library/node:18 1.0s => [invokeai internal] load build context 0.0s => => transferring context: 121.70kB 0.0s => [invokeai runtime 1/11] FROM docker.io/library/ubuntu:23.04@sha256:5a828e28de105c3d7821c4442f0f5d1c52dc16acf4999d5f31a3bc0f03f06edd 0.0s => [invokeai web-builder 1/5] FROM docker.io/library/node:18@sha256:7a4282663db6f22326c03618eef4320fa3cf70c5c3715546f9779858dc0ed3fd 0.0s => CACHED [invokeai web-builder 2/5] WORKDIR /build 0.0s => CACHED [invokeai web-builder 3/5] COPY invokeai/frontend/web/ ./ 0.0s => CACHED [invokeai runtime 2/11] RUN apt update && apt install -y --no-install-recommends git curl vim tmux ncdu iotop bzip2 gosu m 0.0s => CACHED [invokeai builder 2/8] RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache 0.0s => CACHED [invokeai builder 3/8] RUN --mount=type=cache,target=/var/cache/apt,sharing=locked --mount=type=cache,target=/var/lib/apt,sharing=locked apt update && apt-get install -y git 0.0s => CACHED [invokeai builder 4/8] WORKDIR /opt/invokeai 0.0s => CACHED [invokeai builder 5/8] RUN --mount=type=cache,target=/root/.cache/pip python3 -m venv /opt/venv/invokeai && if [ "linux/amd64" = "linux/arm64" ] [ "cuda" = "cpu" ]; then extra_i 0.0s => CACHED [invokeai builder 6/8] COPY invokeai ./invokeai 0.0s => CACHED [invokeai builder 7/8] COPY pyproject.toml ./ 0.0s => CACHED [invokeai builder 8/8] RUN --mount=type=cache,target=/root/.cache/pip if [ "cuda" = "cuda" ] && [ "linux/amd64" = "linux/amd64" ]; then pip install -e ".[xformers]"; else 0.0s => CACHED [invokeai runtime 3/11] COPY --link --from=builder /opt/invokeai /opt/invokeai 0.0s => CACHED [invokeai runtime 4/11] COPY --link --from=builder /opt/venv/invokeai /opt/venv/invokeai 0.0s => ERROR [invokeai web-builder 4/5] RUN --mount=type=cache,target=/usr/lib/node_modules npm install --include=dev 314.2s

[invokeai web-builder 4/5] RUN --mount=type=cache,target=/usr/lib/node_modules npm install --include=dev:
283.9 npm WARN deprecated flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
309.7
309.7 > @invoke-ai/invoke-ai-ui@0.0.1 preinstall
309.7 > npx only-allow pnpm
309.7 311.2 npm WARN exec The following package was not found and will be installed: only-allow@1.2.1 312.2 ╔═════════════════════════════════════════════════════════════╗ 312.2 ║ ║ 312.2 ║ Use "pnpm install" for installation in this project. ║ 312.2 ║ ║ 312.2 ║ If you don't have pnpm, install it via "npm i -g pnpm". ║ 312.2 ║ For more details, go to https://pnpm.js.org/ ║ 312.2 ║ ║ 312.2 ╚═════════════════════════════════════════════════════════════╝ 312.2 npm notice 312.2 npm notice New patch version of npm available! 10.2.3 -> 10.2.5 312.2 npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.2.5 312.2 npm notice Run npm install -g npm@10.2.5 to update! 312.2 npm notice 312.2 npm ERR! code 1 312.2 npm ERR! path /build 312.2 npm ERR! command failed 312.2 npm ERR! command sh -c npx only-allow pnpm 312.2 312.2 npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2023-12-11T03_09_43_632Z-debug-0.log

failed to solve: process "/bin/sh -c npm install --include=dev" did not complete successfully: exit code: 1

Contact Details

No response

psychedelicious commented 11 months ago

We had to change the frontend to use a different package manager. Previously it was yarn, now it is pnpm. The docker configs will need to be updated. Happy for a contribution for this.

sammcj commented 11 months ago

FYI this is still breaking 3.5.0 builds with rc3.

I submitted a PR to fix this which is currently awaiting additional approvals: https://github.com/invoke-ai/InvokeAI/pull/5295

Millu commented 10 months ago

Closed by #5295, and will be included with next release