Skip to content

Conversation

@mrnicegyu11
Copy link
Member

What do these changes do?

Casts yarl.URL explicitly to string so that httpx can ingest it.

This fixes the following issue one hits when providing wrong registry credentials to director-v0:


           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scu/.venv/lib/python3.11/site-packages/tenacity/asyncio/__init__.py", line 111, in __call__
    do = await self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scu/.venv/lib/python3.11/site-packages/tenacity/asyncio/__init__.py", line 153, in iter
    result = await action(retry_state)
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scu/.venv/lib/python3.11/site-packages/tenacity/_utils.py", line 99, in inner
    return call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/scu/.venv/lib/python3.11/site-packages/tenacity/__init__.py", line 398, in <lambda>
    self._add_action_func(lambda rs: rs.outcome.result())
                                     ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/home/scu/.venv/lib/python3.11/site-packages/tenacity/asyncio/__init__.py", line 114, in __call__
    result = await fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scu/.venv/lib/python3.11/site-packages/simcore_service_director/registry_proxy.py", line 226, in _wait_until_registry_responsive
    await _basic_auth_registry_request(app, path="", method="HEAD", timeout=1.0)
  File "/home/scu/.venv/lib/python3.11/site-packages/simcore_service_director/registry_proxy.py", line 82, in _basic_auth_registry_request
    resp_data, resp_headers = await _auth_registry_request(
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scu/.venv/lib/python3.11/site-packages/simcore_service_director/registry_proxy.py", line 159, in _auth_registry_request
    resp_wbasic = await getattr(session, method.lower())(url, auth=auth, **kwargs)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scu/.venv/lib/python3.11/site-packages/httpx/_client.py", line 1872, in head
    return await self.request(
           ^^^^^^^^^^^^^^^^^^^
  File "/home/scu/.venv/lib/python3.11/site-packages/httpx/_client.py", line 1572, in request
    request = self.build_request(
              ^^^^^^^^^^^^^^^^^^^
  File "/home/scu/.venv/lib/python3.11/site-packages/httpx/_client.py", line 346, in build_request
    url = self._merge_url(url)
          ^^^^^^^^^^^^^^^^^^^^
  File "/home/scu/.venv/lib/python3.11/site-packages/httpx/_client.py", line 376, in _merge_url
    merge_url = URL(url)
                ^^^^^^^^
  File "/home/scu/.venv/lib/python3.11/site-packages/httpx/_urls.py", line 121, in __init__
    raise TypeError(
TypeError: Invalid type for url.  Expected str or httpx.URL, got <class 'yarl.URL'>: URL('https://registry.osparc.local/v2/')

Related issue/s

How to test

Dev-ops checklist

@mrnicegyu11 mrnicegyu11 added bug buggy, it does not work as expected a:director issue related with the director service labels Mar 7, 2025
@mrnicegyu11 mrnicegyu11 added this to the The Awakening milestone Mar 7, 2025
@mrnicegyu11 mrnicegyu11 self-assigned this Mar 7, 2025
@codecov
Copy link

codecov bot commented Mar 7, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 67.92%. Comparing base (8918afb) to head (60e0357).
Report is 1 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (8918afb) and HEAD (60e0357). Click for more details.

HEAD has 29 uploads less than BASE
Flag BASE (8918afb) HEAD (60e0357)
unittests 30 1
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #7323       +/-   ##
===========================================
- Coverage   87.22%   67.92%   -19.31%     
===========================================
  Files        1705      675     -1030     
  Lines       66246    32668    -33578     
  Branches     1124      168      -956     
===========================================
- Hits        57784    22189    -35595     
- Misses       8142    10421     +2279     
+ Partials      320       58      -262     
Flag Coverage Δ
integrationtests 65.40% <ø> (+0.06%) ⬆️
unittests 76.59% <0.00%> (-9.80%) ⬇️
Components Coverage Δ
api ∅ <ø> (∅)
pkg_aws_library ∅ <ø> (∅)
pkg_dask_task_models_library ∅ <ø> (∅)
pkg_models_library ∅ <ø> (∅)
pkg_notifications_library ∅ <ø> (∅)
pkg_postgres_database ∅ <ø> (∅)
pkg_service_integration ∅ <ø> (∅)
pkg_service_library ∅ <ø> (∅)
pkg_settings_library ∅ <ø> (∅)
pkg_simcore_sdk 77.30% <ø> (-8.16%) ⬇️
agent ∅ <ø> (∅)
api_server ∅ <ø> (∅)
autoscaling ∅ <ø> (∅)
catalog ∅ <ø> (∅)
clusters_keeper ∅ <ø> (∅)
dask_sidecar ∅ <ø> (∅)
datcore_adapter ∅ <ø> (∅)
director 76.59% <0.00%> (ø)
director_v2 78.94% <ø> (-12.36%) ⬇️
dynamic_scheduler ∅ <ø> (∅)
dynamic_sidecar 89.10% <ø> (-0.98%) ⬇️
efs_guardian ∅ <ø> (∅)
invitations ∅ <ø> (∅)
osparc_gateway_server ∅ <ø> (∅)
payments ∅ <ø> (∅)
resource_usage_tracker ∅ <ø> (∅)
storage ∅ <ø> (∅)
webclient ∅ <ø> (∅)
webserver 59.30% <ø> (-26.51%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8918afb...60e0357. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud
Copy link

@mrnicegyu11 mrnicegyu11 merged commit 755a3b2 into master Mar 14, 2025
89 of 95 checks passed
@mrnicegyu11 mrnicegyu11 deleted the 2025/fix/director-v0-url-type branch March 14, 2025 14:18
mrnicegyu11 added a commit to mrnicegyu11/osparc-simcore that referenced this pull request Mar 26, 2025
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Apr 15, 2025
56 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a:director issue related with the director service bug buggy, it does not work as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants