Skip to content

fix: propagate client metadata to the gateway#141

Open
nicholaspun-wandb wants to merge 1 commit into
mainfrom
npun/wire-client-metadata
Open

fix: propagate client metadata to the gateway#141
nicholaspun-wandb wants to merge 1 commit into
mainfrom
npun/wire-client-metadata

Conversation

@nicholaspun-wandb

Copy link
Copy Markdown
Collaborator

Adds the SDK version and optionally the integration source as headers so that we can track this at the gateway. This will allow us to better understand SDK rollout and also which integrations are receiving usage.

@nicholaspun-wandb

Copy link
Copy Markdown
Collaborator Author

e2e tests:

uv run --no-sync pytest tests/integration/ -p wandb.sandbox -n auto

======================================================= short test summary info ========================================================
FAILED tests/integration/cwsandbox/test_discovery.py::TestListRunners::test_capacity_filter - cwsandbox.exceptions.CWSandboxAuthenticationError: Permission denied: W&B auth is not allowed for this sandbox operation
FAILED tests/integration/cwsandbox/test_discovery.py::TestGetProfile::test_get_nonexistent_profile - cwsandbox.exceptions.CWSandboxAuthenticationError: Permission denied: W&B auth is not allowed for this sandbox operation
FAILED tests/integration/cwsandbox/test_discovery.py::TestListRunners::test_filter_nonexistent_profile - cwsandbox.exceptions.CWSandboxAuthenticationError: Permission denied: W&B auth is not allowed for this sandbox operation
FAILED tests/integration/cwsandbox/test_discovery.py::TestGetRunner::test_get_nonexistent_runner - cwsandbox.exceptions.CWSandboxAuthenticationError: Permission denied: W&B auth is not allowed for this sandbox operation
ERROR tests/integration/cwsandbox/test_discovery.py::TestListRunners::test_include_resources_false_default - cwsandbox.exceptions.CWSandboxAuthenticationError: Permission denied: W&B auth is not allowed for this sandbox operation
ERROR tests/integration/cwsandbox/test_discovery.py::TestListRunners::test_filter_by_architecture - cwsandbox.exceptions.CWSandboxAuthenticationError: Permission denied: W&B auth is not allowed for this sandbox operation
ERROR tests/integration/cwsandbox/test_discovery.py::TestListProfiles::test_filter_by_service_exposure_mode - cwsandbox.exceptions.CWSandboxAuthenticationError: Permission denied: W&B auth is not allowed for this sandbox operation
ERROR tests/integration/cwsandbox/test_discovery.py::TestGetProfile::test_get_existing_profile - cwsandbox.exceptions.CWSandboxAuthenticationError: Permission denied: W&B auth is not allowed for this sandbox operation
ERROR tests/integration/cwsandbox/test_discovery.py::TestListProfiles::test_profile_fields_populated - cwsandbox.exceptions.CWSandboxAuthenticationError: Permission denied: W&B auth is not allowed for this sandbox operation
ERROR tests/integration/cwsandbox/test_discovery.py::TestGetRunner::test_get_existing_runner - cwsandbox.exceptions.CWSandboxAuthenticationError: Permission denied: W&B auth is not allowed for this sandbox operation
ERROR tests/integration/cwsandbox/test_discovery.py::TestListProfiles::test_filter_by_egress_mode - cwsandbox.exceptions.CWSandboxAuthenticationError: Permission denied: W&B auth is not allowed for this sandbox operation
ERROR tests/integration/cwsandbox/test_discovery.py::TestListRunners::test_runner_fields_populated - cwsandbox.exceptions.CWSandboxAuthenticationError: Permission denied: W&B auth is not allowed for this sandbox operation
ERROR tests/integration/cwsandbox/test_discovery.py::TestListRunners::test_filter_by_profile_name - cwsandbox.exceptions.CWSandboxAuthenticationError: Permission denied: W&B auth is not allowed for this sandbox operation
ERROR tests/integration/cwsandbox/test_discovery.py::TestCrossReference::test_profile_runner_ids_exist - cwsandbox.exceptions.CWSandboxAuthenticationError: Permission denied: W&B auth is not allowed for this sandbox operation
ERROR tests/integration/cwsandbox/test_discovery.py::TestGetRunner::test_get_runner_always_has_full_details - cwsandbox.exceptions.CWSandboxAuthenticationError: Permission denied: W&B auth is not allowed for this sandbox operation
ERROR tests/integration/cwsandbox/test_discovery.py::TestListProfiles::test_filter_by_runner_id - cwsandbox.exceptions.CWSandboxAuthenticationError: Permission denied: W&B auth is not allowed for this sandbox operation
ERROR tests/integration/cwsandbox/test_discovery.py::TestGetProfile::test_get_profile_without_runner_id - cwsandbox.exceptions.CWSandboxAuthenticationError: Permission denied: W&B auth is not allowed for this sandbox operation
ERROR tests/integration/cwsandbox/test_discovery.py::TestListProfiles::test_filter_by_architecture - cwsandbox.exceptions.CWSandboxAuthenticationError: Permission denied: W&B auth is not allowed for this sandbox operation
ERROR tests/integration/cwsandbox/test_discovery.py::TestListProfiles::test_returns_profiles - cwsandbox.exceptions.CWSandboxAuthenticationError: Permission denied: W&B auth is not allowed for this sandbox operation
ERROR tests/integration/cwsandbox/test_discovery.py::TestListRunners::test_filter_by_runner_group_id - cwsandbox.exceptions.CWSandboxAuthenticationError: Permission denied: W&B auth is not allowed for this sandbox operation
ERROR tests/integration/cwsandbox/test_discovery.py::TestListRunners::test_include_resources_true - cwsandbox.exceptions.CWSandboxAuthenticationError: Permission denied: W&B auth is not allowed for this sandbox operation
ERROR tests/integration/cwsandbox/test_discovery.py::TestListRunners::test_returns_runners - cwsandbox.exceptions.CWSandboxAuthenticationError: Permission denied: W&B auth is not allowed for this sandbox operation
ERROR tests/integration/cwsandbox/test_discovery.py::TestCrossReference::test_runner_profiles_match_list_profiles - cwsandbox.exceptions.CWSandboxAuthenticationError: Permission denied: W&B auth is not allowed for this sandbox operation
ERROR tests/integration/cwsandbox/test_sandbox.py::test_sandbox_pinned_to_runner - cwsandbox.exceptions.CWSandboxAuthenticationError: Permission denied: W&B auth is not allowed for this sandbox operation
ERROR tests/integration/cwsandbox/test_sandbox.py::test_sandbox_pinned_to_profile - cwsandbox.exceptions.CWSandboxAuthenticationError: Permission denied: W&B auth is not allowed for this sandbox operation
ERROR tests/integration/cwsandbox/test_sandbox.py::test_sandbox_pinned_to_profile_and_runner - cwsandbox.exceptions.CWSandboxAuthenticationError: Permission denied: W&B auth is not allowed for this sandbox operation
========================================= 4 failed, 91 passed, 1 skipped, 22 errors in 49.73s ==========================================
CWSANDBOX_BASE_URL=http://localhost:8080 \
CWSANDBOX_API_KEY=key1 \
uv run pytest \
tests/integration/cwsandbox/test_discovery.py \
tests/integration/cwsandbox/test_sandbox.py::test_sandbox_pinned_to_profile_and_runner \
tests/integration/cwsandbox/test_sandbox.py::test_sandbox_pinned_to_profile \
tests/integration/cwsandbox/test_sandbox.py::test_sandbox_pinned_to_runner \
tests/integration/cwsandbox/test_file_system_snapshot.py \
-n 6
========================================================= test session starts ==========================================================
platform darwin -- Python 3.11.10, pytest-9.0.2, pluggy-1.6.0
rootdir: /Users/nicholaspun/Documents/cwsandbox-client
configfile: pyproject.toml
plugins: anyio-4.12.1, xdist-3.8.0, asyncio-1.3.0, dotenv-0.5.2, cov-7.0.0
asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
6 workers [29 items]    
.............................                                                                                                    [100%]
==================================================== 29 passed in 75.50s (0:01:15) =====================================================

return __version__


def set_integration_metadata(integration: str) -> None:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this going to be used by external callers like the wandb library? If so we should import it within __init__.py, like we do for set_auth_mode.

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