-
Notifications
You must be signed in to change notification settings - Fork 14
196 lines (174 loc) · 6.98 KB
/
Copy pathcontainer-e2e.yml
File metadata and controls
196 lines (174 loc) · 6.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
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
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: 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 }}
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
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: 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 }}
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