Skip to content

CICD update#242

Merged
kazewong merged 6 commits into
mainfrom
dagster_development
Jul 24, 2025
Merged

CICD update#242
kazewong merged 6 commits into
mainfrom
dagster_development

Conversation

@kazewong
Copy link
Copy Markdown
Owner

@kazewong kazewong commented Jul 24, 2025

Summary by CodeRabbit

  • New Features
    • Introduced a unified continuous deployment workflow that automates building, publishing to PyPI, and pushing Docker images to the GitHub Container Registry.
  • Chores
    • Consolidated and streamlined CI/CD workflows by removing separate workflows for pre-commit checks, Docker image publishing, and Python package publishing.
    • Updated Docker build configuration to use the "dagster" extra instead of "pipeline".
  • Refactor
    • Removed Dagster asset definitions and related aggregation for the "SingleRun" workflow.
  • Tests
    • Integrated pre-commit checks directly into the main CI workflow for improved code quality enforcement.

kazewong added 4 commits July 24, 2025 10:21
- Consolidate CI, pre-commit, and publish workflows into CI.yml and
CD.yml - Remove obsolete workflow files - Rename workflow files for
clarity - Remove unused SingleRun pipeline code
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jul 24, 2025

Walkthrough

This update restructures the project's GitHub Actions workflows, consolidating continuous integration, deployment, and publishing steps. It introduces a new unified CD workflow, modifies the CI workflow to include pre-commit checks, and removes redundant or replaced workflows. Minor adjustments are made to Dockerfile build arguments. Several Dagster asset-related Python modules are deleted.

Changes

File(s) Change Summary
.github/workflows/CD.yml New workflow for unified continuous deployment: build, publish to PyPI, and publish Docker image.
.github/workflows/CI.yml CI workflow restructured; adds pre-commit job; triggers refined; minor formatting updates.
.github/workflows/container.yml
.github/workflows/pre-commit.yml
.github/workflows/python-publish.yml
Deleted individual workflows for Docker publish, pre-commit, and PyPI publish (now handled by CD.yml).
containers/Containerfile.cpu
containers/Containerfile.cuda
Changed uv sync argument from pipeline to dagster in both CPU and CUDA Dockerfiles.
jim_dagster/SingleRun/assets.py
jim_dagster/SingleRun/definitions.py
Deleted all Dagster asset and definitions modules for the SingleRun workflow.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub
    participant Actions
    participant PyPI
    participant GHCR
    participant Docker

    GitHub->>Actions: Push/PR to main or Release
    alt Build Job (Python 3.11/3.12)
        Actions->>Actions: Checkout, Setup Python, Install deps, Build
    end
    alt On Release (publish_pypi)
        Actions->>Actions: Checkout, Setup Python, Install deps, Build
        Actions->>PyPI: Publish package
    end
    Actions->>Actions: Checkout, Login to GHCR
    Actions->>Docker: Build & Push image (Containerfile.cuda)
    Actions->>GHCR: Push Docker image
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Poem

A hop, a skip, a workflow anew,
With Docker and PyPI in the queue.
Old assets gone, the garden trimmed,
Pre-commit checks now brightly brimmed.
The CI/CD dance is clean and spry—
A rabbit’s code, reaching for the sky! 🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dagster_development

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
.github/workflows/CD.yml (1)

32-51: Optimize PyPI publish job to avoid redundant rebuild.

The publish job rebuilds the package unnecessarily since the build job already created artifacts. Consider optimizing by downloading build artifacts instead of rebuilding.

Apply this diff to optimize the publish process:

  publish_pypi:
    if: github.event_name == 'release'
    needs: build
    runs-on: ubuntu-latest
    continue-on-error: true
    steps:
      - uses: actions/checkout@v4
+      - name: Download build artifacts
+        uses: actions/download-artifact@v4
+        with:
+          name: dist
+          path: dist/
-      - name: Install uv
-        uses: astral-sh/setup-uv@v3
-      - name: Set up Python 3.12
-        run: uv python install 3.12
-      - name: Install the project
-        run: uv sync --all-extras --dev
-      - name: Run build
-        run: uv build
      - name: Publish package
        uses: pypa/gh-action-pypi-publish@v1.10.3
        with:
          user: __token__
          password: ${{ secrets.PYPI_API_TOKEN }}

You'll also need to add an artifact upload step to the build job:

      - name: Run build
        run: uv build
+      - name: Upload build artifacts
+        uses: actions/upload-artifact@v4
+        with:
+          name: dist
+          path: dist/
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 41005eb and 653ee91.

📒 Files selected for processing (9)
  • .github/workflows/CD.yml (1 hunks)
  • .github/workflows/CI.yml (2 hunks)
  • .github/workflows/container.yml (0 hunks)
  • .github/workflows/pre-commit.yml (0 hunks)
  • .github/workflows/python-publish.yml (0 hunks)
  • containers/Containerfile.cpu (1 hunks)
  • containers/Containerfile.cuda (1 hunks)
  • jim_dagster/SingleRun/assets.py (0 hunks)
  • jim_dagster/SingleRun/definitions.py (0 hunks)
