-
Notifications
You must be signed in to change notification settings - Fork 35
Update tests #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Update tests #91
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,37 +1,79 @@ | ||
| name: chromium-headful-image | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| workflow_call: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| docker: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - arch: amd64 | ||
| runner: ubuntu-latest | ||
| - arch: arm64 | ||
| runner: ubuntu-24.04-arm64 | ||
| runs-on: ${{ matrix.runner }} | ||
| permissions: | ||
| contents: read | ||
| env: | ||
| UKC_TOKEN: dummy | ||
| UKC_METRO: ci | ||
| NAME: ci-chromium-headful | ||
| DETACH: "true" | ||
| SERVICE_EXCEPTIONS: pulseaudio | ||
| CACHE_DIR: .buildx-cache-headful-${{ matrix.runner }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Compute short SHA | ||
| id: vars | ||
| - name: Restore Docker layer cache | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ${{ env.CACHE_DIR }} | ||
| key: buildx-${{ runner.os }}-${{ matrix.runner }}-headful-${{ hashFiles('images/chromium-headful/Dockerfile', 'images/chromium-headful/wrapper.sh', 'images/chromium-headful/client/package.json', 'images/chromium-headful/client/package-lock.json', 'server/go.mod', 'server/go.sum') }} | ||
| restore-keys: | | ||
| buildx-${{ runner.os }}-${{ matrix.runner }}-headful- | ||
|
|
||
| - name: Build image | ||
| shell: bash | ||
| run: echo "short_sha=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT" | ||
| run: | | ||
| bash images/chromium-headful/build-docker.sh | ||
|
|
||
| - name: Login to Docker Hub | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ vars.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
| - name: Run container | ||
| shell: bash | ||
| env: | ||
| ENABLE_WEBRTC: true | ||
| run: | | ||
| bash images/chromium-headful/run-docker.sh | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
| - name: Wait for supervisor services (allow pulseaudio non-RUNNING) | ||
| shell: bash | ||
| run: | | ||
| trap "docker stop ci-chromium-headful >/dev/null 2>&1 || true" EXIT | ||
| attempts=30 | ||
| sleep_seconds=1 | ||
| for i in $(seq 1 "$attempts"); do | ||
| out=$(docker exec ci-chromium-headful supervisorctl status || true) | ||
| echo "$out" | ||
| total=$(echo "$out" | grep -v '^$' | wc -l | tr -d ' ') | ||
| exceptions="${SERVICE_EXCEPTIONS:-}" | ||
| pattern=$(printf '%s' "$exceptions" | tr ', ' '\n' | sed '/^$/d' | paste -sd '|' -) | ||
| ok=$(echo "$out" | awk -v pat="$pattern" 'BEGIN{IGNORECASE=1} { if (pat != "" && $0 ~ pat) print; else if ($0 ~ /RUNNING/) print }' | wc -l | tr -d ' ') | ||
| if [ "$total" -gt 0 ] && [ "$ok" -eq "$total" ]; then | ||
| echo "All required services are RUNNING" | ||
| exit 0 | ||
| fi | ||
| sleep "$sleep_seconds" | ||
| done | ||
| echo "Supervisor services not ready in time" | ||
| docker logs --tail=200 ci-chromium-headful || true | ||
| exit 1 | ||
|
|
||
| - name: Build and push | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: images/chromium-headful/Dockerfile | ||
| push: true | ||
| tags: onkernel/chromium-headful:${{ steps.vars.outputs.short_sha }} | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,37 +1,77 @@ | ||
| name: chromium-headless-image | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| workflow_call: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| docker: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - arch: amd64 | ||
| runner: ubuntu-latest | ||
| - arch: arm64 | ||
| runner: ubuntu-24.04-arm64 | ||
| runs-on: ${{ matrix.runner }} | ||
| permissions: | ||
| contents: read | ||
| env: | ||
| UKC_TOKEN: dummy | ||
| UKC_METRO: ci | ||
| NAME: ci-chromium-headless | ||
| DETACH: "true" | ||
| SERVICE_EXCEPTIONS: pulseaudio | ||
| CACHE_DIR: .buildx-cache-headless-${{ matrix.runner }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Compute short SHA | ||
| id: vars | ||
| - name: Restore Docker layer cache | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ${{ env.CACHE_DIR }} | ||
| key: buildx-${{ runner.os }}-${{ matrix.runner }}-headless-${{ hashFiles('images/chromium-headless/image/Dockerfile', 'images/chromium-headless/image/wrapper.sh', 'server/go.mod', 'server/go.sum') }} | ||
| restore-keys: | | ||
| buildx-${{ runner.os }}-${{ matrix.runner }}-headless- | ||
|
|
||
| - name: Build image | ||
| shell: bash | ||
| run: echo "short_sha=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT" | ||
| run: | | ||
| bash images/chromium-headless/build-docker.sh | ||
|
|
||
| - name: Login to Docker Hub | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ vars.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
| - name: Run container | ||
| shell: bash | ||
| run: | | ||
| bash images/chromium-headless/run-docker.sh | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
| - name: Wait for supervisor services (allow pulseaudio non-RUNNING) | ||
| shell: bash | ||
| run: | | ||
| trap "docker stop ci-chromium-headless >/dev/null 2>&1 || true" EXIT | ||
| attempts=30 | ||
| sleep_seconds=1 | ||
| for i in $(seq 1 "$attempts"); do | ||
| out=$(docker exec ci-chromium-headless supervisorctl status || true) | ||
| echo "$out" | ||
| total=$(echo "$out" | grep -v '^$' | wc -l | tr -d ' ') | ||
| exceptions="${SERVICE_EXCEPTIONS:-}" | ||
| pattern=$(printf '%s' "$exceptions" | tr ', ' '\n' | sed '/^$/d' | paste -sd '|' -) | ||
| ok=$(echo "$out" | awk -v pat="$pattern" 'BEGIN{IGNORECASE=1} { if (pat != "" && $0 ~ pat) print; else if ($0 ~ /RUNNING/) print }' | wc -l | tr -d ' ') | ||
| if [ "$total" -gt 0 ] && [ "$ok" -eq "$total" ]; then | ||
| echo "All required services are RUNNING" | ||
| exit 0 | ||
| fi | ||
| sleep "$sleep_seconds" | ||
| done | ||
| echo "Supervisor services not ready in time" | ||
| docker logs --tail=200 ci-chromium-headless || true | ||
| exit 1 | ||
|
|
||
| - name: Build and push | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: images/chromium-headless/image/Dockerfile | ||
| push: true | ||
| tags: onkernel/chromium-headless:${{ steps.vars.outputs.short_sha }} | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Bug
Inconsistent container cleanup behavior: interactive mode (line 88) is missing the
--rmflag while detached mode (line 86) has it. This causes containers to persist after exit when run interactively but be auto-removed when run detached. The chromium-headless script consistently uses--rmin both modes (lines 31 and 33), which is the correct pattern. This inconsistency will lead to container accumulation when running in interactive mode.