Skip to content

Commit

Permalink
feat(docker): update cleanup scripts (#5497)
Browse files Browse the repository at this point in the history
* update cleanup scripts

Signed-off-by: Yutaka Kondo <[email protected]>

* revert to ubuntu-22.04

Signed-off-by: Yutaka Kondo <[email protected]>

---------

Signed-off-by: Yutaka Kondo <[email protected]>
  • Loading branch information
youtalk authored Nov 28, 2024
1 parent 2490899 commit 09049a5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
docker-build-and-push-cuda:
needs: [load-env, docker-build-and-push]
runs-on: codebuild-autoware-us-east-1-${{ github.run_id }}-${{ github.run_attempt }}-ubuntu-7.0-large
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v4
Expand Down
8 changes: 4 additions & 4 deletions docker/scripts/cleanup_apt.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash

function cleanup_apt() {
local remove_var_lib_apt_lists=$1
apt-get autoremove -y && rm -rf "$HOME"/.cache
if [[ $remove_var_lib_apt_lists == true ]]; then
rm -rf /var/lib/apt/lists/*
local apt_clean=$1
apt-get autoremove -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache
if [[ $apt_clean == true ]]; then
apt-get clean
fi
}

Expand Down
6 changes: 3 additions & 3 deletions docker/scripts/cleanup_system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ function cleanup_system() {
local lib_dir=$1
local ros_distro=$2

apt-get autoremove -y && rm -rf "$HOME"/.cache &&
find /usr/lib/"$lib_dir"-linux-gnu -name "*.a" -type f -delete &&
find /usr/lib/"$lib_dir"-linux-gnu -name "*.a" -type f -delete &&
find / -name "*.o" -type f -delete &&
find / -name "*.h" -type f -delete &&
find / -name "*.hpp" -type f -delete &&
rm -rf /autoware/ansible /autoware/ansible-galaxy-requirements.yaml /autoware/setup-dev-env.sh /autoware/*.env \
/root/.local/pipx /opt/ros/"$ros_distro"/include /etc/apt/sources.list.d/cuda*.list \
/root/.local/pipx /opt/ros/"$ros_distro"/include /opt/autoware/include /etc/apt/sources.list.d/cuda*.list \
/etc/apt/sources.list.d/docker.list /etc/apt/sources.list.d/nvidia-docker.list \
/usr/include /usr/share/doc /usr/lib/gcc /usr/lib/jvm /usr/lib/llvm*
}

./cleanup_apt.sh
cleanup_system "$@"

0 comments on commit 09049a5

Please sign in to comment.