exercism / exercism/julia

Docker image size

Open
#958 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
73
Forks
82
Avg merge
2h 17m
Merged PRs (30d)
5

Description

## Background

The repo is [here](https://github.com/exercism/julia-test-runner). The Dockerfile is [here](https://github.com/exercism/julia-test-runner/blob/main/Dockerfile). In the last 3 years this has had few changes: `dependabot` merges and a sync of org-wide files (code of conduct, etc.)

There was a push in 2023 to [reduce image sizes](https://forum.exercism.org/t/docker-image-sizes/6478). At that time, Julia was a large but not crazy 765 MB. For comparison, the Python test runner was 145 MB then and is 90.6 MB now. Honestly, I never expect Julia to match that (we're like Python + NumPy + Pandas).

Building the current Dockerfile locally now gives a image of a startling 1.34 GB, which is costing Exercism money, paid regularly to AWS.

Shrinking it would be good! Obviously, it is vital to make sure any changes don't break solutions, and don't slow runtime performance.

## Base images

The library image `julia:1.11.5` is based on `debian:bookworm-slim`.

To get I feel for the various official Julia 1.11.5 images, I built a few locally, plus `debian:bookworm-slim`. The default `julia:alpine` failed repeatedly.

| Image | Size |
| ----- | ---- |
| current test runner | 1.34 GB |
| julia:1.11.5 | 1.11 GB |
| julia:1.11.5-bullseye | 1.11 GB |
| julia:alpine3.22 | _500 error_ |
| julia:alpine3.21 | 1.04 GB |
| debian:bookworm-slim | 74.8 MB |

So all the Julia images are >1 GB, nearly 15x the size of the base Debian image. Even alpine isn't much smaller (and we don't know if it will even work in the test runner).

Maybe we could slightly shrink the stuff we add in `julia-test-runner`, but it won't solve the size problem.

## Julia installation

Downloading `julia-1.11.5-linux-x86_64.tar.gz` via curl, as the official `julia:1.11.5` Dockerfile does, gives an installation which is 285.8 MB compressed and 988 MB uncompressed. This points to the main issue!

There has been discussion about the ever-growing installation sizes, for example [here](https://discourse.julialang.org/t/julia-installation-file-sizes/119130).

To quote:

> It seems that during the build process stdlibs are compiled with the 2 differents configurations:
1/ -g2 -O3
2/ -g2 -O3 --check-bounds=yes

and:

> there’s definitely a case for a light version…And doubling the size for testing packages with checkounds=yes, seems like something that could be served by a dev version.
> But with all of these things, someone needs to care and put time into it.

Exercism has a stated preference for official images, and I don't feel competent to get deep into messing with this.

Unfortunately, it seems likely that Julia 1.12 will be even bigger when released in the next few months.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.