From 594e9120ed7979fbfd64cc364217a2291353b674 Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Thu, 21 Aug 2025 12:40:30 +0100 Subject: [PATCH 01/35] electron cloud build --- .../bs_meta_browser_build_and_test.yml | 190 ++++++++++++++++++ .github/workflows/bs_meta_browser_ci_ec2.yml | 134 ++++++++++++ .github/workflows/chromium.yml | 32 ++- .github/workflows/electron.yml | 32 ++- 4 files changed, 384 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/bs_meta_browser_build_and_test.yml create mode 100644 .github/workflows/bs_meta_browser_ci_ec2.yml diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml new file mode 100644 index 000000000..c9b18f6d9 --- /dev/null +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -0,0 +1,190 @@ +name: 'BrightSign Build and Test Meta-Browser: Build and test workflow' +on: + workflow_call: + inputs: + runner_name: + description: 'Runner name' + required: true + type: string + + github_hosted_runner: + description: 'Whether to use GitHub-hosted runner' + required: false + type: boolean + default: false + + build_type: + description: 'Build Type' + required: true + type: string + + yocto_version: + description: 'Yocto version' + required: true + type: string + + chromium_version: + description: 'Chromium version (ozone-wayland or x11)' + required: true + type: string + + libc_flavour: + description: 'libc flavour' + required: true + type: string + + arch: + description: 'Architecture' + required: true + type: string + + aws_arn_role: + required: true + type: string + + aws_region: + required: true + type: string + +jobs: + build-and-test-meta-browser: + name: Build and Test Meta-Browser + runs-on: ${{ inputs.runner_name }} + defaults: + run: + shell: bash + steps: + # Configure AWS credentials for accessing S3 cache buckets + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1-node16 + with: + aws-region: ${{ inputs.aws_region }} + role-to-assume: ${{ inputs.aws_arn_role }} + + # Download config file and set environment variables + - name: Download config file and set env vars from it + run: | + aws s3 cp s3://meta-browser-ci-config-bucket/config.json . + aws s3 cp s3://meta-browser-ci-config-bucket/set_github_env_vars.py . + python3 set_github_env_vars.py --file config.json + + # Install required packages + - name: Install build dependencies + run: | + sudo apt-get update + sudo apt-get install -y nfs-common git build-essential python3-pip + sudo apt-get install -y gawk wget git-core diffstat unzip texinfo gcc-multilib \ + build-essential chrpath socat cpio python3 python3-pip python3-pexpect \ + xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa \ + libsdl1.2-dev pylint3 xterm python3-subunit mesa-common-dev zstd liblz4-tool + + # Mount EFS file systems + - name: Mount EFS file systems + run: | + # Create mount points + sudo mkdir -p /mnt/shared-cache /mnt/git-mirror + + # Mount shared cache EFS (sstate, downloads) + sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,intr,timeo=600 \ + ${{ env.SHARED_CACHE_EFS_ID }}.efs.${{ env.AWS_REGION }}.amazonaws.com:/ /mnt/shared-cache + + # Mount git mirror EFS + sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,intr,timeo=600 \ + ${{ env.GIT_MIRROR_EFS_ID }}.efs.${{ env.AWS_REGION }}.amazonaws.com:/ /mnt/git-mirror + + # Create cache directories if they don't exist + sudo mkdir -p /mnt/shared-cache/sstate-cache + sudo mkdir -p /mnt/shared-cache/downloads + + # Set permissions + sudo chown -R ubuntu:ubuntu /mnt/shared-cache /mnt/git-mirror + + # Set up build directories with EFS mounts + - name: Setup build environment + run: | + mkdir -p /home/ubuntu/yocto/${{ inputs.yocto_version }} + cd /home/ubuntu/yocto/${{ inputs.yocto_version }} + + # Clean any previous builds + rm -rf meta-browser meta-chromium-test build/tmp/work/*/*/*/pseudo build/tmp/sysroots-components/*/pseudo 2>/dev/null || true + + # Create symlinks to EFS mounts + ln -sf /mnt/shared-cache/sstate-cache ./sstate-cache + ln -sf /mnt/shared-cache/downloads ./downloads + + # Clone repositories (check if PR or manual trigger) + - name: Clone repositories + run: | + cd /home/ubuntu/yocto/${{ inputs.yocto_version }} + + if [ "${{ github.event_name }}" = "pull_request" ]; then + GH_URL="$GITHUB_SERVER_URL/${{ github.event.pull_request.head.repo.full_name }}" + GH_REV="$GITHUB_HEAD_REF" + else + GH_URL="$GITHUB_SERVER_URL/brightsign/meta-browser" + GH_REV="master" + fi + + echo "Cloning from $GH_URL, branch/ref: $GH_REV" + git clone $GH_URL + git -C meta-browser checkout $GH_REV + + # Clone the test repo + git clone -b main https://github.com/brightsign/meta-chromium-test.git + + # Run the build + - name: Build Browser + run: | + cd /home/ubuntu/yocto/${{ inputs.yocto_version }} + + # Set environment variables for caching (EFS mounts only) + export SSTATE_DIR=/mnt/shared-cache/sstate-cache + export DL_DIR=/mnt/shared-cache/downloads + + # Determine build type based on chromium_version parameter + if [[ "${{ inputs.chromium_version }}" == *"ozone-wayland"* ]]; then + BUILD_TYPE="chromium" + BROWSER_VERSION="ozone-wayland" + elif [[ "${{ inputs.chromium_version }}" == *"ozone-x11"* ]]; then + BUILD_TYPE="electron" + BROWSER_VERSION="ozone-x11" + elif [[ "${{ inputs.chromium_version }}" == *"x11"* ]]; then + BUILD_TYPE="chromium" + BROWSER_VERSION="x11" + else + BUILD_TYPE="chromium" + BROWSER_VERSION="${{ inputs.chromium_version }}" + fi + + echo "Building $BUILD_TYPE with version $BROWSER_VERSION" + + # Run the build script + ./meta-chromium-test/scripts/build.sh ${{ inputs.yocto_version }} ${{ inputs.arch }} $BROWSER_VERSION $BUILD_TYPE ${{ inputs.libc_flavour }} + + # Upload build artifacts to S3 (if successful) + - name: Upload artifacts + if: success() + run: | + cd /home/ubuntu/yocto/${{ inputs.yocto_version }} + + # Find and upload build artifacts + DEPLOY_DIR=$(find build -name "deploy" -type d | head -1) + if [ -n "$DEPLOY_DIR" ] && [ -d "$DEPLOY_DIR" ]; then + echo "Uploading artifacts from $DEPLOY_DIR" + # Determine build type for artifact path + if [[ "${{ inputs.chromium_version }}" == *"ozone-x11"* ]]; then + BUILD_TYPE="electron" + else + BUILD_TYPE="chromium" + fi + aws s3 sync $DEPLOY_DIR/ s3://${ARTIFACT_BUCKET_NAME}/meta-browser/${{ inputs.yocto_version }}/${{ inputs.arch }}/${BUILD_TYPE}/${{ inputs.chromium_version }}/${{ github.run_id }}/ --quiet + else + echo "No deploy directory found" + fi + + # Unmount EFS file systems + - name: Cleanup EFS mounts + if: always() + run: | + sudo umount /mnt/shared-cache || true + sudo umount /mnt/git-mirror || true diff --git a/.github/workflows/bs_meta_browser_ci_ec2.yml b/.github/workflows/bs_meta_browser_ci_ec2.yml new file mode 100644 index 000000000..3263ae283 --- /dev/null +++ b/.github/workflows/bs_meta_browser_ci_ec2.yml @@ -0,0 +1,134 @@ +name: 'BrightSign Build and Test Meta-Browser: EC2 controller' +on: + workflow_call: + inputs: + build_type: + description: 'Build Type' + required: true + type: string + + yocto_version: + description: 'Yocto version' + required: true + type: string + + chromium_version: + description: 'Chromium version (ozone-wayland or x11)' + required: true + type: string + + libc_flavour: + description: 'libc flavour' + required: true + type: string + + arch: + description: 'Architecture' + required: true + type: string + + instance_type: + description: 'EC2 instance type' + required: false + type: string + default: c6a.4xlarge + + leave_ec2_instance_running: + description: 'Leave EC2 instance running after use' + type: boolean + default: false + + instance_name_postfix: + description: 'Name to add as postfix to the EC2 machine' + type: string + default: auto-triggered + + aws_arn_role: + required: true + type: string + + aws_region: + required: true + type: string + +jobs: + start-runner: + name: Start self-hosted EC2 runner + runs-on: ubuntu-latest + outputs: + label: ${{ steps.start-ec2-runner.outputs.label }} + ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }} + steps: + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1-node16 + with: + aws-region: ${{ inputs.aws_region }} + role-to-assume: ${{ inputs.aws_arn_role }} + + - name: Download config file and set env vars from it + run: | + aws s3 cp s3://meta-browser-ci-config-bucket/config.json . + aws s3 cp s3://meta-browser-ci-config-bucket/set_github_env_vars.py . + python3 set_github_env_vars.py --file config.json + + - name: Start EC2 runner + id: start-ec2-runner + uses: brightsign/ec2-github-runner@0fa8b183dd4124fd191ccdbc48b68f0ea46a9634 + with: + mode: start + github-app-private-key: ${{ secrets.GH_APP_PRIVATE_KEY }} + github-app-id: 287690 + ec2-image-id: ami-07b4a16cd5294af98 # TODO: Create custom AMI for Yocto builds + ec2-instance-type: ${{ inputs.instance_type }} + subnet-id: ${{ env.VPC_SUBNET_ID }} + security-group-id: ${{ env.VPC_SG_ID }} + run-as-service-with-user: ubuntu + runner-home-dir: /home/ubuntu + aws-resource-tags: > # optional, requires additional permissions + [ + {"Key": "Name", "Value": "github-runner-meta-browser-${{ inputs.instance_name_postfix }}"}, + {"Key": "GitHubRepository", "Value": "${{ github.repository }}"}, + {"Key": "YoctoVersion", "Value": "${{ inputs.yocto_version }}"}, + {"Key": "ChromiumVersion", "Value": "${{ inputs.chromium_version }}"}, + {"Key": "Architecture", "Value": "${{ inputs.arch }}"} + ] + + build-and-test-meta-browser: + name: Build and Test Meta-Browser + needs: start-runner # required to start the main job when the runner is ready + uses: ./.github/workflows/bs_meta_browser_build_and_test.yml + secrets: inherit + with: + runner_name: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner + github_hosted_runner: false + build_type: ${{ inputs.build_type }} + yocto_version: ${{ inputs.yocto_version }} + chromium_version: ${{ inputs.chromium_version }} + libc_flavour: ${{ inputs.libc_flavour }} + arch: ${{ inputs.arch }} + aws_arn_role: ${{ inputs.aws_arn_role }} + aws_region: ${{ inputs.aws_region }} + + stop-runner: + name: Stop self-hosted EC2 runner + needs: + - start-runner # required to get output from the start-runner job + - build-and-test-meta-browser # required to wait when the main job is done + runs-on: ubuntu-latest + if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs + steps: + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1-node16 + with: + role-to-assume: ${{ inputs.aws_arn_role }} + aws-region: ${{ inputs.aws_region }} + + - name: Stop EC2 runner + uses: brightsign/ec2-github-runner@0fa8b183dd4124fd191ccdbc48b68f0ea46a9634 + with: + mode: stop + github-app-private-key: ${{ secrets.GH_APP_PRIVATE_KEY }} + github-app-id: 287690 + label: ${{ needs.start-runner.outputs.label }} + ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }} + leave-ec2-instance-running: ${{ inputs.leave_ec2_instance_running }} diff --git a/.github/workflows/chromium.yml b/.github/workflows/chromium.yml index 4f5d7899b..c7bd5bf31 100644 --- a/.github/workflows/chromium.yml +++ b/.github/workflows/chromium.yml @@ -11,6 +11,11 @@ on: description: 'Branch to checkout for the workflow' required: true default: 'master' + use_aws: + description: 'Use AWS EC2 instances instead of local runner' + required: false + type: boolean + default: true pull_request: branches: - master @@ -24,10 +29,33 @@ permissions: contents: read actions: read checks: write + id-token: write # Required for OIDC authentication jobs: - build: - if: ${{ github.repository_owner == 'brightsign' }} + # AWS-based builds (default) + aws-matrix-build: + if: ${{ github.repository_owner == 'brightsign' && (inputs.use_aws == true || inputs.use_aws == null) }} + strategy: + matrix: + yocto_version: [master] + chromium_version: [ozone-wayland, x11] + libc_flavour: [glibc] + arch: [arm, aarch64, x86-64] + uses: ./.github/workflows/bs_meta_browser_ci_ec2.yml + secrets: inherit + with: + build_type: "release" + yocto_version: ${{ matrix.yocto_version }} + chromium_version: ${{ matrix.chromium_version }} + libc_flavour: ${{ matrix.libc_flavour }} + arch: ${{ matrix.arch }} + aws_arn_role: "arn:aws:iam::195607249165:role/github-actions-meta-browser-repo" + aws_region: "us-east-1" + instance_type: "c6a.4xlarge" + + # Local runner fallback + local-build: + if: ${{ github.repository_owner == 'brightsign' && inputs.use_aws == false }} strategy: matrix: yocto_version: [master] diff --git a/.github/workflows/electron.yml b/.github/workflows/electron.yml index ae174c85b..5a242fa0a 100644 --- a/.github/workflows/electron.yml +++ b/.github/workflows/electron.yml @@ -11,6 +11,11 @@ on: description: 'Branch to checkout for the workflow' required: true default: 'master' + use_aws: + description: 'Use AWS EC2 instances instead of local runner' + required: false + type: boolean + default: true pull_request: branches: - master @@ -24,10 +29,33 @@ permissions: contents: read actions: read checks: write + id-token: write # Required for OIDC authentication jobs: - build: - if: ${{ github.repository_owner == 'brightsign' }} + # AWS-based builds (default) + aws-matrix-build: + if: ${{ github.repository_owner == 'brightsign' && (inputs.use_aws == true || inputs.use_aws == null) }} + strategy: + matrix: + yocto_version: [master] + chromium_version: [ozone-wayland, ozone-x11] + libc_flavour: [glibc] + arch: [arm, aarch64, x86-64] + uses: ./.github/workflows/bs_meta_browser_ci_ec2.yml + secrets: inherit + with: + build_type: "release" + yocto_version: ${{ matrix.yocto_version }} + chromium_version: ${{ matrix.chromium_version }} + libc_flavour: ${{ matrix.libc_flavour }} + arch: ${{ matrix.arch }} + aws_arn_role: "arn:aws:iam::195607249165:role/github-actions-meta-browser-repo" + aws_region: "us-east-1" + instance_type: "c6a.4xlarge" + + # Local runner fallback + local-build: + if: ${{ github.repository_owner == 'brightsign' && inputs.use_aws == false }} strategy: matrix: yocto_version: [master] From a8bd3cfabd04e236e67e8618abf491d07d29c3f4 Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Thu, 21 Aug 2025 13:11:44 +0100 Subject: [PATCH 02/35] Use aws by default, fix dependencies --- .github/workflows/bs_meta_browser_build_and_test.yml | 5 ++++- .github/workflows/chromium.yml | 8 ++++---- .github/workflows/electron.yml | 8 ++++---- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index c9b18f6d9..3cb2c28af 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -76,7 +76,10 @@ jobs: sudo apt-get install -y gawk wget git-core diffstat unzip texinfo gcc-multilib \ build-essential chrpath socat cpio python3 python3-pip python3-pexpect \ xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa \ - libsdl1.2-dev pylint3 xterm python3-subunit mesa-common-dev zstd liblz4-tool + libsdl1.2-dev pylint xterm python3-subunit mesa-common-dev zstd liblz4-tool + locale --all-locales | grep en_US.utf8 || true + echo "en_US.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen + sudo locale-gen # Mount EFS file systems - name: Mount EFS file systems diff --git a/.github/workflows/chromium.yml b/.github/workflows/chromium.yml index c7bd5bf31..97e06f678 100644 --- a/.github/workflows/chromium.yml +++ b/.github/workflows/chromium.yml @@ -32,9 +32,9 @@ permissions: id-token: write # Required for OIDC authentication jobs: - # AWS-based builds (default) + # AWS-based builds (always for PR, default for manual dispatch) aws-matrix-build: - if: ${{ github.repository_owner == 'brightsign' && (inputs.use_aws == true || inputs.use_aws == null) }} + if: ${{ github.repository_owner == 'brightsign' && (github.event_name == 'pull_request' || inputs.use_aws == true || inputs.use_aws == null) }} strategy: matrix: yocto_version: [master] @@ -53,9 +53,9 @@ jobs: aws_region: "us-east-1" instance_type: "c6a.4xlarge" - # Local runner fallback + # Local runner (manual dispatch only, when explicitly disabled AWS) local-build: - if: ${{ github.repository_owner == 'brightsign' && inputs.use_aws == false }} + if: ${{ github.repository_owner == 'brightsign' && github.event_name == 'workflow_dispatch' && inputs.use_aws == false }} strategy: matrix: yocto_version: [master] diff --git a/.github/workflows/electron.yml b/.github/workflows/electron.yml index 5a242fa0a..194602bbe 100644 --- a/.github/workflows/electron.yml +++ b/.github/workflows/electron.yml @@ -32,9 +32,9 @@ permissions: id-token: write # Required for OIDC authentication jobs: - # AWS-based builds (default) + # AWS-based builds (always for PR, default for manual dispatch) aws-matrix-build: - if: ${{ github.repository_owner == 'brightsign' && (inputs.use_aws == true || inputs.use_aws == null) }} + if: ${{ github.repository_owner == 'brightsign' && (github.event_name == 'pull_request' || inputs.use_aws == true || inputs.use_aws == null) }} strategy: matrix: yocto_version: [master] @@ -53,9 +53,9 @@ jobs: aws_region: "us-east-1" instance_type: "c6a.4xlarge" - # Local runner fallback + # Local runner (manual dispatch only, when explicitly disabled AWS) local-build: - if: ${{ github.repository_owner == 'brightsign' && inputs.use_aws == false }} + if: ${{ github.repository_owner == 'brightsign' && github.event_name == 'workflow_dispatch' && inputs.use_aws == false }} strategy: matrix: yocto_version: [master] From d2b3273a6d904e6f0e2b26bcb0e950860896d705 Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Thu, 21 Aug 2025 13:28:02 +0100 Subject: [PATCH 03/35] efs dns debug --- .../bs_meta_browser_build_and_test.yml | 63 +++++++++++++++++-- 1 file changed, 57 insertions(+), 6 deletions(-) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index 3cb2c28af..09411e0ac 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -87,13 +87,64 @@ jobs: # Create mount points sudo mkdir -p /mnt/shared-cache /mnt/git-mirror - # Mount shared cache EFS (sstate, downloads) - sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,intr,timeo=600 \ - ${{ env.SHARED_CACHE_EFS_ID }}.efs.${{ env.AWS_REGION }}.amazonaws.com:/ /mnt/shared-cache + # Debug DNS resolution + echo "=== DNS Troubleshooting ===" + echo "Checking DNS resolution for EFS endpoints..." + nslookup ${{ env.SHARED_CACHE_EFS_ID }}.efs.${{ env.AWS_REGION }}.amazonaws.com || echo "DNS lookup failed" + nslookup ${{ env.GIT_MIRROR_EFS_ID }}.efs.${{ env.AWS_REGION }}.amazonaws.com || echo "DNS lookup failed" - # Mount git mirror EFS - sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,intr,timeo=600 \ - ${{ env.GIT_MIRROR_EFS_ID }}.efs.${{ env.AWS_REGION }}.amazonaws.com:/ /mnt/git-mirror + # Check AWS metadata service and VPC DNS + echo "=== VPC DNS Settings ===" + curl -s http://169.254.169.254/latest/meta-data/network/interfaces/macs/ | head -1 | xargs -I {} curl -s http://169.254.169.254/latest/meta-data/network/interfaces/macs/{}/vpc-id || echo "VPC metadata failed" + + # Check if we can reach AWS services + echo "=== AWS Connectivity Check ===" + curl -s --connect-timeout 10 https://s3.amazonaws.com && echo "S3 reachable" || echo "S3 not reachable" + + # Alternative: Use mount target IP if DNS fails + echo "=== Alternative EFS Mount Strategy ===" + # Try to resolve mount target IPs through AWS CLI if available + if command -v aws &> /dev/null; then + echo "Attempting to get EFS mount targets..." + aws efs describe-mount-targets --file-system-id ${{ env.SHARED_CACHE_EFS_ID }} --region ${{ env.AWS_REGION }} || echo "AWS CLI describe failed" + fi + + # Try using regional EFS mount target instead + echo "=== Trying regional EFS mount ===" + echo "Shared cache EFS: ${{ env.SHARED_CACHE_EFS_ID }}" + echo "Git mirror EFS: ${{ env.GIT_MIRROR_EFS_ID }}" + echo "AWS Region: ${{ env.AWS_REGION }}" + + # Mount shared cache EFS (sstate, downloads) with retries + for i in {1..3}; do + echo "Attempt $i: Mounting shared cache EFS..." + if sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,intr,timeo=600 \ + ${{ env.SHARED_CACHE_EFS_ID }}.efs.${{ env.AWS_REGION }}.amazonaws.com:/ /mnt/shared-cache; then + echo "Shared cache EFS mounted successfully" + break + else + echo "Mount attempt $i failed, retrying in 10 seconds..." + sleep 10 + fi + done + + # Mount git mirror EFS with retries + for i in {1..3}; do + echo "Attempt $i: Mounting git mirror EFS..." + if sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,intr,timeo=600 \ + ${{ env.GIT_MIRROR_EFS_ID }}.efs.${{ env.AWS_REGION }}.amazonaws.com:/ /mnt/git-mirror; then + echo "Git mirror EFS mounted successfully" + break + else + echo "Mount attempt $i failed, retrying in 10 seconds..." + sleep 10 + fi + done + + # Verify mounts + echo "=== Mount Verification ===" + mount | grep efs || echo "No EFS mounts found" + df -h | grep mnt || echo "No mnt filesystems found" # Create cache directories if they don't exist sudo mkdir -p /mnt/shared-cache/sstate-cache From dd3d87344b5aeed8d4f24fd7c856318af27fc83e Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Thu, 21 Aug 2025 14:11:20 +0100 Subject: [PATCH 04/35] more debug --- .../bs_meta_browser_build_and_test.yml | 95 ++++++++++++++++++- 1 file changed, 90 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index 09411e0ac..e2bf1c3f5 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -73,13 +73,30 @@ jobs: run: | sudo apt-get update sudo apt-get install -y nfs-common git build-essential python3-pip + + # Yocto build dependencies (matching Docker container requirements) sudo apt-get install -y gawk wget git-core diffstat unzip texinfo gcc-multilib \ build-essential chrpath socat cpio python3 python3-pip python3-pexpect \ xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa \ - libsdl1.2-dev pylint xterm python3-subunit mesa-common-dev zstd liblz4-tool + libsdl1.2-dev pylint xterm python3-subunit mesa-common-dev zstd liblz4-tool \ + file locales sudo + + # Additional tools that might be in the Docker container + sudo apt-get install -y vim nano less curl wget rsync + + # Set up locale (as typically done in Docker containers) locale --all-locales | grep en_US.utf8 || true echo "en_US.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen sudo locale-gen + export LANG=en_US.UTF-8 + export LC_ALL=en_US.UTF-8 + + # Install kas (Yocto build tool) - this is crucial for the build script + python3 -m pip install --user kas + + # Ensure the user has a proper shell environment + echo 'export LANG=en_US.UTF-8' >> ~/.bashrc + echo 'export LC_ALL=en_US.UTF-8' >> ~/.bashrc # Mount EFS file systems - name: Mount EFS file systems @@ -156,6 +173,16 @@ jobs: # Set up build directories with EFS mounts - name: Setup build environment run: | + # Set environment variables that might be expected + export LANG=en_US.UTF-8 + export LC_ALL=en_US.UTF-8 + + # Create the expected directory structure for the build script + # The build script expects to run from /yocto/master and create dirs in /yocto + sudo mkdir -p /yocto/${{ inputs.yocto_version }} + sudo chown -R ubuntu:ubuntu /yocto + + # Also ensure our working directory exists mkdir -p /home/ubuntu/yocto/${{ inputs.yocto_version }} cd /home/ubuntu/yocto/${{ inputs.yocto_version }} @@ -165,6 +192,20 @@ jobs: # Create symlinks to EFS mounts ln -sf /mnt/shared-cache/sstate-cache ./sstate-cache ln -sf /mnt/shared-cache/downloads ./downloads + + # Create symlinks in /yocto to allow the build script to work + ln -sf /mnt/shared-cache/sstate-cache /yocto/yocto_sstate_chromium + ln -sf /mnt/shared-cache/downloads /yocto/yocto_dl + + # Create other directories that the build script expects with proper permissions + sudo mkdir -p /yocto/yocto_ccache /yocto/test-images + sudo chmod 755 /yocto/yocto_ccache /yocto/test-images + sudo chown -R ubuntu:ubuntu /yocto/yocto_ccache /yocto/test-images + + # Ensure kas and other tools are in PATH for the build + echo "export PATH=\$PATH:\$HOME/.local/bin" >> ~/.bashrc + echo "export LANG=en_US.UTF-8" >> ~/.bashrc + echo "export LC_ALL=en_US.UTF-8" >> ~/.bashrc # Clone repositories (check if PR or manual trigger) - name: Clone repositories @@ -183,13 +224,38 @@ jobs: git clone $GH_URL git -C meta-browser checkout $GH_REV - # Clone the test repo - git clone -b main https://github.com/brightsign/meta-chromium-test.git + # Clone the test repo (use electron-master branch for electron builds) + if [[ "${{ inputs.chromium_version }}" == *"ozone-x11"* ]]; then + echo "Cloning meta-chromium-test electron-master branch for electron build" + git clone -b electron-master https://github.com/brightsign/meta-chromium-test.git + else + echo "Cloning meta-chromium-test main branch for chromium build" + git clone -b main https://github.com/brightsign/meta-chromium-test.git + fi # Run the build - name: Build Browser run: | - cd /home/ubuntu/yocto/${{ inputs.yocto_version }} + # Set environment variables that the Docker container would have + export LANG=en_US.UTF-8 + export LC_ALL=en_US.UTF-8 + export PATH=$PATH:$HOME/.local/bin + + # Debug environment + echo "=== Environment Debug ===" + echo "PATH: $PATH" + echo "LANG: $LANG" + echo "LC_ALL: $LC_ALL" + echo "User: $(whoami)" + echo "Home: $HOME" + which kas || echo "kas not found in PATH" + + # The build script expects to run from /yocto/master + cd /yocto/${{ inputs.yocto_version }} + + # Copy the repositories from our working directory + cp -r /home/ubuntu/yocto/${{ inputs.yocto_version }}/meta-browser ./ + cp -r /home/ubuntu/yocto/${{ inputs.yocto_version }}/meta-chromium-test ./ # Set environment variables for caching (EFS mounts only) export SSTATE_DIR=/mnt/shared-cache/sstate-cache @@ -211,6 +277,23 @@ jobs: fi echo "Building $BUILD_TYPE with version $BROWSER_VERSION" + echo "Current directory: $(pwd)" + echo "Directory contents: $(ls -la)" + echo "Yocto directories:" + ls -la /yocto/ 2>/dev/null || echo "No /yocto directory" + + # Verify the build script exists and is executable + if [ -f "./meta-chromium-test/scripts/build.sh" ]; then + echo "Build script found" + ls -la ./meta-chromium-test/scripts/build.sh + chmod +x ./meta-chromium-test/scripts/build.sh + echo "=== Build script first 20 lines ===" + head -20 ./meta-chromium-test/scripts/build.sh + else + echo "Build script not found!" + find . -name "build.sh" 2>/dev/null || echo "No build.sh found anywhere" + exit 1 + fi # Run the build script ./meta-chromium-test/scripts/build.sh ${{ inputs.yocto_version }} ${{ inputs.arch }} $BROWSER_VERSION $BUILD_TYPE ${{ inputs.libc_flavour }} @@ -219,7 +302,7 @@ jobs: - name: Upload artifacts if: success() run: | - cd /home/ubuntu/yocto/${{ inputs.yocto_version }} + cd /yocto/${{ inputs.yocto_version }} # Find and upload build artifacts DEPLOY_DIR=$(find build -name "deploy" -type d | head -1) @@ -234,6 +317,8 @@ jobs: aws s3 sync $DEPLOY_DIR/ s3://${ARTIFACT_BUCKET_NAME}/meta-browser/${{ inputs.yocto_version }}/${{ inputs.arch }}/${BUILD_TYPE}/${{ inputs.chromium_version }}/${{ github.run_id }}/ --quiet else echo "No deploy directory found" + echo "Available directories:" + find . -name "deploy" -type d 2>/dev/null || echo "No deploy directories found" fi # Unmount EFS file systems From 2b81dd22cccfecc96d0a5c26d212a5128260b793 Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Thu, 21 Aug 2025 14:27:31 +0100 Subject: [PATCH 05/35] Fix EFS mounting issues - Add NFS egress rule (port 2049) to VPC security group in Terraform - Improve EFS mounting logic with DNS and IP fallback - Add better debugging and status indicators - Fix Yocto build environment setup for meta-chromium-test script - Install kas tool and set up proper directory structure - Use electron-master branch for chromium builds --- .../bs_meta_browser_build_and_test.yml | 109 ++++++++++++++---- .github/workflows/meta-browser.code-workspace | 14 +++ 2 files changed, 98 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/meta-browser.code-workspace diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index e2bf1c3f5..a5d4e8073 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -3,7 +3,31 @@ on: workflow_call: inputs: runner_name: - description: 'Runner name' + de # Mount shared cache EFS (sstate, downloads) with retries + SHARED_CACHE_MOUNTED=false + for i in {1..3}; do + echo "Attempt $i: Mounting shared cache EFS..." + if sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,intr,timeo=600 + ${{ env.SHARED_CACHE_EFS_ID }}.efs.${{ env.AWS_REGION }}.amazonaws.com:/ /mnt/shared-cache; then + echo "Shared cache EFS mounted successfully" + SHARED_CACHE_MOUNTED=true + break + fi + echo "Mount attempt $i failed, trying with IP address..." + # Get mount target IP for this subnet + MOUNT_TARGET_IP=$(aws efs describe-mount-targets --file-system-id ${{ env.SHARED_CACHE_EFS_ID }} --region ${{ env.AWS_REGION }} --query 'MountTargets[?SubnetId==`${{ env.VPC_SUBNET_ID }}`].IpAddress' --output text) + if [ -n "$MOUNT_TARGET_IP" ] && [ "$MOUNT_TARGET_IP" != "None" ]; then + echo "Trying to mount using IP address: $MOUNT_TARGET_IP" + if sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,intr,timeo=600 + $MOUNT_TARGET_IP:/ /mnt/shared-cache; then + echo "Shared cache EFS mounted successfully using IP" + SHARED_CACHE_MOUNTED=true + break + fi + fi + echo "Mount attempt $i failed, retrying in 10 seconds..." + sleep 10 + doneRunner name' required: true type: string @@ -119,56 +143,91 @@ jobs: curl -s --connect-timeout 10 https://s3.amazonaws.com && echo "S3 reachable" || echo "S3 not reachable" # Alternative: Use mount target IP if DNS fails - echo "=== Alternative EFS Mount Strategy ===" - # Try to resolve mount target IPs through AWS CLI if available + echo "=== EFS Mount Strategy ===" + # Get mount target IPs through AWS CLI if command -v aws &> /dev/null; then - echo "Attempting to get EFS mount targets..." - aws efs describe-mount-targets --file-system-id ${{ env.SHARED_CACHE_EFS_ID }} --region ${{ env.AWS_REGION }} || echo "AWS CLI describe failed" + echo "Getting EFS mount targets..." + SHARED_CACHE_IP=$(aws efs describe-mount-targets --file-system-id ${{ env.SHARED_CACHE_EFS_ID }} --region ${{ env.AWS_REGION }} --query 'MountTargets[0].IpAddress' --output text 2>/dev/null || echo "") + GIT_MIRROR_IP=$(aws efs describe-mount-targets --file-system-id ${{ env.GIT_MIRROR_EFS_ID }} --region ${{ env.AWS_REGION }} --query 'MountTargets[0].IpAddress' --output text 2>/dev/null || echo "") + echo "Shared cache EFS IP: $SHARED_CACHE_IP" + echo "Git mirror EFS IP: $GIT_MIRROR_IP" fi - # Try using regional EFS mount target instead - echo "=== Trying regional EFS mount ===" + echo "=== Mounting EFS file systems ===" echo "Shared cache EFS: ${{ env.SHARED_CACHE_EFS_ID }}" echo "Git mirror EFS: ${{ env.GIT_MIRROR_EFS_ID }}" echo "AWS Region: ${{ env.AWS_REGION }}" - # Mount shared cache EFS (sstate, downloads) with retries - for i in {1..3}; do + # Mount shared cache EFS (sstate, downloads) with DNS and IP fallback + SHARED_MOUNTED=false + for i in {1..2}; do echo "Attempt $i: Mounting shared cache EFS..." + # Try DNS first if sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,intr,timeo=600 \ - ${{ env.SHARED_CACHE_EFS_ID }}.efs.${{ env.AWS_REGION }}.amazonaws.com:/ /mnt/shared-cache; then - echo "Shared cache EFS mounted successfully" + ${{ env.SHARED_CACHE_EFS_ID }}.efs.${{ env.AWS_REGION }}.amazonaws.com:/ /mnt/shared-cache 2>/dev/null; then + echo "✓ Shared cache EFS mounted successfully via DNS" + SHARED_MOUNTED=true break - else - echo "Mount attempt $i failed, retrying in 10 seconds..." - sleep 10 + elif [ -n "$SHARED_CACHE_IP" ]; then + echo "DNS failed, trying IP address: $SHARED_CACHE_IP" + if sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,intr,timeo=600 \ + $SHARED_CACHE_IP:/ /mnt/shared-cache; then + echo "✓ Shared cache EFS mounted successfully via IP" + SHARED_MOUNTED=true + break + fi fi + echo "✗ Mount attempt $i failed, retrying..." + sleep 5 done - # Mount git mirror EFS with retries - for i in {1..3}; do + # Mount git mirror EFS with DNS and IP fallback + GIT_MOUNTED=false + for i in {1..2}; do echo "Attempt $i: Mounting git mirror EFS..." + # Try DNS first if sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,intr,timeo=600 \ - ${{ env.GIT_MIRROR_EFS_ID }}.efs.${{ env.AWS_REGION }}.amazonaws.com:/ /mnt/git-mirror; then - echo "Git mirror EFS mounted successfully" + ${{ env.GIT_MIRROR_EFS_ID }}.efs.${{ env.AWS_REGION }}.amazonaws.com:/ /mnt/git-mirror 2>/dev/null; then + echo "✓ Git mirror EFS mounted successfully via DNS" + GIT_MOUNTED=true break - else - echo "Mount attempt $i failed, retrying in 10 seconds..." - sleep 10 + elif [ -n "$GIT_MIRROR_IP" ]; then + echo "DNS failed, trying IP address: $GIT_MIRROR_IP" + if sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,intr,timeo=600 \ + $GIT_MIRROR_IP:/ /mnt/git-mirror; then + echo "✓ Git mirror EFS mounted successfully via IP" + GIT_MOUNTED=true + break + fi fi + echo "✗ Mount attempt $i failed, retrying..." + sleep 5 done + # Report mount results + if [ "$SHARED_MOUNTED" = "false" ]; then + echo "⚠️ WARNING: Failed to mount shared cache EFS - builds will be slower without cache" + fi + if [ "$GIT_MOUNTED" = "false" ]; then + echo "⚠️ WARNING: Failed to mount git mirror EFS - will clone repositories directly" + fi + + if [ "$SHARED_MOUNTED" = "true" ] && [ "$GIT_MOUNTED" = "true" ]; then + echo "🎉 All EFS file systems mounted successfully!" + fi + # Verify mounts echo "=== Mount Verification ===" - mount | grep efs || echo "No EFS mounts found" - df -h | grep mnt || echo "No mnt filesystems found" + mount | grep mnt || echo "No /mnt filesystems found" + df -h | grep mnt || echo "No /mnt filesystems in df" - # Create cache directories if they don't exist + # Create cache directories even if mounts failed (for graceful degradation) sudo mkdir -p /mnt/shared-cache/sstate-cache sudo mkdir -p /mnt/shared-cache/downloads + sudo mkdir -p /mnt/git-mirror # Set permissions - sudo chown -R ubuntu:ubuntu /mnt/shared-cache /mnt/git-mirror + sudo chown -R ubuntu:ubuntu /mnt/shared-cache /mnt/git-mirror || true # Set up build directories with EFS mounts - name: Setup build environment diff --git a/.github/workflows/meta-browser.code-workspace b/.github/workflows/meta-browser.code-workspace new file mode 100644 index 000000000..17d6f76c1 --- /dev/null +++ b/.github/workflows/meta-browser.code-workspace @@ -0,0 +1,14 @@ +{ + "folders": [ + { + "path": "../.." + }, + { + "path": "../../../sources/chromium-138.0.7204.35" + }, + { + "path": "../../../meta" + } + ], + "settings": {} +} \ No newline at end of file From efcffe85d1da8c105a01bb72baecde10e477003b Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Thu, 21 Aug 2025 14:32:09 +0100 Subject: [PATCH 06/35] Fix YAML syntax and improve EFS mounting - Fix corrupted YAML structure in build workflow - Add kas installation for Yocto builds - Improve EFS mounting with IP fallback and better error handling - Add proper directory structure setup for build script - Enhanced debugging and status reporting - Use electron-master branch for electron builds --- .../bs_meta_browser_build_and_test.yml | 56 ++++++++----------- 1 file changed, 23 insertions(+), 33 deletions(-) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index a5d4e8073..0e12e244d 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -3,31 +3,7 @@ on: workflow_call: inputs: runner_name: - de # Mount shared cache EFS (sstate, downloads) with retries - SHARED_CACHE_MOUNTED=false - for i in {1..3}; do - echo "Attempt $i: Mounting shared cache EFS..." - if sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,intr,timeo=600 - ${{ env.SHARED_CACHE_EFS_ID }}.efs.${{ env.AWS_REGION }}.amazonaws.com:/ /mnt/shared-cache; then - echo "Shared cache EFS mounted successfully" - SHARED_CACHE_MOUNTED=true - break - fi - echo "Mount attempt $i failed, trying with IP address..." - # Get mount target IP for this subnet - MOUNT_TARGET_IP=$(aws efs describe-mount-targets --file-system-id ${{ env.SHARED_CACHE_EFS_ID }} --region ${{ env.AWS_REGION }} --query 'MountTargets[?SubnetId==`${{ env.VPC_SUBNET_ID }}`].IpAddress' --output text) - if [ -n "$MOUNT_TARGET_IP" ] && [ "$MOUNT_TARGET_IP" != "None" ]; then - echo "Trying to mount using IP address: $MOUNT_TARGET_IP" - if sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,intr,timeo=600 - $MOUNT_TARGET_IP:/ /mnt/shared-cache; then - echo "Shared cache EFS mounted successfully using IP" - SHARED_CACHE_MOUNTED=true - break - fi - fi - echo "Mount attempt $i failed, retrying in 10 seconds..." - sleep 10 - doneRunner name' + description: 'Runner name' required: true type: string @@ -112,6 +88,9 @@ jobs: locale --all-locales | grep en_US.utf8 || true echo "en_US.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen sudo locale-gen + + # Install kas (Yocto build tool) + python3 -m pip install --user kas export LANG=en_US.UTF-8 export LC_ALL=en_US.UTF-8 @@ -143,21 +122,25 @@ jobs: curl -s --connect-timeout 10 https://s3.amazonaws.com && echo "S3 reachable" || echo "S3 not reachable" # Alternative: Use mount target IP if DNS fails - echo "=== EFS Mount Strategy ===" - # Get mount target IPs through AWS CLI + echo "=== Alternative EFS Mount Strategy ===" + # Try to resolve mount target IPs through AWS CLI if available if command -v aws &> /dev/null; then - echo "Getting EFS mount targets..." - SHARED_CACHE_IP=$(aws efs describe-mount-targets --file-system-id ${{ env.SHARED_CACHE_EFS_ID }} --region ${{ env.AWS_REGION }} --query 'MountTargets[0].IpAddress' --output text 2>/dev/null || echo "") - GIT_MIRROR_IP=$(aws efs describe-mount-targets --file-system-id ${{ env.GIT_MIRROR_EFS_ID }} --region ${{ env.AWS_REGION }} --query 'MountTargets[0].IpAddress' --output text 2>/dev/null || echo "") - echo "Shared cache EFS IP: $SHARED_CACHE_IP" - echo "Git mirror EFS IP: $GIT_MIRROR_IP" + echo "Attempting to get EFS mount targets..." + aws efs describe-mount-targets --file-system-id ${{ env.SHARED_CACHE_EFS_ID }} --region ${{ env.AWS_REGION }} || echo "AWS CLI describe failed" fi + # Try using regional EFS mount target instead echo "=== Mounting EFS file systems ===" echo "Shared cache EFS: ${{ env.SHARED_CACHE_EFS_ID }}" echo "Git mirror EFS: ${{ env.GIT_MIRROR_EFS_ID }}" echo "AWS Region: ${{ env.AWS_REGION }}" + # Get EFS mount target IPs for fallback + SHARED_CACHE_IP=$(aws efs describe-mount-targets --file-system-id ${{ env.SHARED_CACHE_EFS_ID }} --region ${{ env.AWS_REGION }} --query 'MountTargets[0].IpAddress' --output text 2>/dev/null || echo "") + GIT_MIRROR_IP=$(aws efs describe-mount-targets --file-system-id ${{ env.GIT_MIRROR_EFS_ID }} --region ${{ env.AWS_REGION }} --query 'MountTargets[0].IpAddress' --output text 2>/dev/null || echo "") + echo "Shared cache EFS IP: $SHARED_CACHE_IP" + echo "Git mirror EFS IP: $GIT_MIRROR_IP" + # Mount shared cache EFS (sstate, downloads) with DNS and IP fallback SHARED_MOUNTED=false for i in {1..2}; do @@ -181,7 +164,7 @@ jobs: sleep 5 done - # Mount git mirror EFS with DNS and IP fallback + # Mount git mirror EFS with DNS and IP fallback GIT_MOUNTED=false for i in {1..2}; do echo "Attempt $i: Mounting git mirror EFS..." @@ -256,6 +239,13 @@ jobs: ln -sf /mnt/shared-cache/sstate-cache /yocto/yocto_sstate_chromium ln -sf /mnt/shared-cache/downloads /yocto/yocto_dl + # Create other directories that the build script expects + sudo mkdir -p /yocto/yocto_ccache /yocto/test-images + sudo chown -R ubuntu:ubuntu /yocto/yocto_ccache /yocto/test-images + + # Ensure kas is in PATH for the build + echo "export PATH=\$PATH:\$HOME/.local/bin" >> ~/.bashrc + # Create other directories that the build script expects with proper permissions sudo mkdir -p /yocto/yocto_ccache /yocto/test-images sudo chmod 755 /yocto/yocto_ccache /yocto/test-images From ec9b93c1d9ab65365b379bc3e9d7b4fa1ba78471 Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Thu, 21 Aug 2025 15:02:59 +0100 Subject: [PATCH 07/35] fix build.sh parameter order --- .github/workflows/bs_meta_browser_build_and_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index 0e12e244d..714c7d94b 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -345,7 +345,7 @@ jobs: fi # Run the build script - ./meta-chromium-test/scripts/build.sh ${{ inputs.yocto_version }} ${{ inputs.arch }} $BROWSER_VERSION $BUILD_TYPE ${{ inputs.libc_flavour }} + ./meta-chromium-test/scripts/build.sh ${{ inputs.yocto_version }} ${{ inputs.arch }} $BROWSER_VERSION ${{ inputs.libc_flavour }} # Upload build artifacts to S3 (if successful) - name: Upload artifacts From cadf37c16ec3c704b78076827dd957bb62b64711 Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Thu, 21 Aug 2025 15:35:42 +0100 Subject: [PATCH 08/35] Fix electron build branch --- .../bs_meta_browser_build_and_test.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index 714c7d94b..481bc8b9b 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -273,14 +273,9 @@ jobs: git clone $GH_URL git -C meta-browser checkout $GH_REV - # Clone the test repo (use electron-master branch for electron builds) - if [[ "${{ inputs.chromium_version }}" == *"ozone-x11"* ]]; then - echo "Cloning meta-chromium-test electron-master branch for electron build" - git clone -b electron-master https://github.com/brightsign/meta-chromium-test.git - else - echo "Cloning meta-chromium-test main branch for chromium build" - git clone -b main https://github.com/brightsign/meta-chromium-test.git - fi + # Clone the test repo (use electron-master branch for all builds) + echo "Cloning meta-chromium-test electron-master branch" + git clone -b electron-master https://github.com/brightsign/meta-chromium-test.git # Run the build - name: Build Browser @@ -306,6 +301,12 @@ jobs: cp -r /home/ubuntu/yocto/${{ inputs.yocto_version }}/meta-browser ./ cp -r /home/ubuntu/yocto/${{ inputs.yocto_version }}/meta-chromium-test ./ + # Generate KAS configuration files (required for build) + echo "Generating KAS configuration files..." + cd meta-chromium-test + ./scripts/generate_kas_files.sh + cd .. + # Set environment variables for caching (EFS mounts only) export SSTATE_DIR=/mnt/shared-cache/sstate-cache export DL_DIR=/mnt/shared-cache/downloads From 661d5d0178e59db1614b5a69e6b782487dd1935b Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Thu, 21 Aug 2025 15:58:44 +0100 Subject: [PATCH 09/35] Fix Chromium/Electron builds. --- .../bs_meta_browser_build_and_test.yml | 41 +++++-------------- .github/workflows/bs_meta_browser_ci_ec2.yml | 6 +++ .github/workflows/chromium.yml | 1 + .github/workflows/electron.yml | 1 + 4 files changed, 18 insertions(+), 31 deletions(-) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index 481bc8b9b..ea45536ab 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -13,6 +13,11 @@ on: type: boolean default: false + browser: + description: "Electron or Chromium" + required: true + type: string + build_type: description: 'Build Type' required: true @@ -301,32 +306,11 @@ jobs: cp -r /home/ubuntu/yocto/${{ inputs.yocto_version }}/meta-browser ./ cp -r /home/ubuntu/yocto/${{ inputs.yocto_version }}/meta-chromium-test ./ - # Generate KAS configuration files (required for build) - echo "Generating KAS configuration files..." - cd meta-chromium-test - ./scripts/generate_kas_files.sh - cd .. - # Set environment variables for caching (EFS mounts only) export SSTATE_DIR=/mnt/shared-cache/sstate-cache export DL_DIR=/mnt/shared-cache/downloads - - # Determine build type based on chromium_version parameter - if [[ "${{ inputs.chromium_version }}" == *"ozone-wayland"* ]]; then - BUILD_TYPE="chromium" - BROWSER_VERSION="ozone-wayland" - elif [[ "${{ inputs.chromium_version }}" == *"ozone-x11"* ]]; then - BUILD_TYPE="electron" - BROWSER_VERSION="ozone-x11" - elif [[ "${{ inputs.chromium_version }}" == *"x11"* ]]; then - BUILD_TYPE="chromium" - BROWSER_VERSION="x11" - else - BUILD_TYPE="chromium" - BROWSER_VERSION="${{ inputs.chromium_version }}" - fi - - echo "Building $BUILD_TYPE with version $BROWSER_VERSION" + + echo "Building ${{ inputs.browser }} with ${{ inputs.chromium_version }}" echo "Current directory: $(pwd)" echo "Directory contents: $(ls -la)" echo "Yocto directories:" @@ -346,7 +330,7 @@ jobs: fi # Run the build script - ./meta-chromium-test/scripts/build.sh ${{ inputs.yocto_version }} ${{ inputs.arch }} $BROWSER_VERSION ${{ inputs.libc_flavour }} + ./meta-chromium-test/scripts/build.sh ${{ inputs.yocto_version }} ${{ inputs.arch }} ${{ inputs.chromium_version }} ${{ inputs.browser }} ${{ inputs.libc_flavour }} # Upload build artifacts to S3 (if successful) - name: Upload artifacts @@ -358,13 +342,8 @@ jobs: DEPLOY_DIR=$(find build -name "deploy" -type d | head -1) if [ -n "$DEPLOY_DIR" ] && [ -d "$DEPLOY_DIR" ]; then echo "Uploading artifacts from $DEPLOY_DIR" - # Determine build type for artifact path - if [[ "${{ inputs.chromium_version }}" == *"ozone-x11"* ]]; then - BUILD_TYPE="electron" - else - BUILD_TYPE="chromium" - fi - aws s3 sync $DEPLOY_DIR/ s3://${ARTIFACT_BUCKET_NAME}/meta-browser/${{ inputs.yocto_version }}/${{ inputs.arch }}/${BUILD_TYPE}/${{ inputs.chromium_version }}/${{ github.run_id }}/ --quiet + # Use chromium_version for artifact path + aws s3 sync $DEPLOY_DIR/ s3://${ARTIFACT_BUCKET_NAME}/meta-browser/${{ inputs.yocto_version }}/${{ inputs.arch }}/${{ inputs.chromium_version }}/${{ github.run_id }}/ --quiet else echo "No deploy directory found" echo "Available directories:" diff --git a/.github/workflows/bs_meta_browser_ci_ec2.yml b/.github/workflows/bs_meta_browser_ci_ec2.yml index 3263ae283..06478cc6d 100644 --- a/.github/workflows/bs_meta_browser_ci_ec2.yml +++ b/.github/workflows/bs_meta_browser_ci_ec2.yml @@ -7,6 +7,11 @@ on: required: true type: string + browser: + description: 'Chromium or Electron' + required: true + type: string + yocto_version: description: 'Yocto version' required: true @@ -101,6 +106,7 @@ jobs: with: runner_name: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner github_hosted_runner: false + browser: ${{ inputs.browser }} build_type: ${{ inputs.build_type }} yocto_version: ${{ inputs.yocto_version }} chromium_version: ${{ inputs.chromium_version }} diff --git a/.github/workflows/chromium.yml b/.github/workflows/chromium.yml index 97e06f678..7be1ced77 100644 --- a/.github/workflows/chromium.yml +++ b/.github/workflows/chromium.yml @@ -45,6 +45,7 @@ jobs: secrets: inherit with: build_type: "release" + browser: "chromium" yocto_version: ${{ matrix.yocto_version }} chromium_version: ${{ matrix.chromium_version }} libc_flavour: ${{ matrix.libc_flavour }} diff --git a/.github/workflows/electron.yml b/.github/workflows/electron.yml index 194602bbe..2d148bb9b 100644 --- a/.github/workflows/electron.yml +++ b/.github/workflows/electron.yml @@ -45,6 +45,7 @@ jobs: secrets: inherit with: build_type: "release" + browser: "electron" yocto_version: ${{ matrix.yocto_version }} chromium_version: ${{ matrix.chromium_version }} libc_flavour: ${{ matrix.libc_flavour }} From 475ec4a6329e2ea4a13497e1cda6b6ab4af3b6ac Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Fri, 22 Aug 2025 05:50:48 +0100 Subject: [PATCH 10/35] Add a new action for cleaning up efs --- .github/workflows/cleanup-efs-cache.yml | 169 ++++++++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 .github/workflows/cleanup-efs-cache.yml diff --git a/.github/workflows/cleanup-efs-cache.yml b/.github/workflows/cleanup-efs-cache.yml new file mode 100644 index 000000000..cedaea5bf --- /dev/null +++ b/.github/workflows/cleanup-efs-cache.yml @@ -0,0 +1,169 @@ +name: 'EFS Cache Cleanup' + +on: + workflow_dispatch: + inputs: + cleanup_downloads: + description: 'Clean downloads directory on EFS' + required: true + type: boolean + default: false + + cleanup_sstate: + description: 'Clean sstate-cache directory on EFS' + required: true + type: boolean + default: false + + aws_region: + description: 'AWS Region' + required: true + type: string + default: 'us-east-1' + + instance_type: + description: 'EC2 instance type for cleanup' + required: false + type: string + default: 't3.medium' + +permissions: + contents: read + actions: read + id-token: write + +jobs: + start-runner: + name: Start EC2 Runner + runs-on: ubuntu-latest + outputs: + label: ${{ steps.start-runner.outputs.label }} + ec2-instance-id: ${{ steps.start-runner.outputs.ec2-instance-id }} + steps: + # Configure AWS credentials + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-region: ${{ inputs.aws_region }} + role-to-assume: "arn:aws:iam::195607249165:role/github-actions-meta-browser-repo" + + # Start EC2 runner for cleanup + - name: Start EC2 runner + id: start-runner + uses: machulav/ec2-github-runner@v2 + with: + mode: start + github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} + ec2-image-id: ami-0ba9883b710398fbb + ec2-instance-type: ${{ inputs.instance_type }} + subnet-id: subnet-06b2fe35df970cb71 + security-group-id: sg-0905fa8cd994895e8 + iam-role-name: yocto-github-actions-role + aws-resource-tags: > + [ + {"Key": "Name", "Value": "gh-runner-meta-browser-cleanup"}, + {"Key": "GitHubRepository", "Value": "${{ github.repository }}"} + ] + + cleanup-efs: + name: Cleanup EFS Cache + needs: start-runner + runs-on: ${{ needs.start-runner.outputs.label }} + steps: + # Configure AWS credentials on the EC2 runner + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-region: ${{ inputs.aws_region }} + role-to-assume: "arn:aws:iam::195607249165:role/github-actions-meta-browser-repo" + + # Download config and get EFS ID + - name: Download config file and set env vars from it + run: | + aws s3 cp s3://meta-browser-ci-config-bucket/config.json . + aws s3 cp s3://meta-browser-ci-config-bucket/set_github_env_vars.py . + python3 set_github_env_vars.py --file config.json + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y nfs-common + + - name: Mount EFS and perform cleanup + run: | + # Create mount point + sudo mkdir -p /mnt/shared-cache + + # Mount EFS (using the shared cache EFS ID) + echo "Mounting EFS: fs-065ed1ce53c230c7d" + sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,intr,timeo=600 \ + fs-065ed1ce53c230c7d.efs.${{ inputs.aws_region }}.amazonaws.com:/ /mnt/shared-cache + + # Show current disk usage + echo "=== Current EFS disk usage ===" + df -h /mnt/shared-cache + echo "" + echo "=== Directory sizes before cleanup ===" + sudo du -sh /mnt/shared-cache/* 2>/dev/null || echo "No directories found" + echo "" + + # Cleanup downloads if requested + if [ "${{ inputs.cleanup_downloads }}" = "true" ]; then + echo "=== Cleaning yocto_downloads ===" + if [ -d "/mnt/shared-cache/downloads" ]; then + echo "Removing downloads directory..." + sudo rm -rf /mnt/shared-cache/downloads/* + echo "Downloads directory cleaned" + else + echo "Downloads directory not found" + fi + else + echo "Skipping downloads cleanup" + fi + + # Cleanup sstate-cache if requested + if [ "${{ inputs.cleanup_sstate }}" = "true" ]; then + echo "=== Cleaning sstate-cache ===" + if [ -d "/mnt/shared-cache/sstate-cache" ]; then + echo "Removing sstate-cache directory..." + sudo rm -rf /mnt/shared-cache/sstate-cache/* + echo "sstate-cache directory cleaned" + else + echo "sstate-cache directory not found" + fi + else + echo "Skipping sstate-cache cleanup" + fi + + # Show final disk usage + echo "" + echo "=== Directory sizes after cleanup ===" + sudo du -sh /mnt/shared-cache/* 2>/dev/null || echo "No directories found" + echo "" + echo "=== Final EFS disk usage ===" + df -h /mnt/shared-cache + + # Unmount EFS + sudo umount /mnt/shared-cache + + stop-runner: + name: Stop EC2 Runner + needs: + - start-runner + - cleanup-efs + runs-on: ubuntu-latest + if: always() + steps: + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-region: ${{ inputs.aws_region }} + role-to-assume: "arn:aws:iam::195607249165:role/github-actions-meta-browser-repo" + + - name: Stop EC2 runner + uses: machulav/ec2-github-runner@v2 + with: + mode: stop + github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} + label: ${{ needs.start-runner.outputs.label }} + ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }} From 061a3f2f7a8483b1e39e6a018c448ce464340036 Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Fri, 22 Aug 2025 11:20:48 +0100 Subject: [PATCH 11/35] Fix for premature job cancellation --- .github/workflows/bs_meta_browser_build_and_test.yml | 2 ++ .github/workflows/chromium.yml | 2 +- .github/workflows/cleanup-efs-cache.yml | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index ea45536ab..8b351e738 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -55,6 +55,7 @@ jobs: build-and-test-meta-browser: name: Build and Test Meta-Browser runs-on: ${{ inputs.runner_name }} + timeout-minutes: 480 # 8 hours - increase for long Yocto builds defaults: run: shell: bash @@ -284,6 +285,7 @@ jobs: # Run the build - name: Build Browser + timeout-minutes: 420 # 7 hours for Yocto build run: | # Set environment variables that the Docker container would have export LANG=en_US.UTF-8 diff --git a/.github/workflows/chromium.yml b/.github/workflows/chromium.yml index 7be1ced77..266b881a0 100644 --- a/.github/workflows/chromium.yml +++ b/.github/workflows/chromium.yml @@ -52,7 +52,7 @@ jobs: arch: ${{ matrix.arch }} aws_arn_role: "arn:aws:iam::195607249165:role/github-actions-meta-browser-repo" aws_region: "us-east-1" - instance_type: "c6a.4xlarge" + instance_type: "c6a.8xlarge" # Increased from 4xlarge for faster builds # Local runner (manual dispatch only, when explicitly disabled AWS) local-build: diff --git a/.github/workflows/cleanup-efs-cache.yml b/.github/workflows/cleanup-efs-cache.yml index cedaea5bf..e713a21a7 100644 --- a/.github/workflows/cleanup-efs-cache.yml +++ b/.github/workflows/cleanup-efs-cache.yml @@ -95,9 +95,9 @@ jobs: sudo mkdir -p /mnt/shared-cache # Mount EFS (using the shared cache EFS ID) - echo "Mounting EFS: fs-065ed1ce53c230c7d" + echo "Mounting EFS: fs-0ee52486275950d2e" sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,intr,timeo=600 \ - fs-065ed1ce53c230c7d.efs.${{ inputs.aws_region }}.amazonaws.com:/ /mnt/shared-cache + fs-0ee52486275950d2e.efs.${{ inputs.aws_region }}.amazonaws.com:/ /mnt/shared-cache # Show current disk usage echo "=== Current EFS disk usage ===" From f990026198d8da4ac889192610bd03bf66a702da Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Fri, 22 Aug 2025 12:12:20 +0100 Subject: [PATCH 12/35] Do not fail-fast Continue running jobs even if one fails --- .github/workflows/chromium.yml | 2 ++ .github/workflows/electron.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/chromium.yml b/.github/workflows/chromium.yml index 266b881a0..76bba7a67 100644 --- a/.github/workflows/chromium.yml +++ b/.github/workflows/chromium.yml @@ -36,6 +36,7 @@ jobs: aws-matrix-build: if: ${{ github.repository_owner == 'brightsign' && (github.event_name == 'pull_request' || inputs.use_aws == true || inputs.use_aws == null) }} strategy: + fail-fast: false # Continue other matrix jobs even if one fails matrix: yocto_version: [master] chromium_version: [ozone-wayland, x11] @@ -58,6 +59,7 @@ jobs: local-build: if: ${{ github.repository_owner == 'brightsign' && github.event_name == 'workflow_dispatch' && inputs.use_aws == false }} strategy: + fail-fast: false # Continue other matrix jobs even if one fails matrix: yocto_version: [master] browser_version: [ozone-wayland, x11] diff --git a/.github/workflows/electron.yml b/.github/workflows/electron.yml index 2d148bb9b..2a14ff4fd 100644 --- a/.github/workflows/electron.yml +++ b/.github/workflows/electron.yml @@ -36,6 +36,7 @@ jobs: aws-matrix-build: if: ${{ github.repository_owner == 'brightsign' && (github.event_name == 'pull_request' || inputs.use_aws == true || inputs.use_aws == null) }} strategy: + fail-fast: false # Continue other matrix jobs even if one fails matrix: yocto_version: [master] chromium_version: [ozone-wayland, ozone-x11] @@ -58,6 +59,7 @@ jobs: local-build: if: ${{ github.repository_owner == 'brightsign' && github.event_name == 'workflow_dispatch' && inputs.use_aws == false }} strategy: + fail-fast: false # Continue other matrix jobs even if one fails matrix: yocto_version: [master] browser_version: [ozone-wayland, ozone-x11] From a5640483e8af15fefc2c8493892b646eb993ebaa Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Fri, 22 Aug 2025 14:17:24 +0100 Subject: [PATCH 13/35] use larger aws instances --- .github/workflows/chromium.yml | 2 +- .github/workflows/electron.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/chromium.yml b/.github/workflows/chromium.yml index 76bba7a67..41c692a3e 100644 --- a/.github/workflows/chromium.yml +++ b/.github/workflows/chromium.yml @@ -53,7 +53,7 @@ jobs: arch: ${{ matrix.arch }} aws_arn_role: "arn:aws:iam::195607249165:role/github-actions-meta-browser-repo" aws_region: "us-east-1" - instance_type: "c6a.8xlarge" # Increased from 4xlarge for faster builds + instance_type: "c6a.16xlarge" # Increased from 4xlarge for faster builds # Local runner (manual dispatch only, when explicitly disabled AWS) local-build: diff --git a/.github/workflows/electron.yml b/.github/workflows/electron.yml index 2a14ff4fd..6e3dd7bf9 100644 --- a/.github/workflows/electron.yml +++ b/.github/workflows/electron.yml @@ -53,7 +53,7 @@ jobs: arch: ${{ matrix.arch }} aws_arn_role: "arn:aws:iam::195607249165:role/github-actions-meta-browser-repo" aws_region: "us-east-1" - instance_type: "c6a.4xlarge" + instance_type: "c6a.16xlarge" # Local runner (manual dispatch only, when explicitly disabled AWS) local-build: From 59e07e7b0851d26e41879b99ef9bd33ac768bf84 Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Fri, 22 Aug 2025 15:25:17 +0100 Subject: [PATCH 14/35] Use smaller AWS instances with swap. --- .../bs_meta_browser_build_and_test.yml | 45 +++++++++++++++++++ .github/workflows/chromium.yml | 2 +- .github/workflows/electron.yml | 2 +- 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index 8b351e738..dc39a04e0 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -107,6 +107,51 @@ jobs: echo 'export LANG=en_US.UTF-8' >> ~/.bashrc echo 'export LC_ALL=en_US.UTF-8' >> ~/.bashrc + # Setup large swap space on local NVMe SSD for memory-intensive Yocto builds + - name: Setup swap space + run: | + echo "=== Setting up 128GB swap space ===" + # Check for NVMe devices (c6id instances have local NVMe storage) + if [ -b /dev/nvme1n1 ]; then + echo "Found NVMe device: /dev/nvme1n1" + echo "Device info:" + lsblk /dev/nvme1n1 + + # Create a 128GB swap file on the NVMe device + sudo mkfs.ext4 /dev/nvme1n1 + sudo mkdir -p /mnt/nvme + sudo mount /dev/nvme1n1 /mnt/nvme + + echo "Creating 128GB swap file (this may take a few minutes)..." + sudo fallocate -l 128G /mnt/nvme/swapfile + sudo chmod 600 /mnt/nvme/swapfile + sudo mkswap /mnt/nvme/swapfile + sudo swapon /mnt/nvme/swapfile + + # Optimize swap performance for build workloads + echo "Optimizing swap settings for build performance..." + echo 10 | sudo tee /proc/sys/vm/swappiness # Reduce swap usage preference + echo 1 | sudo tee /proc/sys/vm/vfs_cache_pressure # Favor keeping build caches in memory + + echo "✓ 128GB swap enabled on NVMe SSD with optimized settings" + else + echo "No NVMe device found, creating large swap on root filesystem" + # Fallback: create large swap file on root filesystem + echo "Creating 64GB swap file (reduced size for root filesystem)..." + sudo fallocate -l 64G /swapfile + sudo chmod 600 /swapfile + sudo mkswap /swapfile + sudo swapon /swapfile + echo "✓ 64GB swap enabled on root filesystem" + fi + + # Verify swap is active + echo "=== Memory and swap status ===" + free -h + swapon --show + echo "Available disk space:" + df -h + # Mount EFS file systems - name: Mount EFS file systems run: | diff --git a/.github/workflows/chromium.yml b/.github/workflows/chromium.yml index 41c692a3e..25abadfa5 100644 --- a/.github/workflows/chromium.yml +++ b/.github/workflows/chromium.yml @@ -53,7 +53,7 @@ jobs: arch: ${{ matrix.arch }} aws_arn_role: "arn:aws:iam::195607249165:role/github-actions-meta-browser-repo" aws_region: "us-east-1" - instance_type: "c6a.16xlarge" # Increased from 4xlarge for faster builds + instance_type: "c6id.4xlarge" # Uses NVMe SSD for swap to handle memory pressure # Local runner (manual dispatch only, when explicitly disabled AWS) local-build: diff --git a/.github/workflows/electron.yml b/.github/workflows/electron.yml index 6e3dd7bf9..2ad819b4f 100644 --- a/.github/workflows/electron.yml +++ b/.github/workflows/electron.yml @@ -53,7 +53,7 @@ jobs: arch: ${{ matrix.arch }} aws_arn_role: "arn:aws:iam::195607249165:role/github-actions-meta-browser-repo" aws_region: "us-east-1" - instance_type: "c6a.16xlarge" + instance_type: "c6id.4xlarge" # Local runner (manual dispatch only, when explicitly disabled AWS) local-build: From 783929cf1af434fd7ab6ae010927409598943d15 Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Fri, 22 Aug 2025 16:53:39 +0100 Subject: [PATCH 15/35] Enhance artifact upload with 128GB swap and better S3 diagnostics - Increase swap from 4GB to 128GB on NVMe SSD for memory-intensive Yocto builds - Add swap performance optimization (swappiness=10, vfs_cache_pressure=1) - Enhance S3 upload with detailed logging and error handling - Add pre-upload diagnostics (disk space, upload size, S3 access test) - Remove --quiet flag for better error visibility - Add post-upload verification and file listing - Improve timeout settings for reliable uploads --- .../bs_meta_browser_build_and_test.yml | 60 ++++++++++++++++++- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index dc39a04e0..d83f81a33 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -388,13 +388,67 @@ jobs: # Find and upload build artifacts DEPLOY_DIR=$(find build -name "deploy" -type d | head -1) if [ -n "$DEPLOY_DIR" ] && [ -d "$DEPLOY_DIR" ]; then - echo "Uploading artifacts from $DEPLOY_DIR" - # Use chromium_version for artifact path - aws s3 sync $DEPLOY_DIR/ s3://${ARTIFACT_BUCKET_NAME}/meta-browser/${{ inputs.yocto_version }}/${{ inputs.arch }}/${{ inputs.chromium_version }}/${{ github.run_id }}/ --quiet + echo "=== Artifact Upload ===" + echo "Deploy directory: $DEPLOY_DIR" + echo "Checking directory contents:" + ls -la "$DEPLOY_DIR" || echo "Failed to list deploy directory" + + # Check available disk space + echo "Available disk space:" + df -h + + # Calculate upload size + UPLOAD_SIZE=$(du -sh "$DEPLOY_DIR" | cut -f1) + echo "Upload size: $UPLOAD_SIZE" + + # S3 destination path + S3_PATH="s3://${ARTIFACT_BUCKET_NAME}/meta-browser/${{ inputs.yocto_version }}/${{ inputs.arch }}/${{ inputs.chromium_version }}/${{ github.run_id }}/" + echo "S3 destination: $S3_PATH" + echo "Bucket name from env: ${ARTIFACT_BUCKET_NAME}" + + # Test S3 access first + echo "Testing S3 bucket access..." + if aws s3 ls "s3://${ARTIFACT_BUCKET_NAME}/" > /dev/null 2>&1; then + echo "✓ S3 bucket access confirmed" + else + echo "ERROR: Cannot access S3 bucket ${ARTIFACT_BUCKET_NAME}" + echo "AWS CLI version:" + aws --version + echo "AWS credentials configured:" + aws sts get-caller-identity || echo "Failed to get caller identity" + echo "Available S3 buckets:" + aws s3 ls || echo "Failed to list buckets" + echo "Trying alternative bucket name..." + # Try with the exact bucket name from logs + if aws s3 ls "s3://meta-browser-ci-public-artifact-bucket/" > /dev/null 2>&1; then + echo "✓ Found bucket with hardcoded name" + export ARTIFACT_BUCKET_NAME="meta-browser-ci-public-artifact-bucket" + S3_PATH="s3://${ARTIFACT_BUCKET_NAME}/meta-browser/${{ inputs.yocto_version }}/${{ inputs.arch }}/${{ inputs.chromium_version }}/${{ github.run_id }}/" + echo "Updated S3 destination: $S3_PATH" + else + echo "✗ Cannot access any expected bucket" + exit 1 + fi + fi + + echo "Starting S3 upload..." + # Use verbose mode and enable progress tracking + if aws s3 sync "$DEPLOY_DIR/" "$S3_PATH" --cli-read-timeout 0 --cli-connect-timeout 60; then + echo "✓ Artifacts uploaded successfully to $S3_PATH" + + # Verify upload + echo "Verifying upload..." + aws s3 ls "$S3_PATH" --recursive --human-readable --summarize + else + echo "✗ S3 upload failed" + exit 1 + fi else echo "No deploy directory found" echo "Available directories:" find . -name "deploy" -type d 2>/dev/null || echo "No deploy directories found" + echo "Build directory structure:" + find build -type d -maxdepth 3 2>/dev/null || echo "No build directory found" fi # Unmount EFS file systems From 9807b4e0e2cf30dcea0faaa9ac31c41ff505cef2 Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Tue, 26 Aug 2025 13:00:40 +0100 Subject: [PATCH 16/35] refresh aws credentials. --- .../bs_meta_browser_build_and_test.yml | 35 ++++++------------- 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index d83f81a33..a8456c0ee 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -379,6 +379,14 @@ jobs: # Run the build script ./meta-chromium-test/scripts/build.sh ${{ inputs.yocto_version }} ${{ inputs.arch }} ${{ inputs.chromium_version }} ${{ inputs.browser }} ${{ inputs.libc_flavour }} + # Refresh AWS credentials before upload (they may have expired during long build) + - name: Refresh AWS credentials for artifact upload + if: success() + uses: aws-actions/configure-aws-credentials@v1-node16 + with: + aws-region: ${{ env.AWS_REGION }} + role-to-assume: ${{ env.AWS_ARN_ROLE }} + # Upload build artifacts to S3 (if successful) - name: Upload artifacts if: success() @@ -406,30 +414,9 @@ jobs: echo "S3 destination: $S3_PATH" echo "Bucket name from env: ${ARTIFACT_BUCKET_NAME}" - # Test S3 access first - echo "Testing S3 bucket access..." - if aws s3 ls "s3://${ARTIFACT_BUCKET_NAME}/" > /dev/null 2>&1; then - echo "✓ S3 bucket access confirmed" - else - echo "ERROR: Cannot access S3 bucket ${ARTIFACT_BUCKET_NAME}" - echo "AWS CLI version:" - aws --version - echo "AWS credentials configured:" - aws sts get-caller-identity || echo "Failed to get caller identity" - echo "Available S3 buckets:" - aws s3 ls || echo "Failed to list buckets" - echo "Trying alternative bucket name..." - # Try with the exact bucket name from logs - if aws s3 ls "s3://meta-browser-ci-public-artifact-bucket/" > /dev/null 2>&1; then - echo "✓ Found bucket with hardcoded name" - export ARTIFACT_BUCKET_NAME="meta-browser-ci-public-artifact-bucket" - S3_PATH="s3://${ARTIFACT_BUCKET_NAME}/meta-browser/${{ inputs.yocto_version }}/${{ inputs.arch }}/${{ inputs.chromium_version }}/${{ github.run_id }}/" - echo "Updated S3 destination: $S3_PATH" - else - echo "✗ Cannot access any expected bucket" - exit 1 - fi - fi + # Verify AWS credentials are working + echo "Verifying AWS credentials..." + aws sts get-caller-identity echo "Starting S3 upload..." # Use verbose mode and enable progress tracking From dfdbcfdd8c3c874f5d22cea10371aa8efd1f9531 Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Tue, 26 Aug 2025 13:09:18 +0100 Subject: [PATCH 17/35] use unique name for aws ec2 instances --- .github/workflows/bs_meta_browser_ci_ec2.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bs_meta_browser_ci_ec2.yml b/.github/workflows/bs_meta_browser_ci_ec2.yml index 06478cc6d..4014d3b4d 100644 --- a/.github/workflows/bs_meta_browser_ci_ec2.yml +++ b/.github/workflows/bs_meta_browser_ci_ec2.yml @@ -89,13 +89,15 @@ jobs: security-group-id: ${{ env.VPC_SG_ID }} run-as-service-with-user: ubuntu runner-home-dir: /home/ubuntu + label: "runner-${{ github.run_id }}-${{ inputs.yocto_version }}-${{ inputs.arch }}-${{ inputs.chromium_version }}" # Unique label to avoid hostname conflicts aws-resource-tags: > # optional, requires additional permissions [ {"Key": "Name", "Value": "github-runner-meta-browser-${{ inputs.instance_name_postfix }}"}, {"Key": "GitHubRepository", "Value": "${{ github.repository }}"}, {"Key": "YoctoVersion", "Value": "${{ inputs.yocto_version }}"}, {"Key": "ChromiumVersion", "Value": "${{ inputs.chromium_version }}"}, - {"Key": "Architecture", "Value": "${{ inputs.arch }}"} + {"Key": "Architecture", "Value": "${{ inputs.arch }}"}, + {"Key": "RunId", "Value": "${{ github.run_id }}"} ] build-and-test-meta-browser: From e1a18b77fba033fb02222ab15d6e47dc1fdffe97 Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Tue, 26 Aug 2025 21:07:10 +0100 Subject: [PATCH 18/35] increase timeout --- .github/workflows/bs_meta_browser_build_and_test.yml | 4 ++-- .github/workflows/chromium.yml | 2 +- .github/workflows/electron.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index a8456c0ee..957ee9f51 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -55,7 +55,7 @@ jobs: build-and-test-meta-browser: name: Build and Test Meta-Browser runs-on: ${{ inputs.runner_name }} - timeout-minutes: 480 # 8 hours - increase for long Yocto builds + timeout-minutes: 660 # 11 hours - increase for long Yocto builds defaults: run: shell: bash @@ -330,7 +330,7 @@ jobs: # Run the build - name: Build Browser - timeout-minutes: 420 # 7 hours for Yocto build + timeout-minutes: 660 # 11 hours for Yocto build run: | # Set environment variables that the Docker container would have export LANG=en_US.UTF-8 diff --git a/.github/workflows/chromium.yml b/.github/workflows/chromium.yml index 25abadfa5..747fdb2e3 100644 --- a/.github/workflows/chromium.yml +++ b/.github/workflows/chromium.yml @@ -53,7 +53,7 @@ jobs: arch: ${{ matrix.arch }} aws_arn_role: "arn:aws:iam::195607249165:role/github-actions-meta-browser-repo" aws_region: "us-east-1" - instance_type: "c6id.4xlarge" # Uses NVMe SSD for swap to handle memory pressure + instance_type: "c6id.8xlarge" # Uses NVMe SSD for swap to handle memory pressure # Local runner (manual dispatch only, when explicitly disabled AWS) local-build: diff --git a/.github/workflows/electron.yml b/.github/workflows/electron.yml index 2ad819b4f..0e89eb386 100644 --- a/.github/workflows/electron.yml +++ b/.github/workflows/electron.yml @@ -53,7 +53,7 @@ jobs: arch: ${{ matrix.arch }} aws_arn_role: "arn:aws:iam::195607249165:role/github-actions-meta-browser-repo" aws_region: "us-east-1" - instance_type: "c6id.4xlarge" + instance_type: "c6id.8xlarge" # Local runner (manual dispatch only, when explicitly disabled AWS) local-build: From 459a0f1068fb2359c2c369b5fa489330bc5cf34f Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Wed, 27 Aug 2025 10:47:03 +0100 Subject: [PATCH 19/35] increase swap size --- .github/workflows/bs_meta_browser_build_and_test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index 957ee9f51..d69acd437 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -110,20 +110,20 @@ jobs: # Setup large swap space on local NVMe SSD for memory-intensive Yocto builds - name: Setup swap space run: | - echo "=== Setting up 128GB swap space ===" + echo "=== Setting up 256GB swap space ===" # Check for NVMe devices (c6id instances have local NVMe storage) if [ -b /dev/nvme1n1 ]; then echo "Found NVMe device: /dev/nvme1n1" echo "Device info:" lsblk /dev/nvme1n1 - # Create a 128GB swap file on the NVMe device + # Create a 256GB swap file on the NVMe device sudo mkfs.ext4 /dev/nvme1n1 sudo mkdir -p /mnt/nvme sudo mount /dev/nvme1n1 /mnt/nvme - echo "Creating 128GB swap file (this may take a few minutes)..." - sudo fallocate -l 128G /mnt/nvme/swapfile + echo "Creating 256GB swap file (this may take a few minutes)..." + sudo fallocate -l 256G /mnt/nvme/swapfile sudo chmod 600 /mnt/nvme/swapfile sudo mkswap /mnt/nvme/swapfile sudo swapon /mnt/nvme/swapfile @@ -133,7 +133,7 @@ jobs: echo 10 | sudo tee /proc/sys/vm/swappiness # Reduce swap usage preference echo 1 | sudo tee /proc/sys/vm/vfs_cache_pressure # Favor keeping build caches in memory - echo "✓ 128GB swap enabled on NVMe SSD with optimized settings" + echo "✓ 256GB swap enabled on NVMe SSD with optimized settings" else echo "No NVMe device found, creating large swap on root filesystem" # Fallback: create large swap file on root filesystem From 58fc331f634a47ecf90dd333d4d0eaed8181b73f Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Wed, 27 Aug 2025 14:29:50 +0100 Subject: [PATCH 20/35] Use updated AMI image and do not install new packages --- .../bs_meta_browser_build_and_test.yml | 50 +++++++++---------- .github/workflows/bs_meta_browser_ci_ec2.yml | 2 +- 2 files changed, 24 insertions(+), 28 deletions(-) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index d69acd437..f59b61e05 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -74,38 +74,34 @@ jobs: aws s3 cp s3://meta-browser-ci-config-bucket/set_github_env_vars.py . python3 set_github_env_vars.py --file config.json - # Install required packages - - name: Install build dependencies + # Quick system verification (using pre-configured custom AMI) + - name: Verify AMI configuration run: | - sudo apt-get update - sudo apt-get install -y nfs-common git build-essential python3-pip - - # Yocto build dependencies (matching Docker container requirements) - sudo apt-get install -y gawk wget git-core diffstat unzip texinfo gcc-multilib \ - build-essential chrpath socat cpio python3 python3-pip python3-pexpect \ - xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa \ - libsdl1.2-dev pylint xterm python3-subunit mesa-common-dev zstd liblz4-tool \ - file locales sudo - - # Additional tools that might be in the Docker container - sudo apt-get install -y vim nano less curl wget rsync + echo "=== Verifying pre-configured AMI ===" + echo "AMI Info:" + cat /etc/ami-info || echo "No AMI info file found" - # Set up locale (as typically done in Docker containers) - locale --all-locales | grep en_US.utf8 || true - echo "en_US.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen - sudo locale-gen + echo "" + echo "Checking KAS installation:" + kas --version || echo "KAS not found" - # Install kas (Yocto build tool) - python3 -m pip install --user kas - export LANG=en_US.UTF-8 - export LC_ALL=en_US.UTF-8 + echo "" + echo "Checking locale:" + locale + + echo "" + echo "Checking AWS CLI:" + aws --version || echo "AWS CLI not found" - # Install kas (Yocto build tool) - this is crucial for the build script - python3 -m pip install --user kas + echo "" + echo "Available disk space:" + df -h + + echo "" + echo "Memory info:" + free -h - # Ensure the user has a proper shell environment - echo 'export LANG=en_US.UTF-8' >> ~/.bashrc - echo 'export LC_ALL=en_US.UTF-8' >> ~/.bashrc + echo "✓ AMI verification complete - all dependencies pre-installed" # Setup large swap space on local NVMe SSD for memory-intensive Yocto builds - name: Setup swap space diff --git a/.github/workflows/bs_meta_browser_ci_ec2.yml b/.github/workflows/bs_meta_browser_ci_ec2.yml index 4014d3b4d..b2f3b82ff 100644 --- a/.github/workflows/bs_meta_browser_ci_ec2.yml +++ b/.github/workflows/bs_meta_browser_ci_ec2.yml @@ -83,7 +83,7 @@ jobs: mode: start github-app-private-key: ${{ secrets.GH_APP_PRIVATE_KEY }} github-app-id: 287690 - ec2-image-id: ami-07b4a16cd5294af98 # TODO: Create custom AMI for Yocto builds + ec2-image-id: ami-08a4255385679596c # Custom AMI with Yocto build dependencies pre-installed ec2-instance-type: ${{ inputs.instance_type }} subnet-id: ${{ env.VPC_SUBNET_ID }} security-group-id: ${{ env.VPC_SG_ID }} From 72068db2d7c1f82d497f5451da73230519d48633 Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Thu, 28 Aug 2025 09:42:36 +0100 Subject: [PATCH 21/35] Increase AWS session duration and use newer plugin --- .github/workflows/bs_meta_browser_build_and_test.yml | 8 ++++++-- .github/workflows/bs_meta_browser_ci_ec2.yml | 7 +++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index f59b61e05..9dec97f9e 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -62,10 +62,12 @@ jobs: steps: # Configure AWS credentials for accessing S3 cache buckets - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1-node16 + uses: aws-actions/configure-aws-credentials@v4 with: aws-region: ${{ inputs.aws_region }} role-to-assume: ${{ inputs.aws_arn_role }} + role-session-name: meta-browser-build-${{ github.run_id }} + role-duration-seconds: 43200 # 12 hours - maximum for most IAM roles # Download config file and set environment variables - name: Download config file and set env vars from it @@ -378,10 +380,12 @@ jobs: # Refresh AWS credentials before upload (they may have expired during long build) - name: Refresh AWS credentials for artifact upload if: success() - uses: aws-actions/configure-aws-credentials@v1-node16 + uses: aws-actions/configure-aws-credentials@v4 with: aws-region: ${{ env.AWS_REGION }} role-to-assume: ${{ env.AWS_ARN_ROLE }} + role-session-name: meta-browser-upload-${{ github.run_id }} + role-duration-seconds: 3600 # 1 hour for upload # Upload build artifacts to S3 (if successful) - name: Upload artifacts diff --git a/.github/workflows/bs_meta_browser_ci_ec2.yml b/.github/workflows/bs_meta_browser_ci_ec2.yml index b2f3b82ff..c8c23cb44 100644 --- a/.github/workflows/bs_meta_browser_ci_ec2.yml +++ b/.github/workflows/bs_meta_browser_ci_ec2.yml @@ -65,10 +65,12 @@ jobs: ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }} steps: - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1-node16 + uses: aws-actions/configure-aws-credentials@v4 with: aws-region: ${{ inputs.aws_region }} role-to-assume: ${{ inputs.aws_arn_role }} + role-session-name: meta-browser-ci-${{ github.run_id }} + role-duration-seconds: 43200 # 12 hours for long builds - name: Download config file and set env vars from it run: | @@ -126,10 +128,11 @@ jobs: if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs steps: - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1-node16 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ inputs.aws_arn_role }} aws-region: ${{ inputs.aws_region }} + role-session-name: meta-browser-ci-cleanup-${{ github.run_id }} - name: Stop EC2 runner uses: brightsign/ec2-github-runner@0fa8b183dd4124fd191ccdbc48b68f0ea46a9634 From b47d07fe3fd29da9f9bcc84fb1fb8d1445719990 Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Thu, 28 Aug 2025 10:22:25 +0100 Subject: [PATCH 22/35] fix sstate cache paths --- .../bs_meta_browser_build_and_test.yml | 104 +++++++++++++++++- 1 file changed, 101 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index 9dec97f9e..3d019ad4e 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -351,9 +351,37 @@ jobs: cp -r /home/ubuntu/yocto/${{ inputs.yocto_version }}/meta-browser ./ cp -r /home/ubuntu/yocto/${{ inputs.yocto_version }}/meta-chromium-test ./ - # Set environment variables for caching (EFS mounts only) - export SSTATE_DIR=/mnt/shared-cache/sstate-cache - export DL_DIR=/mnt/shared-cache/downloads + # Create cache directories if they don't exist + sudo mkdir -p /mnt/shared-cache/sstate-cache + sudo mkdir -p /mnt/shared-cache/downloads + sudo chown -R ubuntu:ubuntu /mnt/shared-cache/sstate-cache + sudo chown -R ubuntu:ubuntu /mnt/shared-cache/downloads + sudo chmod -R 755 /mnt/shared-cache/sstate-cache + sudo chmod -R 755 /mnt/shared-cache/downloads + + # Test cache directory accessibility + if [ -w /mnt/shared-cache/sstate-cache ]; then + echo "✓ sstate-cache directory is writable" + # Check if cache has existing content + SSTATE_COUNT=$(find /mnt/shared-cache/sstate-cache -name "*.tar.*" | wc -l) + echo " Existing sstate files: $SSTATE_COUNT" + else + echo "✗ sstate-cache directory is not writable" + fi + + if [ -w /mnt/shared-cache/downloads ]; then + echo "✓ downloads directory is writable" + # Check if downloads has existing content + DOWNLOADS_COUNT=$(find /mnt/shared-cache/downloads -type f | wc -l) + echo " Existing download files: $DOWNLOADS_COUNT" + else + echo "✗ downloads directory is not writable" + fi + + # Show cache directory sizes + echo "Cache directory sizes:" + du -sh /mnt/shared-cache/sstate-cache 2>/dev/null || echo " sstate-cache: not accessible" + du -sh /mnt/shared-cache/downloads 2>/dev/null || echo " downloads: not accessible" echo "Building ${{ inputs.browser }} with ${{ inputs.chromium_version }}" echo "Current directory: $(pwd)" @@ -374,8 +402,78 @@ jobs: exit 1 fi + # Create symlinks from hardcoded kas paths to EFS cache directories + echo "=== Setting up cache directory symlinks ===" + + # Remove any existing directories and create symlinks to EFS cache + sudo rm -rf /yocto/yocto_dl /yocto/yocto_sstate_chromium /yocto/yocto_sstate_electron + sudo mkdir -p /yocto + sudo ln -sf /mnt/shared-cache/downloads /yocto/yocto_dl + sudo ln -sf /mnt/shared-cache/sstate-cache /yocto/yocto_sstate_chromium + sudo ln -sf /mnt/shared-cache/sstate-cache /yocto/yocto_sstate_electron + + # Also create ccache directory on local SSD for performance + sudo mkdir -p /yocto/yocto_ccache + sudo chown -R ubuntu:ubuntu /yocto + + # Verify symlinks + echo "Cache directory symlinks:" + ls -la /yocto/ + echo "Contents of cache directories:" + ls -la /mnt/shared-cache/ + echo "Downloads directory contents (first 10 items):" + ls -la /mnt/shared-cache/downloads/ | head -10 || echo "Downloads directory empty" + echo "Sstate cache directory contents (first 10 items):" + ls -la /mnt/shared-cache/sstate-cache/ | head -10 || echo "Sstate cache directory empty" + + # Show cache statistics + echo "=== Cache Statistics ===" + echo "Downloads directory size:" + du -sh /mnt/shared-cache/downloads 2>/dev/null || echo "0 bytes" + echo "Sstate cache directory size:" + du -sh /mnt/shared-cache/sstate-cache 2>/dev/null || echo "0 bytes" + + # Count cache files + DOWNLOADS_COUNT=$(find /mnt/shared-cache/downloads -type f 2>/dev/null | wc -l) + SSTATE_COUNT=$(find /mnt/shared-cache/sstate-cache -type f 2>/dev/null | wc -l) + echo "Downloads files count: $DOWNLOADS_COUNT" + echo "Sstate cache files count: $SSTATE_COUNT" + # Run the build script + echo "=== Starting build with enhanced cache debugging ===" ./meta-chromium-test/scripts/build.sh ${{ inputs.yocto_version }} ${{ inputs.arch }} ${{ inputs.chromium_version }} ${{ inputs.browser }} ${{ inputs.libc_flavour }} + + # Post-build cache analysis + echo "=== Post-Build Cache Analysis ===" + DOWNLOADS_COUNT_AFTER=$(find /mnt/shared-cache/downloads -type f 2>/dev/null | wc -l) + SSTATE_COUNT_AFTER=$(find /mnt/shared-cache/sstate-cache -type f 2>/dev/null | wc -l) + echo "Downloads files after build: $DOWNLOADS_COUNT_AFTER" + echo "Sstate cache files after build: $SSTATE_COUNT_AFTER" + echo "Downloads size after build:" + du -sh /mnt/shared-cache/downloads 2>/dev/null || echo "0 bytes" + echo "Sstate cache size after build:" + du -sh /mnt/shared-cache/sstate-cache 2>/dev/null || echo "0 bytes" + + # Analyze BitBake log for cache utilization + echo "=== BitBake Cache Analysis ===" + BUILD_LOG=$(find build/tmp/log -name "*.log" -type f | head -1) + if [ -n "$BUILD_LOG" ] && [ -f "$BUILD_LOG" ]; then + echo "Analyzing build log: $BUILD_LOG" + echo "Sstate cache hits:" + grep -c "sstate.*Found.*valid" "$BUILD_LOG" 2>/dev/null || echo "0" + echo "Sstate cache misses:" + grep -c "sstate.*not.*found" "$BUILD_LOG" 2>/dev/null || echo "0" + echo "Cache restore operations:" + grep -c "restoring.*from sstate" "$BUILD_LOG" 2>/dev/null || echo "0" + else + echo "No build log found for analysis" + fi + + # Show recent sstate cache activity + echo "Most recent sstate cache files (last 10 created):" + find /mnt/shared-cache/sstate-cache -type f -printf '%T@ %p\n' 2>/dev/null | sort -n | tail -10 | while read timestamp file; do + echo "$(date -d @${timestamp%.*} '+%Y-%m-%d %H:%M:%S') $file" + done || echo "No sstate files found" # Refresh AWS credentials before upload (they may have expired during long build) - name: Refresh AWS credentials for artifact upload From 93f211e3ad8817b4bd237ed96bfb6a5f65a6ca6f Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Thu, 28 Aug 2025 14:15:24 +0100 Subject: [PATCH 23/35] Super unique name --- .github/workflows/bs_meta_browser_ci_ec2.yml | 21 +++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bs_meta_browser_ci_ec2.yml b/.github/workflows/bs_meta_browser_ci_ec2.yml index c8c23cb44..b45fb9ba0 100644 --- a/.github/workflows/bs_meta_browser_ci_ec2.yml +++ b/.github/workflows/bs_meta_browser_ci_ec2.yml @@ -78,9 +78,19 @@ jobs: aws s3 cp s3://meta-browser-ci-config-bucket/set_github_env_vars.py . python3 set_github_env_vars.py --file config.json - - name: Start EC2 runner + - name: Clean up any leftover runners + run: | + echo "Checking for any leftover runners from previous runs..." + # This is informational only - the action will handle unique labels + echo "Current GitHub run context:" + echo "Run ID: ${{ github.run_id }}" + echo "Run attempt: ${{ github.run_attempt }}" + echo "Run number: ${{ github.run_number }}" + + - name: Start EC2 runner with retry id: start-ec2-runner uses: brightsign/ec2-github-runner@0fa8b183dd4124fd191ccdbc48b68f0ea46a9634 + timeout-minutes: 15 # Allow more time for registration with: mode: start github-app-private-key: ${{ secrets.GH_APP_PRIVATE_KEY }} @@ -90,16 +100,17 @@ jobs: subnet-id: ${{ env.VPC_SUBNET_ID }} security-group-id: ${{ env.VPC_SG_ID }} run-as-service-with-user: ubuntu - runner-home-dir: /home/ubuntu - label: "runner-${{ github.run_id }}-${{ inputs.yocto_version }}-${{ inputs.arch }}-${{ inputs.chromium_version }}" # Unique label to avoid hostname conflicts + label: "mb-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.run_number }}" # Ultra-unique short label aws-resource-tags: > # optional, requires additional permissions [ - {"Key": "Name", "Value": "github-runner-meta-browser-${{ inputs.instance_name_postfix }}"}, + {"Key": "Name", "Value": "github-runner-meta-browser-${{ inputs.instance_name_postfix }}-${{ github.run_id }}"}, {"Key": "GitHubRepository", "Value": "${{ github.repository }}"}, {"Key": "YoctoVersion", "Value": "${{ inputs.yocto_version }}"}, {"Key": "ChromiumVersion", "Value": "${{ inputs.chromium_version }}"}, {"Key": "Architecture", "Value": "${{ inputs.arch }}"}, - {"Key": "RunId", "Value": "${{ github.run_id }}"} + {"Key": "RunId", "Value": "${{ github.run_id }}"}, + {"Key": "RunAttempt", "Value": "${{ github.run_attempt }}"}, + {"Key": "Browser", "Value": "${{ inputs.browser }}"} ] build-and-test-meta-browser: From 5d0cfdda7a916013940807d8196c1ffa810db949 Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Thu, 28 Aug 2025 14:51:55 +0100 Subject: [PATCH 24/35] Do not use ccache and build on nvme, rather than rootfs --- .../bs_meta_browser_build_and_test.yml | 73 ++++++++++--------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index 3d019ad4e..298353680 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -109,38 +109,42 @@ jobs: - name: Setup swap space run: | echo "=== Setting up 256GB swap space ===" - # Check for NVMe devices (c6id instances have local NVMe storage) - if [ -b /dev/nvme1n1 ]; then - echo "Found NVMe device: /dev/nvme1n1" - echo "Device info:" - lsblk /dev/nvme1n1 + # Check for NVMe storage and set up build directory + echo "=== Setting up NVMe storage for build ===" + if [ -e /dev/nvme1n1 ]; then + echo "NVMe storage detected, setting up build directory..." - # Create a 256GB swap file on the NVMe device - sudo mkfs.ext4 /dev/nvme1n1 - sudo mkdir -p /mnt/nvme - sudo mount /dev/nvme1n1 /mnt/nvme + # Create filesystem if not already done + if ! mount | grep -q nvme1n1; then + sudo mkfs.ext4 -F /dev/nvme1n1 + sudo mkdir -p /mnt/nvme + sudo mount /dev/nvme1n1 /mnt/nvme + sudo chown ubuntu:ubuntu /mnt/nvme + fi + + # Create build directory on NVMe storage + echo "Setting up build workspace on NVMe storage..." + sudo mkdir -p /mnt/nvme/yocto-build + sudo chown ubuntu:ubuntu /mnt/nvme/yocto-build + + # Create symlink from /yocto to NVMe storage + sudo rm -rf /yocto 2>/dev/null || true + sudo ln -sf /mnt/nvme/yocto-build /yocto + sudo chown -h ubuntu:ubuntu /yocto - echo "Creating 256GB swap file (this may take a few minutes)..." + # Set up swap on NVMe (256GB) + echo "Creating 256GB swap file on NVMe SSD..." sudo fallocate -l 256G /mnt/nvme/swapfile sudo chmod 600 /mnt/nvme/swapfile sudo mkswap /mnt/nvme/swapfile sudo swapon /mnt/nvme/swapfile - # Optimize swap performance for build workloads - echo "Optimizing swap settings for build performance..." - echo 10 | sudo tee /proc/sys/vm/swappiness # Reduce swap usage preference - echo 1 | sudo tee /proc/sys/vm/vfs_cache_pressure # Favor keeping build caches in memory - - echo "✓ 256GB swap enabled on NVMe SSD with optimized settings" + echo "✓ Build directory and swap configured on NVMe storage" else - echo "No NVMe device found, creating large swap on root filesystem" - # Fallback: create large swap file on root filesystem - echo "Creating 64GB swap file (reduced size for root filesystem)..." - sudo fallocate -l 64G /swapfile - sudo chmod 600 /swapfile - sudo mkswap /swapfile - sudo swapon /swapfile - echo "✓ 64GB swap enabled on root filesystem" + echo "ERROR: No NVMe device found! c6id.4xlarge should have NVMe storage." + echo "Available block devices:" + lsblk + exit 1 fi # Verify swap is active @@ -412,22 +416,14 @@ jobs: sudo ln -sf /mnt/shared-cache/sstate-cache /yocto/yocto_sstate_chromium sudo ln -sf /mnt/shared-cache/sstate-cache /yocto/yocto_sstate_electron - # Also create ccache directory on local SSD for performance - sudo mkdir -p /yocto/yocto_ccache + # ccache is disabled in kas configuration - no need for ccache directory + echo "✓ ccache disabled in kas configuration - relying on sstate cache" + sudo chown -R ubuntu:ubuntu /yocto - # Verify symlinks + # Verify symlinks and show cache statistics echo "Cache directory symlinks:" ls -la /yocto/ - echo "Contents of cache directories:" - ls -la /mnt/shared-cache/ - echo "Downloads directory contents (first 10 items):" - ls -la /mnt/shared-cache/downloads/ | head -10 || echo "Downloads directory empty" - echo "Sstate cache directory contents (first 10 items):" - ls -la /mnt/shared-cache/sstate-cache/ | head -10 || echo "Sstate cache directory empty" - - # Show cache statistics - echo "=== Cache Statistics ===" echo "Downloads directory size:" du -sh /mnt/shared-cache/downloads 2>/dev/null || echo "0 bytes" echo "Sstate cache directory size:" @@ -441,6 +437,11 @@ jobs: # Run the build script echo "=== Starting build with enhanced cache debugging ===" + # Run the build script + echo "=== Starting build on NVMe storage ===" + echo "Available disk space:" + df -h + ./meta-chromium-test/scripts/build.sh ${{ inputs.yocto_version }} ${{ inputs.arch }} ${{ inputs.chromium_version }} ${{ inputs.browser }} ${{ inputs.libc_flavour }} # Post-build cache analysis From ee08015ee8f8027ea9aa009ac32da79011d0cbac Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Thu, 28 Aug 2025 15:08:23 +0100 Subject: [PATCH 25/35] Fix permission issues --- .../bs_meta_browser_build_and_test.yml | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index 298353680..81de8e35c 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -277,14 +277,11 @@ jobs: sudo mkdir -p /yocto/${{ inputs.yocto_version }} sudo chown -R ubuntu:ubuntu /yocto - # Also ensure our working directory exists - mkdir -p /home/ubuntu/yocto/${{ inputs.yocto_version }} - cd /home/ubuntu/yocto/${{ inputs.yocto_version }} - - # Clean any previous builds + # Clean any previous builds in the NVMe-backed directory + cd /yocto/${{ inputs.yocto_version }} rm -rf meta-browser meta-chromium-test build/tmp/work/*/*/*/pseudo build/tmp/sysroots-components/*/pseudo 2>/dev/null || true - # Create symlinks to EFS mounts + # Create symlinks to EFS mounts (in the build directory) ln -sf /mnt/shared-cache/sstate-cache ./sstate-cache ln -sf /mnt/shared-cache/downloads ./downloads @@ -292,17 +289,15 @@ jobs: ln -sf /mnt/shared-cache/sstate-cache /yocto/yocto_sstate_chromium ln -sf /mnt/shared-cache/downloads /yocto/yocto_dl - # Create other directories that the build script expects - sudo mkdir -p /yocto/yocto_ccache /yocto/test-images - sudo chown -R ubuntu:ubuntu /yocto/yocto_ccache /yocto/test-images + # Create all build directories that the build script expects with proper permissions + sudo mkdir -p /yocto/${{ inputs.yocto_version }} /yocto/yocto_ccache /yocto/test-images + sudo chmod 755 /yocto/${{ inputs.yocto_version }} /yocto/yocto_ccache /yocto/test-images + sudo chown -R ubuntu:ubuntu /yocto/${{ inputs.yocto_version }} /yocto/yocto_ccache /yocto/test-images - # Ensure kas is in PATH for the build + # Ensure kas and other tools are in PATH for the build echo "export PATH=\$PATH:\$HOME/.local/bin" >> ~/.bashrc - - # Create other directories that the build script expects with proper permissions - sudo mkdir -p /yocto/yocto_ccache /yocto/test-images - sudo chmod 755 /yocto/yocto_ccache /yocto/test-images - sudo chown -R ubuntu:ubuntu /yocto/yocto_ccache /yocto/test-images + echo "export LANG=en_US.UTF-8" >> ~/.bashrc + echo "export LC_ALL=en_US.UTF-8" >> ~/.bashrc # Ensure kas and other tools are in PATH for the build echo "export PATH=\$PATH:\$HOME/.local/bin" >> ~/.bashrc @@ -312,7 +307,8 @@ jobs: # Clone repositories (check if PR or manual trigger) - name: Clone repositories run: | - cd /home/ubuntu/yocto/${{ inputs.yocto_version }} + # Clone directly into the NVMe-backed /yocto directory + cd /yocto/${{ inputs.yocto_version }} if [ "${{ github.event_name }}" = "pull_request" ]; then GH_URL="$GITHUB_SERVER_URL/${{ github.event.pull_request.head.repo.full_name }}" @@ -348,12 +344,18 @@ jobs: echo "Home: $HOME" which kas || echo "kas not found in PATH" - # The build script expects to run from /yocto/master + # The build script expects to run from /yocto/master (repositories already cloned here) cd /yocto/${{ inputs.yocto_version }} - # Copy the repositories from our working directory - cp -r /home/ubuntu/yocto/${{ inputs.yocto_version }}/meta-browser ./ - cp -r /home/ubuntu/yocto/${{ inputs.yocto_version }}/meta-chromium-test ./ + # Verify repositories are present + if [ -d "meta-browser" ] && [ -d "meta-chromium-test" ]; then + echo "✓ Repositories successfully cloned to /yocto/${{ inputs.yocto_version }}" + ls -la meta-browser/ meta-chromium-test/ + else + echo "✗ ERROR: Repositories not found in /yocto/${{ inputs.yocto_version }}" + ls -la + exit 1 + fi # Create cache directories if they don't exist sudo mkdir -p /mnt/shared-cache/sstate-cache From 116d94d96f61b03e444a877a37c56e41b72d17bd Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Thu, 28 Aug 2025 15:25:36 +0100 Subject: [PATCH 26/35] refactor and fix permission problems --- .../bs_meta_browser_build_and_test.yml | 145 ++++++------------ 1 file changed, 51 insertions(+), 94 deletions(-) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index 81de8e35c..3f566e63e 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -106,11 +106,15 @@ jobs: echo "✓ AMI verification complete - all dependencies pre-installed" # Setup large swap space on local NVMe SSD for memory-intensive Yocto builds - - name: Setup swap space + - name: Setup NVMe storage and swap run: | - echo "=== Setting up 256GB swap space ===" + echo "=== Setting up NVMe storage and swap ===" + + # Get current user once for all operations + CURRENT_USER=$(whoami) + echo "Setting up NVMe storage for user: $CURRENT_USER" + # Check for NVMe storage and set up build directory - echo "=== Setting up NVMe storage for build ===" if [ -e /dev/nvme1n1 ]; then echo "NVMe storage detected, setting up build directory..." @@ -119,18 +123,18 @@ jobs: sudo mkfs.ext4 -F /dev/nvme1n1 sudo mkdir -p /mnt/nvme sudo mount /dev/nvme1n1 /mnt/nvme - sudo chown ubuntu:ubuntu /mnt/nvme + sudo chown $CURRENT_USER:$CURRENT_USER /mnt/nvme fi # Create build directory on NVMe storage echo "Setting up build workspace on NVMe storage..." sudo mkdir -p /mnt/nvme/yocto-build - sudo chown ubuntu:ubuntu /mnt/nvme/yocto-build + sudo chown $CURRENT_USER:$CURRENT_USER /mnt/nvme/yocto-build # Create symlink from /yocto to NVMe storage sudo rm -rf /yocto 2>/dev/null || true sudo ln -sf /mnt/nvme/yocto-build /yocto - sudo chown -h ubuntu:ubuntu /yocto + sudo chown -h $CURRENT_USER:$CURRENT_USER /yocto # Set up swap on NVMe (256GB) echo "Creating 256GB swap file on NVMe SSD..." @@ -154,11 +158,15 @@ jobs: echo "Available disk space:" df -h - # Mount EFS file systems - - name: Mount EFS file systems + # Mount EFS file systems and setup cache directories + - name: Setup EFS mounts and cache directories run: | - # Create mount points - sudo mkdir -p /mnt/shared-cache /mnt/git-mirror + # Get current user for consistent permission management + CURRENT_USER=$(whoami) + echo "Setting up EFS mounts and cache directories for user: $CURRENT_USER" + + # Create mount points and cache directories + sudo mkdir -p /mnt/shared-cache/sstate-cache /mnt/shared-cache/downloads /mnt/git-mirror # Debug DNS resolution echo "=== DNS Troubleshooting ===" @@ -257,52 +265,39 @@ jobs: mount | grep mnt || echo "No /mnt filesystems found" df -h | grep mnt || echo "No /mnt filesystems in df" - # Create cache directories even if mounts failed (for graceful degradation) - sudo mkdir -p /mnt/shared-cache/sstate-cache - sudo mkdir -p /mnt/shared-cache/downloads - sudo mkdir -p /mnt/git-mirror - - # Set permissions - sudo chown -R ubuntu:ubuntu /mnt/shared-cache /mnt/git-mirror || true + # Set permissions on all cache directories (using current user from above) + sudo chown -R $CURRENT_USER:$CURRENT_USER /mnt/shared-cache /mnt/git-mirror + sudo chmod -R 755 /mnt/shared-cache - # Set up build directories with EFS mounts + # Set up build directories and environment - name: Setup build environment run: | - # Set environment variables that might be expected + # Set environment variables and get current user export LANG=en_US.UTF-8 export LC_ALL=en_US.UTF-8 + CURRENT_USER=$(whoami) + echo "Setting up build environment for user: $CURRENT_USER" + + # Setup environment variables for all shells + echo "export PATH=\$PATH:\$HOME/.local/bin" >> ~/.bashrc + echo "export LANG=en_US.UTF-8" >> ~/.bashrc + echo "export LC_ALL=en_US.UTF-8" >> ~/.bashrc - # Create the expected directory structure for the build script - # The build script expects to run from /yocto/master and create dirs in /yocto - sudo mkdir -p /yocto/${{ inputs.yocto_version }} - sudo chown -R ubuntu:ubuntu /yocto + # Create and setup the build directory structure + sudo mkdir -p /yocto/${{ inputs.yocto_version }} /yocto/yocto_ccache /yocto/test-images + sudo chown -R $CURRENT_USER:$CURRENT_USER /yocto + sudo chmod -R 755 /yocto/${{ inputs.yocto_version }} /yocto/yocto_ccache /yocto/test-images # Clean any previous builds in the NVMe-backed directory cd /yocto/${{ inputs.yocto_version }} rm -rf meta-browser meta-chromium-test build/tmp/work/*/*/*/pseudo build/tmp/sysroots-components/*/pseudo 2>/dev/null || true - # Create symlinks to EFS mounts (in the build directory) + # Create symlinks to EFS mounts in both build directory and /yocto root ln -sf /mnt/shared-cache/sstate-cache ./sstate-cache ln -sf /mnt/shared-cache/downloads ./downloads - - # Create symlinks in /yocto to allow the build script to work ln -sf /mnt/shared-cache/sstate-cache /yocto/yocto_sstate_chromium + ln -sf /mnt/shared-cache/sstate-cache /yocto/yocto_sstate_electron ln -sf /mnt/shared-cache/downloads /yocto/yocto_dl - - # Create all build directories that the build script expects with proper permissions - sudo mkdir -p /yocto/${{ inputs.yocto_version }} /yocto/yocto_ccache /yocto/test-images - sudo chmod 755 /yocto/${{ inputs.yocto_version }} /yocto/yocto_ccache /yocto/test-images - sudo chown -R ubuntu:ubuntu /yocto/${{ inputs.yocto_version }} /yocto/yocto_ccache /yocto/test-images - - # Ensure kas and other tools are in PATH for the build - echo "export PATH=\$PATH:\$HOME/.local/bin" >> ~/.bashrc - echo "export LANG=en_US.UTF-8" >> ~/.bashrc - echo "export LC_ALL=en_US.UTF-8" >> ~/.bashrc - - # Ensure kas and other tools are in PATH for the build - echo "export PATH=\$PATH:\$HOME/.local/bin" >> ~/.bashrc - echo "export LANG=en_US.UTF-8" >> ~/.bashrc - echo "export LC_ALL=en_US.UTF-8" >> ~/.bashrc # Clone repositories (check if PR or manual trigger) - name: Clone repositories @@ -335,15 +330,15 @@ jobs: export LC_ALL=en_US.UTF-8 export PATH=$PATH:$HOME/.local/bin - # Debug environment + # Debug environment and verify setup echo "=== Environment Debug ===" echo "PATH: $PATH" - echo "LANG: $LANG" - echo "LC_ALL: $LC_ALL" echo "User: $(whoami)" - echo "Home: $HOME" + echo "Current directory: $(pwd)" which kas || echo "kas not found in PATH" + echo "Building ${{ inputs.browser }} with ${{ inputs.chromium_version }}" + # The build script expects to run from /yocto/master (repositories already cloned here) cd /yocto/${{ inputs.yocto_version }} @@ -357,31 +352,20 @@ jobs: exit 1 fi - # Create cache directories if they don't exist - sudo mkdir -p /mnt/shared-cache/sstate-cache - sudo mkdir -p /mnt/shared-cache/downloads - sudo chown -R ubuntu:ubuntu /mnt/shared-cache/sstate-cache - sudo chown -R ubuntu:ubuntu /mnt/shared-cache/downloads - sudo chmod -R 755 /mnt/shared-cache/sstate-cache - sudo chmod -R 755 /mnt/shared-cache/downloads - - # Test cache directory accessibility + # Display cache status (cache directories already set up in previous step) + echo "=== Cache Status ===" if [ -w /mnt/shared-cache/sstate-cache ]; then - echo "✓ sstate-cache directory is writable" - # Check if cache has existing content SSTATE_COUNT=$(find /mnt/shared-cache/sstate-cache -name "*.tar.*" | wc -l) - echo " Existing sstate files: $SSTATE_COUNT" + echo "✓ sstate-cache directory accessible, existing files: $SSTATE_COUNT" else - echo "✗ sstate-cache directory is not writable" + echo "✗ sstate-cache directory not accessible" fi if [ -w /mnt/shared-cache/downloads ]; then - echo "✓ downloads directory is writable" - # Check if downloads has existing content DOWNLOADS_COUNT=$(find /mnt/shared-cache/downloads -type f | wc -l) - echo " Existing download files: $DOWNLOADS_COUNT" + echo "✓ downloads directory accessible, existing files: $DOWNLOADS_COUNT" else - echo "✗ downloads directory is not writable" + echo "✗ downloads directory not accessible" fi # Show cache directory sizes @@ -397,46 +381,19 @@ jobs: # Verify the build script exists and is executable if [ -f "./meta-chromium-test/scripts/build.sh" ]; then - echo "Build script found" - ls -la ./meta-chromium-test/scripts/build.sh + echo "✓ Build script found and ready" chmod +x ./meta-chromium-test/scripts/build.sh - echo "=== Build script first 20 lines ===" - head -20 ./meta-chromium-test/scripts/build.sh else - echo "Build script not found!" + echo "✗ Build script not found!" find . -name "build.sh" 2>/dev/null || echo "No build.sh found anywhere" exit 1 fi - # Create symlinks from hardcoded kas paths to EFS cache directories - echo "=== Setting up cache directory symlinks ===" - - # Remove any existing directories and create symlinks to EFS cache - sudo rm -rf /yocto/yocto_dl /yocto/yocto_sstate_chromium /yocto/yocto_sstate_electron - sudo mkdir -p /yocto - sudo ln -sf /mnt/shared-cache/downloads /yocto/yocto_dl - sudo ln -sf /mnt/shared-cache/sstate-cache /yocto/yocto_sstate_chromium - sudo ln -sf /mnt/shared-cache/sstate-cache /yocto/yocto_sstate_electron - - # ccache is disabled in kas configuration - no need for ccache directory + # Verify cache symlinks (already created in build environment setup) + echo "=== Cache Directory Verification ===" + ls -la /yocto/ | grep -E "(yocto_dl|yocto_sstate)" || echo "Cache symlinks not found" echo "✓ ccache disabled in kas configuration - relying on sstate cache" - sudo chown -R ubuntu:ubuntu /yocto - - # Verify symlinks and show cache statistics - echo "Cache directory symlinks:" - ls -la /yocto/ - echo "Downloads directory size:" - du -sh /mnt/shared-cache/downloads 2>/dev/null || echo "0 bytes" - echo "Sstate cache directory size:" - du -sh /mnt/shared-cache/sstate-cache 2>/dev/null || echo "0 bytes" - - # Count cache files - DOWNLOADS_COUNT=$(find /mnt/shared-cache/downloads -type f 2>/dev/null | wc -l) - SSTATE_COUNT=$(find /mnt/shared-cache/sstate-cache -type f 2>/dev/null | wc -l) - echo "Downloads files count: $DOWNLOADS_COUNT" - echo "Sstate cache files count: $SSTATE_COUNT" - # Run the build script echo "=== Starting build with enhanced cache debugging ===" # Run the build script From 300809acaeff970fcd7d9873416ad514cf5f60f2 Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Thu, 28 Aug 2025 15:46:41 +0100 Subject: [PATCH 27/35] fix permission errors --- .github/workflows/bs_meta_browser_build_and_test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index 3f566e63e..614275b96 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -292,6 +292,10 @@ jobs: cd /yocto/${{ inputs.yocto_version }} rm -rf meta-browser meta-chromium-test build/tmp/work/*/*/*/pseudo build/tmp/sysroots-components/*/pseudo 2>/dev/null || true + # Ensure current directory has proper permissions for symlink creation + sudo chown $CURRENT_USER:$CURRENT_USER . + sudo chmod 755 . + # Create symlinks to EFS mounts in both build directory and /yocto root ln -sf /mnt/shared-cache/sstate-cache ./sstate-cache ln -sf /mnt/shared-cache/downloads ./downloads From 1f4a4278d6a25e65c5fe94933d9874aa25b533c2 Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Thu, 28 Aug 2025 20:13:09 +0100 Subject: [PATCH 28/35] Fix permissions --- .github/workflows/bs_meta_browser_build_and_test.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index 614275b96..c213d8fd6 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -398,9 +398,15 @@ jobs: ls -la /yocto/ | grep -E "(yocto_dl|yocto_sstate)" || echo "Cache symlinks not found" echo "✓ ccache disabled in kas configuration - relying on sstate cache" + # Fix test-images directory permissions (build script needs to write here) + echo "=== Fixing test-images directory permissions ===" + CURRENT_USER=$(whoami) + sudo chown -R $CURRENT_USER:$CURRENT_USER /yocto/test-images + sudo chmod 755 /yocto/test-images + echo "test-images directory ownership:" + ls -la /yocto/ | grep test-images + # Run the build script - echo "=== Starting build with enhanced cache debugging ===" - # Run the build script echo "=== Starting build on NVMe storage ===" echo "Available disk space:" df -h From c6959d6b1b67f3705385ca3f3a2c73f004f8f412 Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Fri, 29 Aug 2025 09:19:47 +0100 Subject: [PATCH 29/35] Remove workspace file --- .github/workflows/meta-browser.code-workspace | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 .github/workflows/meta-browser.code-workspace diff --git a/.github/workflows/meta-browser.code-workspace b/.github/workflows/meta-browser.code-workspace deleted file mode 100644 index 17d6f76c1..000000000 --- a/.github/workflows/meta-browser.code-workspace +++ /dev/null @@ -1,14 +0,0 @@ -{ - "folders": [ - { - "path": "../.." - }, - { - "path": "../../../sources/chromium-138.0.7204.35" - }, - { - "path": "../../../meta" - } - ], - "settings": {} -} \ No newline at end of file From d56f155dbdcd64046489fba3e32530b725d1d63c Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Fri, 29 Aug 2025 16:16:10 +0100 Subject: [PATCH 30/35] Address github copilot review comments --- .github/workflows/bs_meta_browser_build_and_test.yml | 4 ++-- .github/workflows/bs_meta_browser_ci_ec2.yml | 2 +- .github/workflows/chromium.yml | 4 ++-- .github/workflows/cleanup-efs-cache.yml | 6 +++--- .github/workflows/electron.yml | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index c213d8fd6..85900b534 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -29,7 +29,7 @@ on: type: string chromium_version: - description: 'Chromium version (ozone-wayland or x11)' + description: 'Display backend/Ozone platform (ozone-wayland or x11)' required: true type: string @@ -145,7 +145,7 @@ jobs: echo "✓ Build directory and swap configured on NVMe storage" else - echo "ERROR: No NVMe device found! c6id.4xlarge should have NVMe storage." + echo "ERROR: No NVMe device found! Instance should have NVMe storage for optimal build performance." echo "Available block devices:" lsblk exit 1 diff --git a/.github/workflows/bs_meta_browser_ci_ec2.yml b/.github/workflows/bs_meta_browser_ci_ec2.yml index b45fb9ba0..592a18811 100644 --- a/.github/workflows/bs_meta_browser_ci_ec2.yml +++ b/.github/workflows/bs_meta_browser_ci_ec2.yml @@ -18,7 +18,7 @@ on: type: string chromium_version: - description: 'Chromium version (ozone-wayland or x11)' + description: 'Display backend/Ozone platform (ozone-wayland or x11)' required: true type: string diff --git a/.github/workflows/chromium.yml b/.github/workflows/chromium.yml index 747fdb2e3..40275c3a7 100644 --- a/.github/workflows/chromium.yml +++ b/.github/workflows/chromium.yml @@ -39,7 +39,7 @@ jobs: fail-fast: false # Continue other matrix jobs even if one fails matrix: yocto_version: [master] - chromium_version: [ozone-wayland, x11] + ozone_platform: [ozone-wayland, x11] libc_flavour: [glibc] arch: [arm, aarch64, x86-64] uses: ./.github/workflows/bs_meta_browser_ci_ec2.yml @@ -48,7 +48,7 @@ jobs: build_type: "release" browser: "chromium" yocto_version: ${{ matrix.yocto_version }} - chromium_version: ${{ matrix.chromium_version }} + chromium_version: ${{ matrix.ozone_platform }} libc_flavour: ${{ matrix.libc_flavour }} arch: ${{ matrix.arch }} aws_arn_role: "arn:aws:iam::195607249165:role/github-actions-meta-browser-repo" diff --git a/.github/workflows/cleanup-efs-cache.yml b/.github/workflows/cleanup-efs-cache.yml index e713a21a7..3d883fdc5 100644 --- a/.github/workflows/cleanup-efs-cache.yml +++ b/.github/workflows/cleanup-efs-cache.yml @@ -94,10 +94,10 @@ jobs: # Create mount point sudo mkdir -p /mnt/shared-cache - # Mount EFS (using the shared cache EFS ID) - echo "Mounting EFS: fs-0ee52486275950d2e" + # Mount EFS using environment variable from config + echo "Mounting EFS: ${{ env.SHARED_CACHE_EFS_ID }}" sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,intr,timeo=600 \ - fs-0ee52486275950d2e.efs.${{ inputs.aws_region }}.amazonaws.com:/ /mnt/shared-cache + ${{ env.SHARED_CACHE_EFS_ID }}.efs.${{ inputs.aws_region }}.amazonaws.com:/ /mnt/shared-cache # Show current disk usage echo "=== Current EFS disk usage ===" diff --git a/.github/workflows/electron.yml b/.github/workflows/electron.yml index 0e89eb386..9713cbd5d 100644 --- a/.github/workflows/electron.yml +++ b/.github/workflows/electron.yml @@ -39,7 +39,7 @@ jobs: fail-fast: false # Continue other matrix jobs even if one fails matrix: yocto_version: [master] - chromium_version: [ozone-wayland, ozone-x11] + ozone_platform: [ozone-wayland, ozone-x11] libc_flavour: [glibc] arch: [arm, aarch64, x86-64] uses: ./.github/workflows/bs_meta_browser_ci_ec2.yml @@ -48,7 +48,7 @@ jobs: build_type: "release" browser: "electron" yocto_version: ${{ matrix.yocto_version }} - chromium_version: ${{ matrix.chromium_version }} + chromium_version: ${{ matrix.ozone_platform }} libc_flavour: ${{ matrix.libc_flavour }} arch: ${{ matrix.arch }} aws_arn_role: "arn:aws:iam::195607249165:role/github-actions-meta-browser-repo" From bbf490ba29349f8d94d0ec3c45bf2ca25cf04362 Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Fri, 29 Aug 2025 17:10:46 +0100 Subject: [PATCH 31/35] Address Tariq's review comments. --- .../bs_meta_browser_build_and_test.yml | 21 ++++++++++++++----- .github/workflows/chromium.yml | 12 ++++++++++- .github/workflows/cleanup-efs-cache.yml | 10 ++++----- .github/workflows/electron.yml | 12 ++++++++++- 4 files changed, 43 insertions(+), 12 deletions(-) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index 85900b534..3d58962f3 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -180,7 +180,13 @@ jobs: # Check if we can reach AWS services echo "=== AWS Connectivity Check ===" - curl -s --connect-timeout 10 https://s3.amazonaws.com && echo "S3 reachable" || echo "S3 not reachable" + if curl -s --connect-timeout 10 https://s3.amazonaws.com; then + echo "✓ S3 reachable" + else + echo "✗ S3 not reachable - this will cause build artifact upload to fail" + echo "Network connectivity issue detected" + exit 1 + fi # Alternative: Use mount target IP if DNS fails echo "=== Alternative EFS Mount Strategy ===" @@ -451,7 +457,7 @@ jobs: uses: aws-actions/configure-aws-credentials@v4 with: aws-region: ${{ env.AWS_REGION }} - role-to-assume: ${{ env.AWS_ARN_ROLE }} + role-to-assume: ${{ inputs.aws_arn_role }} role-session-name: meta-browser-upload-${{ github.run_id }} role-duration-seconds: 3600 # 1 hour for upload @@ -484,11 +490,16 @@ jobs: # Verify AWS credentials are working echo "Verifying AWS credentials..." - aws sts get-caller-identity + if aws sts get-caller-identity; then + echo "✓ AWS credentials verified successfully" + else + echo "✗ AWS credentials verification failed" + exit 1 + fi echo "Starting S3 upload..." - # Use verbose mode and enable progress tracking - if aws s3 sync "$DEPLOY_DIR/" "$S3_PATH" --cli-read-timeout 0 --cli-connect-timeout 60; then + # Use quiet mode to avoid excessive logging for large uploads + if aws s3 sync "$DEPLOY_DIR/" "$S3_PATH" --cli-read-timeout 0 --cli-connect-timeout 60 --quiet; then echo "✓ Artifacts uploaded successfully to $S3_PATH" # Verify upload diff --git a/.github/workflows/chromium.yml b/.github/workflows/chromium.yml index 40275c3a7..e27097f49 100644 --- a/.github/workflows/chromium.yml +++ b/.github/workflows/chromium.yml @@ -16,6 +16,16 @@ on: required: false type: boolean default: true + instance_type: + description: 'EC2 instance type for build (more cores = faster builds)' + required: false + type: choice + options: + - 'c6id.4xlarge' # 16 vCPUs, 32 GB RAM, 1x 950 GB NVMe + - 'c6id.8xlarge' # 32 vCPUs, 64 GB RAM, 1x 1900 GB NVMe + - 'c6id.12xlarge' # 48 vCPUs, 96 GB RAM, 2x 1425 GB NVMe + - 'c6id.16xlarge' # 64 vCPUs, 128 GB RAM, 2x 1900 GB NVMe + default: 'c6id.8xlarge' pull_request: branches: - master @@ -53,7 +63,7 @@ jobs: arch: ${{ matrix.arch }} aws_arn_role: "arn:aws:iam::195607249165:role/github-actions-meta-browser-repo" aws_region: "us-east-1" - instance_type: "c6id.8xlarge" # Uses NVMe SSD for swap to handle memory pressure + instance_type: ${{ inputs.instance_type || 'c6id.8xlarge' }} # Default for PR builds, user choice for manual # Local runner (manual dispatch only, when explicitly disabled AWS) local-build: diff --git a/.github/workflows/cleanup-efs-cache.yml b/.github/workflows/cleanup-efs-cache.yml index 3d883fdc5..dbcacc891 100644 --- a/.github/workflows/cleanup-efs-cache.yml +++ b/.github/workflows/cleanup-efs-cache.yml @@ -45,7 +45,7 @@ jobs: uses: aws-actions/configure-aws-credentials@v4 with: aws-region: ${{ inputs.aws_region }} - role-to-assume: "arn:aws:iam::195607249165:role/github-actions-meta-browser-repo" + role-to-assume: ${{ secrets.AWS_ARN_ROLE }} # Start EC2 runner for cleanup - name: Start EC2 runner @@ -56,8 +56,8 @@ jobs: github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} ec2-image-id: ami-0ba9883b710398fbb ec2-instance-type: ${{ inputs.instance_type }} - subnet-id: subnet-06b2fe35df970cb71 - security-group-id: sg-0905fa8cd994895e8 + subnet-id: ${{ env.VPC_SUBNET_ID }} + security-group-id: ${{ env.VPC_SG_ID }} iam-role-name: yocto-github-actions-role aws-resource-tags: > [ @@ -75,7 +75,7 @@ jobs: uses: aws-actions/configure-aws-credentials@v4 with: aws-region: ${{ inputs.aws_region }} - role-to-assume: "arn:aws:iam::195607249165:role/github-actions-meta-browser-repo" + role-to-assume: ${{ secrets.AWS_ARN_ROLE }} # Download config and get EFS ID - name: Download config file and set env vars from it @@ -158,7 +158,7 @@ jobs: uses: aws-actions/configure-aws-credentials@v4 with: aws-region: ${{ inputs.aws_region }} - role-to-assume: "arn:aws:iam::195607249165:role/github-actions-meta-browser-repo" + role-to-assume: ${{ secrets.AWS_ARN_ROLE }} - name: Stop EC2 runner uses: machulav/ec2-github-runner@v2 diff --git a/.github/workflows/electron.yml b/.github/workflows/electron.yml index 9713cbd5d..520e9a595 100644 --- a/.github/workflows/electron.yml +++ b/.github/workflows/electron.yml @@ -16,6 +16,16 @@ on: required: false type: boolean default: true + instance_type: + description: 'EC2 instance type for build (more cores = faster builds)' + required: false + type: choice + options: + - 'c6id.4xlarge' # 16 vCPUs, 32 GB RAM, 1x 950 GB NVMe + - 'c6id.8xlarge' # 32 vCPUs, 64 GB RAM, 1x 1900 GB NVMe + - 'c6id.12xlarge' # 48 vCPUs, 96 GB RAM, 2x 1425 GB NVMe + - 'c6id.16xlarge' # 64 vCPUs, 128 GB RAM, 2x 1900 GB NVMe + default: 'c6id.8xlarge' pull_request: branches: - master @@ -53,7 +63,7 @@ jobs: arch: ${{ matrix.arch }} aws_arn_role: "arn:aws:iam::195607249165:role/github-actions-meta-browser-repo" aws_region: "us-east-1" - instance_type: "c6id.8xlarge" + instance_type: ${{ github.event.inputs.instance_type || 'c6id.8xlarge' }} # Local runner (manual dispatch only, when explicitly disabled AWS) local-build: From 2f3b3a5ada2dcb5fe66defe729f892f0ff0193ef Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Fri, 29 Aug 2025 23:18:30 +0100 Subject: [PATCH 32/35] Use unique session names and labels --- .github/workflows/bs_meta_browser_build_and_test.yml | 4 ++-- .github/workflows/bs_meta_browser_ci_ec2.yml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index 3d58962f3..85e24962c 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -66,7 +66,7 @@ jobs: with: aws-region: ${{ inputs.aws_region }} role-to-assume: ${{ inputs.aws_arn_role }} - role-session-name: meta-browser-build-${{ github.run_id }} + role-session-name: meta-browser-build-${{ github.run_id }}-${{ inputs.browser }}-${{ inputs.arch }}-${{ inputs.chromium_version }} role-duration-seconds: 43200 # 12 hours - maximum for most IAM roles # Download config file and set environment variables @@ -458,7 +458,7 @@ jobs: with: aws-region: ${{ env.AWS_REGION }} role-to-assume: ${{ inputs.aws_arn_role }} - role-session-name: meta-browser-upload-${{ github.run_id }} + role-session-name: meta-browser-upload-${{ github.run_id }}-${{ inputs.browser }}-${{ inputs.arch }}-${{ inputs.chromium_version }} role-duration-seconds: 3600 # 1 hour for upload # Upload build artifacts to S3 (if successful) diff --git a/.github/workflows/bs_meta_browser_ci_ec2.yml b/.github/workflows/bs_meta_browser_ci_ec2.yml index 592a18811..25a5d3149 100644 --- a/.github/workflows/bs_meta_browser_ci_ec2.yml +++ b/.github/workflows/bs_meta_browser_ci_ec2.yml @@ -69,7 +69,7 @@ jobs: with: aws-region: ${{ inputs.aws_region }} role-to-assume: ${{ inputs.aws_arn_role }} - role-session-name: meta-browser-ci-${{ github.run_id }} + role-session-name: meta-browser-ci-${{ github.run_id }}-${{ inputs.browser }}-${{ inputs.arch }}-${{ inputs.chromium_version }} role-duration-seconds: 43200 # 12 hours for long builds - name: Download config file and set env vars from it @@ -100,7 +100,7 @@ jobs: subnet-id: ${{ env.VPC_SUBNET_ID }} security-group-id: ${{ env.VPC_SG_ID }} run-as-service-with-user: ubuntu - label: "mb-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.run_number }}" # Ultra-unique short label + label: "mb-${{ github.run_id }}-${{ inputs.browser }}-${{ inputs.arch }}-${{ inputs.chromium_version }}" # Unique per matrix job aws-resource-tags: > # optional, requires additional permissions [ {"Key": "Name", "Value": "github-runner-meta-browser-${{ inputs.instance_name_postfix }}-${{ github.run_id }}"}, @@ -143,7 +143,7 @@ jobs: with: role-to-assume: ${{ inputs.aws_arn_role }} aws-region: ${{ inputs.aws_region }} - role-session-name: meta-browser-ci-cleanup-${{ github.run_id }} + role-session-name: meta-browser-ci-cleanup-${{ github.run_id }}-${{ inputs.browser }}-${{ inputs.arch }}-${{ inputs.chromium_version }} - name: Stop EC2 runner uses: brightsign/ec2-github-runner@0fa8b183dd4124fd191ccdbc48b68f0ea46a9634 From f52f3f5ca64d055ffc53da8777149b6fe68cdc25 Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Fri, 29 Aug 2025 23:30:20 +0100 Subject: [PATCH 33/35] Do not recursively change permissions --- .github/workflows/bs_meta_browser_build_and_test.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index 85e24962c..354641438 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -271,9 +271,10 @@ jobs: mount | grep mnt || echo "No /mnt filesystems found" df -h | grep mnt || echo "No /mnt filesystems in df" - # Set permissions on all cache directories (using current user from above) - sudo chown -R $CURRENT_USER:$CURRENT_USER /mnt/shared-cache /mnt/git-mirror - sudo chmod -R 755 /mnt/shared-cache + # Set permissions on mount points only (not recursive to avoid processing massive cache data) + sudo chown $CURRENT_USER:$CURRENT_USER /mnt/shared-cache /mnt/git-mirror + sudo chmod 755 /mnt/shared-cache /mnt/git-mirror + echo "✓ Mount point permissions set (skipped recursive operation to avoid processing 100GB+ of cache data)" # Set up build directories and environment - name: Setup build environment From ebb89ef7b7b858103270d83707d236d40597863d Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Fri, 29 Aug 2025 23:34:37 +0100 Subject: [PATCH 34/35] shorten role names --- .github/workflows/bs_meta_browser_build_and_test.yml | 4 ++-- .github/workflows/bs_meta_browser_ci_ec2.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index 354641438..a220bd61d 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -66,7 +66,7 @@ jobs: with: aws-region: ${{ inputs.aws_region }} role-to-assume: ${{ inputs.aws_arn_role }} - role-session-name: meta-browser-build-${{ github.run_id }}-${{ inputs.browser }}-${{ inputs.arch }}-${{ inputs.chromium_version }} + role-session-name: mb-build-${{ github.run_id }} role-duration-seconds: 43200 # 12 hours - maximum for most IAM roles # Download config file and set environment variables @@ -459,7 +459,7 @@ jobs: with: aws-region: ${{ env.AWS_REGION }} role-to-assume: ${{ inputs.aws_arn_role }} - role-session-name: meta-browser-upload-${{ github.run_id }}-${{ inputs.browser }}-${{ inputs.arch }}-${{ inputs.chromium_version }} + role-session-name: mb-upload-${{ github.run_id }} role-duration-seconds: 3600 # 1 hour for upload # Upload build artifacts to S3 (if successful) diff --git a/.github/workflows/bs_meta_browser_ci_ec2.yml b/.github/workflows/bs_meta_browser_ci_ec2.yml index 25a5d3149..33392929d 100644 --- a/.github/workflows/bs_meta_browser_ci_ec2.yml +++ b/.github/workflows/bs_meta_browser_ci_ec2.yml @@ -69,7 +69,7 @@ jobs: with: aws-region: ${{ inputs.aws_region }} role-to-assume: ${{ inputs.aws_arn_role }} - role-session-name: meta-browser-ci-${{ github.run_id }}-${{ inputs.browser }}-${{ inputs.arch }}-${{ inputs.chromium_version }} + role-session-name: mb-ci-${{ github.run_id }} role-duration-seconds: 43200 # 12 hours for long builds - name: Download config file and set env vars from it @@ -143,7 +143,7 @@ jobs: with: role-to-assume: ${{ inputs.aws_arn_role }} aws-region: ${{ inputs.aws_region }} - role-session-name: meta-browser-ci-cleanup-${{ github.run_id }}-${{ inputs.browser }}-${{ inputs.arch }}-${{ inputs.chromium_version }} + role-session-name: mb-cleanup-${{ github.run_id }} - name: Stop EC2 runner uses: brightsign/ec2-github-runner@0fa8b183dd4124fd191ccdbc48b68f0ea46a9634 From 9d1aa725bb726c2e9d26fc366a4dfabc15dff089 Mon Sep 17 00:00:00 2001 From: Caner Altinbasak Date: Mon, 1 Sep 2025 10:11:26 +0100 Subject: [PATCH 35/35] Use main branch of meta-chromium-test During development, I've used electron-master branch. electron-master is now merged to main. Switch to that branch --- .github/workflows/bs_meta_browser_build_and_test.yml | 4 ++-- .github/workflows/chromium.yml | 2 +- .github/workflows/electron.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bs_meta_browser_build_and_test.yml b/.github/workflows/bs_meta_browser_build_and_test.yml index a220bd61d..e539c55ad 100644 --- a/.github/workflows/bs_meta_browser_build_and_test.yml +++ b/.github/workflows/bs_meta_browser_build_and_test.yml @@ -328,9 +328,9 @@ jobs: git clone $GH_URL git -C meta-browser checkout $GH_REV - # Clone the test repo (use electron-master branch for all builds) + # Clone the test repo echo "Cloning meta-chromium-test electron-master branch" - git clone -b electron-master https://github.com/brightsign/meta-chromium-test.git + git clone https://github.com/brightsign/meta-chromium-test.git # Run the build - name: Build Browser diff --git a/.github/workflows/chromium.yml b/.github/workflows/chromium.yml index e27097f49..9e7436330 100644 --- a/.github/workflows/chromium.yml +++ b/.github/workflows/chromium.yml @@ -98,5 +98,5 @@ jobs: git clone $GH_URL git -C meta-browser checkout $GH_REV # clone the test repo - git clone -b electron-master https://github.com/brightsign/meta-chromium-test.git + git clone https://github.com/brightsign/meta-chromium-test.git ./meta-chromium-test/scripts/build.sh ${{ matrix.yocto_version}} ${{ matrix.arch }} ${{ matrix.browser_version }} ${{ matrix.browser }} ${{ matrix.libc_flavour}} diff --git a/.github/workflows/electron.yml b/.github/workflows/electron.yml index 520e9a595..90f8c8311 100644 --- a/.github/workflows/electron.yml +++ b/.github/workflows/electron.yml @@ -98,5 +98,5 @@ jobs: git clone $GH_URL git -C meta-browser checkout $GH_REV # clone the test repo - git clone -b electron-master https://github.com/brightsign/meta-chromium-test.git + git clone https://github.com/brightsign/meta-chromium-test.git ./meta-chromium-test/scripts/build.sh ${{ matrix.yocto_version}} ${{ matrix.arch }} ${{ matrix.browser_version }} ${{ matrix.browser }} ${{ matrix.libc_flavour}}