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

ci(framework) Optimize Ubuntu base image #3458

Merged
merged 5 commits into from
May 22, 2024

Conversation

Robert-Steiner
Copy link
Member

@Robert-Steiner Robert-Steiner commented May 16, 2024

Issue

Description

  • Optimizes the Ubuntu base image.
    • Uses python-build (a pyenv plugin) to install Python. That makes the pyenv rehash call obsolete. 🎉
    • Adds a non-root app user.
    • Uses a multi-stage build to avoid having system dependencies in the final base image that are necessary for Python compilation.
    • Use a virtual environment to ensure that Python packages are installed in the same location regardless of whether the subsequent image build is run with the app or the root user (also applies for the Alpine base image).
  • Increases the CI timeout to 180 min because the compilation of grpcio on alpine arm64 takes over two hours.
  • Adds the Alpine base image to the build CI job.
  • Adjusts the Alpine base image to be aligned with the Ubuntu base image (virtual env is under /app/venv).

Related issues/PRs

Proposal

Explanation

Checklist

  • Implement proposed change
  • Write tests
  • Update documentation
  • Update the changelog entry below
  • Make CI checks pass
  • Ping maintainers on Slack (channel #contributions)

Changelog entry

Any other comments?

@Robert-Steiner Robert-Steiner changed the title ci(framework:docker) Optimise ubuntu base image ci(framework) Optimise ubuntu base image May 17, 2024
@Robert-Steiner Robert-Steiner force-pushed the feature/ubuntu-base-image-optimization branch from 6c2a711 to 93a14ca Compare May 17, 2024 08:05
@Robert-Steiner Robert-Steiner self-assigned this May 21, 2024
Signed-off-by: Robert Steiner <robert@flower.ai>
Signed-off-by: Robert Steiner <robert@flower.ai>
@Robert-Steiner Robert-Steiner force-pushed the feature/ubuntu-base-image-optimization branch from 19a1313 to 313a0b8 Compare May 21, 2024 15:40
Signed-off-by: Robert Steiner <robert@flower.ai>
@Robert-Steiner Robert-Steiner force-pushed the feature/ubuntu-base-image-optimization branch from 313a0b8 to 84b5865 Compare May 21, 2024 15:45
@Robert-Steiner Robert-Steiner changed the title ci(framework) Optimise ubuntu base image ci(framework) Optimise Ubuntu base image May 21, 2024
@Robert-Steiner Robert-Steiner changed the title ci(framework) Optimise Ubuntu base image ci(framework) Optimize Ubuntu base image May 21, 2024
Signed-off-by: Robert Steiner <robert@flower.ai>
@Robert-Steiner Robert-Steiner marked this pull request as ready for review May 22, 2024 07:20
Copy link
Member

@tanertopal tanertopal left a comment

Choose a reason for hiding this comment

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

lgtm!

@tanertopal tanertopal enabled auto-merge (squash) May 22, 2024 09:02
@tanertopal tanertopal merged commit c600677 into main May 22, 2024
29 checks passed
@tanertopal tanertopal deleted the feature/ubuntu-base-image-optimization branch May 22, 2024 09:10
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