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

handle docker-compose v2, free up more space #3809

Merged
merged 22 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ jobs:
# Related to https://github.com/sigstore/cosign/issues/3149
- name: free up disk space
run: |
rm -rf /opt/hostedtoolcache/CodeQL
rm -rf /usr/share/dotnet/
rm -rf "$AGENT_TOOLSDIRECTORY"
rm -rf "/usr/local/share/boost"
Expand Down Expand Up @@ -135,6 +136,7 @@ jobs:
php-igbinary php-memcache php-memcached php-mongodb php-redis php-xdebug \
php-zmq snmp pollinate libpq-dev postgresql-client powershell ruby-full \
sphinxsearch subversion mongodb-org -yq >/dev/null 2>&1 || true
apt-get remove -y '^llvm.*' || true
apt-get remove -y 'php.*' || true
apt-get autoremove -y >/dev/null 2>&1 || true
apt-get autoclean -y >/dev/null 2>&1 || true
Expand Down
27 changes: 20 additions & 7 deletions .github/workflows/validate-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ jobs:

container:
image: ghcr.io/gythialy/golang-cross:v1.22.5-0@sha256:5cf8fca7fe80392c8d1597fe89d291d49120507390f25507746f73d4b7f8a8f2
volumes:
- /usr:/host_usr
- /opt:/host_opt

permissions: {}

Expand All @@ -64,13 +67,22 @@ jobs:
# Related to https://github.com/sigstore/cosign/issues/3149
- name: free up disk space for the release
run: |
rm -rf /usr/share/dotnet/
rm -rf "$AGENT_TOOLSDIRECTORY"
rm -rf "/usr/local/share/boost"
rm -rf /opt/ghc
docker rmi $(docker image ls -aq) || true
swapoff /swapfile || true
rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc || true
rm -rf /host_usr/share/dotnet || true
rm -rf /host_usr/share/swift || true
rm -rf /host_usr/local/lib/android || true
rm -rf /host_opt/ghc || true
rm -rf /host_usr/local/.ghcup || true
rm -rf /host_opt/hostedtoolcache/ || true
rm -rf /host_usr/local/graalvm/ || true
rm -rf /host_usr/local/share/powershell || true
rm -rf /host_usr/local/share/chromium || true
rm -rf /host_usr/local/lib/node_modules || true
rm -rf /host_usr/lib/google-cloud-sdk || true
rm -rf /host_opt/hostedtoolcache/CodeQL || true
rm -rf "/host_usr/local/share/boost" || true
# docker rmi $(docker image ls -aq) || true
# swapoff /swapfile || true
# rm -rf /host/swapfile || true
apt purge aria2 ansible hhvm mono-devel azure-cli shellcheck rpm xorriso zsync \
clang-6.0 lldb-6.0 lld-6.0 clang-format-6.0 clang-8 lldb-8 lld-8 clang-format-8 \
clang-9 lldb-9 lld-9 clangd-9 clang-format-9 dotnet-sdk-3.0 dotnet-sdk-3.1=3.1.101-1 \
Expand Down Expand Up @@ -110,6 +122,7 @@ jobs:
apt-get remove -y 'php.*' || true
apt-get autoremove -y >/dev/null 2>&1 || true
apt-get autoclean -y >/dev/null 2>&1 || true
apt-get clean -y >/dev/null 2>&1 || true
- name: check disk space
run: df -h

Expand Down
18 changes: 14 additions & 4 deletions test/e2e_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@

set -ex

docker_compose="docker compose"
if ! ${docker_compose} version >/dev/null 2>&1; then
docker_compose="docker-compose"
fi

echo "setting up OIDC provider"
pushd ./test/fakeoidc
oidcimg=$(ko build main.go --local)
docker network ls | grep fulcio_default || docker network create fulcio_default
docker network ls | grep fulcio_default || docker network create fulcio_default --label "com.docker.compose.network=fulcio_default"

Choose a reason for hiding this comment

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

com.docker.compose.network=default

docker run -d --rm -p 8080:8080 --network fulcio_default --name fakeoidc $oidcimg
cleanup_oidc() {
echo "cleaning up oidc"
Expand Down Expand Up @@ -59,10 +64,15 @@ export FULCIO_METRICS_PORT=2113
export FULCIO_CONFIG=/tmp/fulcio-config.json
for repo in rekor fulcio; do
pushd $repo
docker-compose up -d
if [ "$repo" == "fulcio" ]; then
yq -i e '.networks={"default":{ "name":"fulcio_default","external":true }}' docker-compose.yml
yq -i e '.services.fulcio-server.networks=["default"]' docker-compose.yml
tail docker-compose.yml
fi
Comment on lines +67 to +71
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI I think all this is unnecessary if you change line 27 to use label com.docker.compose.network=default

${docker_compose} up -d
echo -n "waiting up to 60 sec for system to start"
count=0
until [ $(docker-compose ps | grep -c "(healthy)") == 3 ];
until [ $(${docker_compose} ps | grep -c "(healthy)") == 3 ];
do
if [ $count -eq 6 ]; then
echo "! timeout reached"
Expand All @@ -80,7 +90,7 @@ cleanup_services() {
cleanup_oidc
for repo in rekor fulcio; do
pushd $HOME/$repo
docker-compose down
${docker_compose} down
popd
done
}
Expand Down
Loading