Flush edge caches after website deployment
This commit is contained in:
parent
0d682bd9af
commit
387c0bedf4
|
|
@ -665,6 +665,11 @@ for example `192.168.100.73:30500/php-website:src-...`. If it still shows
|
||||||
Check the `website-production` Application source, sync status, and repository
|
Check the `website-production` Application source, sync status, and repository
|
||||||
access before restarting pods.
|
access before restarting pods.
|
||||||
|
|
||||||
|
After the website rollout is ready, `./jeannie apps website` flushes
|
||||||
|
the OCI edge nginx, Varnish, and Squid caches. The purge also runs when the
|
||||||
|
immutable image was already current, so retrying the deployment can recover
|
||||||
|
from an earlier edge connection or cache-purge failure.
|
||||||
|
|
||||||
The first demo, `The Client-Side Media Cruncher (Wasm + TS)`, currently performs
|
The first demo, `The Client-Side Media Cruncher (Wasm + TS)`, currently performs
|
||||||
private, browser-only image compression and conversion using native Canvas APIs.
|
private, browser-only image compression and conversion using native Canvas APIs.
|
||||||
Heavier video conversion, such as MP4 to WebM, should use a Rust core compiled
|
Heavier video conversion, such as MP4 to WebM, should use a Rust core compiled
|
||||||
|
|
|
||||||
|
|
@ -665,6 +665,11 @@ for example `192.168.100.73:30500/php-website:src-...`. If it still shows
|
||||||
Check the `website-production` Application source, sync status, and repository
|
Check the `website-production` Application source, sync status, and repository
|
||||||
access before restarting pods.
|
access before restarting pods.
|
||||||
|
|
||||||
|
After the website rollout is ready, `./{{ main_script }} apps website` flushes
|
||||||
|
the OCI edge nginx, Varnish, and Squid caches. The purge also runs when the
|
||||||
|
immutable image was already current, so retrying the deployment can recover
|
||||||
|
from an earlier edge connection or cache-purge failure.
|
||||||
|
|
||||||
The first demo, `The Client-Side Media Cruncher (Wasm + TS)`, currently performs
|
The first demo, `The Client-Side Media Cruncher (Wasm + TS)`, currently performs
|
||||||
private, browser-only image compression and conversion using native Canvas APIs.
|
private, browser-only image compression and conversion using native Canvas APIs.
|
||||||
Heavier video conversion, such as MP4 to WebM, should use a Rust core compiled
|
Heavier video conversion, such as MP4 to WebM, should use a Rust core compiled
|
||||||
|
|
|
||||||
|
|
@ -8683,6 +8683,10 @@ apps() (
|
||||||
if [[ "${website_image_built}" == "true" ]]; then
|
if [[ "${website_image_built}" == "true" ]]; then
|
||||||
write_website_image_state "${website_image_state_file}" "${website_source_hash}" "${website_platforms}" "${website_image_ref}"
|
write_website_image_state "${website_image_state_file}" "${website_source_hash}" "${website_platforms}" "${website_image_ref}"
|
||||||
fi
|
fi
|
||||||
|
# The public edge caches HTML and static assets independently from the
|
||||||
|
# immutable Kubernetes image. Purge them after every successful
|
||||||
|
# website reconciliation so retries also recover from a failed purge.
|
||||||
|
edge_flush_caches || return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${deploy_demos}" == "true" ]]; then
|
if [[ "${deploy_demos}" == "true" ]]; then
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,16 @@ class WebsiteCVTests(unittest.TestCase):
|
||||||
self.assertIn('target="_blank"', page)
|
self.assertIn('target="_blank"', page)
|
||||||
self.assertNotIn("window.print()", page)
|
self.assertNotIn("window.print()", page)
|
||||||
|
|
||||||
|
def test_website_deploy_flushes_edge_after_rollout(self):
|
||||||
|
pipeline = (ROOT / "lib" / "jeannie" / "pipeline.sh").read_text()
|
||||||
|
rollout = pipeline.index(
|
||||||
|
"wait_for_deployment_ready website-production php-website-deployment"
|
||||||
|
)
|
||||||
|
flush = pipeline.index("edge_flush_caches || return 1", rollout)
|
||||||
|
next_deployment = pipeline.index('if [[ "${deploy_demos}" == "true" ]]', rollout)
|
||||||
|
self.assertLess(rollout, flush)
|
||||||
|
self.assertLess(flush, next_deployment)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue