Skip to content

ci: nightly builds for mainnet and nextnet #7219

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

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open

Conversation

ns212
Copy link
Contributor

@ns212 ns212 commented Jun 14, 2025

This pull request introduces significant updates to the GitHub Actions workflows for building Docker images. The changes include the removal of scheduled builds from the build_dockers.yml workflow, the addition of new input parameters for network configurations in the build_dockers_workflow.yml, and the creation of a dedicated nightly Docker build workflow (nightly_docker_builds.yml). These updates aim to streamline the build process and enhance configurability for nightly builds.

Removal of scheduled builds from build_dockers.yml:

  • Removed the cron-based scheduled builds and associated logic for daily and weekly builds from the build_dockers.yml workflow. This workflow now exclusively supports manual dispatch builds. [1] [2]

Enhancements in build_dockers_workflow.yml:

  • Added new input parameters (tari_network, tari_target_network, and tari_network_dir) to allow specifying Tari network configurations during workflow execution.
  • Introduced logic to set environment variables based on the new inputs, enabling dynamic configuration of network-related settings.

Creation of nightly_docker_builds.yml:

  • Added a new workflow dedicated to nightly Docker builds, triggered either by a schedule or manually. This workflow supports selective builds with configurable platforms and build items.
  • Implemented matrix-based builds for both mainnet and nextnet networks, enabling parallel builds with distinct configurations for each network.

Summary by CodeRabbit

  • New Features
    • Introduced a new workflow to automate nightly Docker image builds, supporting both scheduled and manual triggers with configurable options.
  • Chores
    • Removed automatic scheduled builds from the main Docker build workflow; it now only triggers on pushes and manual runs.
    • Added new input parameters for network configuration in the Docker build workflow for greater flexibility.

@ns212 ns212 requested a review from a team as a code owner June 14, 2025 09:12
Copy link
Contributor

coderabbitai bot commented Jun 14, 2025

Walkthrough

Scheduled Docker builds have been refactored by removing the schedule event from the main build workflow and introducing a dedicated nightly workflow. The nightly workflow supports daily and weekly builds with matrix-based parallelization and environment setup. Additionally, the reusable Docker build workflow now accepts extra network-related input parameters for greater configurability.

Changes

File(s) Change Summary
.github/workflows/build_dockers.yml Removed scheduled (cron) triggers and related conditional logic; now triggers only on push/dispatch
.github/workflows/build_dockers_workflow.yml Added new workflow inputs for network parameters; updated environment setup logic accordingly
.github/workflows/nightly_docker_builds.yml Added new workflow for nightly and weekly scheduled Docker builds with matrix and environment setup

Sequence Diagram(s)

sequenceDiagram
    participant Scheduler as GitHub Scheduler
    participant User as Manual Trigger
    participant NightlyWorkflow as Nightly Docker Builds Workflow
    participant SetupJob as nightly_builds_envs_setup
    participant BuildJob as nightly_builds_run
    participant ReusableWorkflow as build_dockers_workflow

    Scheduler->>NightlyWorkflow: Trigger (cron schedule)
    User->>NightlyWorkflow: Trigger (workflow_dispatch)
    NightlyWorkflow->>SetupJob: Start setup job
    SetupJob->>SetupJob: Set env vars, determine matrix, set build params
    SetupJob->>BuildJob: Pass matrix & params
    BuildJob->>ReusableWorkflow: Call reusable workflow for each matrix entry
    ReusableWorkflow->>ReusableWorkflow: Build Docker images with provided params
Loading

Suggested reviewers

  • SWvheerden

Poem

🐇
Nightly builds now hop with glee,
In workflows new, with matrix spree!
Old schedules gone, new triggers in tow,
Networks and targets ready to go.
The Docker dance at midnight’s call—
Rabbits rejoice, builds for all!
🛠️✨


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 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
Contributor

@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/build_dockers_workflow.yml (1)

94-96: Remove trailing whitespace to satisfy YAML lint
There's a trailing space at line 96 causing a lint error. Please remove the extra whitespace.

Proposed diff:

-94  # Setup the json build matrix 
+94  # Setup the json build matrix
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7ab0cd5 and 2773add.

