Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image should be rebuild on filechange #461

Closed
1 of 3 tasks
Hikari opened this issue Feb 4, 2025 · 1 comment · Fixed by #462 or #472
Closed
1 of 3 tasks

Image should be rebuild on filechange #461

Hikari opened this issue Feb 4, 2025 · 1 comment · Fixed by #462 or #472
Labels

Comments

@Hikari
Copy link
Contributor

Hikari commented Feb 4, 2025

🐛 Describe the bug

I am using the setup which has no frontend, just the backend. While developing suddenly I got the error, that the image cannot be build. It worked fine before for about 2 months.
I cross checked with a second project, I am running on the same setup and it gives the exact same error.

💭 Expected Behavior

The image should be build successfully.

🔁 Steps To Reproduce

  1. in the console: tilt up
  2. hit the space bar
  3. in the browser check the output of the backend service
  4. observe the error mentioned above

🌎 Environments

  • Sandbox
  • Staging
  • Production

📝 Additional context

No response

📜 Relevant log output

STEP 1/4 — Force update
     Beginning force update
     Deleting kubernetes objects:
     → Deployment/backend
     → Service/backend

STEP 2/4 — Building Dockerfile: [backend]
Building Dockerfile for platform linux/arm64:
  # Build all of the dependencies then we will build the actual application image
  FROM python:3.12-slim as build
  
  ENV PYTHONUNBUFFERED 1
  ENV PYTHONDONTWRITEBYTECODE 1
  ENV BOGUS 1
  
  ARG DEVEL=no
  ARG TEST=no
  
  RUN apt-get update \
      && apt-get install --no-install-recommends -y \
      build-essential \
      ca-certificates \
      curl \
      gettext \
      gnupg \
      && curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
      && echo "deb http://apt.postgresql.org/pub/repos/apt bookworm-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
      && apt-get update \
      && apt-get install --no-install-recommends -y \
      libffi-dev \
      libpq-dev \
      libssl-dev \
      postgresql-client-16 \
      postgresql-client-common
  
  
  # We create an /app directory with a virtual environment in it to store our
  # application in.
  RUN set -x \
      && python3 -m venv /app
  
  # Now that we've created our virtual environment, we'll go ahead and update
  # our $PATH to refer to it first.
  ENV PATH="/app/bin:${PATH}"
  
  # Next, we want to update pip, setuptools, and wheel inside of this virtual
  # environment to ensure that we have the latest versions of them.
  RUN pip --no-cache-dir install --upgrade uv
  RUN uv pip --no-cache install --upgrade setuptools wheel
  
  COPY requirements /tmp/requirements
  
  RUN set -x \
      && if [ "$DEVEL" = "yes" ]; then uv pip --no-cache install -r /tmp/requirements/local.txt; fi
  
  RUN set -x \
      && uv pip --no-cache install --no-deps \
      -r /tmp/requirements/production.txt \
      -r /tmp/requirements/base.txt
  
  RUN set -x \
      && if [ "$TEST" = "yes" ]; then uv pip --no-cache install --no-deps \
      -r /tmp/requirements/tests.txt; fi
  
  # Now we can build the application image
  FROM python:3.12-slim
  
  ENV PYTHONUNBUFFERED 1
  ENV PYTHONPATH /app
  ENV PATH="/app/bin:${PATH}"
  ENV BOGUS 1
  
  WORKDIR /app/src
  
  ARG DEVEL=no
  # this is used by Sentry to associate errors with releases
  ARG RELEASE="dev"
  
  # This is a work around because otherwise postgresql-client bombs out trying
  # to create symlinks to these directories.
  RUN set -x \
      && mkdir -p /usr/share/man/man1 \
      && mkdir -p /usr/share/man/man7
  
  RUN apt-get update \
      # psycopg2 dependencies
      && apt-get install --no-install-recommends -y \
      ca-certificates \
      curl \
      gettext \
      gnupg \
      && curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
      && echo "deb http://apt.postgresql.org/pub/repos/apt bookworm-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
      && apt-get update \
      && apt-get install --no-install-recommends -y \
      libpq5 \
      $(if [ "$DEVEL" = "yes" ]; then echo 'bash postgresql-client-16'; fi) \
      # awscli
      && apt-get install -y \
      awscli \
      # cleaning up unused files
      && apt-get remove -y \
      curl \
      gnupg \
      && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
      && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
  
  RUN adduser --system --no-create-home django
  COPY --chown=django:django --from=build /app/ /app/
  COPY --chown=django:django config/ /app/src/config/
  COPY --chown=django:django manage.py /app/src/
  COPY --chown=django:django nhs/ /app/src/nhs/
  
  USER django


     Building image
     [build 1/9] FROM docker.io/library/python:3.12-slim@sha256:44bea088c998714140c0e844e713eec2f620790888640219347ad49867f3329d [done: 63ms]
     [background] read source files 1.38MB [done: 151ms]
     [build 3/9] RUN set -x     && python3 -m venv /app [cached]
     [build 4/9] RUN pip --no-cache-dir install --upgrade uv [cached]
     [stage-1 3/9] RUN set -x     && mkdir -p /usr/share/man/man1     && mkdir -p /usr/share/man/man7 [cached]
     [build 2/9] RUN apt-get update     && apt-get install --no-install-recommends -y     build-essential     ca-certificates     curl     gettext     gnupg     && curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -     && echo "deb http://apt.postgresql.org/pub/repos/apt bookworm-pgdg main" > /etc/apt/sources.list.d/pgdg.list     && apt-get update     && apt-get install --no-install-recommends -y     libffi-dev     libpq-dev     libssl-dev     postgresql-client-16     postgresql-client-common [cached]
     [stage-1 4/9] RUN apt-get update     && apt-get install --no-install-recommends -y     ca-certificates     curl     gettext     gnupg     && curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -     && echo "deb http://apt.postgresql.org/pub/repos/apt bookworm-pgdg main" > /etc/apt/sources.list.d/pgdg.list     && apt-get update     && apt-get install --no-install-recommends -y     libpq5     $(if [ "yes" = "yes" ]; then echo 'bash postgresql-client-16'; fi)     && apt-get install -y     awscli     && apt-get remove -y     curl     gnupg     && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false     && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
     [stage-1 2/9] WORKDIR /app/src [cached]
     [build 5/9] RUN uv pip --no-cache install --upgrade setuptools wheel
       → error: No virtual environment found; run `uv venv` to create an environment, or pass `--system` to install into a non-virtual environment
     
     ERROR IN: [build 5/9] RUN uv pip --no-cache install --upgrade setuptools wheel
     
     ERROR IN: [stage-1 4/9] RUN apt-get update     && apt-get install --no-install-recommends -y     ca-certificates     curl     gettext     gnupg     && curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -     && echo "deb http://apt.postgresql.org/pub/repos/apt bookworm-pgdg main" > /etc/apt/sources.list.d/pgdg.list     && apt-get update     && apt-get install --no-install-recommends -y     libpq5     $(if [ "yes" = "yes" ]; then echo 'bash postgresql-client-16'; fi)     && apt-get install -y     awscli     && apt-get remove -y     curl     gnupg     && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false     && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

Build Failed: ImageBuild: process "/bin/sh -c uv pip --no-cache install --upgrade setuptools wheel" did not complete successfully: exit code: 2
█

📸 Screenshots

No response

github-actions bot pushed a commit that referenced this issue Mar 5, 2025
## [1.22.0](v1.21.0...v1.22.0) (2025-03-05)

### Features

* Update scaf to use copier and multiple templates (closes [#332](#332), [#441](#441), [#443](#443), [#444](#444), [#445](#445)) ([ff3645a](ff3645a))

### Bug Fixes

* Add VIRTUAL_ENV env variable for uv to work after latest upgrade… (fixes [#461](#461)) ([c0f2c9a](c0f2c9a))
* fullstack template url ([c136fdb](c136fdb))
Copy link

github-actions bot commented Mar 5, 2025

🎉 This issue has been resolved in version 1.22.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant