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

Unreasonable image size when using tryolabs/restricttotopic for linux/amd64 #5

Open
arielweinberger opened this issue May 9, 2024 · 1 comment

Comments

@arielweinberger
Copy link

arielweinberger commented May 9, 2024

Hi,

We're using this repo in our build process and as a part of docker build, we noticed a huge different in the resulting image size between arm and amd64 architectures.

Here is a reproduction dockerfile:

FROM python:3.8-slim

# Install system dependencies
RUN apt-get update && apt-get install -y git

# Set work directory
WORKDIR /usr/src/app

# Copy only the requirements file, to cache the pip install step
RUN pip install --no-cache-dir --upgrade guardrails-ai

# Install specific tools
RUN guardrails hub install hub://tryolabs/restricttotopic

If you build this image from a Mac M1/M2 for example, the resulting image size will be around 1GB.

If you build it with the --platform=linux/amd64 flag, the size becomes 8GB.

This causes us a lot of trouble as it makes our CI pipeline very slow, and also requires us to dramatically increase our Kubernetes nodes' disk size, as we are using linux/amd64 in the cluster, as it is still the most common architecture. It takes several minutes to download the image to the cluster with every deployment.

Is this something you're able to address, please?

ovejabu pushed a commit that referenced this issue Jun 3, 2024
@hieu-cove
Copy link

This is also affecting our organization. Even though we are not using the local model, it still install torch and transformer in their entirety, making the image size very large.

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

No branches or pull requests

2 participants