graphcore-distro 0.2.0__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {graphcore_distro-0.2.0/graphcore_distro.egg-info → graphcore_distro-0.2.2}/PKG-INFO +3 -3
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2/graphcore_distro.egg-info}/PKG-INFO +3 -3
- graphcore_distro-0.2.2/graphcore_distro.egg-info/requires.txt +3 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project/identity.py +15 -16
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project/tests/test_identity.py +20 -37
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/project_template/.env.example +3 -2
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/project_template/backend/project_name/settings.py-tpl +3 -1
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/project_template/react_frontend/src/App.tsx +0 -2
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_user_guides/agent_views.md +8 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_user_guides/app_design/how_to_design_gc_apps.md +2 -2
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_user_guides/frontend.md +4 -6
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_user_guides/identity_infrastructure.md +43 -44
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_user_guides/production.md +20 -19
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_user_guides/service_accounts.md +11 -11
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/pyproject.toml +3 -3
- graphcore_distro-0.2.0/graphcore_distro.egg-info/requires.txt +0 -3
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/LICENSE +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/NOTICE +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/README.md +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/doc_topics.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_cli/__init__.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_cli/api_cmd.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_cli/apps_cmd.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_cli/db_cmd.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_cli/docker_cmd.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_cli/docs_cmd.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_cli/frontend_cmd.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_cli/identity_cmd.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_cli/infra_cmd.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_cli/scaffold_cmd.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_cli/skills_cmd.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_cli/tests/__init__.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_cli/tests/test_api_cmd.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_cli/tests/test_cli.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_cli/tests/test_createadmin_cmd.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_cli/tests/test_dev_reset.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_cli/tests/test_docker_cmd.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_cli/tests/test_docs_cmd.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_cli/tests/test_frontend_cmd.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_cli/tests/test_infra_cmd.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_cli/tests/test_migrate.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_cli/tests/test_packaging.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_cli/tests/test_policy_cmd.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_cli/tests/test_skills_cmd.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_cli/tests/test_status_cmd.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_distro.egg-info/SOURCES.txt +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_distro.egg-info/dependency_links.txt +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_distro.egg-info/entry_points.txt +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_distro.egg-info/top_level.txt +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project/__init__.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project/http.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project/keycloak_admin.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project/locate.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project/runner.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project/tests/__init__.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project/tests/test_keycloak_admin.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project/tests/test_locate.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project/tests/test_runner.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/__init__.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/infra/docker-compose.yml +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/infra/realm/README.md +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/infra/realm/template-realm.json +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/infra/themes/graphcore/login/template.ftl +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/infra/themes/graphcore/login/theme.properties +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/app_template/backend/app_name/__init__.py-tpl +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/app_template/backend/app_name/apps.py-tpl +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/app_template/backend/app_name/authorization.py-tpl +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/app_template/backend/app_name/entities/__init__.py-tpl +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/app_template/backend/app_name/migrations/__init__.py-tpl +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/app_template/backend/app_name/models.py-tpl +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/app_template/backend/app_name/persistence.py-tpl +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/app_template/backend/app_name/routes.py-tpl +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/app_template/backend/app_name/strategies/__init__.py-tpl +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/app_template/backend/app_name/test_settings.py-tpl +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/app_template/backend/app_name/tests/__init__.py-tpl +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/app_template/backend/app_name_agent_frontend/__init__.py-tpl +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/app_template/backend/app_name_agent_frontend/agent_views.py-tpl +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/app_template/backend/pyproject.toml +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/app_template/react_frontend/generated/README.md +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/app_template/react_frontend/index.ts-tpl +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/app_template/react_frontend/package.json +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/app_template/react_frontend/style.css-tpl +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/project_template/.gitignore +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/project_template/.mcp.json +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/project_template/AGENTS.md +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/project_template/CLAUDE.md +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/project_template/README.md +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/project_template/apps/.gitkeep +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/project_template/backend/Dockerfile +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/project_template/backend/manage.py-tpl +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/project_template/backend/project_name/__init__.py-tpl +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/project_template/backend/project_name/asgi.py-tpl +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/project_template/backend/project_name/urls.py-tpl +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/project_template/backend/requirements.txt +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/project_template/docker-compose.yml +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/project_template/package.json +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/project_template/react_frontend/index.html +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/project_template/react_frontend/package.json +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/project_template/react_frontend/src/generated/installedApps.css +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/project_template/react_frontend/src/generated/installedApps.ts +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/project_template/react_frontend/src/index.css +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/project_template/react_frontend/src/main.tsx +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/project_template/react_frontend/src/vite-env.d.ts +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/project_template/react_frontend/tsconfig.json +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scaffold/project_template/react_frontend/vite.config.ts +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scripts/backup_postgres.sh +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scripts/restore_postgres.sh +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/skills/graphcore-docs/SKILL.md +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_user_guides/__init__.py +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_user_guides/app_design/app_tdd_template.md +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_user_guides/app_design/stacks_tdd.md +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_user_guides/custom_authorization.md +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_user_guides/deployment_access.md +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_user_guides/entities.md +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_user_guides/getting_started.md +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_user_guides/writing_strategies.md +0 -0
- {graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: graphcore-distro
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: GraphCore distro — CLI, scaffolding, and curated built-in apps
|
|
5
5
|
Author: GraphCore
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -14,8 +14,8 @@ Requires-Python: >=3.13
|
|
|
14
14
|
Description-Content-Type: text/markdown
|
|
15
15
|
License-File: LICENSE
|
|
16
16
|
License-File: NOTICE
|
|
17
|
-
Requires-Dist: graphcore-kernel[redis,server]==0.2.
|
|
18
|
-
Requires-Dist: graphcore-agents==0.2.
|
|
17
|
+
Requires-Dist: graphcore-kernel[redis,server]==0.2.2
|
|
18
|
+
Requires-Dist: graphcore-agents==0.2.2
|
|
19
19
|
Requires-Dist: python-dotenv<2,>=1.0
|
|
20
20
|
Dynamic: license-file
|
|
21
21
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: graphcore-distro
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: GraphCore distro — CLI, scaffolding, and curated built-in apps
|
|
5
5
|
Author: GraphCore
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -14,8 +14,8 @@ Requires-Python: >=3.13
|
|
|
14
14
|
Description-Content-Type: text/markdown
|
|
15
15
|
License-File: LICENSE
|
|
16
16
|
License-File: NOTICE
|
|
17
|
-
Requires-Dist: graphcore-kernel[redis,server]==0.2.
|
|
18
|
-
Requires-Dist: graphcore-agents==0.2.
|
|
17
|
+
Requires-Dist: graphcore-kernel[redis,server]==0.2.2
|
|
18
|
+
Requires-Dist: graphcore-agents==0.2.2
|
|
19
19
|
Requires-Dist: python-dotenv<2,>=1.0
|
|
20
20
|
Dynamic: license-file
|
|
21
21
|
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Built from declarations (the project's settings and its apps'
|
|
4
4
|
`graphcore_service_clients`), rendered from the template realm, and applied
|
|
5
|
-
idempotently
|
|
6
|
-
`graphcore
|
|
5
|
+
idempotently to the local Keycloak's admin API by `graphcore identity apply`.
|
|
6
|
+
A deployment configures its own provider; `graphcore identity render` shows
|
|
7
|
+
what a realm for this project holds. `graphcore docs
|
|
8
|
+
distro/identity-infrastructure` describes the behaviour.
|
|
7
9
|
"""
|
|
8
10
|
|
|
9
11
|
from __future__ import annotations
|
|
@@ -219,7 +221,7 @@ def domain_secrets(root: Path, spec: DomainSpec) -> dict[str, str]:
|
|
|
219
221
|
raise SystemExit(
|
|
220
222
|
f"Missing client secrets for {spec.keycloak_base}: {', '.join(missing)}.\n"
|
|
221
223
|
"Generate each once, keep it in your secret store and set it in the environment; "
|
|
222
|
-
"
|
|
224
|
+
"secrets are generated only for a local Keycloak."
|
|
223
225
|
)
|
|
224
226
|
return secrets
|
|
225
227
|
|
|
@@ -617,24 +619,15 @@ def _apply_direction(applier: _Applier, spec: DomainSpec, caller: str, target: s
|
|
|
617
619
|
applier.identity_provider(target, provider, secret_changed=broker is None)
|
|
618
620
|
|
|
619
621
|
|
|
620
|
-
def _admin_credentials(
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
if spec.dev:
|
|
624
|
-
return user or "admin", password or "admin"
|
|
625
|
-
missing = [key for key, value in zip(keys, (user, password)) if not value]
|
|
626
|
-
if missing:
|
|
627
|
-
raise SystemExit(
|
|
628
|
-
f"Missing admin credentials for {spec.keycloak_base}: {', '.join(missing)}.\n"
|
|
629
|
-
"Set them from your secret store; `admin` / `admin` is tried only on a local Keycloak."
|
|
630
|
-
)
|
|
631
|
-
return user, password
|
|
622
|
+
def _admin_credentials() -> tuple[str, str]:
|
|
623
|
+
return (os.environ.get("GRAPHCORE_KEYCLOAK_ADMIN") or "admin",
|
|
624
|
+
os.environ.get("GRAPHCORE_KEYCLOAK_ADMIN_PASSWORD") or "admin")
|
|
632
625
|
|
|
633
626
|
|
|
634
627
|
def _admin_for(spec: DomainSpec):
|
|
635
628
|
from .keycloak_admin import KeycloakAdmin
|
|
636
629
|
|
|
637
|
-
return KeycloakAdmin(spec.admin_base, *_admin_credentials(
|
|
630
|
+
return KeycloakAdmin(spec.admin_base, *_admin_credentials())
|
|
638
631
|
|
|
639
632
|
|
|
640
633
|
def apply_identity(root: Path | None = None, *, admin=None, log: Callable[[str], None] = print,
|
|
@@ -645,6 +638,12 @@ def apply_identity(root: Path | None = None, *, admin=None, log: Callable[[str],
|
|
|
645
638
|
|
|
646
639
|
root = require_project_root(root, command="graphcore identity apply")
|
|
647
640
|
spec = load_spec(root, service_clients=service_clients)
|
|
641
|
+
if not spec.dev:
|
|
642
|
+
raise SystemExit(
|
|
643
|
+
f"{spec.issuer} is not a local Keycloak. `graphcore identity apply` sets up local development "
|
|
644
|
+
"only; a deployment's provider is configured by its own deployment tooling. "
|
|
645
|
+
"See `graphcore docs distro/identity-infrastructure`, In production."
|
|
646
|
+
)
|
|
648
647
|
admin = admin or _admin_for(spec)
|
|
649
648
|
realm = render_realm(spec, load_template(), domain_secrets(root, spec))
|
|
650
649
|
|
|
@@ -203,21 +203,13 @@ class DomainSecretsTests(ProjectFixture):
|
|
|
203
203
|
|
|
204
204
|
|
|
205
205
|
class AdminCredentialsTests(ProjectFixture):
|
|
206
|
-
def
|
|
207
|
-
self.assertEqual(identity._admin_credentials(
|
|
206
|
+
def test_the_local_keycloak_defaults_to_admin(self):
|
|
207
|
+
self.assertEqual(identity._admin_credentials(), ("admin", "admin"))
|
|
208
208
|
|
|
209
|
-
def
|
|
209
|
+
def test_the_environment_overrides_the_default(self):
|
|
210
210
|
os.environ.update({"GRAPHCORE_KEYCLOAK_ADMIN": "ops", "GRAPHCORE_KEYCLOAK_ADMIN_PASSWORD": "pw"})
|
|
211
211
|
|
|
212
|
-
self.assertEqual(identity._admin_credentials(
|
|
213
|
-
|
|
214
|
-
def test_another_keycloak_never_tries_the_default(self):
|
|
215
|
-
os.environ["GRAPHCORE_KEYCLOAK_ADMIN"] = "ops"
|
|
216
|
-
|
|
217
|
-
with self.assertRaises(SystemExit) as raised:
|
|
218
|
-
identity._admin_credentials(_spec(dev=False, keycloak_base="https://auth.example.com"))
|
|
219
|
-
|
|
220
|
-
self.assertIn("https://auth.example.com: GRAPHCORE_KEYCLOAK_ADMIN_PASSWORD.", str(raised.exception))
|
|
212
|
+
self.assertEqual(identity._admin_credentials(), ("ops", "pw"))
|
|
221
213
|
|
|
222
214
|
|
|
223
215
|
class RenderRealmTests(TestCase):
|
|
@@ -698,40 +690,31 @@ class ApplyIdentityTests(ProjectFixture):
|
|
|
698
690
|
|
|
699
691
|
self.assertIn("'wedding' has no backend client", str(raised.exception))
|
|
700
692
|
|
|
701
|
-
def
|
|
702
|
-
(self.root / ".env").unlink()
|
|
693
|
+
def test_another_keycloak_is_refused_before_any_contact(self):
|
|
703
694
|
os.environ.update({
|
|
704
695
|
"GRAPHCORE_OIDC_ISSUER": "https://auth.example.com/realms/notes",
|
|
705
|
-
"
|
|
706
|
-
|
|
696
|
+
"GRAPHCORE_KEYCLOAK_ADMIN": "ops",
|
|
697
|
+
"GRAPHCORE_KEYCLOAK_ADMIN_PASSWORD": "pw",
|
|
707
698
|
})
|
|
699
|
+
before = (self.root / ".env").read_bytes()
|
|
708
700
|
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
self.assertEqual(clients["wedding-gateway"]["secret"], "gateway-secret")
|
|
713
|
-
self.assertEqual(clients["notes-backend"]["secret"], "backend-secret")
|
|
714
|
-
self.assertEqual(list(self.root.iterdir()), [self.root / "backend"])
|
|
715
|
-
|
|
716
|
-
def test_another_keycloak_without_its_secrets_is_refused_before_any_write(self):
|
|
717
|
-
os.environ["GRAPHCORE_OIDC_ISSUER"] = "https://auth.example.com/realms/notes"
|
|
718
|
-
|
|
719
|
-
with self.assertRaises(SystemExit) as raised:
|
|
720
|
-
self.apply()
|
|
701
|
+
with patch("graphcore_project.keycloak_admin.KeycloakAdmin") as admin, \
|
|
702
|
+
self.assertRaises(SystemExit) as raised:
|
|
703
|
+
apply_identity(self.root, service_clients=lambda root: [("wedding", ["gateway"])])
|
|
721
704
|
|
|
722
|
-
self.assertIn("
|
|
723
|
-
self.
|
|
724
|
-
|
|
705
|
+
self.assertIn("https://auth.example.com/realms/notes is not a local Keycloak", str(raised.exception))
|
|
706
|
+
self.assertIn("distro/identity-infrastructure", str(raised.exception))
|
|
707
|
+
admin.assert_not_called()
|
|
708
|
+
self.assertEqual((self.root / ".env").read_bytes(), before)
|
|
725
709
|
|
|
726
|
-
def
|
|
710
|
+
def test_another_keycloaks_realm_still_renders(self):
|
|
727
711
|
os.environ["GRAPHCORE_OIDC_ISSUER"] = "https://auth.example.com/realms/notes"
|
|
728
712
|
|
|
729
|
-
|
|
730
|
-
self.assertRaises(SystemExit) as raised:
|
|
731
|
-
apply_identity(self.root, service_clients=lambda root: [])
|
|
713
|
+
realm = render_identity(self.root, service_clients=lambda root: [("wedding", ["gateway"])])
|
|
732
714
|
|
|
733
|
-
self.
|
|
734
|
-
|
|
715
|
+
self.assertEqual(realm["sslRequired"], "external")
|
|
716
|
+
self.assertIn("graphcore-mcp", {c["clientId"] for c in realm["clients"]})
|
|
717
|
+
self.assertNotIn("graphcore-dev-test", {c["clientId"] for c in realm["clients"]})
|
|
735
718
|
|
|
736
719
|
def test_render_lists_the_secrets_the_realm_needs(self):
|
|
737
720
|
self.assertEqual(required_secrets(self.root, service_clients=lambda root: [("wedding", ["gateway"])]),
|
|
@@ -45,8 +45,9 @@ GRAPHCORE_OIDC_AUDIENCE={{ project_name }}
|
|
|
45
45
|
# GRAPHCORE_KEYCLOAK_ADMIN=admin
|
|
46
46
|
# GRAPHCORE_KEYCLOAK_ADMIN_PASSWORD=admin
|
|
47
47
|
|
|
48
|
-
# The public client of the issuer the frontend signs in as
|
|
49
|
-
|
|
48
|
+
# The public client of the issuer the frontend signs in as; the backend
|
|
49
|
+
# tells the frontend at runtime.
|
|
50
|
+
GRAPHCORE_OIDC_WEB_CLIENT_ID=graphcore-web
|
|
50
51
|
# Off localhost, the backend's URL and host the frontend calls (default
|
|
51
52
|
# http://localhost:$BACKEND_PORT) and the frontend origins the backend allows
|
|
52
53
|
# (default localhost and 127.0.0.1 on $FRONTEND_PORT).
|
|
@@ -154,11 +154,13 @@ GRAPHCORE_RECONCILE_INTERVAL = int(os.environ.get('GRAPHCORE_RECONCILE_INTERVAL'
|
|
|
154
154
|
# that `graphcore infra up` runs; any standard OIDC issuer works. The audience
|
|
155
155
|
# is what tokens must carry in `aud`. GRAPHCORE_OIDC_INTERNAL_URL is the issuer
|
|
156
156
|
# URL as this process reaches it, when that differs (`graphcore docker up`
|
|
157
|
-
# sets it for a container reaching the host).
|
|
157
|
+
# sets it for a container reaching the host). The web client is the issuer's
|
|
158
|
+
# public client the frontend signs in as; the backend tells the frontend.
|
|
158
159
|
GRAPHCORE_TRUSTED_ISSUERS = [{
|
|
159
160
|
'issuer': os.environ.get('GRAPHCORE_OIDC_ISSUER', 'http://localhost:8180/realms/{{ project_name }}'),
|
|
160
161
|
'audience': os.environ.get('GRAPHCORE_OIDC_AUDIENCE', '{{ project_name }}'),
|
|
161
162
|
'internal_url': os.environ.get('GRAPHCORE_OIDC_INTERNAL_URL') or None,
|
|
163
|
+
'web_client_id': os.environ.get('GRAPHCORE_OIDC_WEB_CLIENT_ID', 'graphcore-web'),
|
|
162
164
|
}]
|
|
163
165
|
|
|
164
166
|
# This deployment's public origin when it sits behind a proxy; unset uses the
|
|
@@ -14,8 +14,6 @@ import { installedApps } from './generated/installedApps';
|
|
|
14
14
|
const config = {
|
|
15
15
|
apiUrl: import.meta.env.VITE_API_URL,
|
|
16
16
|
wsUrl: import.meta.env.VITE_WS_URL,
|
|
17
|
-
// The issuer's public client this frontend signs in as (see .env).
|
|
18
|
-
oidcClientId: import.meta.env.VITE_OIDC_CLIENT_ID ?? 'graphcore-web',
|
|
19
17
|
};
|
|
20
18
|
|
|
21
19
|
// Views: `baseViews` (the framework's generic views, including
|
|
@@ -199,6 +199,14 @@ async def board_tools(ctx, board):
|
|
|
199
199
|
may run it is decided when the agent calls it, exactly as for any client.
|
|
200
200
|
- `call` validates the agent's parameters against the schema before
|
|
201
201
|
running anything.
|
|
202
|
+
- `strategy_tool(name, bind=entity_id, from_shell=True)` is run from the
|
|
203
|
+
agent's shell, for params too large for the conversation, such as a
|
|
204
|
+
file's bytes. It takes no parameters and runs nothing when called: it
|
|
205
|
+
returns a strategy token, good for 15 minutes for that strategy on that
|
|
206
|
+
target as the user, the request to send, the strategy's schema, and how
|
|
207
|
+
to post the request with the token. The agent's shell builds and sends
|
|
208
|
+
each request, so a file's bytes never pass through the conversation. An
|
|
209
|
+
agent without a shell cannot use it.
|
|
202
210
|
|
|
203
211
|
An **operation** is a tool written as code, for work that is not one
|
|
204
212
|
strategy run:
|
|
@@ -439,8 +439,8 @@ view as it lands, and to walk through the TDD's worked examples.
|
|
|
439
439
|
```
|
|
440
440
|
|
|
441
441
|
If `.env` sets another `BACKEND_PORT`, change the port in `url` to
|
|
442
|
-
match. `graphcore-mcp` is the public client
|
|
443
|
-
creates
|
|
442
|
+
match. `graphcore-mcp` is the public client every GraphCore realm has
|
|
443
|
+
(`graphcore identity apply` creates it locally). Its only redirect URIs are
|
|
444
444
|
`http://localhost:8765/callback` and `http://127.0.0.1:8765/callback`,
|
|
445
445
|
so `callbackPort` must be `8765`. Another MCP host registers the same
|
|
446
446
|
URL and client in its own configuration.
|
|
@@ -38,7 +38,6 @@ import { installedApps } from './generated/installedApps';
|
|
|
38
38
|
const config = {
|
|
39
39
|
apiUrl: import.meta.env.VITE_API_URL,
|
|
40
40
|
wsUrl: import.meta.env.VITE_WS_URL,
|
|
41
|
-
oidcClientId: import.meta.env.VITE_OIDC_CLIENT_ID ?? 'graphcore-web',
|
|
42
41
|
};
|
|
43
42
|
|
|
44
43
|
const registry = createViewRegistry();
|
|
@@ -177,7 +176,6 @@ in the app. The backend cannot read `basePath`; set it in both places.
|
|
|
177
176
|
|---|---|
|
|
178
177
|
| `apiUrl` | Full API base URL, e.g. `https://api.example.com` |
|
|
179
178
|
| `wsUrl` | WebSocket host and port, e.g. `api.example.com` |
|
|
180
|
-
| `oidcClientId` | The issuer's public client to sign in as. Default `graphcore-web` |
|
|
181
179
|
| `agentMirror` | Offer every routed view a pane showing what an agent reads at that address |
|
|
182
180
|
| `getToken`, `principalEntityId` | Supply a token yourself instead of signing in |
|
|
183
181
|
|
|
@@ -312,9 +310,10 @@ graphcore frontend up --script build # prepare, then npm run build
|
|
|
312
310
|
under the base path.
|
|
313
311
|
- Register the web client at your issuer with redirect URI
|
|
314
312
|
`<frontend origin><base path>/auth/callback` and post-logout URI
|
|
315
|
-
`<frontend origin><base path
|
|
316
|
-
|
|
317
|
-
|
|
313
|
+
`<frontend origin><base path>` (`<origin>/*` covers any base path), and set
|
|
314
|
+
its id in the backend's `GRAPHCORE_OIDC_WEB_CLIENT_ID`. The frontend asks
|
|
315
|
+
the backend for the issuer and the client when it loads, so one build
|
|
316
|
+
works with any provider.
|
|
318
317
|
- Set the backend's `GRAPHCORE_WEB_URL` to the frontend's public URL with
|
|
319
318
|
its base path. Unless `CORS_ALLOWED_ORIGINS` is set, the backend allows
|
|
320
319
|
that URL's origin.
|
|
@@ -329,7 +328,6 @@ graphcore frontend up --script build # prepare, then npm run build
|
|
|
329
328
|
| `BACKEND_PORT` | The local backend's port, which the two URLs below default to | `8000` | Unused |
|
|
330
329
|
| `VITE_API_URL` | The backend's HTTP base URL (`config.apiUrl`) | `http://localhost:$BACKEND_PORT` | The backend's public URL |
|
|
331
330
|
| `VITE_WS_URL` | The backend's WebSocket host and port (`config.wsUrl`) | `localhost:$BACKEND_PORT` | The backend's public host |
|
|
332
|
-
| `VITE_OIDC_CLIENT_ID` | The issuer's public web client (`config.oidcClientId`) | `graphcore-web` | Your provider's web client id |
|
|
333
331
|
| `GRAPHCORE_WEB_URL` | The app's full URL with its base path, read by the backend for agents' `web:` links and the default allowed origin | `http://localhost:$FRONTEND_PORT` | The frontend's public URL, plus `basePath` |
|
|
334
332
|
|
|
335
333
|
## How the kernel does this
|
{graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_user_guides/identity_infrastructure.md
RENAMED
|
@@ -153,8 +153,10 @@ for just the list of variables).
|
|
|
153
153
|
|
|
154
154
|
It signs in to Keycloak's `master` realm with `GRAPHCORE_KEYCLOAK_ADMIN` and
|
|
155
155
|
`GRAPHCORE_KEYCLOAK_ADMIN_PASSWORD`, which default to the local-only
|
|
156
|
-
`admin` / `admin
|
|
157
|
-
|
|
156
|
+
`admin` / `admin`. Those credentials are given only to this command, never
|
|
157
|
+
to the backend. It refuses an issuer whose Keycloak is not at `localhost`:
|
|
158
|
+
a deployment's realm is its deployment tooling's to configure (*In
|
|
159
|
+
production*). It reaches Keycloak at the base of
|
|
158
160
|
`GRAPHCORE_OIDC_ISSUER`, or of `GRAPHCORE_OIDC_INTERNAL_URL` when set.
|
|
159
161
|
|
|
160
162
|
Within a shared domain, the realm's settings (display name, login theme,
|
|
@@ -179,7 +181,7 @@ Every realm has:
|
|
|
179
181
|
|
|
180
182
|
| Client | Kind | Used by |
|
|
181
183
|
|---|---|---|
|
|
182
|
-
| `graphcore-web` | Public, code + PKCE; redirect URIs from the project's origins | The web frontend (`
|
|
184
|
+
| `graphcore-web` | Public, code + PKCE; redirect URIs from the project's origins | The web frontend, which the backend tells its id (`GRAPHCORE_OIDC_WEB_CLIENT_ID`) |
|
|
183
185
|
| `graphcore-cli` | Public, device authorization grant | `graphcore api login` |
|
|
184
186
|
| `graphcore-mcp` | Public, code + PKCE, loopback redirect URIs | MCP hosts that cannot register themselves |
|
|
185
187
|
| `<project>-backend` per project in the domain | Confidential, standard token exchange; secret in `.env` as `GRAPHCORE_BACKEND_CLIENT_SECRET` | The backend, exchanging a user's token to act for them at another deployment |
|
|
@@ -269,9 +271,9 @@ mappings).
|
|
|
269
271
|
|
|
270
272
|
| Client | Grant | Register it with |
|
|
271
273
|
|---|---|---|
|
|
272
|
-
| The web frontend | Authorization code with PKCE, public | Redirect URI `<frontend origin><base path>/auth/callback` and post-logout URI `<frontend origin><base path>`; its id in `
|
|
274
|
+
| The web frontend | Authorization code with PKCE, public | Redirect URI `<frontend origin><base path>/auth/callback` and post-logout URI `<frontend origin><base path>`; its id in `GRAPHCORE_OIDC_WEB_CLIENT_ID`, which the backend gives the frontend at runtime |
|
|
273
275
|
| The `graphcore` CLI | Device authorization grant (RFC 8628), public | Its id in `GRAPHCORE_OIDC_CLI_CLIENT_ID`, or `--client-id`; default `graphcore-cli` |
|
|
274
|
-
| MCP hosts | Authorization code with PKCE | Dynamic client registration (RFC 7591), or a client you register and configure in the host |
|
|
276
|
+
| MCP hosts | Authorization code with PKCE | Dynamic client registration (RFC 7591), or a client you register and configure in the host. Hosts on the person's machine (Claude Code, Codex) redirect to a loopback URI; a hosted one (Claude on the web) redirects to its own HTTPS callback, which the client's redirect URIs or the registration policy must allow |
|
|
275
277
|
| Each service account | Client credentials, confidential | Client id exactly `<app_id>-<name>`, which tokens must carry in `azp` |
|
|
276
278
|
|
|
277
279
|
- For one deployment acting for a user at another: RFC 8693 token exchange
|
|
@@ -281,44 +283,41 @@ mappings).
|
|
|
281
283
|
|
|
282
284
|
### With Keycloak
|
|
283
285
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
286
|
+
Define the realm in your deployment tooling, for example as a realm file
|
|
287
|
+
your pipeline imports with a declarative import tool, and apply it before
|
|
288
|
+
the backend starts. `graphcore identity apply` sets up the local Keycloak
|
|
289
|
+
only and refuses any other.
|
|
290
|
+
|
|
291
|
+
`graphcore identity render`, run with the production
|
|
292
|
+
`GRAPHCORE_OIDC_ISSUER` and `CORS_ALLOWED_ORIGINS`, prints the realm the
|
|
293
|
+
project expects, each secret shown as its variable. Use it as the reference
|
|
294
|
+
for what your realm must hold: the clients above, the domain's audience
|
|
295
|
+
scope, the user profile and the client-registration policies. Leave out what
|
|
296
|
+
Keycloak creates for every realm itself (its built-in clients and signing
|
|
297
|
+
keys). For an issuer not at `localhost` it has none of the local-development
|
|
298
|
+
settings: the realm requires HTTPS for external requests, has no
|
|
299
|
+
`test@example.com` user and no `graphcore-dev-test` client, and takes the
|
|
300
|
+
web client's redirect URIs and web origins from `CORS_ALLOWED_ORIGINS` only.
|
|
301
|
+
|
|
302
|
+
- **Secrets.** `graphcore identity render --secrets` lists the client
|
|
303
|
+
secrets. Generate each once, keep it in your secret store, set it on its
|
|
304
|
+
client in the realm, and give the same value to the backend and each
|
|
305
|
+
service-account process.
|
|
306
|
+
- **Clients that register themselves.** MCP hosts register clients through
|
|
307
|
+
dynamic client registration at runtime. Import the realm without deleting
|
|
308
|
+
clients your file does not list, or each release signs those hosts out.
|
|
309
|
+
- **The login theme.** Install the `graphcore` theme on your Keycloak, or set
|
|
310
|
+
your realm's login theme to one it has.
|
|
303
311
|
|
|
304
312
|
Running Keycloak itself, its HTTPS, hostname, database and backups, is
|
|
305
|
-
outside GraphCore.
|
|
306
|
-
`GRAPHCORE_IDENTITY_LOGIN_THEME` to a theme it has.
|
|
307
|
-
|
|
308
|
-
Each client secret is read from the environment first, then from `.env`;
|
|
309
|
-
no `.env` is needed. Only for a Keycloak at `localhost` does `apply`
|
|
310
|
-
generate a missing secret into `.env` or fall back to `admin` / `admin`.
|
|
311
|
-
For any other, it writes nothing to disk and stops before any change,
|
|
312
|
-
naming the missing admin credentials or secrets. Give the same secrets to
|
|
313
|
-
the backend and each service-account process.
|
|
313
|
+
outside GraphCore.
|
|
314
314
|
|
|
315
315
|
### With another provider
|
|
316
316
|
|
|
317
317
|
Register the clients above in the provider's console or its own
|
|
318
318
|
infrastructure-as-code, and set `GRAPHCORE_OIDC_ISSUER`,
|
|
319
|
-
`GRAPHCORE_OIDC_AUDIENCE`, `
|
|
320
|
-
not `graphcore-cli`, `GRAPHCORE_OIDC_CLI_CLIENT_ID`.
|
|
321
|
-
`graphcore identity apply`; it configures Keycloak only.
|
|
319
|
+
`GRAPHCORE_OIDC_AUDIENCE`, `GRAPHCORE_OIDC_WEB_CLIENT_ID` and, if the CLI's
|
|
320
|
+
client is not `graphcore-cli`, `GRAPHCORE_OIDC_CLI_CLIENT_ID`.
|
|
322
321
|
|
|
323
322
|
- **Domains** are whatever set of applications the provider lets share
|
|
324
323
|
accounts; give every deployment in one the same audience.
|
|
@@ -335,17 +334,17 @@ not `graphcore-cli`, `GRAPHCORE_OIDC_CLI_CLIENT_ID`. Do not run
|
|
|
335
334
|
|
|
336
335
|
| Setting | Meaning | Local default | In production |
|
|
337
336
|
|---|---|---|---|
|
|
338
|
-
| `GRAPHCORE_IDENTITY_DOMAIN` | The identity domain (realm) this project belongs to | the project name |
|
|
339
|
-
| `GRAPHCORE_IDENTITY_DISPLAY_NAME` | The realm's display name, on its login page | the domain |
|
|
340
|
-
| `GRAPHCORE_IDENTITY_LOGIN_THEME` | The realm's login theme | `graphcore` |
|
|
341
|
-
| `GRAPHCORE_IDENTITY_REGISTRATION` | Whether people may register themselves | `true` |
|
|
342
|
-
| `GRAPHCORE_IDENTITY_LINKED_DOMAINS` | Domains linked to this one, both ways, comma-separated | none |
|
|
337
|
+
| `GRAPHCORE_IDENTITY_DOMAIN` | The identity domain (realm) this project belongs to | the project name | Read by `render` only; your realm's name |
|
|
338
|
+
| `GRAPHCORE_IDENTITY_DISPLAY_NAME` | The realm's display name, on its login page | the domain | Read by `render` only; set it in your realm |
|
|
339
|
+
| `GRAPHCORE_IDENTITY_LOGIN_THEME` | The realm's login theme | `graphcore` | Read by `render` only; set it in your realm |
|
|
340
|
+
| `GRAPHCORE_IDENTITY_REGISTRATION` | Whether people may register themselves | `true` | Read by `render` only; set it in your realm |
|
|
341
|
+
| `GRAPHCORE_IDENTITY_LINKED_DOMAINS` | Domains linked to this one, both ways, comma-separated | none | Not used; configure links in your provider |
|
|
343
342
|
| `GRAPHCORE_OIDC_ISSUER` | The issuer URL the backend trusts. With `apply`, must be `<keycloak>/realms/<domain>` | `http://localhost:8180/realms/<domain>` | Your provider's issuer URL |
|
|
344
343
|
| `GRAPHCORE_OIDC_AUDIENCE` | The audience tokens must carry | the domain | The audience your provider issues for the deployment |
|
|
345
344
|
| `GRAPHCORE_OIDC_INTERNAL_URL` | Where this process fetches discovery and keys, and `apply` reaches the admin API, when the public URL is unreachable from it | unset; `graphcore docker up` sets it | Only when your network needs it |
|
|
346
|
-
| `GRAPHCORE_KEYCLOAK_ADMIN`, `GRAPHCORE_KEYCLOAK_ADMIN_PASSWORD` | Admin credentials `apply` signs in with | `admin` / `admin`, local only |
|
|
347
|
-
| `GRAPHCORE_BACKEND_CLIENT_SECRET`, `*_CLIENT_SECRET` | Client secrets | generated into `.env` by `apply` | Required; from your secret store (`graphcore identity render --secrets` lists them) |
|
|
348
|
-
| `
|
|
345
|
+
| `GRAPHCORE_KEYCLOAK_ADMIN`, `GRAPHCORE_KEYCLOAK_ADMIN_PASSWORD` | Admin credentials `apply` signs in with | `admin` / `admin`, local only | Not used |
|
|
346
|
+
| `GRAPHCORE_BACKEND_CLIENT_SECRET`, `*_CLIENT_SECRET` | Client secrets | generated into `.env` by `apply` | Required; from your secret store, the same values your realm holds (`graphcore identity render --secrets` lists them) |
|
|
347
|
+
| `GRAPHCORE_OIDC_WEB_CLIENT_ID` | The public client the web frontend signs in as; the backend gives it to the frontend at runtime | `graphcore-web` | Your provider's browser client id |
|
|
349
348
|
| `GRAPHCORE_OIDC_CLI_CLIENT_ID` | The client `graphcore api login` signs in as | `graphcore-cli` | Your provider's device-grant client id |
|
|
350
349
|
|
|
351
350
|
## Why
|
|
@@ -18,7 +18,7 @@ distro does not provide something for production yet, the guide says so.
|
|
|
18
18
|
| The framework packages | The release (`graphcore-distro` in `backend/requirements.txt`, `@graphcore/react` from npm), or the monorepo checkout for a `--local-framework` project | The release, installed from PyPI and npm; the project's Dockerfile builds an image from them with nothing else checked out. A `--local-framework` project needs the checkout next to it |
|
|
19
19
|
| A Postgres database | One database per project on the shared Postgres from `graphcore infra up` (`graphcore db create`) | A database of your own, named by `POSTGRES_*` |
|
|
20
20
|
| Redis | The shared Redis from `graphcore infra up`, one namespace per project (`REDIS_NS`) | A Redis of your own, `REDIS_URL` and `REDIS_NS` |
|
|
21
|
-
| An OIDC issuer | A Keycloak realm per project on the shared Keycloak, created by `graphcore identity apply` | Any standard OIDC provider; see Identity |
|
|
21
|
+
| An OIDC issuer | A Keycloak realm per project on the shared Keycloak, created by `graphcore identity apply` | Any standard OIDC provider, configured by your deployment tooling; see Identity |
|
|
22
22
|
| The backend processes | `graphcore run` (web, worker and beat in one process) or `graphcore docker up` | `graphcore run --role web`, `--role worker`, and exactly one `--role beat` |
|
|
23
23
|
| The web frontend | The Vite dev server (`graphcore frontend up`) | A static build served by any web server; see Frontend |
|
|
24
24
|
|
|
@@ -38,11 +38,12 @@ not required.
|
|
|
38
38
|
| `POSTGRES_POOL_MAX_SIZE`, `GRAPHCORE_DB_THREADS` | `10` pooled connections and `4` query threads per process | Keep the threads below the pool size, and every process's pool together below your database's connection limit |
|
|
39
39
|
| `REDIS_URL` (or `REDIS_HOST`, `REDIS_PORT`), `REDIS_NS` | the shared infra Redis | Your Redis; a namespace unique to the deployment |
|
|
40
40
|
| `GRAPHCORE_OIDC_ISSUER`, `GRAPHCORE_OIDC_AUDIENCE` | the project's realm on the local Keycloak | Your provider's issuer URL and the audience its tokens carry for this deployment |
|
|
41
|
+
| `GRAPHCORE_OIDC_WEB_CLIENT_ID` | `graphcore-web` | Your provider's browser client id. The backend gives it to the frontend at runtime |
|
|
41
42
|
| `GRAPHCORE_PUBLIC_URL` | unset (the request's own host) | The backend's public origin, when it sits behind a proxy |
|
|
42
43
|
| `GRAPHCORE_WEB_URL` | `http://localhost:$FRONTEND_PORT` | The web app's public URL, base path included (it must match `basePath`). Agents link users to pages there |
|
|
43
44
|
| `CORS_ALLOWED_ORIGINS` | `localhost` and `127.0.0.1` on `FRONTEND_PORT` (`3000`), and the origin of `GRAPHCORE_WEB_URL` | The frontend's public origin(s); unset allows the origin of `GRAPHCORE_WEB_URL` |
|
|
44
|
-
| `GRAPHCORE_BACKEND_CLIENT_SECRET`, `*_CLIENT_SECRET` | generated into `.env` by `graphcore identity apply` | Generated once, kept in your secret store; `graphcore identity render --secrets` lists them |
|
|
45
|
-
| `VITE_API_URL`, `VITE_WS_URL
|
|
45
|
+
| `GRAPHCORE_BACKEND_CLIENT_SECRET`, `*_CLIENT_SECRET` | generated into `.env` by `graphcore identity apply` | Generated once, kept in your secret store and registered with your provider; `graphcore identity render --secrets` lists them |
|
|
46
|
+
| `VITE_API_URL`, `VITE_WS_URL` | the local backend on `BACKEND_PORT` (`8000`) | The backend's public URL and host. Read when the frontend is built, not when it runs |
|
|
46
47
|
|
|
47
48
|
## Steps on every deploy
|
|
48
49
|
|
|
@@ -50,7 +51,6 @@ Run these from the project root, with the production settings in the
|
|
|
50
51
|
environment:
|
|
51
52
|
|
|
52
53
|
```bash
|
|
53
|
-
graphcore identity apply # only when the issuer is Keycloak; see Identity
|
|
54
54
|
graphcore migrate # safe to run from several replicas at once
|
|
55
55
|
```
|
|
56
56
|
|
|
@@ -67,21 +67,22 @@ settings, from wherever you run one-off commands against the deployment
|
|
|
67
67
|
|
|
68
68
|
The backend trusts any OIDC provider that meets the kernel's contract
|
|
69
69
|
(`graphcore docs kernel/authentication`). Keycloak is what the distro runs
|
|
70
|
-
locally, not a requirement.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
70
|
+
locally, not a requirement. The deployment owns its provider's
|
|
71
|
+
configuration: the project only reads the settings that name it
|
|
72
|
+
(`GRAPHCORE_OIDC_ISSUER`, `GRAPHCORE_OIDC_AUDIENCE`,
|
|
73
|
+
`GRAPHCORE_OIDC_WEB_CLIENT_ID` and the client secrets).
|
|
74
|
+
`graphcore docs distro/identity-infrastructure`, under *In production*,
|
|
75
|
+
lists what a provider must offer and the clients to register with it.
|
|
76
|
+
|
|
77
|
+
- **With Keycloak**, define the project's realm in your deployment tooling,
|
|
78
|
+
for example as a realm file your pipeline imports.
|
|
79
|
+
`graphcore identity render` prints the realm `apply` builds locally, with
|
|
80
|
+
each secret as its variable: use it as the reference for the clients,
|
|
81
|
+
scopes and policies the realm must hold. `graphcore identity apply` sets
|
|
82
|
+
up the local Keycloak only and refuses any other.
|
|
83
|
+
- **With another provider**, register the same clients there. Domains,
|
|
84
|
+
linking and delegation are then the provider's to configure, and service
|
|
85
|
+
accounts need it to let you choose client ids.
|
|
85
86
|
|
|
86
87
|
## Frontend
|
|
87
88
|
|
|
@@ -106,25 +106,25 @@ graphcore api execute-strategy --await-response \
|
|
|
106
106
|
The declaration, the principal and the grants are the same, and `graphcore
|
|
107
107
|
migrate` creates the account on deploy as it does locally. What changes:
|
|
108
108
|
|
|
109
|
-
- **Registering the client.**
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
confidential client-credentials client whose id is exactly
|
|
109
|
+
- **Registering the client.** Your deployment tooling registers it with the
|
|
110
|
+
provider (`graphcore docs distro/identity-infrastructure`, *In
|
|
111
|
+
production*): a confidential client-credentials client whose id is exactly
|
|
113
112
|
`<app_id>-<name>`, whose tokens carry that id in `azp` and the
|
|
114
113
|
deployment's audience in `aud`. A provider that assigns its own client ids
|
|
115
114
|
cannot be used for service accounts yet.
|
|
116
|
-
- **The secret.**
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
- **The secret.** Generate it once and keep it in your secret store. Set it
|
|
116
|
+
on the client at the provider, and give the process its client id and
|
|
117
|
+
secret through its environment.
|
|
119
118
|
- **The token endpoint** is the issuer's, found at
|
|
120
119
|
`<issuer>/.well-known/openid-configuration` (`token_endpoint`).
|
|
121
120
|
|
|
122
121
|
## Changing or removing one
|
|
123
122
|
|
|
124
|
-
- **Rotating the secret.**
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
123
|
+
- **Rotating the secret.** Locally: delete the variable from `.env` and run
|
|
124
|
+
`graphcore identity apply`, which generates a new secret and sets it on the
|
|
125
|
+
client. In production, set a new secret on the client at the provider and
|
|
126
|
+
in your secret store. The old one stops working at once, so update the
|
|
127
|
+
process in the same step.
|
|
128
128
|
- **Recreating the client** at the issuer gives its tokens a new `sub`. The
|
|
129
129
|
account and its grants stay: the backend recognizes the client by its id,
|
|
130
130
|
not by `sub`. A token for the client from a different issuer is refused.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "graphcore-distro"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.2"
|
|
8
8
|
description = "GraphCore distro — CLI, scaffolding, and curated built-in apps"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "Apache-2.0"
|
|
@@ -20,8 +20,8 @@ classifiers = [
|
|
|
20
20
|
"Framework :: Django :: 5.2",
|
|
21
21
|
]
|
|
22
22
|
dependencies = [
|
|
23
|
-
"graphcore-kernel[redis,server]==0.2.
|
|
24
|
-
"graphcore-agents==0.2.
|
|
23
|
+
"graphcore-kernel[redis,server]==0.2.2",
|
|
24
|
+
"graphcore-agents==0.2.2",
|
|
25
25
|
"python-dotenv>=1.0,<2",
|
|
26
26
|
]
|
|
27
27
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_cli/tests/test_createadmin_cmd.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_distro.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_distro.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project/tests/test_keycloak_admin.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/infra/docker-compose.yml
RENAMED
|
File without changes
|
{graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/infra/realm/README.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scripts/backup_postgres.sh
RENAMED
|
File without changes
|
{graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_project_kit/scripts/restore_postgres.sh
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_user_guides/app_design/stacks_tdd.md
RENAMED
|
File without changes
|
{graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_user_guides/custom_authorization.md
RENAMED
|
File without changes
|
{graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_user_guides/deployment_access.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{graphcore_distro-0.2.0 → graphcore_distro-0.2.2}/graphcore_user_guides/writing_strategies.md
RENAMED
|
File without changes
|
|
File without changes
|