Skip to content

Commit

Permalink
handle docker-compose v2, free up more space (#3809)
Browse files Browse the repository at this point in the history
* handle docker-compose v2, free up more space

Signed-off-by: Bob Callaway <[email protected]>

* set docker compose labels on network

Signed-off-by: Bob Callaway <[email protected]>

* llvm is needed

Signed-off-by: Bob Callaway <[email protected]>

* try again

Signed-off-by: Bob Callaway <[email protected]>

* sudo

Signed-off-by: Bob Callaway <[email protected]>

* try again

Signed-off-by: Bob Callaway <[email protected]>

* try codeql

Signed-off-by: Bob Callaway <[email protected]>

* fix yq

Signed-off-by: Bob Callaway <[email protected]>

* yq e

Signed-off-by: Bob Callaway <[email protected]>

---------

Signed-off-by: Bob Callaway <[email protected]>
  • Loading branch information
bobcallaway authored Aug 6, 2024
1 parent 06d1290 commit 7e3c2f5
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 11 deletions.
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"
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
${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

0 comments on commit 7e3c2f5

Please sign in to comment.