-
Notifications
You must be signed in to change notification settings - Fork 142
feat: enhance CI scripts for improved logging and DPF-reader support #4040
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: enhance CI scripts for improved logging and DPF-reader support #4040
Conversation
|
Thanks for opening a Pull Request. If you want to perform a review write a comment saying: @ansys-reviewer-bot review |
Reviewer's GuideThis PR refactors and enriches the CI infrastructure by overhauling the container startup script to support DPF reader modes and dynamic logging, updating GitHub Actions workflows to handle dual-instance and CICD‐specific DPF backends, and improving log collection and service‐waiting scripts with enhanced visibility. Flow diagram for improved MAPDL container startup with DPF-reader supportflowchart TD
ENV[Set environment variables]
CHECK[Check if MAPDL_VERSION contains 'cicd']
CICD{Is CICD version?}
DPF[Bind DPF port and set DB_INT_PORT=50056]
NODPF[Set DPF_ARG empty and DB_INT_PORT=50055]
CMD[Build docker run command]
RUN[Run docker container]
LOG[Redirect output to INSTANCE_NAME.log]
WAIT[Wait for 'Server listening on' in log]
SHOW[Show log content]
ENV --> CHECK --> CICD
CICD -- Yes --> DPF --> CMD
CICD -- No --> NODPF --> CMD
CMD --> RUN --> LOG --> WAIT --> SHOW
Flow diagram for enhanced log collection in CIflowchart TD
START[Start log collection script]
MKDIR[Create log directory]
DOCKERDIR[Create /mapdl_logs in container]
MVLOG[Move *.log files to /mapdl_logs]
PROCESSES[Save ps aux to docker_processes_end.log]
OUTERR[Move *.out and *.err files to /mapdl_logs]
COPY[Copy /mapdl_logs to host]
LOCAL[Collect local build logs]
DOCKERPS[Save docker ps to docker_ps_end.log]
MVLOCAL[Move all *.log files to log directory]
PROF[Move profiling files]
START --> MKDIR --> DOCKERDIR --> MVLOG --> PROCESSES --> OUTERR --> COPY --> LOCAL --> DOCKERPS --> MVLOCAL --> PROF
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @germa89 - I've reviewed your changes - here's some feedback:
- In start_mapdl.sh you removed the
--health-cmdfrom the Docker invocation but kept the health-interval/timeout flags—re-add the health check command to ensure the container’s health is actually being probed. - In collect_mapdl_logs_remote.sh the line
docker ps > /"$LOG_NAMES"/docker_ps_end.loguses a leading slash, causing logs to write under the root directory; drop the slash so it writes to the intended relative folder. - The
*"cicd"*detection and TEST_DPF_BACKEND logic is duplicated in both test-remote.yml and test-local.yml—consider extracting it into a shared step or composite action to reduce repetition.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In start_mapdl.sh you removed the `--health-cmd` from the Docker invocation but kept the health-interval/timeout flags—re-add the health check command to ensure the container’s health is actually being probed.
- In collect_mapdl_logs_remote.sh the line `docker ps > /"$LOG_NAMES"/docker_ps_end.log` uses a leading slash, causing logs to write under the root directory; drop the slash so it writes to the intended relative folder.
- The `*"cicd"*` detection and TEST_DPF_BACKEND logic is duplicated in both test-remote.yml and test-local.yml—consider extracting it into a shared step or composite action to reduce repetition.
## Individual Comments
### Comment 1
<location> `.ci/collect_mapdl_logs_remote.sh:34` </location>
<code_context>
-echo "Collecting docker run log..."
-mv log.txt ./"$LOG_NAMES"/log.txt || echo "MAPDL run docker log not found."
-mv log_dpf.txt ./"$LOG_NAMES"/log_dpf.txt || echo "DPF run docker log not found."
+docker ps > /"$LOG_NAMES"/docker_ps_end.log || echo "Failed to print the docker ps"
-echo "Moving docker launch log..."
</code_context>
<issue_to_address>
The path '/"$LOG_NAMES"/docker_ps_end.log' may not resolve as intended due to the leading slash and quoting.
A leading slash creates an absolute path, which may not be writable or correct. Quoting $LOG_NAMES will include the quotes in the filename. Use './$LOG_NAMES/docker_ps_end.log' instead.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4040 +/- ##
=======================================
Coverage 89.18% 89.18%
=======================================
Files 187 187
Lines 14993 14993
=======================================
Hits 13372 13372
Misses 1621 1621 🚀 New features to boost your workflow:
|
…ors, and limiting the message length when reporting
…F server tests for improved clarity
… and save MAPDL state in test_dpf
|
@pyansys-ci-bot LGTM |
pyansys-ci-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…r-support' of https://github.com/ansys/pymapdl into ci/improving-infrastructure-for-future-DPF-reader-support
…nfrastructure-for-future-DPF-reader-support

Description
As the title.
Issue linked
Extracted from #1300
Checklist
draftif it is not ready to be reviewed yet.feat: adding new MAPDL command)Summary by Sourcery
Enhance CI infrastructure and scripts to improve logging, support DPF services for CICD MAPDL images, and streamline multi-instance testing workflows.
New Features:
Enhancements:
CI:
Chores: