Skip to content

Commit 47beff0

Browse files
Merge branch '5.0.0' into merge-5.0.0-into-main
2 parents a4948c4 + 2954bfe commit 47beff0

28 files changed

Lines changed: 551 additions & 346 deletions

.github/workflows/4_builderpackage_dashboard.yml

Lines changed: 84 additions & 75 deletions
Large diffs are not rendered by default.

.github/workflows/4_builderpackage_dashboard_core.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ on:
3838

3939
jobs:
4040
build:
41-
runs-on: ${{ (inputs.ARCHITECTURE == 'x86_64' || inputs.ARCHITECTURE == 'amd64') && 'wz-linux-amd64' || 'wz-linux-arm64' }}
41+
runs-on: ${{ (inputs.ARCHITECTURE == 'x86_64' || inputs.ARCHITECTURE == 'amd64') && format('codebuild-github-actions-codebuild-runner-dashboard-amd-{0}-{1}', github.run_id, github.run_attempt) || format('codebuild-github-actions-codebuild-runner-dashboard-arm-{0}-{1}', github.run_id, github.run_attempt) }}
4242
name: Build
4343
defaults:
4444
run:
@@ -88,14 +88,21 @@ jobs:
8888
run: |
8989
echo "ARTIFACT_BUILD_NAME=wazuh-dashboard_${{ env.WZD_VERSION }}-${{ env.WZD_REVISION }}_${{ (inputs.ARCHITECTURE == 'x86_64' || inputs.ARCHITECTURE == 'amd64') && 'x64' || 'arm64' }}.${{ matrix.DISTRIBUTION }}" >> $GITHUB_ENV
9090
91+
- name: Create non-root build user
92+
run: |
93+
useradd -m builduser
94+
chown -R builduser:builduser .
95+
9196
- name: Run bootstrap
92-
run: yarn osd bootstrap
97+
run: |
98+
chown -R builduser:builduser "$YARN_CACHE_LOCATION" 2>/dev/null || true
99+
sudo -u builduser -H env PATH="$PATH" yarn osd bootstrap
93100
94101
- name: Build
95-
run: yarn build-platform --${{(inputs.ARCHITECTURE == 'x86_64' || inputs.ARCHITECTURE == 'amd64') && 'linux' || 'linux-arm'}} --skip-os-packages --release
102+
run: sudo -u builduser -H env PATH="$PATH" yarn build-platform --${{(inputs.ARCHITECTURE == 'x86_64' || inputs.ARCHITECTURE == 'amd64') && 'linux' || 'linux-arm'}} --skip-os-packages --release
96103

97104
- name: Rename artifact
98-
run: mv /home/runner/work/wazuh-dashboard/wazuh-dashboard/artifacts/target/opensearch-dashboards-${{ env.VERSION }}-linux-${{ (inputs.ARCHITECTURE == 'x86_64' || inputs.ARCHITECTURE == 'amd64') && 'x64' || 'arm64' }}.${{ matrix.DISTRIBUTION }} /home/runner/work/wazuh-dashboard/wazuh-dashboard/artifacts/target/${{ env.ARTIFACT_BUILD_NAME }}
105+
run: mv target/opensearch-dashboards-${{ env.VERSION }}-linux-${{ (inputs.ARCHITECTURE == 'x86_64' || inputs.ARCHITECTURE == 'amd64') && 'x64' || 'arm64' }}.${{ matrix.DISTRIBUTION }} target/${{ env.ARTIFACT_BUILD_NAME }}
99106

100107
- uses: actions/upload-artifact@v4
101108
if: success()

.github/workflows/4_bumper_repository.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ on:
3636
jobs:
3737
bump:
3838
name: Repository bumper
39-
runs-on: ubuntu-22.04
39+
runs-on: codebuild-github-actions-codebuild-runner-dashboard-amd-${{ github.run_id }}-${{ github.run_attempt }}
4040
permissions:
4141
contents: write
4242
pull-requests: write

.github/workflows/5_builderpackage_dashboard.yml

Lines changed: 99 additions & 124 deletions
Large diffs are not rendered by default.

.github/workflows/5_builderpackage_dashboard_core.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ on:
3838

3939
jobs:
4040
build:
41-
runs-on: ${{ (inputs.ARCHITECTURE == 'x86_64' || inputs.ARCHITECTURE == 'amd64') && 'wz-linux-amd64' || 'wz-linux-arm64' }}
41+
runs-on: ${{ (inputs.ARCHITECTURE == 'x86_64' || inputs.ARCHITECTURE == 'amd64') && format('codebuild-github-actions-codebuild-runner-dashboard-amd-{0}-{1}', github.run_id, github.run_attempt) || format('codebuild-github-actions-codebuild-runner-dashboard-arm-{0}-{1}', github.run_id, github.run_attempt) }}
4242
name: Build
4343
defaults:
4444
run:
@@ -88,14 +88,23 @@ jobs:
8888
run: |
8989
echo "ARTIFACT_BUILD_NAME=wazuh-dashboard_${{ env.WZD_VERSION }}-${{ env.WZD_REVISION }}_${{ (inputs.ARCHITECTURE == 'x86_64' || inputs.ARCHITECTURE == 'amd64') && 'x64' || 'arm64' }}.${{ matrix.DISTRIBUTION }}" >> $GITHUB_ENV
9090
91+
# Workaround: AWS CodeBuild runners execute as root; OpenSearch Dashboards refuses to run as root
92+
- name: Create non-root build user
93+
run: |
94+
useradd -m builduser
95+
chown -R builduser:builduser .
96+
9197
- name: Run bootstrap
92-
run: yarn osd bootstrap || yarn osd bootstrap
98+
run: |
99+
chown -R builduser:builduser "$YARN_CACHE_LOCATION" 2>/dev/null || true
100+
sudo -u builduser -H env PATH="$PATH" yarn osd bootstrap || \
101+
sudo -u builduser -H env PATH="$PATH" yarn osd bootstrap
93102
94103
- name: Build
95-
run: yarn build-platform --${{(inputs.ARCHITECTURE == 'x86_64' || inputs.ARCHITECTURE == 'amd64') && 'linux' || 'linux-arm'}} --skip-os-packages --release
104+
run: sudo -u builduser -H env PATH="$PATH" yarn build-platform --${{(inputs.ARCHITECTURE == 'x86_64' || inputs.ARCHITECTURE == 'amd64') && 'linux' || 'linux-arm'}} --skip-os-packages --release
96105

97106
- name: Rename artifact
98-
run: mv /home/runner/work/wazuh-dashboard/wazuh-dashboard/artifacts/target/opensearch-dashboards-${{ env.VERSION }}-linux-${{ (inputs.ARCHITECTURE == 'x86_64' || inputs.ARCHITECTURE == 'amd64') && 'x64' || 'arm64' }}.${{ matrix.DISTRIBUTION }} /home/runner/work/wazuh-dashboard/wazuh-dashboard/artifacts/target/${{ env.ARTIFACT_BUILD_NAME }}
107+
run: mv target/opensearch-dashboards-${{ env.VERSION }}-linux-${{ (inputs.ARCHITECTURE == 'x86_64' || inputs.ARCHITECTURE == 'amd64') && 'x64' || 'arm64' }}.${{ matrix.DISTRIBUTION }} target/${{ env.ARTIFACT_BUILD_NAME }}
99108

100109
- uses: actions/upload-artifact@v4
101110
if: success()

.github/workflows/5_builderpackage_dashboard_plugins.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ on:
3535
jobs:
3636
build-plugins:
3737
name: Build Plugin ${{ inputs.name }}
38-
runs-on: wz-linux-amd64
38+
runs-on: codebuild-github-actions-codebuild-runner-dashboard-amd-${{ github.run_id }}-${{ github.run_attempt }}
3939
env:
4040
PLUGIN_REF: ${{ inputs.reference_plugins }}
4141
steps:
@@ -113,18 +113,27 @@ jobs:
113113
mv ${{inputs.pathPlugin}}/${{ inputs.path }} plugins/${{ inputs.name }}
114114
rm -rf ${{inputs.pathPlugin}}
115115
116+
# Workaround: AWS CodeBuild runners execute as root; OpenSearch Dashboards refuses to run as root
117+
- name: Create non-root build user
118+
run: |
119+
useradd -m builduser
120+
chown -R builduser:builduser .
121+
116122
- name: Bootstrap with Plugins
117123
env:
118124
GIT_REF: ${{ env.PLUGIN_REF }}
119-
run: yarn osd bootstrap --single-version=loose || yarn osd bootstrap --single-version=loose
125+
run: |
126+
chown -R builduser:builduser "$YARN_CACHE_LOCATION" 2>/dev/null || true
127+
sudo -u builduser -H env PATH="$PATH" GIT_REF="$GIT_REF" yarn osd bootstrap --single-version=loose || \
128+
sudo -u builduser -H env PATH="$PATH" GIT_REF="$GIT_REF" yarn osd bootstrap --single-version=loose
120129
121130
- name: Build Plugin
122131
working-directory: plugins/${{ inputs.name }}
123132
env:
124133
GIT_REF: ${{ env.PLUGIN_REF }}
125134
run: |
126135
set -o pipefail
127-
OPENSEARCH_DASHBOARDS_VERSION=${{ inputs.version_opensearch }} yarn build 2>&1 | tee build.log
136+
sudo -u builduser -H env PATH="$PATH" GIT_REF="$GIT_REF" OPENSEARCH_DASHBOARDS_VERSION="${{ inputs.version_opensearch }}" yarn build 2>&1 | tee build.log
128137
129138
- name: Build metadata
130139
if: success()

.github/workflows/5_builderpackage_dev_docker_image.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ on:
3838

3939
jobs:
4040
extract-versions:
41-
runs-on: ubuntu-24.04
41+
runs-on: codebuild-github-actions-codebuild-runner-dashboard-amd-${{ github.run_id }}-${{ github.run_attempt }}
4242
outputs:
4343
opensearch_version: ${{ steps.versions.outputs.opensearch_version }}
4444
tag: ${{ steps.versions.outputs.tag }}
@@ -95,10 +95,10 @@ jobs:
9595
matrix:
9696
include:
9797
- platform: linux/amd64
98-
runner: ubuntu-24.04
98+
runner: ${{ format('codebuild-github-actions-codebuild-runner-dashboard-amd-{0}-{1}', github.run_id, github.run_attempt) }}
9999
arch: amd64
100100
- platform: linux/arm64
101-
runner: ubuntu-24.04-arm
101+
runner: ${{ format('codebuild-github-actions-codebuild-runner-dashboard-arm-{0}-{1}', github.run_id, github.run_attempt) }}
102102
arch: arm64
103103
steps:
104104
- name: Checkout code
@@ -153,7 +153,7 @@ jobs:
153153
--push
154154
155155
create-manifest:
156-
runs-on: ubuntu-24.04
156+
runs-on: ${{ format('codebuild-github-actions-codebuild-runner-dashboard-amd-{0}-{1}', github.run_id, github.run_attempt) }}
157157
needs: [extract-versions, build]
158158

159159
steps:

.github/workflows/5_bumper_repository.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ on:
5050
jobs:
5151
bump:
5252
name: Repository bumper
53-
runs-on: ubuntu-22.04
53+
runs-on: codebuild-github-actions-codebuild-runner-dashboard-amd-${{ github.run_id }}-${{ github.run_attempt }}
5454
permissions:
5555
contents: write
5656
pull-requests: write

.github/workflows/6_builderpackage_dashboard.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ jobs:
127127
# - Final package name based on system, architecture and stage.
128128
# - Architecture flags.
129129
# - Version, revision and commit SHA information.
130-
runs-on: wz-linux-amd64
130+
runs-on: codebuild-github-actions-codebuild-runner-dashboard-amd-${{ github.run_id }}-${{ github.run_attempt }}
131131
name: Setup variables
132132
outputs:
133133
CURRENT_DIR: ${{ steps.setup-variables.outputs.CURRENT_DIR }}
@@ -235,7 +235,7 @@ jobs:
235235
validate-job:
236236
# 1. Validates valid combinations of system and architecture.
237237
# 2. Sets up AWS CLI for future uploads if needed.
238-
runs-on: wz-linux-amd64
238+
runs-on: codebuild-github-actions-codebuild-runner-dashboard-amd-${{ github.run_id }}-${{ github.run_attempt }}
239239
needs: setup-variables
240240
name: Validate job
241241
steps:
@@ -296,7 +296,7 @@ jobs:
296296
# 7. Finally, upload the resulting package as an artifact.
297297
needs:
298298
[setup-variables, build-main-plugins, build-base, build-security-plugin, build-report-plugin]
299-
runs-on: ${{ (inputs.architecture == 'arm64' || inputs.architecture == 'aarch64') && 'wz-linux-arm64' || 'wz-linux-amd64' }}
299+
runs-on: ${{ (inputs.architecture == 'arm64' || inputs.architecture == 'aarch64') && format('codebuild-github-actions-codebuild-runner-dashboard-arm-{0}-{1}', github.run_id, github.run_attempt) || format('codebuild-github-actions-codebuild-runner-dashboard-amd-{0}-{1}', github.run_id, github.run_attempt) }}
300300
name: Generate packages
301301
steps:
302302
- name: Checkout code

.github/workflows/6_builderpackage_dashboard_core.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ on:
3838

3939
jobs:
4040
build:
41-
runs-on: ${{ (inputs.ARCHITECTURE == 'x86_64' || inputs.ARCHITECTURE == 'amd64') && 'wz-linux-amd64' || 'wz-linux-arm64' }}
41+
runs-on: ${{ (inputs.ARCHITECTURE == 'x86_64' || inputs.ARCHITECTURE == 'amd64') && 'codebuild-github-actions-codebuild-runner-dashboard-amd-${{ github.run_id }}-${{ github.run_attempt }}' || 'codebuild-github-actions-codebuild-runner-dashboard-arm-${{ github.run_id }}-${{ github.run_attempt }}' }}
4242
name: Build
4343
defaults:
4444
run:

0 commit comments

Comments
 (0)