Skip to content

feat(rados): read Ceph client id from CEPH_ID environment variable - #571

Open
t-tomek wants to merge 1 commit into
openstreetmap:masterfrom
t-tomek:feat/rados-client-id-from-env
Open

t-tomek wants to merge 1 commit into
openstreetmap:masterfrom
t-tomek:feat/rados-client-id-from-env

Conversation

@t-tomek

@t-tomek t-tomek commented Nov 27, 2026

Copy link
Copy Markdown
  • Pass getenv("CEPH_ID") to rados_create() in src/store_rados.c instead of NULL, allowing RADOS tile stores to connect as a non-admin Ceph user (e.g. CEPH_ID=tiles for client.tiles)
  • Falls back to the librados default (client.admin) when unset, so existing setups are unaffected
  • Document CEPH_ID in a new ENVIRONMENT section of docs/man/renderd.1

- Pass `getenv("CEPH_ID")` to `rados_create()` in `src/store_rados.c` instead of `NULL`, allowing RADOS tile stores to connect as a non-admin Ceph user (e.g. `CEPH_ID=tiles` for `client.tiles`)
- Falls back to the librados default (`client.admin`) when unset, so existing setups are unaffected
- Document `CEPH_ID` in a new ENVIRONMENT section of `docs/man/renderd.1`

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread src/store_rados.c
conf = strdup(&(tmp[i]));

err = rados_create(&(ctx->cluster), NULL);
err = rados_create(&(ctx->cluster), getenv("CEPH_ID"));
@codecov

codecov Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.70%. Comparing base (c4e3e62) to head (5bb97f9).
⚠️ Report is 103 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #571      +/-   ##
==========================================
+ Coverage   81.54%   89.70%   +8.16%     
==========================================
  Files          24       24              
  Lines        5645     5547      -98     
==========================================
+ Hits         4603     4976     +373     
+ Misses       1042      571     -471     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hummeltech

Copy link
Copy Markdown
Collaborator

Thanks for putting this together—supporting non-admin Ceph users is a great addition.

Rather than an environment variable, I'd prefer this to be configured in renderd.conf so renderd, mod_tile, and the render_* tools don't end up out of sync across different service environments.

Since mod_tile only reads [layer] sections and passes TILEDIR straight to init_storage_backend(), the cleanest fit is likely to extend the URI syntax to rados://<client_id>@<pool>/<path_to_ceph.conf> (defaulting to NULL when omitted):

  • Parse the optional <client_id>@ prefix in init_storage_rados() (src/store_rados.c) and pass it to rados_create().
  • Document the updated TILEDIR syntax in docs/man/renderd.conf.5 and the example renderd.conf.

Let me know what you think!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants