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

Reduce CI-built docker image size #911

Merged
merged 2 commits into from
Jul 11, 2023
Merged

Conversation

marip8
Copy link
Contributor

@marip8 marip8 commented Jul 7, 2023

The tesseract docker image that is produced in CI is fairly large (~5 Gb), a good chunk of which is the artifacts of the build that are not deleted (600Mb for tesseract). This PR adds a final step to the CI to remove the build directories of the target and upstream workspaces to reduce the size of the saved docker image

@marip8
Copy link
Contributor Author

marip8 commented Jul 7, 2023

I think we could probably also uninstall all -dev libraries as well before the test stage to further reduce. Playing around with the docker image manually showed that reduced the size of the /usr directory from ~3.3Gb to ~2.2Gb

@Levi-Armstrong
Copy link
Contributor

Can't you also remove the source?

@marip8 marip8 force-pushed the update/ci branch 2 times, most recently from 44e253c to 6a3f567 Compare July 7, 2023 23:53
@marip8
Copy link
Contributor Author

marip8 commented Jul 7, 2023

We could remove the source too, but it's only ~180Mb (I think due to a clone depth of 1), so I didn't think it was worth it. I can add it if you want though

@Levi-Armstrong
Copy link
Contributor

We could remove the source too, but it's only ~180Mb (I think due to a clone depth of 1), so I didn't think it was worth it. I can add it if you want though

Nah, just thinking of other things that may be able to reduce it.

What about the following commands? These are commonly used when generating dockers, but never looked into how much space they save.

apt-get clean && rm -rf /var/lib/apt/lists/*

@marip8
Copy link
Contributor Author

marip8 commented Jul 11, 2023

What about the following commands?

Turns out its only 45Mb in this particular image, so I'm not sure it's worth adding in the interest of keeping the AFTER_SCRIPT short

@marip8 marip8 merged commit e8d6378 into tesseract-robotics:master Jul 11, 2023
@marip8 marip8 deleted the update/ci branch July 11, 2023 15:46
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.

2 participants