From bca194e3e1f51f9efe8bf2af708e1fa5107fc504 Mon Sep 17 00:00:00 2001 From: Jonathan Fischer PEPE Date: Sun, 17 Nov 2024 17:06:16 -0500 Subject: [PATCH 1/5] restricted concurrency group to fix multiple PR build error --- .github/workflows/Documentation.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index 71f647c56..31984e5f2 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -12,8 +12,8 @@ permissions: contents: read concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true + group: docs-${{ github.ref }} # Group name for concurrency control + cancel-in-progress: true # Ensures only one doc build runs at a time for each branch/ref, regardless of the trigger jobs: build: From 678053be6b11368cfcecd77219ec36e853de38fd Mon Sep 17 00:00:00 2001 From: Jonathan Fischer PEPE Date: Sun, 17 Nov 2024 17:44:26 -0500 Subject: [PATCH 2/5] added logging and sleep/verify step for xvfb framebuffer --- .github/workflows/Documentation.yml | 56 ++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index 31984e5f2..513eb2a84 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -22,11 +22,34 @@ jobs: - name: Checkout uses: actions/checkout@v4 - # Install binary dependencies needed for GLMakie to run in a headless environment - # xvfb: Creates a virtual frame buffer to simulate a display - # libgl1, mesa-utils, freeglut3-dev, xorg-dev, libxrandr-dev, libxinerama-dev, libxcursor-dev, libxi-dev, libxext-dev: Required libraries for OpenGL rendering + # Install all required X11 and OpenGL libraries + # These are needed for GLMakie to work in a headless environment - name: Install binary dependencies - run: sudo apt-get update && sudo apt-get install -y xvfb libgl1 mesa-utils freeglut3-dev xorg-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev + run: | + sudo apt-get update + sudo apt-get install -y xvfb libgl1 mesa-utils freeglut3-dev xorg-dev \ + libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev + + # Start Xvfb explicitly instead of using xvfb-run + # This gives us more control and visibility into the virtual display setup + - name: Setup and verify virtual framebuffer + run: | + # Start Xvfb on display :99 + /usr/bin/Xvfb :99 -screen 0 1024x768x24 & + echo "Waiting for Xvfb to start..." + sleep 3 + + # Test if Xvfb is accepting connections + echo "Testing Xvfb connection..." + if xdpyinfo -display :99 >/dev/null 2>&1; then + echo "✓ Xvfb is running and accepting connections" + echo "DISPLAY=:99" >> $GITHUB_ENV + else + echo "✗ Failed to connect to Xvfb" + echo "Xvfb status:" + ps aux | grep Xvfb + exit 1 + fi - name: Install Julia uses: julia-actions/setup-julia@latest @@ -38,22 +61,23 @@ jobs: with: cache-name: docs-cache - # Install Julia package dependencies for the documentation project + # Install dependencies with the virtual display already running - name: Install dependencies - run: > - DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' julia --project=docs/ -e 'ENV["JULIA_PKG_SERVER"] = ""; using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' + run: | + julia --project=docs/ -e ' + ENV["JULIA_PKG_SERVER"] = ""; + using Pkg; + Pkg.develop(PackageSpec(path=pwd())); + Pkg.instantiate()' - # Build and deploy the documentation using xvfb to simulate a display for GLMakie - # xvfb-run: Runs Julia with a virtual display to support OpenGL rendering - # --server-args: Configures the virtual display resolution and color depth + # Build documentation with the stable virtual display - name: Build and deploy env: - GKSwstype: "100" # Specifies the workstation type for GR framework rendering, https://discourse.julialang.org/t/generation-of-documentation-fails-qt-qpa-xcb-could-not-connect-to-display/60988/7 - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Required for permissions to deploy documentation - DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key - run: > - DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' - julia --project=docs --color=yes --code-coverage=user docs/make.jl + # GKSwstype=100 tells GR to use a different backend that works better in headless environments + GKSwstype: "100" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} + run: julia --project=docs --color=yes --code-coverage=user docs/make.jl - name: Upload site as artifact uses: actions/upload-artifact@v4 From bd1dc6fe03be91fadbb93fb8bc3e6662cba36e05 Mon Sep 17 00:00:00 2001 From: Jonathan Fischer PEPE Date: Sun, 17 Nov 2024 17:49:10 -0500 Subject: [PATCH 3/5] 10 second wait time for xvfb init --- .github/workflows/Documentation.yml | 30 +++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index 513eb2a84..dc7a78894 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -37,19 +37,25 @@ jobs: # Start Xvfb on display :99 /usr/bin/Xvfb :99 -screen 0 1024x768x24 & echo "Waiting for Xvfb to start..." - sleep 3 - # Test if Xvfb is accepting connections - echo "Testing Xvfb connection..." - if xdpyinfo -display :99 >/dev/null 2>&1; then - echo "✓ Xvfb is running and accepting connections" - echo "DISPLAY=:99" >> $GITHUB_ENV - else - echo "✗ Failed to connect to Xvfb" - echo "Xvfb status:" - ps aux | grep Xvfb - exit 1 - fi + # Try to connect to Xvfb for up to 10 seconds + max_attempts=10 + attempt=1 + while [ $attempt -le $max_attempts ]; do + echo "Connection attempt $attempt of $max_attempts..." + if xdpyinfo -display :99 >/dev/null 2>&1; then + echo "✓ Xvfb is running and accepting connections" + echo "DISPLAY=:99" >> $GITHUB_ENV + exit 0 + fi + attempt=$((attempt+1)) + sleep 1 + done + + echo "✗ Failed to connect to Xvfb after $max_attempts seconds" + echo "Xvfb status:" + ps aux | grep Xvfb + exit 1 - name: Install Julia uses: julia-actions/setup-julia@latest From 56dd4c0838ad4909f4eace1f487d76baaaea431b Mon Sep 17 00:00:00 2001 From: Jonathan Fischer PEPE Date: Sun, 17 Nov 2024 20:41:51 -0500 Subject: [PATCH 4/5] use default settings for xvfb --- .github/workflows/Documentation.yml | 30 +++++------------------------ 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index dc7a78894..d8ac17133 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -32,30 +32,11 @@ jobs: # Start Xvfb explicitly instead of using xvfb-run # This gives us more control and visibility into the virtual display setup - - name: Setup and verify virtual framebuffer + - name: Setup virtual framebuffer run: | - # Start Xvfb on display :99 - /usr/bin/Xvfb :99 -screen 0 1024x768x24 & - echo "Waiting for Xvfb to start..." - - # Try to connect to Xvfb for up to 10 seconds - max_attempts=10 - attempt=1 - while [ $attempt -le $max_attempts ]; do - echo "Connection attempt $attempt of $max_attempts..." - if xdpyinfo -display :99 >/dev/null 2>&1; then - echo "✓ Xvfb is running and accepting connections" - echo "DISPLAY=:99" >> $GITHUB_ENV - exit 0 - fi - attempt=$((attempt+1)) - sleep 1 - done - - echo "✗ Failed to connect to Xvfb after $max_attempts seconds" - echo "Xvfb status:" - ps aux | grep Xvfb - exit 1 + # Start Xvfb and wait for it to be ready + /usr/bin/Xvfb :99 -screen 0 1024x768x24 + echo "DISPLAY=:99" >> $GITHUB_ENV - name: Install Julia uses: julia-actions/setup-julia@latest @@ -79,11 +60,10 @@ jobs: # Build documentation with the stable virtual display - name: Build and deploy env: - # GKSwstype=100 tells GR to use a different backend that works better in headless environments GKSwstype: "100" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} - run: julia --project=docs --color=yes --code-coverage=user docs/make.jl + run: xvfb-run julia --project=docs --color=yes --code-coverage=user docs/make.jl - name: Upload site as artifact uses: actions/upload-artifact@v4 From 3bc96c159253da79b03e6a89596799f8579c6b2c Mon Sep 17 00:00:00 2001 From: Jonathan Fischer PEPE Date: Sun, 17 Nov 2024 20:44:31 -0500 Subject: [PATCH 5/5] rm xvfb setup step --- .github/workflows/Documentation.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index d8ac17133..f501fb885 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -30,13 +30,13 @@ jobs: sudo apt-get install -y xvfb libgl1 mesa-utils freeglut3-dev xorg-dev \ libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev - # Start Xvfb explicitly instead of using xvfb-run - # This gives us more control and visibility into the virtual display setup - - name: Setup virtual framebuffer - run: | - # Start Xvfb and wait for it to be ready - /usr/bin/Xvfb :99 -screen 0 1024x768x24 - echo "DISPLAY=:99" >> $GITHUB_ENV + # # Start Xvfb explicitly instead of using xvfb-run + # # This gives us more control and visibility into the virtual display setup + # - name: Setup virtual framebuffer + # run: | + # # Start Xvfb and wait for it to be ready + # /usr/bin/Xvfb :99 -screen 0 1024x768x24 + # echo "DISPLAY=:99" >> $GITHUB_ENV - name: Install Julia uses: julia-actions/setup-julia@latest