📒 Files selected for processing (3)
  • .github/workflows/build_dockers.yml (0 hunks)
  • .github/workflows/build_dockers_workflow.yml (2 hunks)
  • .github/workflows/nightly_docker_builds.yml (1 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/build_dockers.yml
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/nightly_docker_builds.yml

54-54: property "toolchain" is not defined in object type {build_items: string; platforms: string}

(expression)

🪛 YAMLlint (1.37.1)
.github/workflows/nightly_docker_builds.yml

[error] 96-96: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (12)
  • GitHub Check: test (mainnet, stagenet)
  • GitHub Check: test (nextnet, nextnet)
  • GitHub Check: test (testnet, esmeralda)
  • GitHub Check: ci
  • GitHub Check: cargo check with stable
  • GitHub Check: Cucumber tests / FFI
  • GitHub Check: Cucumber tests / Base Layer
  • GitHub Check: test (nextnet, nextnet)
  • GitHub Check: test (mainnet, stagenet)
  • GitHub Check: test (testnet, esmeralda)
  • GitHub Check: ci
  • GitHub Check: cargo check with stable
🔇 Additional comments (3)
.github/workflows/build_dockers_workflow.yml (1)

38-49: Well-structured input parameters for network configurability
The new tari_network, tari_target_network, and tari_network_dir inputs enhance flexibility and reuse of this workflow.

.github/workflows/nightly_docker_builds.yml (2)

1-7: Good scheduling and manual trigger configuration
The schedule cron and workflow_dispatch trigger are configured correctly to support nightly runs and manual dispatch.


107-126: Reuse of the Docker build workflow is correct
The nightly_builds_run job cleanly invokes the reusable build_dockers_workflow.yml, passing through all required inputs, including the newly added network parameters.

Comment on lines +130 to +140
- name: Set network environment variables from inputs
if: ${{ inputs.tari_target_network != '' }}
shell: bash
run: |
echo "Setting network environment variables from workflow inputs"
echo "TARI_NETWORK=${{ inputs.tari_network }}" >> $GITHUB_ENV
echo "TARI_TARGET_NETWORK=${{ inputs.tari_target_network }}" >> $GITHUB_ENV
echo "TARI_NETWORK_DIR=${{ inputs.tari_network_dir }}" >> $GITHUB_ENV
echo "Network: ${{ inputs.tari_network }}"
echo "Target Network: ${{ inputs.tari_target_network }}"
echo "Network Dir: ${{ inputs.tari_network_dir }}"
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Ensure consistent export of TARI_NETWORK_DIR in tag-based logic
Currently, the Set network environment variables from inputs step only exports TARI_NETWORK_DIR when using inputs. To avoid missing TARI_NETWORK_DIR for tag-triggered runs, extend the Declare TestNet for tags step to also set TARI_NETWORK_DIR.

Proposed diff:

--- a/.github/workflows/build_dockers_workflow.yml
+++ b/.github/workflows/build_dockers_workflow.yml
@@ -121,6 +121,9 @@
           echo "TARI_TARGET_NETWORK=${TARI_TARGET_NETWORK}" >> $GITHUB_ENV
+          # Export network dir based on the declared network
+          echo "TARI_NETWORK_DIR=${TARI_NETWORK}" >> $GITHUB_ENV
📝 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
- name: Set network environment variables from inputs
if: ${{ inputs.tari_target_network != '' }}
shell: bash
run: |
echo "Setting network environment variables from workflow inputs"
echo "TARI_NETWORK=${{ inputs.tari_network }}" >> $GITHUB_ENV
echo "TARI_TARGET_NETWORK=${{ inputs.tari_target_network }}" >> $GITHUB_ENV
echo "TARI_NETWORK_DIR=${{ inputs.tari_network_dir }}" >> $GITHUB_ENV
echo "Network: ${{ inputs.tari_network }}"
echo "Target Network: ${{ inputs.tari_target_network }}"
echo "Network Dir: ${{ inputs.tari_network_dir }}"
- name: Declare TestNet for tags
if: startsWith(github.ref, 'refs/tags/v')
shell: bash
run: |
echo "Declaring TestNet environment variables for tag run"
echo "TARI_NETWORK=${TARI_NETWORK}" >> $GITHUB_ENV
echo "TARI_TARGET_NETWORK=${TARI_TARGET_NETWORK}" >> $GITHUB_ENV
# Export network dir based on the declared network
echo "TARI_NETWORK_DIR=${TARI_NETWORK}" >> $GITHUB_ENV
🤖 Prompt for AI Agents
In .github/workflows/build_dockers_workflow.yml around lines 130 to 140, the
environment variable TARI_NETWORK_DIR is only set when inputs are provided,
causing it to be missing in tag-triggered runs. To fix this, update the Declare
TestNet for tags step to also export TARI_NETWORK_DIR by adding a line that sets
TARI_NETWORK_DIR with the appropriate value, ensuring consistent availability of
this variable across all workflow triggers.

Comment on lines +63 to +67
if [ "${{ github.event_name }}" == "workflow_dispatch" ] ; then
echo "Manual Nightly Build - selective"
echo "platforms=${{ github.event.inputs.platforms }}" >> $GITHUB_OUTPUT
echo "build_items=${{ github.event.inputs.build_items }}" >> $GITHUB_OUTPUT
else
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Critical: Missing tag_alias output for manual dispatch
In the workflow_dispatch branch, you set platforms and build_items but do not emit a tag_alias output. Downstream jobs rely on needs.nightly_builds_envs_setup.outputs.tag_alias, which will be empty for manual runs, leading to malformed tags.

Suggested fix: add a default or input-based tag_alias for manual builds. Example:

@@ if [ "${{ github.event_name }}" == "workflow_dispatch" ] ; then
-   echo "build_items=${{ github.event.inputs.build_items }}" >> $GITHUB_OUTPUT
+   echo "build_items=${{ github.event.inputs.build_items }}" >> $GITHUB_OUTPUT
+   echo "tag_alias=${{ github.event.inputs.tag_alias || '' }}" >> $GITHUB_OUTPUT

Or define a tag_alias input under workflow_dispatch inputs.

📝 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
if [ "${{ github.event_name }}" == "workflow_dispatch" ] ; then
echo "Manual Nightly Build - selective"
echo "platforms=${{ github.event.inputs.platforms }}" >> $GITHUB_OUTPUT
echo "build_items=${{ github.event.inputs.build_items }}" >> $GITHUB_OUTPUT
else
if [ "${{ github.event_name }}" == "workflow_dispatch" ] ; then
echo "Manual Nightly Build - selective"
echo "platforms=${{ github.event.inputs.platforms }}" >> $GITHUB_OUTPUT
echo "build_items=${{ github.event.inputs.build_items }}" >> $GITHUB_OUTPUT
echo "tag_alias=${{ github.event.inputs.tag_alias || '' }}" >> $GITHUB_OUTPUT
else
🤖 Prompt for AI Agents
In .github/workflows/nightly_docker_builds.yml around lines 63 to 67, the manual
dispatch branch sets outputs for platforms and build_items but does not set the
required tag_alias output, causing downstream jobs to fail. To fix this, add an
echo statement to set tag_alias in the $GITHUB_OUTPUT file during the
workflow_dispatch branch, either using a default value or an input parameter
defined under workflow_dispatch inputs, ensuring tag_alias is always available
for downstream steps.

Copy link

github-actions bot commented Jun 14, 2025

Test Results (CI)

    3 files    126 suites   1h 39m 24s ⏱️
1 340 tests 1 338 ✅ 0 💤 2 ❌
4 018 runs  4 014 ✅ 0 💤 4 ❌

For more details on these failures, see this check.

Results for commit 2773add.

♻️ This comment has been updated with latest results.

Copy link

Test Results (Integration tests)

 2 files  + 2  10 suites  +10   2h 37m 7s ⏱️ + 2h 37m 7s
27 tests +27  18 ✅ +18  1 💤 +1   8 ❌ + 8 
41 runs  +41  21 ✅ +21  1 💤 +1  19 ❌ +19 

For more details on these failures, see this check.

Results for commit 2773add. ± Comparison against base commit 7ab0cd5.

@leet4tari
Copy link
Contributor

There is already a PR in which adds nightly test builds - #7206

Anything you looking for that can be added to that PR?

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.

2 participants