-
Notifications
You must be signed in to change notification settings - Fork 247
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
base: development
Are you sure you want to change the base?
Conversation
WalkthroughScheduled 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
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
Suggested reviewers
Poem
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
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
📒 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 newtari_network
,tari_target_network
, andtari_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
Theschedule
cron andworkflow_dispatch
trigger are configured correctly to support nightly runs and manual dispatch.
107-126
: Reuse of the Docker build workflow is correct
Thenightly_builds_run
job cleanly invokes the reusablebuild_dockers_workflow.yml
, passing through all required inputs, including the newly added network parameters.
- 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 }}" |
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.
🛠️ 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.
- 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.
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 |
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.
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.
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.
Test Results (CI) 3 files 126 suites 1h 39m 24s ⏱️ For more details on these failures, see this check. Results for commit 2773add. ♻️ This comment has been updated with latest results. |
Test Results (Integration tests) 2 files + 2 10 suites +10 2h 37m 7s ⏱️ + 2h 37m 7s For more details on these failures, see this check. Results for commit 2773add. ± Comparison against base commit 7ab0cd5. |
There is already a PR in which adds nightly test builds - #7206 Anything you looking for that can be added to that PR? |
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 thebuild_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
:build_dockers.yml
workflow. This workflow now exclusively supports manual dispatch builds. [1] [2]Enhancements in
build_dockers_workflow.yml
:tari_network
,tari_target_network
, andtari_network_dir
) to allow specifying Tari network configurations during workflow execution.Creation of
nightly_docker_builds.yml
:mainnet
andnextnet
networks, enabling parallel builds with distinct configurations for each network.Summary by CodeRabbit