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

build(frontend): Optimize Docker build time and image size #8695

Merged
merged 2 commits into from
Nov 18, 2024

Conversation

Pwuts
Copy link
Member

@Pwuts Pwuts commented Nov 18, 2024

The AutoGPT Platform frontend image is currently 5.3GB and takes forever to build and cache.

This PR reduces image size by 4.9GB (93%) and reduces uncached build time from ~7m to ~5m20s.

Changes 🏗️

  • Use cache mount to prevent Yarn cache from being included in yarn install layer
  • Leverage Next.js output tracing to generate minimal application w/ tree-shaken dependencies
  • Add non-root user following the reference Dockerfile

Checklist 📋

For code changes:

  • I have clearly listed my changes in the PR description
  • I have made a test plan
  • I have tested my changes according to the test plan:
    • ...
Example test plan
  • Create from scratch and execute an agent with at least 3 blocks
  • Import an agent from file upload, and confirm it executes correctly
  • Upload agent to marketplace
  • Import an agent from marketplace and confirm it executes correctly
  • Edit an agent from monitor, and confirm it executes correctly

@Pwuts Pwuts requested a review from a team as a code owner November 18, 2024 14:39
@Pwuts Pwuts requested review from Bentlybro and kcze and removed request for a team November 18, 2024 14:39
@github-actions github-actions bot added platform/frontend AutoGPT Platform - Front end platform/backend AutoGPT Platform - Back end size/m labels Nov 18, 2024
Copy link

netlify bot commented Nov 18, 2024

Deploy Preview for auto-gpt-docs canceled.

Name Link
🔨 Latest commit 658816d
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/673b5560e84c2c0008889642

@Pwuts Pwuts enabled auto-merge (squash) November 18, 2024 15:01
@Pwuts Pwuts merged commit 1f34f78 into dev Nov 18, 2024
15 checks passed
@Pwuts Pwuts deleted the reinier/secrt-994-update-caching-for-frontend-in-ci branch November 18, 2024 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform/backend AutoGPT Platform - Back end platform/frontend AutoGPT Platform - Front end size/m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants