Skip to content

Conversation

@germa89
Copy link
Collaborator

@germa89 germa89 commented Jun 13, 2025

Description

As the title.

Issue linked

Required by #1300

Checklist

Summary by Sourcery

Enable starting the DPF server on the same container for CICD images by adding an ON_SAME_CONTAINER flag and branching CI steps accordingly.

New Features:

  • Add a CI path to launch the DPF server inside the existing MAPDL container for CICD versions.

Enhancements:

  • Introduce ON_SAME_CONTAINER environment variable in test-remote workflow to distinguish CICD images.
  • Split the DPF server startup into separate steps for same-container and separate-container scenarios.

Build:

  • Update build_matrix.sh skip logic to retain CICD versions when running on remote builds.

CI:

  • Echo and output the ON_SAME_CONTAINER flag in test-remote.yml and conditionally run DPF startup steps.

@germa89 germa89 requested a review from a team as a code owner June 13, 2025 17:46
@ansys-reviewer-bot
Copy link
Contributor

Thanks for opening a Pull Request. If you want to perform a review write a comment saying:

@ansys-reviewer-bot review

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jun 13, 2025

Reviewer's Guide

This PR enhances the GitHub CI workflow to support starting the DPF server either on the same container (for 'cicd' versions) or on a separate container, and adjusts the build matrix script to ensure 'cicd' versions are not skipped in remote runs.

Flow Diagram: Updated Build Matrix Logic for Remote Non-Student Version Selection

graph TD
    Start["Input: A version to evaluate in build_matrix.sh"] --> IsRemoteAndNotStudent{"Context: Remote Run (ON_REMOTE=true)<br/>AND Non-Student (ON_STUDENT=false)?"};
    IsRemoteAndNotStudent -- "Yes (Logic changed by PR)" --> CheckCicd{"Version string contains 'cicd'?"};
    IsRemoteAndNotStudent -- "No (e.g. local run, or student version)" --> OtherLogic["Handled by existing/other logic (not shown)"];

    CheckCicd -- "Yes" --> IncludeVersion["Action: Include version in build<br/>(Not Skipped)"];
    CheckCicd -- "No" --> SkipVersion["Action: Skip this version for the build"];

    IncludeVersion --> EndEval["End evaluation for this version"];
    SkipVersion --> EndEval;
    OtherLogic --> EndEval;
Loading

File-Level Changes

Change Details Files
Introduce ON_SAME_CONTAINER flag and conditional DPF server startup in CI workflow
  • Initialize and export ON_SAME_CONTAINER based on inputs
  • Extend ubuntu_check step to detect 'cicd' mapdl-version and set flag
  • Expose ON_SAME_CONTAINER in GITHUB_OUTPUT
  • Split DPF activation into two steps with if-conditions for same vs separate container
  • Add echo logging for same-container startup
.github/workflows/test-remote.yml
Modify build_matrix.sh to include 'cicd' versions in remote runs
  • Update skip condition to bypass skipping when version contains 'cicd'
  • Insert explicit branch to run 'cicd' versions on remote
  • Convert original skip into an elif to preserve legacy behavior
.ci/build_matrix.sh

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@germa89 germa89 self-assigned this Jun 13, 2025
@germa89 germa89 changed the title cicd/allow starting DPF on same container cicd: allow starting DPF on same container Jun 13, 2025
@github-actions github-actions bot added CI/CD Related with CICD, Github Actions, etc maintenance General maintenance of the repo (libraries, cicd, etc) labels Jun 13, 2025
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a 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:

  • Consider refactoring the two ‘Start DPF server…’ steps into a single step with conditional logic or YAML anchors to reduce duplication and improve maintainability.
  • Move the ON_SAME_CONTAINER detection and export logic up into a shared env block or step to avoid scattering environment variable assignments.
  • Simplify the build_matrix.sh version check by combining the cicd version exception into the primary remote/student condition, reducing nested if/elif branches.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider refactoring the two ‘Start DPF server…’ steps into a single step with conditional logic or YAML anchors to reduce duplication and improve maintainability.
- Move the ON_SAME_CONTAINER detection and export logic up into a shared env block or step to avoid scattering environment variable assignments.
- Simplify the build_matrix.sh version check by combining the cicd version exception into the primary remote/student condition, reducing nested if/elif branches.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@germa89 germa89 changed the title cicd: allow starting DPF on same container ci: allow starting DPF on same container Jun 13, 2025
@codecov
Copy link

codecov bot commented Jun 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.12%. Comparing base (4494edd) to head (366e7ef).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4008      +/-   ##
==========================================
- Coverage   89.17%   89.12%   -0.05%     
==========================================
  Files         187      187              
  Lines       14970    14970              
==========================================
- Hits        13349    13342       -7     
- Misses       1621     1628       +7     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@germa89
Copy link
Collaborator Author

germa89 commented Jun 16, 2025

@pyansys-ci-bot LGTM.

@germa89 germa89 enabled auto-merge (squash) June 16, 2025 15:56
Copy link
Contributor

@pyansys-ci-bot pyansys-ci-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approving this PR because germa89 said so in here 😬

LGTM

@germa89 germa89 merged commit a6e939a into main Jun 16, 2025
44 checks passed
@germa89 germa89 deleted the cicd/allow-running-remote-on-cicd-docker-image branch June 16, 2025 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD Related with CICD, Github Actions, etc maintenance General maintenance of the repo (libraries, cicd, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants