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

Add docker and apptainer image building on demand #176

Merged
merged 14 commits into from
Jul 24, 2023

Conversation

mikemhenry
Copy link
Contributor

This PR will let us build docker and apptainer (singulairty) images using github action's workflow dispatch feature

@codecov-commenter
Copy link

codecov-commenter commented Jul 14, 2023

Codecov Report

❗ No coverage uploaded for pull request base (main@b7b069e). Click here to learn what that means.
The diff coverage is n/a.

@mikemhenry
Copy link
Contributor Author

Looks like the docker image builds fine but we run out of space when building the apptainer image, going to try a few hacks to fix this

on:
push:
branches:
- feat/add_docker_and_apptainer
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will remove this before we merge it in

Copy link
Contributor

@ijpulidos ijpulidos left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Comment on lines +37 to +62
sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true
sudo rm -rf \
/usr/share/dotnet /usr/local/lib/android /opt/ghc \
/usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \
/usr/lib/jvm || true
echo "some directories deleted"
sudo apt install aptitude -y >/dev/null 2>&1
sudo aptitude purge aria2 ansible azure-cli shellcheck rpm xorriso zsync \
esl-erlang firefox gfortran-8 gfortran-9 google-chrome-stable \
google-cloud-sdk imagemagick \
libmagickcore-dev libmagickwand-dev libmagic-dev ant ant-optional kubectl \
mercurial apt-transport-https mono-complete libmysqlclient \
unixodbc-dev yarn chrpath libssl-dev libxft-dev \
libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev \
snmp pollinate libpq-dev postgresql-client powershell ruby-full \
sphinxsearch subversion mongodb-org azure-cli microsoft-edge-stable \
-y -f >/dev/null 2>&1
sudo aptitude purge google-cloud-sdk -f -y >/dev/null 2>&1
sudo aptitude purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true
sudo apt purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true
sudo aptitude purge '~n ^mysql' -f -y >/dev/null 2>&1
sudo aptitude purge '~n ^php' -f -y >/dev/null 2>&1
sudo aptitude purge '~n ^dotnet' -f -y >/dev/null 2>&1
sudo apt-get autoremove -y >/dev/null 2>&1
sudo apt-get autoclean -y >/dev/null 2>&1
echo "some packages purged"
Copy link
Contributor

Choose a reason for hiding this comment

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

That's a lot of things that have to be remove/purged from the ubuntu image, I wonder if we should eventually try a lighter docker image for our purposes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is actually running on the host, not inside the image. The image we base on is quite small, but the host has a TON of stuff, so I found that I ran out of space when building the singularity image after building the docker image.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh yeah, I did notice that after I wrote my comment, but I guess the point still stands that we might want to use something smaller compared to ubuntu-latest for the host (even though I know this could change many things for us, just something to keep in mind in the future)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From here https://github.com/actions/runner-images#available-images and skimming that page, I don't think github plans on making any minimal images

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh ok, then this is as good as it gets! :) Thanks for checking that out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem! Thanks for giving me the idea to check!

@mikemhenry mikemhenry enabled auto-merge (squash) July 24, 2023 22:22
@mikemhenry mikemhenry merged commit dd8ebb7 into main Jul 24, 2023
4 checks passed
@mikemhenry mikemhenry deleted the feat/add_docker_and_apptainer branch July 24, 2023 22:45
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