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

feat(docker): update cleanup scripts #5497

Merged
merged 2 commits into from
Nov 28, 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: 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 "$@"
Loading