Skip to content

build: remove dev deps from prod image, add separate test-reqs and test-app images #188

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

Open
wants to merge 1 commit into
base: branchless/pr190
Choose a base branch
from

Conversation

matt-codecov
Copy link
Collaborator

@matt-codecov matt-codecov commented May 28, 2025

as title

this should clean up our production image as well as save some CI time. as-is, every CI run for worker, api, and shared all must run apt-get install ... and pip install ... to install the same junk inside the container. this PR caches that junk so all that must be done most of the time is copying the repo into the image

further changes are possible. all three test images are essentially identical; we could just build/publish a generic test image and override the workdir and entrypoint in docker-compose. i may try to do basically that for our production images.

Stack info:
Stack 1

Copy link

codecov bot commented May 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.21%. Comparing base (cddf945) to head (0db3372).

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@                Coverage Diff                @@
##           branchless/pr190     #188   +/-   ##
=================================================
  Coverage             94.21%   94.21%           
=================================================
  Files                  1215     1215           
  Lines                 45024    45024           
  Branches               1435     1435           
=================================================
  Hits                  42420    42420           
  Misses                 2303     2303           
  Partials                301      301           
Flag Coverage Δ
apiunit 96.48% <ø> (ø)
sharedintegration 39.74% <ø> (ø)
sharedunit 88.15% <ø> (ø)
workerintegration 61.61% <ø> (ø)
workerunit 90.62% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codecov-notifications
Copy link

codecov-notifications bot commented May 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link

codspeed-hq bot commented May 28, 2025

CodSpeed Performance Report

Merging #188 will not alter performance

Comparing branchless/pr188 (0db3372) with branchless/pr190 (cddf945)

Summary

✅ 9 untouched benchmarks

@matt-codecov matt-codecov requested review from a team May 28, 2025 22:12
@matt-codecov matt-codecov marked this pull request as ready for review May 28, 2025 22:17
Copy link

seer-by-sentry bot commented Jun 11, 2025

Sentry detected 2 potential issues in your recent changes

Suspicion of a critical build issue: The PR adds references to missing Docker build files (`Makefile.docker`, `Dockerfile.requirements`, etc.) and targets, causing the build process to fail immediately with "No such file or directory" or "No rule to make target" errors, preventing image creation.
  • Description: The code changes introduce dependencies on a Docker build system that is currently missing from the repository. Specifically, the PR adds references in Makefiles (e.g., apps/codecov-api/Makefile, apps/worker/Makefile) to docker/Makefile.docker and tools/devenv/Makefile.devenv, which do not exist. These missing Makefiles are expected to define targets like build.requirements and build.test-requirements. Furthermore, the code attempts to calculate SHA sums of docker/Dockerfile.requirements and docker/Dockerfile.test-requirements, and references a base image using ${AR_REQS_REPO}:${REQUIREMENTS_TAG}, but these files and the AR_REQS_REPO variable are also missing. When the build process attempts to include the missing Makefiles, calculate the SHA sums of the missing Dockerfiles (e.g., $(shell sha1sum docker/Dockerfile.requirements | cut -d ' ' -f 1)), or invoke the missing targets ($(MAKE) build.requirements), it will fail with errors like "No such file or directory" or "No rule to make target". This prevents the necessary build variables from being set and aborts the entire build process for API, worker, and test requirements images. This would prevent any Docker image builds or development environment setups from succeeding, leading to a complete inability to deploy or develop using the standard build system.
  • Code location: docker/Makefile.docker:37~67
  • Suggested fix: Add the missing docker/Makefile.docker, tools/devenv/Makefile.devenv, docker/Dockerfile.requirements, and docker/Dockerfile.test-requirements files, defining the necessary targets and variables, or remove the references if these components are not intended to be added in this PR.
Suspicion of a technical issue in `docker/Makefile.docker:10`. A new reference to a non-existent file `docker/Dockerfile.requirements` is added, which could cause build processes to fail when attempting to calculate its hash.
  • Description: The sha1sum command in docker/Makefile.docker:10 attempts to calculate the hash of docker/Dockerfile.requirements. This file does not exist in the repository. When the make target containing this command is executed, the sha1sum command will fail with a "No such file or directory" error. This failure will halt the execution of the make target. Any subsequent build or deployment processes that depend on variables derived from this command, such as DOCKER_REQS_SHA or REQUIREMENTS_TAG, will unexpectedly terminate. For example, if a build process attempts to tag a Docker image using a tag that includes DOCKER_REQS_SHA, the process will fail when trying to resolve the variable. This could prevent the successful building and deployment of Docker images.
  • Code location: docker/Makefile.docker:13
  • Suggested fix: Either create the docker/Dockerfile.requirements file with appropriate content or remove the reference to it in docker/Makefile.docker:10 and any other locations referencing this missing file.

Did you find this useful? React with a 👍 or 👎

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

Successfully merging this pull request may close these issues.

3 participants