Repository navigation
ci: add runtime smoke test that boots each image and checks health - #179
Open
amitkojha05 wants to merge 3 commits into
Open
amitkojha05 wants to merge 3 commits into
amitkojha05 wants to merge 3 commits into
Conversation
Author
|
Hi @Filip3mac @mihajlo-kuzmanoski , this PR adds a CI job, so the workflow is waiting for a maintainer to approve the run. Could one of you approve it so the Smoke Test results show up for 2.10, 2.11 and 2.12?If anything fails, I'll fix it right away. Thanks! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
CI lints, builds, and Trivy-scans the images, but never starts one. A change that builds cleanly but breaks startup (a bad Alpine package pin, a failing
ckan db init, a brokenprerun.pyorstart_ckan.sh) passes every check and ships to Docker Hub and GHCR. This also means the weeklyupdate_dockerfiles.ymlpackage-bump PRs are never verified at runtime.Change
One new
smoke_testjob in.github/workflows/ci.yml. It runs per CKAN version through the existingmatrix_generator, on pull requests only, likelintandbuild.For each version it:
ENV IMAGE_TAG(for example2.12->2.12.0).docker/build-push-action(load: true,push: false) and tags itghcr.io/keitaroinc/ckan:<IMAGE_TAG>, the name the composeckanservice references, so compose uses the PR's build instead of pulling the published image. It reads the same GitHub Actions layer cache (cache-from: type=gha) that thebuildjob populates.docker compose configresolves to that image.compose/config/.global-envpinsCKAN_VERSION=2.12.0, so this step fails the job if the shell override ever stops taking effect, rather than silently testing the wrong version.compose/stack (db, solr, redis, ckan), so there are no separate service images to keep in sync./api/3/action/status_show, the endpoint the DockerfileHEALTHCHECKuses, for up to 5 minutes. On timeout it prints the recent CKAN logs and fails.docker compose ps -aand logs for all services, so a db or Solr startup failure is diagnosable too.docker compose down -v.The job also sets
timeout-minutes: 30andpermissions: contents: read.No existing jobs or files are modified.
Testing
Tested locally on 2.10, 2.11 and 2.12: for each, CKAN boots and
/api/3/action/status_showreturns"success": true. The Smoke Test job will also run in CI for all three versions once a maintainer approves the workflow run.Notes
lintandbuild. Removing theif: github.event_name == 'pull_request'line would also run it on the weekly schedule to catch upstream drift. Happy to do that if you prefer.buildjob still covers both architectures.