You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2026/07/22 06:51:51 UTC
(airavata-custos) 14/29: Make the authenticating admin the tutorial project PI
This is an automated email from the ASF dual-hosted git repository.
lahirujayathilake pushed a commit to branch pearc26
in repository https://gitbox.apache.org/repos/asf/airavata-custos.git
commit 6b8fe504f1c7910781473df7f7408e2c83071110
Author: lahiruj <la...@gmail.com>
AuthorDate: Thu Jul 16 10:02:32 2026 -0400
Make the authenticating admin the tutorial project PI
---
dev-ops/compose/seeds/pearc26/README.md | 5 +++--
dev-ops/compose/seeds/pearc26/setup-live.sh | 14 ++++++++------
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/dev-ops/compose/seeds/pearc26/README.md b/dev-ops/compose/seeds/pearc26/README.md
index fd13774a2..372bd6f75 100644
--- a/dev-ops/compose/seeds/pearc26/README.md
+++ b/dev-ops/compose/seeds/pearc26/README.md
@@ -63,7 +63,7 @@ To reset one attendee (registry person, custos rows, cluster cache):
| 01_org_cluster.sql | PEARC26 Attendees org; the `nexus-dev` cluster row |
| 02_resources_rates.sql | `debug` partition catalog entry + SU rate |
| 03_admin_role.sql | approver/bootstrap-admin user + `access-approver` role |
-| setup-live.sh | project (PI = seed-03 admin), `pearc26-tutorial` allocation (25000 SU), resource grant, PEARC26 access-event row |
+| setup-live.sh | project (PI = the admin who authenticates), `pearc26-tutorial` allocation (25000 SU), resource grant, PEARC26 access-event row |
## Notes
@@ -73,7 +73,8 @@ To reset one attendee (registry person, custos rows, cluster cache):
different id means approvals silently never reach COmanage. The row
upserts the name to `nexus-dev` if `default_cluster.sql` got there
first.
-- The seed-03 user is approver, bootstrap admin, AND project PI: set
+- The seed-03 user is a fallback approver role holder; the PI is whoever
+ runs setup-live.sh. Bootstrap admin: set
`CUSTOS_BOOTSTRAP_ADMIN_EMAIL=approver@pearc26.local` (or edit that
email to your own) and boot grants super_admin idempotently.
- **Never create the allocation with SQL.** Seeded rows bypass the event
diff --git a/dev-ops/compose/seeds/pearc26/setup-live.sh b/dev-ops/compose/seeds/pearc26/setup-live.sh
index b2aa64031..4895800cd 100755
--- a/dev-ops/compose/seeds/pearc26/setup-live.sh
+++ b/dev-ops/compose/seeds/pearc26/setup-live.sh
@@ -89,13 +89,14 @@ capi() { # method path [json-body] -- prints the body, aborts loudly on non-2xx
echo "== Preflight: who am I against the backend"
me=$(capi GET /me)
-echo "$me" | python3 -c "
+ADMIN_ID=$(echo "$me" | python3 -c "
import json,sys
d=json.load(sys.stdin)
u=d.get('user') or {}
-print(' user:', u.get('email'), '(', u.get('id'), ')')
-print(' privileges:', len(d.get('privileges') or []))
-" || { echo "Could not parse /me response: $me"; exit 1; }
+print(' user:', u.get('email'), '(', u.get('id'), ')', file=sys.stderr)
+print(' privileges:', len(d.get('privileges') or []), file=sys.stderr)
+print(u.get('id') or '')")
+[ -n "$ADMIN_ID" ] || { echo "Could not resolve the caller from /me: $me"; exit 1; }
if ! echo "$me" | grep -q "projects:write"; then
echo "This identity lacks core:projects:write. Authenticate as the ADMIN"
echo "identity at the CILogon prompt (the linked admin email), then re-run."
@@ -103,7 +104,8 @@ if ! echo "$me" | grep -q "projects:write"; then
fi
echo "== Creating project"
-project=$(capi POST /projects '{"originated_id":"PEARC26","title":"PEARC26 Tutorial Workshop","origination":"pearc26","project_pi_id":"pearc26-approver","status":"ACTIVE"}')
+# The authenticated admin is the PI: the seed approver has no login.
+project=$(capi POST /projects "{\"originated_id\":\"PEARC26\",\"title\":\"PEARC26 Tutorial Workshop\",\"origination\":\"pearc26\",\"project_pi_id\":\"$ADMIN_ID\",\"status\":\"ACTIVE\"}")
project_id=$(echo "$project" | python3 -c "import json,sys; print(json.load(sys.stdin)['id'])")
echo " project $project_id"
@@ -121,7 +123,7 @@ echo " grant: cpu x4 for 87840 minutes on partition debug"
echo "== Recording PI membership and the PEARC26 access event"
"${DB_EXEC[@]}" <<SQL
INSERT IGNORE INTO project_memberships (project_id, user_id, role, added_time)
-VALUES ('$project_id', 'pearc26-approver', 'PI', NOW(6));
+VALUES ('$project_id', '$ADMIN_ID', 'PI', NOW(6));
INSERT INTO access_events (code, compute_allocation_id, organization_id)
VALUES ('PEARC26', '$alloc_id', 'pearc26-org')
ON DUPLICATE KEY UPDATE compute_allocation_id = '$alloc_id';