💤 Files with no reviewable changes (5)
  • jim_dagster/SingleRun/definitions.py
  • .github/workflows/python-publish.yml
  • .github/workflows/pre-commit.yml
  • .github/workflows/container.yml
  • jim_dagster/SingleRun/assets.py
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/CI.yml

43-43: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


45-45: the runner of "actions/setup-python@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

.github/workflows/CD.yml

65-65: the runner of "docker/login-action@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: publish_docker
🔇 Additional comments (6)
containers/Containerfile.cuda (1)

15-15: LGTM! Alignment with Dagster tooling.

The change from --extra pipeline to --extra dagster aligns the container build with Dagster-specific dependencies, which is consistent with the broader CICD restructuring.

.github/workflows/CI.yml (2)

1-6: LGTM! Improved workflow specificity.

The explicit workflow name and refined triggers (pull requests + main branch pushes only) improve the CI workflow's clarity and scope.


35-35: Minor formatting improvement.

Good cleanup of the build step formatting.

containers/Containerfile.cpu (1)

15-15: LGTM! Consistent alignment with Dagster tooling.

The change from --extra pipeline to --extra dagster maintains consistency with the CUDA container and aligns both containers with Dagster-specific dependencies.

.github/workflows/CD.yml (2)

3-9: LGTM! Well-structured workflow triggers.

The trigger configuration is comprehensive and appropriate:

  • Push/PR to main for testing
  • Release events for publishing
  • Good separation of concerns

12-31: LGTM! Clean build job implementation.

The build job properly uses matrix strategy and follows the same pattern as the CI workflow for consistency.

Comment thread .github/workflows/CD.yml
Comment on lines +52 to +85
publish_docker:
runs-on: ubuntu-latest
continue-on-error: true
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}

- name: Build and push Docker image
id: push
uses: docker/build-push-action@v5
with:
context: .
file: ./containers/Containerfile.cuda
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

Update Docker login action version and approve overall structure.

The Docker publish job is well-structured with proper permissions and GHCR integration. However, the static analysis correctly identifies an outdated action version.

Apply this diff to update the outdated action:

      - name: Log in to GitHub Container Registry
-        uses: docker/login-action@v2
+        uses: docker/login-action@v3
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
publish_docker:
runs-on: ubuntu-latest
continue-on-error: true
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v5
with:
context: .
file: ./containers/Containerfile.cuda
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
publish_docker:
runs-on: ubuntu-latest
continue-on-error: true
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v5
with:
context: .
file: ./containers/Containerfile.cuda
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
🧰 Tools
🪛 actionlint (1.7.7)

65-65: the runner of "docker/login-action@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
In .github/workflows/CD.yml between lines 52 and 85, update the
docker/login-action from version v2 to the latest stable version (e.g., v2.2 or
newer) to ensure compatibility and security. Replace the uses line under "Log in
to GitHub Container Registry" step with the updated version tag while keeping
the rest of the step unchanged. Confirm the overall job structure remains intact
and permissions are correctly set.

Comment thread .github/workflows/CI.yml
Comment on lines +36 to +54
pre-commit:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install .
- uses: pre-commit/action@v3.0.1
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

Update action versions and align with build job approach.

The pre-commit job has several issues:

  1. Outdated actions: Using actions/checkout@v3 and actions/setup-python@v3 instead of v4
  2. Inconsistent setup: Uses actions/setup-python while the build job uses uv python install
  3. Manual dependency management: Installs dependencies manually instead of using uv sync

Apply this diff to align with the build job's approach and update action versions:

-  pre-commit:
-    runs-on: ubuntu-latest
-    strategy:
-      fail-fast: false
-      matrix:
-        python-version: ["3.11", "3.12"]
-    steps:
-    - uses: actions/checkout@v3
-    - name: Set up Python ${{ matrix.python-version }}
-      uses: actions/setup-python@v3
-      with:
-        python-version: ${{ matrix.python-version }}
-    - name: Install dependencies
-      run: |
-        python -m pip install --upgrade pip
-        python -m pip install pytest
-        if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
-        python -m pip install .
-    - uses: pre-commit/action@v3.0.1
+  pre-commit:
+    runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        python-version: ["3.11", "3.12"]
+    steps:
+      - uses: actions/checkout@v4
+      - name: Install uv
+        uses: astral-sh/setup-uv@v3
+      - name: Set up Python ${{ matrix.python-version }}
+        run: uv python install ${{ matrix.python-version }}
+      - name: Install the project
+        run: uv sync --all-extras --dev
+      - uses: pre-commit/action@v3.0.1
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
pre-commit:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install .
- uses: pre-commit/action@v3.0.1
pre-commit:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install the project
run: uv sync --all-extras --dev
- uses: pre-commit/action@v3.0.1
🧰 Tools
🪛 actionlint (1.7.7)

43-43: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


45-45: the runner of "actions/setup-python@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
In .github/workflows/CI.yml lines 36 to 54, update the pre-commit job to use the
latest action versions by changing actions/checkout@v3 and
actions/setup-python@v3 to v4. Replace the manual Python dependency installation
steps with the uv python install and uv sync commands to align with the build
job's approach, ensuring consistent environment setup and dependency management
across jobs.

@kazewong kazewong merged commit 3d01168 into main Jul 24, 2025
7 of 9 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant