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

feat(build): Docker build improvements #4272

Merged
merged 11 commits into from
Jul 5, 2024
Merged

feat(build): Docker build improvements #4272

merged 11 commits into from
Jul 5, 2024

Conversation

khvn26
Copy link
Member

@khvn26 khvn26 commented Jul 2, 2024

Thanks for submitting a PR! Please check the boxes below:

  • I have run pre-commit to check linting
  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

  • Add PR comments with Docker image build status.
  • Run E2E for ARM images.
  • Remove pip from runtime layers to reduce attack surface (and have nicer Docker Scout reports).
  • Bump requests to a non-yanked version.
  • Remove pip-tools (and pip as transient dependency) from development dependencies.

How did you test this code?

The builds are tested in CI.

@khvn26 khvn26 requested a review from a team as a code owner July 2, 2024 12:44
@khvn26 khvn26 requested review from gagantrivedi and removed request for a team July 2, 2024 12:44
Copy link

vercel bot commented Jul 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Jul 4, 2024 7:30pm
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Jul 4, 2024 7:30pm
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Jul 4, 2024 7:30pm

@github-actions github-actions bot added api Issue related to the REST API chore labels Jul 2, 2024
Copy link
Contributor

github-actions bot commented Jul 2, 2024

Uffizzi Preview deployment-53723 was deleted.

Copy link

codecov bot commented Jul 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.60%. Comparing base (1eb3061) to head (9422132).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4272   +/-   ##
=======================================
  Coverage   96.60%   96.60%           
=======================================
  Files        1195     1195           
  Lines       39099    39099           
=======================================
  Hits        37773    37773           
  Misses       1326     1326           

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

Dockerfile Outdated
ARG TARGETARCH
RUN if [ "${TARGETARCH}" != "amd64" ]; then \
RUN pip uninstall -y pip && \
if [ "${TARGETARCH}" != "amd64" ]; then \
apt-get update && apt-get install -y libpq-dev && rm -rf /var/lib/apt/lists/*; fi;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we still need to install these for arm?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might not psycopg/psycopg2#1545

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E2E passes on ARM without it 👍

@github-actions github-actions bot added chore and removed chore labels Jul 2, 2024
@khvn26 khvn26 requested a review from a team as a code owner July 2, 2024 13:54
@khvn26 khvn26 requested review from kyle-ssg and removed request for a team July 2, 2024 13:54
@github-actions github-actions bot added front-end Issue related to the React Front End Dashboard chore and removed chore labels Jul 2, 2024
@khvn26 khvn26 requested a review from dabeeeenster July 2, 2024 15:08
@github-actions github-actions bot added chore and removed chore labels Jul 2, 2024
@github-actions github-actions bot added chore and removed chore labels Jul 3, 2024
@github-actions github-actions bot added chore and removed chore labels Jul 4, 2024
Copy link
Contributor

github-actions bot commented Jul 4, 2024

flagsmith-e2e image build finished ✨

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-4272 Finished ✅ Skipped

Copy link
Contributor

github-actions bot commented Jul 4, 2024

flagsmith-frontend image build and security scan finished ✨

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-frontend:pr-4272 Finished ✅ Results

Copy link
Contributor

github-actions bot commented Jul 4, 2024

flagsmith-api image build and security scan finished ✨

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api:pr-4272 Finished ✅ Results

Copy link
Contributor

github-actions bot commented Jul 4, 2024

flagsmith image build and security scan finished ✨

Image Build Status Security report
ghcr.io/flagsmith/flagsmith:pr-4272 Finished ✅ Results

Copy link
Contributor

github-actions bot commented Jul 4, 2024

flagsmith-private-cloud image build and security scan finished ✨

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-private-cloud:pr-4272 Finished ✅ Results

@github-actions github-actions bot added feature New feature or request and removed chore labels Jul 4, 2024
Copy link
Member

@gagantrivedi gagantrivedi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with a question

@@ -30,4 +30,4 @@ serve:
test:
docker compose run frontend \
npx cross-env E2E_CONCURRENCY=${E2E_CONCURRENCY} npm run test -- $(opts) \
|| docker compose logs flagsmith-api
|| (docker compose logs flagsmith-api; exit 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we add this? How was this working before?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docker compose logs flagsmith-api exited 0, making failed E2E jobs green.

@khvn26 khvn26 added this pull request to the merge queue Jul 5, 2024
Merged via the queue into main with commit 627370f Jul 5, 2024
33 checks passed
@khvn26 khvn26 deleted the chore/pipless branch July 5, 2024 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API feature New feature or request front-end Issue related to the React Front End Dashboard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants