refactor: share DWARF analyzer queries #196
Workflow file for this run
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
| name: Container E2E | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: [ main ] | |
| push: | |
| branches: [ main ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| container-e2e-full: | |
| name: Container E2E Full (${{ matrix.name }}) | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 90 | |
| env: | |
| LLVM_SYS_181_PREFIX: /usr/lib/llvm-18 | |
| FIXTURE_COMPILER_IMAGE: ghcr.io/swananan/ghostscope-fixture-compiler@sha256:b1e716ec17610673dcaf69497bd93ef0c700a2ad7fe8265d6764d15a8c1edc89 | |
| FIXTURE_COMPILER_CACHE_REV: b1e716ec17610673dcaf69497bd93ef0c700a2ad7fe8265d6764d15a8c1edc89 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: host-to-private | |
| ghostscope_sandbox: host | |
| target_sandbox: docker-private | |
| target_mode: same | |
| - name: private-same-sandbox | |
| ghostscope_sandbox: docker-private | |
| target_sandbox: docker-private | |
| target_mode: same | |
| - name: private-to-child-container | |
| ghostscope_sandbox: docker-private | |
| target_sandbox: docker-private | |
| target_mode: child-container | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install LLVM 18 and Polly | |
| run: | | |
| wget https://apt.llvm.org/llvm.sh | |
| chmod +x llvm.sh | |
| sudo ./llvm.sh 18 | |
| sudo apt-get install -y llvm-18-dev libpolly-18-dev | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@1.88.0 | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/registry | |
| key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-registry- | |
| - name: Cache cargo index | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/git | |
| key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-index- | |
| - name: Cache cargo build | |
| uses: actions/cache@v4 | |
| with: | |
| path: target | |
| key: ${{ runner.os }}-${{ github.job }}-${{ matrix.name }}-target-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ github.job }}-${{ matrix.name }}-target- | |
| - name: Cache fixture binaries | |
| id: fixture-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| e2e-tests/tests/fixtures/sample_program/sample_program | |
| e2e-tests/tests/fixtures/sample_program/sample_program_o1 | |
| e2e-tests/tests/fixtures/sample_program/sample_program_o2 | |
| e2e-tests/tests/fixtures/sample_program/sample_program_o3 | |
| e2e-tests/tests/fixtures/sample_program/sample_program_stripped | |
| e2e-tests/tests/fixtures/sample_program/sample_program_stripped.debug | |
| e2e-tests/tests/fixtures/complex_types_program/complex_types_program | |
| e2e-tests/tests/fixtures/complex_types_program/complex_types_program_o1 | |
| e2e-tests/tests/fixtures/complex_types_program/complex_types_program_o2 | |
| e2e-tests/tests/fixtures/complex_types_program/complex_types_program_o3 | |
| e2e-tests/tests/fixtures/complex_types_program/complex_types_program_nopie | |
| e2e-tests/tests/fixtures/member_pointer_program/member_pointer_program | |
| e2e-tests/tests/fixtures/member_pointer_program/member_pointer_program_o1 | |
| e2e-tests/tests/fixtures/member_pointer_program/member_pointer_program_o2 | |
| e2e-tests/tests/fixtures/member_pointer_program/member_pointer_program_o3 | |
| e2e-tests/tests/fixtures/globals_program/globals_program | |
| e2e-tests/tests/fixtures/globals_program/libgvars.so | |
| e2e-tests/tests/fixtures/late_globals_program/late_globals_program | |
| e2e-tests/tests/fixtures/rust_global_program/target/debug/rust_global_program | |
| e2e-tests/tests/fixtures/inline_callsite_program/inline_callsite_program | |
| e2e-tests/tests/fixtures/inline_callsite_program/inline_callsite_program_clang_dwarf5 | |
| e2e-tests/tests/fixtures/inline_call_value_program/inline_call_value_program | |
| e2e-tests/tests/fixtures/partitioned_ranges_program/partitioned_ranges_program | |
| e2e-tests/tests/fixtures/cpp_complex_program/cpp_complex_program | |
| e2e-tests/tests/fixtures/static_scope_program/static_scope_program | |
| e2e-tests/tests/fixtures/static_scope_program/static_scope_program_clang_dwarf5 | |
| e2e-tests/tests/fixtures/entry_value_recovery_program/entry_value_recovery_program | |
| e2e-tests/tests/fixtures/entry_value_recovery_program/entry_value_recovery_program_clang_dwarf5 | |
| key: ${{ runner.os }}-${{ github.job }}-${{ matrix.name }}-fixtures-${{ env.FIXTURE_COMPILER_CACHE_REV }}-${{ hashFiles('e2e-tests/compile-fixtures.sh', 'e2e-tests/tests/fixtures/**/*.c', 'e2e-tests/tests/fixtures/**/*.h', 'e2e-tests/tests/fixtures/**/*.cpp', 'e2e-tests/tests/fixtures/**/*.rs', 'e2e-tests/tests/fixtures/**/Makefile', 'e2e-tests/tests/fixtures/**/Cargo.toml', 'e2e-tests/tests/fixtures/**/Cargo.lock') }} | |
| - name: Compile fixtures with fixture compiler image | |
| if: steps.fixture-cache.outputs.cache-hit != 'true' | |
| run: | | |
| docker run --rm \ | |
| -v "${GITHUB_WORKSPACE}/e2e-tests:/workspace/e2e-tests" \ | |
| -w /workspace/e2e-tests \ | |
| "$FIXTURE_COMPILER_IMAGE" \ | |
| bash ./compile-fixtures.sh | |
| sudo chown -R "$(id -u):$(id -g)" "${GITHUB_WORKSPACE}/e2e-tests/tests/fixtures" | |
| - name: Build GhostScope CLI and dwarf-tool | |
| run: cargo build -p ghostscope -p dwarf-tool --all-features | |
| - name: Run container topology full e2e | |
| env: | |
| E2E_CONTAINER_IMAGE: ghcr.io/swananan/ghostscope-e2e-runtime@sha256:d5df1b977c38f7a51bbf28b878f2246705a05b83ac6df7cb6be8f8a4de4105f4 | |
| E2E_CHILD_CONTAINER_IMAGE: ghcr.io/swananan/ghostscope-e2e-runtime@sha256:d5df1b977c38f7a51bbf28b878f2246705a05b83ac6df7cb6be8f8a4de4105f4 | |
| E2E_SANDBOX_SESSION: container-e2e-${{ github.run_id }}-${{ github.job }}-${{ matrix.name }} | |
| E2E_GHOSTSCOPE_SANDBOX: ${{ matrix.ghostscope_sandbox }} | |
| E2E_TARGET_SANDBOX: ${{ matrix.target_sandbox }} | |
| E2E_TARGET_MODE: ${{ matrix.target_mode }} | |
| GHOSTSCOPE_PRESERVE_PRECOMPILED_FIXTURES: 1 | |
| run: | | |
| sudo -E env \ | |
| E2E_CONTAINER_IMAGE="$E2E_CONTAINER_IMAGE" \ | |
| E2E_CHILD_CONTAINER_IMAGE="$E2E_CHILD_CONTAINER_IMAGE" \ | |
| E2E_SANDBOX_SESSION="$E2E_SANDBOX_SESSION" \ | |
| E2E_GHOSTSCOPE_SANDBOX="$E2E_GHOSTSCOPE_SANDBOX" \ | |
| E2E_TARGET_SANDBOX="$E2E_TARGET_SANDBOX" \ | |
| E2E_TARGET_MODE="$E2E_TARGET_MODE" \ | |
| "$(which cargo)" test -p ghostscope-e2e-tests --tests --all-features -- --nocapture | |
| - name: Cleanup session sandboxes | |
| if: always() | |
| env: | |
| E2E_SANDBOX_SESSION: container-e2e-${{ github.run_id }}-${{ github.job }}-${{ matrix.name }} | |
| run: | | |
| ids=$(docker ps -aq --filter "label=ghostscope.session=$E2E_SANDBOX_SESSION") | |
| if [ -n "$ids" ]; then | |
| docker rm -f $ids | |
| fi | |
| container-e2e-smoke: | |
| name: Container E2E Smoke (${{ matrix.name }}) | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 90 | |
| env: | |
| LLVM_SYS_181_PREFIX: /usr/lib/llvm-18 | |
| FIXTURE_COMPILER_IMAGE: ghcr.io/swananan/ghostscope-fixture-compiler@sha256:b1e716ec17610673dcaf69497bd93ef0c700a2ad7fe8265d6764d15a8c1edc89 | |
| FIXTURE_COMPILER_CACHE_REV: b1e716ec17610673dcaf69497bd93ef0c700a2ad7fe8265d6764d15a8c1edc89 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: host-pid-same-sandbox | |
| ghostscope_sandbox: docker-host | |
| target_sandbox: docker-host | |
| target_mode: same | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install LLVM 18 and Polly | |
| run: | | |
| wget https://apt.llvm.org/llvm.sh | |
| chmod +x llvm.sh | |
| sudo ./llvm.sh 18 | |
| sudo apt-get install -y llvm-18-dev libpolly-18-dev | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@1.88.0 | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/registry | |
| key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-registry- | |
| - name: Cache cargo index | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/git | |
| key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-index- | |
| - name: Cache cargo build | |
| uses: actions/cache@v4 | |
| with: | |
| path: target | |
| key: ${{ runner.os }}-${{ github.job }}-${{ matrix.name }}-target-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ github.job }}-${{ matrix.name }}-target- | |
| - name: Cache fixture binaries | |
| id: fixture-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| e2e-tests/tests/fixtures/sample_program/sample_program | |
| e2e-tests/tests/fixtures/sample_program/sample_program_o1 | |
| e2e-tests/tests/fixtures/sample_program/sample_program_o2 | |
| e2e-tests/tests/fixtures/sample_program/sample_program_o3 | |
| e2e-tests/tests/fixtures/sample_program/sample_program_stripped | |
| e2e-tests/tests/fixtures/sample_program/sample_program_stripped.debug | |
| e2e-tests/tests/fixtures/complex_types_program/complex_types_program | |
| e2e-tests/tests/fixtures/complex_types_program/complex_types_program_o1 | |
| e2e-tests/tests/fixtures/complex_types_program/complex_types_program_o2 | |
| e2e-tests/tests/fixtures/complex_types_program/complex_types_program_o3 | |
| e2e-tests/tests/fixtures/complex_types_program/complex_types_program_nopie | |
| e2e-tests/tests/fixtures/member_pointer_program/member_pointer_program | |
| e2e-tests/tests/fixtures/member_pointer_program/member_pointer_program_o1 | |
| e2e-tests/tests/fixtures/member_pointer_program/member_pointer_program_o2 | |
| e2e-tests/tests/fixtures/member_pointer_program/member_pointer_program_o3 | |
| e2e-tests/tests/fixtures/globals_program/globals_program | |
| e2e-tests/tests/fixtures/globals_program/libgvars.so | |
| e2e-tests/tests/fixtures/late_globals_program/late_globals_program | |
| e2e-tests/tests/fixtures/rust_global_program/target/debug/rust_global_program | |
| e2e-tests/tests/fixtures/inline_callsite_program/inline_callsite_program | |
| e2e-tests/tests/fixtures/inline_callsite_program/inline_callsite_program_clang_dwarf5 | |
| e2e-tests/tests/fixtures/inline_call_value_program/inline_call_value_program | |
| e2e-tests/tests/fixtures/partitioned_ranges_program/partitioned_ranges_program | |
| e2e-tests/tests/fixtures/cpp_complex_program/cpp_complex_program | |
| e2e-tests/tests/fixtures/static_scope_program/static_scope_program | |
| e2e-tests/tests/fixtures/static_scope_program/static_scope_program_clang_dwarf5 | |
| e2e-tests/tests/fixtures/entry_value_recovery_program/entry_value_recovery_program | |
| e2e-tests/tests/fixtures/entry_value_recovery_program/entry_value_recovery_program_clang_dwarf5 | |
| key: ${{ runner.os }}-${{ github.job }}-${{ matrix.name }}-fixtures-${{ env.FIXTURE_COMPILER_CACHE_REV }}-${{ hashFiles('e2e-tests/compile-fixtures.sh', 'e2e-tests/tests/fixtures/**/*.c', 'e2e-tests/tests/fixtures/**/*.h', 'e2e-tests/tests/fixtures/**/*.cpp', 'e2e-tests/tests/fixtures/**/*.rs', 'e2e-tests/tests/fixtures/**/Makefile', 'e2e-tests/tests/fixtures/**/Cargo.toml', 'e2e-tests/tests/fixtures/**/Cargo.lock') }} | |
| - name: Compile fixtures with fixture compiler image | |
| if: steps.fixture-cache.outputs.cache-hit != 'true' | |
| run: | | |
| docker run --rm \ | |
| -v "${GITHUB_WORKSPACE}/e2e-tests:/workspace/e2e-tests" \ | |
| -w /workspace/e2e-tests \ | |
| "$FIXTURE_COMPILER_IMAGE" \ | |
| bash ./compile-fixtures.sh | |
| sudo chown -R "$(id -u):$(id -g)" "${GITHUB_WORKSPACE}/e2e-tests/tests/fixtures" | |
| - name: Build GhostScope CLI and dwarf-tool | |
| run: cargo build -p ghostscope -p dwarf-tool --all-features | |
| - name: Run host-PID same-sandbox smoke | |
| env: | |
| E2E_CONTAINER_IMAGE: ghcr.io/swananan/ghostscope-e2e-runtime@sha256:d5df1b977c38f7a51bbf28b878f2246705a05b83ac6df7cb6be8f8a4de4105f4 | |
| E2E_CHILD_CONTAINER_IMAGE: ghcr.io/swananan/ghostscope-e2e-runtime@sha256:d5df1b977c38f7a51bbf28b878f2246705a05b83ac6df7cb6be8f8a4de4105f4 | |
| E2E_SANDBOX_SESSION: container-e2e-${{ github.run_id }}-${{ github.job }}-${{ matrix.name }} | |
| E2E_GHOSTSCOPE_SANDBOX: ${{ matrix.ghostscope_sandbox }} | |
| E2E_TARGET_SANDBOX: ${{ matrix.target_sandbox }} | |
| E2E_TARGET_MODE: ${{ matrix.target_mode }} | |
| GHOSTSCOPE_PRESERVE_PRECOMPILED_FIXTURES: 1 | |
| run: | | |
| for test_case in \ | |
| test_invalid_pid_handling \ | |
| test_correct_pid_filtering \ | |
| test_pid_specificity_with_multiple_processes | |
| do | |
| sudo -E env \ | |
| E2E_CONTAINER_IMAGE="$E2E_CONTAINER_IMAGE" \ | |
| E2E_CHILD_CONTAINER_IMAGE="$E2E_CHILD_CONTAINER_IMAGE" \ | |
| E2E_SANDBOX_SESSION="$E2E_SANDBOX_SESSION" \ | |
| E2E_GHOSTSCOPE_SANDBOX="$E2E_GHOSTSCOPE_SANDBOX" \ | |
| E2E_TARGET_SANDBOX="$E2E_TARGET_SANDBOX" \ | |
| E2E_TARGET_MODE="$E2E_TARGET_MODE" \ | |
| "$(which cargo)" test -p ghostscope-e2e-tests --all-features --test script_execution "$test_case" -- --nocapture | |
| done | |
| - name: Cleanup session sandboxes | |
| if: always() | |
| env: | |
| E2E_SANDBOX_SESSION: container-e2e-${{ github.run_id }}-${{ github.job }}-${{ matrix.name }} | |
| run: | | |
| ids=$(docker ps -aq --filter "label=ghostscope.session=$E2E_SANDBOX_SESSION") | |
| if [ -n "$ids" ]; then | |
| docker rm -f $ids | |
| fi |