diff --git a/.github/workflows/manual-docker-clean.yaml b/.github/workflows/manual-docker-clean.yaml index 54573ab2b..25cf22872 100644 --- a/.github/workflows/manual-docker-clean.yaml +++ b/.github/workflows/manual-docker-clean.yaml @@ -13,7 +13,7 @@ on: clean_list: default: "" description: "docker command to clean" - required: true + required: false type: string jobs: @@ -24,6 +24,8 @@ jobs: run: | docker ps if [ "${{ inputs.clean_list }}" ]; then + echo "----------stop and remove containers----------" docker stop ${{ inputs.clean_list }} && docker rm ${{ inputs.clean_list }} + echo "----------container removed----------" docker ps fi diff --git a/.github/workflows/scripts/docker_compose_clean_up.sh b/.github/workflows/scripts/docker_compose_clean_up.sh index 6dd7b7381..4bf99b5dd 100644 --- a/.github/workflows/scripts/docker_compose_clean_up.sh +++ b/.github/workflows/scripts/docker_compose_clean_up.sh @@ -23,12 +23,7 @@ case "$1" in ports) # Remove all ports used by containers echo "Release all ports used by the services in $yaml_file ..." - export PATH=/home/huggingface/miniconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin - echo $PATH - pip install --force-reinstall PyYAML - pip install --force-reinstall jq yq - pip list | grep jq - pip list | grep yq + pip install jq yq ports=$(yq '.services[].ports[] | split(":")[0]' $yaml_file | grep -o '[0-9]\+') echo "$ports" for port in $ports; do