Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/actionlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
self-hosted-runner:
# Ubicloud machines we are using
labels:
- ubicloud-standard-8-arm
- ubicloud-standard-8-arm-ubuntu-2404
- ubicloud-standard-8-ubuntu-2404
3 changes: 2 additions & 1 deletion .github/workflows/build_opensearch_dashboards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ run-name: |
on:
workflow_dispatch:
schedule:
- cron: '0 0 2/2 * *' # https://crontab.guru/#0_0_2/2_*_*
- cron: "0 0 2/2 * *" # https://crontab.guru/#0_0_2/2_*_*
push:
branches: [main]
tags:
Expand Down Expand Up @@ -34,3 +34,4 @@ jobs:
product-name: opensearch-dashboards
sdp-version: ${{ github.ref_type == 'tag' && github.ref_name || '0.0.0-dev' }}
registry-namespace: sdp
runners: ubicloud
52 changes: 42 additions & 10 deletions .github/workflows/reusable_build_image.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
on:

Check warning on line 1 in .github/workflows/reusable_build_image.yaml

View workflow job for this annotation

GitHub Actions / pre-commit

1:1 [document-start] missing document start "---"
workflow_call:
inputs:
product-name:
Expand All @@ -10,6 +10,13 @@
registry-namespace:
required: true
type: string
runners:
description: |
The type of runners used.
- `mixed`: x86_64 builds run on the GitHub hosted runners and the aarch64 builds run on the Ubicloud runners
- `ubicloud`: Both the x86_64 and the aarch64 builds run on the Ubicloud runners
default: mixed
type: string
secrets:
harbor-robot-secret:
description: The secret for the Harbor robot user used to push images and manifest
Expand All @@ -19,8 +26,33 @@
required: true

jobs:
generate_matrix:
name: Generate Version List
generate_runner_dimension:
name: Generate Runner Dimension
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- id: runners
shell: bash
env:
RUNNERS_TYPE: ${{ inputs.runners }}
run: |
if [ "$RUNNERS_TYPE" == "mixed" ]; then
RUNNERS=$(jq --compact-output < .github/workflows/runners/mixed.json)
echo "RUNNERS=$RUNNERS" | tee -a "$GITHUB_OUTPUT"
elif [ "$RUNNERS_TYPE" == "ubicloud" ]; then
RUNNERS=$(jq --compact-output < .github/workflows/runners/ubicloud.json)
echo "RUNNERS=$RUNNERS" | tee -a "$GITHUB_OUTPUT"
else
echo "Invalid runners type, expected 'mixed' or 'ubicloud'"
exit 1
fi
outputs:
runners: ${{ steps.runners.outputs.RUNNERS }}

generate_version_dimension:
name: Generate Version Dimension
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand All @@ -35,17 +67,17 @@

build:
name: Build/Publish ${{ matrix.versions }}-${{ matrix.runner.arch }} Image
needs: [generate_matrix]
needs:
- generate_version_dimension
- generate_runner_dimension
permissions:
id-token: write
runs-on: ${{ matrix.runner.name }}
strategy:
fail-fast: false
matrix:
runner:
- {name: "ubuntu-latest", arch: "amd64"}
- {name: "ubicloud-standard-8-arm-ubuntu-2404", arch: "arm64"}
versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }}
versions: ${{ fromJson(needs.generate_version_dimension.outputs.versions) }}
runner: ${{ fromJson(needs.generate_runner_dimension.outputs.runners) }}
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down Expand Up @@ -76,14 +108,14 @@

publish_manifests:
name: Build/Publish ${{ matrix.versions }} Manifests
needs: [generate_matrix, build]
needs: [generate_version_dimension, build]
permissions:
id-token: write
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
versions: ${{ fromJson(needs.generate_matrix.outputs.versions) }}
versions: ${{ fromJson(needs.generate_version_dimension.outputs.versions) }}
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand All @@ -101,7 +133,7 @@

notify:
name: Failure Notification
needs: [generate_matrix, build, publish_manifests]
needs: [generate_version_dimension, build, publish_manifests]
runs-on: ubuntu-latest
if: failure() || (github.run_attempt > 1 && !cancelled())
steps:
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/runners/mixed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"name": "ubuntu-latest",
"arch": "amd64"
},
{
"name": "ubicloud-standard-8-arm-ubuntu-2404",
"arch": "arm64"
}
]
10 changes: 10 additions & 0 deletions .github/workflows/runners/ubicloud.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"name": "ubicloud-standard-8-ubuntu-2404",
"arch": "amd64"
},
{
"name": "ubicloud-standard-8-arm-ubuntu-2404",
"arch": "arm64"
}
]