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

ci: Print and stop stale containers after run #2935

Merged
merged 1 commit into from
Jun 10, 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
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ jobs:
restore-keys: |
Python-${{ runner.os }}-${{ matrix.python-version }}

- name: Cleanup previous docker containers
run: make cleanup-previous-docker-containers

- name: Install pyfluent
run: make install

Expand Down Expand Up @@ -231,9 +228,6 @@ jobs:
restore-keys: |
Python-${{ runner.os }}-${{ matrix.python-version }}

- name: Cleanup previous docker containers
run: make cleanup-previous-docker-containers

- name: Add version information
run: make version-info

Expand Down Expand Up @@ -531,6 +525,9 @@ jobs:
env:
FLUENT_IMAGE_TAG: ${{ matrix.image-tag }}

- name: Cleanup previous docker containers
mkundu1 marked this conversation as resolved.
Show resolved Hide resolved
run: make cleanup-previous-docker-containers

- name: Upload 24.2 Coverage Artifacts
if: matrix.image-tag == 'v24.2.0'
uses: actions/upload-artifact@v4
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/doc-build-dev-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ jobs:
sudo apt update
sudo apt-get install pandoc libegl1 make xvfb libfontconfig1 libxrender1 libxkbcommon-x11-0 -y

- name: Cleanup previous docker containers
run: make cleanup-previous-docker-containers

- name: Install pyfluent
run: make install

Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/doc-build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ jobs:
sudo apt update
sudo apt-get install pandoc libegl1 make xvfb libfontconfig1 libxrender1 libxkbcommon-x11-0 -y

- name: Cleanup previous docker containers
run: make cleanup-previous-docker-containers

- name: Install pyfluent
run: make install

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-run-custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ jobs:
restore-keys: |
Python-${{ runner.os }}-${{ matrix.python-version }}

- name: Cleanup previous docker containers
run: make cleanup-previous-docker-containers

- name: Add version information
run: make version-info

Expand Down Expand Up @@ -111,3 +108,6 @@ jobs:
poetry python -m pytest -v --no-cov --capture=no -k test_parametric_workflow --nightly
env:
FLUENT_IMAGE_TAG: ${{ matrix.image-tag }}

- name: Cleanup previous docker containers
run: make cleanup-previous-docker-containers
6 changes: 3 additions & 3 deletions .github/workflows/test-run-dev-version-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ jobs:
restore-keys: |
Python-${{ runner.os }}-${{ matrix.python-version }}

- name: Cleanup previous docker containers
run: make cleanup-previous-docker-containers

- name: Add version information
run: make version-info

Expand Down Expand Up @@ -84,6 +81,9 @@ jobs:
env:
FLUENT_IMAGE_TAG: v25.1.0

- name: Cleanup previous docker containers
run: make cleanup-previous-docker-containers

- name: Update Fluent image
env:
GITHUB_TOKEN: ${{ secrets.ADMIN_ACCESS_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-run-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ jobs:
restore-keys: |
Python-${{ runner.os }}-${{ matrix.python-version }}

- name: Cleanup previous docker containers
run: make cleanup-previous-docker-containers

- name: Add version information
run: make version-info

Expand Down Expand Up @@ -84,6 +81,9 @@ jobs:
env:
FLUENT_IMAGE_TAG: v24.2.0

- name: Cleanup previous docker containers
run: make cleanup-previous-docker-containers

- name: Upload 24.2 Coverage Results to Codecov
uses: codecov/codecov-action@v4
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-run-old-versions-weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ jobs:
restore-keys: |
Python-${{ runner.os }}-${{ matrix.python-version }}

- name: Cleanup previous docker containers
run: make cleanup-previous-docker-containers

- name: Add version information
run: make version-info

Expand Down Expand Up @@ -195,3 +192,6 @@ jobs:
make unittest-all-${{ matrix.version }}
env:
FLUENT_IMAGE_TAG: ${{ matrix.image-tag }}

- name: Cleanup previous docker containers
run: make cleanup-previous-docker-containers
6 changes: 3 additions & 3 deletions .github/workflows/test-run-solvermode-weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ jobs:
restore-keys: |
Python-${{ runner.os }}-${{ matrix.python-version }}

- name: Cleanup previous docker containers
run: make cleanup-previous-docker-containers

- name: Add version information
run: make version-info

Expand Down Expand Up @@ -80,3 +77,6 @@ jobs:
run: |
make install-test
make unittest-solvermode-251

- name: Cleanup previous docker containers
run: make cleanup-previous-docker-containers
6 changes: 3 additions & 3 deletions .github/workflows/test-run-wo-codegen-weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ jobs:
restore-keys: |
Python-${{ runner.os }}-${{ matrix.python-version }}

- name: Cleanup previous docker containers
run: make cleanup-previous-docker-containers

- name: Add version information
run: make version-info

Expand Down Expand Up @@ -127,3 +124,6 @@ jobs:
make unittest-all-${{ matrix.version }}-no-codegen
env:
FLUENT_IMAGE_TAG: ${{ matrix.image-tag }}

- name: Cleanup previous docker containers
run: make cleanup-previous-docker-containers
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,5 +151,8 @@ compare-flobject:
@python .ci/compare_flobject.py

cleanup-previous-docker-containers:
@if [ -n "$(docker ps -a -q)" ]; then docker stop $(docker ps -a -q); fi
@if [ -n "$(docker ps -a -q)" ]; then \
docker inspect --format='{{.Config.Labels.test_name}}' $(docker ps -a -q); \
mkundu1 marked this conversation as resolved.
Show resolved Hide resolved
docker stop $(docker ps -a -q); \
fi
@if [ -n "$(docker ps -a -q)" ]; then docker rm -vf $(docker ps -a -q); fi
1 change: 1 addition & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def _stop_fluent_container(gallery_conf, fname):
.split()
)
for container_name in container_names:
print(f"Container still running for script {fname}")
mkundu1 marked this conversation as resolved.
Show resolved Hide resolved
mkundu1 marked this conversation as resolved.
Show resolved Hide resolved
subprocess.run(f"docker stop {container_name}", shell=is_linux)
except Exception:
pass
Expand Down