gitbugactions / gitbugactions

⚙️ A tool for collecting executable code datasets with GitHub Actions ⚙️
MIT License
21 stars 5 forks source link

use a smaller base image #254

Open andre15silva opened 1 month ago

andre15silva commented 1 month ago

We use ghcr.io/catthehacker/ubuntu:full-latest as the base image, which occupies slightly less than 60GiB.

This can be problematic when scaling.

List of images to use are at https://github.com/catthehacker/docker_images

andre15silva commented 1 month ago

Attempt 1 (ghcr.io/catthehacker/ubuntu:act-latest) which is "image used in github.com/nektos/act as medium size image retaining compatibility with most actions while maintaining small size".

error:

 => ERROR [2/5] RUN sudo usermod -u 4000000 runneradmin                                                                                                   0.7s
------
 > [2/5] RUN sudo usermod -u 4000000 runneradmin:
0.121 usermod: user 'runneradmin' does not exist
------
WARNING: No output specified with docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
Dockerfile:2
--------------------
   1 |     FROM ghcr.io/catthehacker/ubuntu:act-latest
   2 | >>> RUN sudo usermod -u 4000000 runneradmin
   3 |     RUN sudo groupadd -o -g 1000 andre
   4 |     RUN sudo usermod -G 1000 runner
--------------------
ERROR: failed to solve: process "/bin/bash --login -e -o pipefail -c sudo usermod -u 4000000 runneradmin" did not complete successfully: exit code: 6

This is because the image uses root as the default user. Let's try with the image with the runner user.

andre15silva commented 1 month ago

ghcr.io/catthehacker/ubuntu:runner-latest builds but at least maven is missing from it

[d9f56325-3125-4c65-84c3-ead3c58e290c/Build on Java 8] ⭐ Run Main Build with Maven
[d9f56325-3125-4c65-84c3-ead3c58e290c/Build on Java 8] unable to get git ref: failed to identify reference (tag/branch) for the checked-out revision '873d4f5dbb3d9877feaec73292099adfdfc3ca30'
[d9f56325-3125-4c65-84c3-ead3c58e290c/Build on Java 8] unable to get git ref: failed to identify reference (tag/branch) for the checked-out revision '873d4f5dbb3d9877feaec73292099adfdfc3ca30'
[d9f56325-3125-4c65-84c3-ead3c58e290c/Build on Java 8] unable to get git ref: failed to identify reference (tag/branch) for the checked-out revision '873d4f5dbb3d9877feaec73292099adfdfc3ca30'
[d9f56325-3125-4c65-84c3-ead3c58e290c/Build on Java 8] unable to get git ref: failed to identify reference (tag/branch) for the checked-out revision '873d4f5dbb3d9877feaec73292099adfdfc3ca30'
[d9f56325-3125-4c65-84c3-ead3c58e290c/Build on Java 8]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/2] user= workdir=
[d9f56325-3125-4c65-84c3-ead3c58e290c/Build on Java 8]   | /var/run/act/workflow/2: line 2: mvn: command not found
[d9f56325-3125-4c65-84c3-ead3c58e290c/Build on Java 8]   ❌  Failure - Main Build with Maven
[d9f56325-3125-4c65-84c3-ead3c58e290c/Build on Java 8] exitcode '127': command not found, please refer to https://github.com/nektos/act/issues/107 for more information
andre15silva commented 1 month ago

If we force maven to be installed in the Dockerfile this specific sample w3c-epubcheck-0759a82ae407 works.

However, others, like Bindambc-whatsapp-business-java-api-362caf5eb33c fail in the offline mode (but work online). This might be fixable by running the export again using this smaller image, so that the export run saves the necessary files in the docker diff.