Repository navigation
Make the local Swift store work out of the box - #476
Merged
Merged
Conversation
Setting up a local Keystone + Swift took a page of manual openstack commands, redone whenever the container was recreated, since Keystone keeps its state inside it. A one-shot service now does it on every `docker compose up`. Keystone generates application credential IDs, so template.env can't ship one. swift_connection() now also accepts a credential name plus username; an ID still takes precedence, so production auth is unchanged. Note: an existing .env needs the Swift block from template.env, or swift-init exits on the missing variables. Assisted-by: Claude Opus 5.5 Bug: T442038
Production relies on Swift now, so local archives should last as long as the local database does. Keeping the objects alone isn't enough: Swift files them under the project's account ID, which a fresh Keystone regenerates, so Keystone's database gets a volume too. A kept database can meet a newer image's schema, so the image is pinned. The web app and crons wait for swift-init so neither runs before the credential exists. Assisted-by: Claude Opus 5.5 Bug: T442038
Member
|
Quick testing so far (threw away my local and brought it up using this):
|
theresnotime
approved these changes
Oct 22, 2026
DHardy-WMF
approved these changes
Oct 22, 2026
DHardy-WMF
left a comment
Contributor
There was a problem hiding this comment.
Thanks for improving the Swift setup, @jsnshrmn! Feel free to merge this patch @MusikAnimal once you confirm it's working in your local environment too.
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.
Description
Run a local Keystone + Swift as part of the dev stack, set up and kept in volumes so it works out of the box and lasts as long as the local database.
docker-compose.override.ymladds aswiftservice (CSCfi keystone-swift, pinned to2026.9.0) and a one-shotswift-initthat runsbin/swift_local_init.shon everyup. It creates the project, user and application credential named in.env, and points the Swift endpoints at the compose networkswift_objectsandswift_keystonevolumes, so they survivedocker compose downand go away withdown -v, like the databaseexternallinksandcronswait forswift-initto finishswift_connection()also accepts a credential name plus username when no ID is set. Keystone generates credential IDs, sotemplate.envcan't ship one. An ID still takes precedence, so production auth is unchangedNote: an existing
.envneeds the Swift block copied fromtemplate.env. Without it,swift-initfails and the web app and crons won't start.Rationale
Production relies on Swift for link event and aggregate archives, but a local store meant a page of manual
openstackcommands from the README, redone whenever the container was recreated, since Keystone kept its state inside it.Phabricator Ticket
T442038
How Has This Been Tested?
.envcopied fromtemplate.env,swift-initsucceeded on the first run and again against existing stateextlinks.common.swifthelpers created a container and uploaded, listed and downloaded an object;get_archive_list()reached Swiftdocker compose downandup;down -vremoved all three volumeskeystone-manage db_syncsteps run cleanly against the kept databaseTo try it: copy the Swift block from
template.envinto.env, rundocker compose up -d, then checkdocker compose logs swift-initends with "Local Swift ready".Screenshots of your changes (if appropriate):
N/A
Types of changes
What types of changes does your code introduce? Add an
xin all the boxes that apply:The breaking change is local dev only: see the
.envnote above.