|
52 | 52 |
|
53 | 53 |
|
54 | 54 | test-e2e: |
55 | | - name: End-to-end test |
| 55 | + name: End-to-end test (Docker) |
56 | 56 | runs-on: ubuntu-latest |
57 | 57 | steps: |
58 | 58 | - name: Checkout repository |
@@ -168,6 +168,121 @@ jobs: |
168 | 168 | # We use tail so that we can see the name of each file as it's printed |
169 | 169 | run: "docker run -t --rm -v augur_logs:/logs bash -c 'find /logs -type f | xargs tail -n +0'" |
170 | 170 |
|
| 171 | + test-e2e-podman: |
| 172 | + name: End-to-end test (Podman) |
| 173 | + runs-on: ubuntu-latest |
| 174 | + steps: |
| 175 | + - name: Remove unnecessary files from the base image |
| 176 | + run: | |
| 177 | + sudo rm -rf /usr/share/dotnet |
| 178 | + sudo rm -rf "$AGENT_TOOLSDIRECTORY" |
| 179 | +
|
| 180 | + - name: Start Podman socket |
| 181 | + run: systemctl --user start podman.socket |
| 182 | + |
| 183 | + - name: Checkout repository |
| 184 | + uses: actions/checkout@v4 |
| 185 | + |
| 186 | + - name: Build database container |
| 187 | + uses: redhat-actions/buildah-build@v2 |
| 188 | + with: |
| 189 | + context: . |
| 190 | + containerfiles: | |
| 191 | + ./docker/database/Dockerfile |
| 192 | + platforms: linux/amd64 |
| 193 | + tags: ghcr.io/${{ github.repository_owner }}/augur_database:test |
| 194 | + layers: true |
| 195 | + |
| 196 | + - name: Build keyman container |
| 197 | + uses: redhat-actions/buildah-build@v2 |
| 198 | + with: |
| 199 | + context: . |
| 200 | + containerfiles: | |
| 201 | + ./docker/keyman/Dockerfile |
| 202 | + platforms: linux/amd64 |
| 203 | + tags: ghcr.io/${{ github.repository_owner }}/augur_keyman:test |
| 204 | + layers: true |
| 205 | + |
| 206 | + - name: Build rabbitmq container |
| 207 | + uses: redhat-actions/buildah-build@v2 |
| 208 | + with: |
| 209 | + context: . |
| 210 | + containerfiles: | |
| 211 | + ./docker/rabbitmq/Dockerfile |
| 212 | + platforms: linux/amd64 |
| 213 | + tags: ghcr.io/${{ github.repository_owner }}/augur_rabbitmq:test |
| 214 | + layers: true |
| 215 | + |
| 216 | + - name: Build backend container |
| 217 | + uses: redhat-actions/buildah-build@v2 |
| 218 | + with: |
| 219 | + context: . |
| 220 | + containerfiles: | |
| 221 | + ./docker/backend/Dockerfile |
| 222 | + platforms: linux/amd64 |
| 223 | + tags: ghcr.io/${{ github.repository_owner }}/augur_backend:test |
| 224 | + layers: true |
| 225 | + |
| 226 | + - name: Prepare compose file |
| 227 | + run: | |
| 228 | + yq eval -i '.services.augur.image = "ghcr.io/${{ github.repository_owner }}/augur_backend:test"' docker-compose.yml |
| 229 | + yq eval -i '.services.augur.pull_policy = "never"' docker-compose.yml |
| 230 | + yq eval -i '.services.augur.restart = "no"' docker-compose.yml |
| 231 | +
|
| 232 | + yq eval -i '.services.augur-db.image = "ghcr.io/${{ github.repository_owner }}/augur_database:test"' docker-compose.yml |
| 233 | + yq eval -i '.services.augur-db.pull_policy = "never"' docker-compose.yml |
| 234 | + yq eval -i '.services.augur-db.restart = "no"' docker-compose.yml |
| 235 | +
|
| 236 | + yq eval -i '.services.augur-keyman.image = "ghcr.io/${{ github.repository_owner }}/augur_keyman:test"' docker-compose.yml |
| 237 | + yq eval -i '.services.augur-keyman.pull_policy = "never"' docker-compose.yml |
| 238 | + yq eval -i '.services.augur-keyman.restart = "no"' docker-compose.yml |
| 239 | +
|
| 240 | + yq eval -i '.services.rabbitmq.image = "ghcr.io/${{ github.repository_owner }}/augur_rabbitmq:test"' docker-compose.yml |
| 241 | + yq eval -i '.services.rabbitmq.pull_policy = "never"' docker-compose.yml |
| 242 | + yq eval -i '.services.rabbitmq.restart = "no"' docker-compose.yml |
| 243 | +
|
| 244 | + - name: Setup Podman Compose |
| 245 | + uses: webgtx/setup-podman-compose@v1 |
| 246 | + |
| 247 | + - name: Set up list of log lines to match |
| 248 | + run: | |
| 249 | + cat <<EOF > /tmp/regex_matches.txt |
| 250 | + Gunicorn webserver started |
| 251 | + Starting core worker processes |
| 252 | + Starting secondary worker processes |
| 253 | + Starting facade worker processes |
| 254 | + Retrieved \\d+ github api keys for use |
| 255 | + Fetching new repos \\(complete\\) |
| 256 | + Inserting \\d+ contributors |
| 257 | + Inserting \\d+ issues |
| 258 | + Inserting prs of length: \\d+ |
| 259 | + Querying committers count |
| 260 | + Done generating scc data for repo |
| 261 | + Sending due task |
| 262 | + EOF |
| 263 | +
|
| 264 | + - name: Start services & wait for output |
| 265 | + # This starts the system and sends the output to "await_all.py" which |
| 266 | + # scans for the regex matches from above. Once all matches are seen at |
| 267 | + # least once, the `compose down` will run to shut down the system. If |
| 268 | + # this all doesn't happen before the timeout, the job will fail. |
| 269 | + run: | |
| 270 | + podman compose -f docker-compose.yml up --no-build 2>&1 \ |
| 271 | + | (./scripts/ci/await_all.py /tmp/regex_matches.txt \ |
| 272 | + && docker compose -f docker-compose.yml down) |
| 273 | + timeout-minutes: 3 |
| 274 | + env: |
| 275 | + AUGUR_GITHUB_API_KEY: ${{ secrets.GITHUB_TOKEN }} |
| 276 | + AUGUR_GITHUB_USERNAME: ${{ github.repository_owner }} |
| 277 | + AUGUR_GITLAB_API_KEY: dummy |
| 278 | + AUGUR_GITLAB_USERNAME: dummy |
| 279 | + |
| 280 | + - name: Dump logs |
| 281 | + # Always run this step to get logs, even if the previous step fails |
| 282 | + if: always() |
| 283 | + # We use tail so that we can see the name of each file as it's printed |
| 284 | + run: "podman run -t --rm -v augur_logs:/logs bash -c 'find /logs -type f | xargs tail -n +0'" |
| 285 | + |
171 | 286 |
|
172 | 287 |
|
173 | 288 | push-image: |
|
0 commit comments