Skip to content

Commit 8b2e65c

Browse files
committed
Merge branch 'extract-celery-code' of github.com:giancarloromeo/osparc-simcore into extract-celery-code
2 parents f27e9ad + 2c065f7 commit 8b2e65c

File tree

49 files changed

+190
-93
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+190
-93
lines changed

api/tests/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
aiohappyeyeballs==2.6.1
22
# via aiohttp
3-
aiohttp==3.12.7
3+
aiohttp==3.11.18
44
# via
55
# -c ../../requirements/constraints.txt
66
# -r requirements.in

ci/helpers/requirements/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
aiohappyeyeballs==2.6.1
22
# via aiohttp
3-
aiohttp==3.12.7
3+
aiohttp==3.11.18
44
# via
55
# -c requirements/../../../requirements/constraints.txt
66
# -r requirements/requirements.in

packages/aws-library/requirements/_base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ aiofiles==24.1.0
1818
# aioboto3
1919
aiohappyeyeballs==2.6.1
2020
# via aiohttp
21-
aiohttp==3.12.7
21+
aiohttp==3.11.18
2222
# via
2323
# -c requirements/../../../packages/common-library/requirements/../../../requirements/constraints.txt
2424
# -c requirements/../../../packages/models-library/requirements/../../../packages/common-library/requirements/../../../requirements/constraints.txt

packages/notifications-library/requirements/_test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ aiodocker==0.24.0
22
# via -r requirements/_test.in
33
aiohappyeyeballs==2.6.1
44
# via aiohttp
5-
aiohttp==3.12.7
5+
aiohttp==3.11.18
66
# via
77
# -c requirements/../../../requirements/constraints.txt
88
# aiodocker

packages/service-library/requirements/_aiohttp.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
aiohappyeyeballs==2.6.1
22
# via aiohttp
3-
aiohttp==3.12.7
3+
aiohttp==3.11.18
44
# via -r requirements/_aiohttp.in
55
aiopg==1.4.0
66
# via -r requirements/_aiohttp.in

packages/service-library/requirements/_base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ aiofiles==24.1.0
1010
# via -r requirements/_base.in
1111
aiohappyeyeballs==2.6.1
1212
# via aiohttp
13-
aiohttp==3.12.7
13+
aiohttp==3.11.18
1414
# via
1515
# -c requirements/../../../packages/common-library/requirements/../../../requirements/constraints.txt
1616
# -c requirements/../../../packages/models-library/requirements/../../../packages/common-library/requirements/../../../requirements/constraints.txt

packages/service-library/requirements/_test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ aiohappyeyeballs==2.6.1
33
# -c requirements/_aiohttp.txt
44
# -c requirements/_base.txt
55
# aiohttp
6-
aiohttp==3.12.7
6+
aiohttp==3.11.18
77
# via
88
# -c requirements/../../../requirements/constraints.txt
99
# -c requirements/_aiohttp.txt

packages/simcore-sdk/requirements/_base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ aiofiles==24.1.0
1414
# -r requirements/_base.in
1515
aiohappyeyeballs==2.6.1
1616
# via aiohttp
17-
aiohttp==3.12.7
17+
aiohttp==3.11.18
1818
# via
1919
# -c requirements/../../../packages/common-library/requirements/../../../requirements/constraints.txt
2020
# -c requirements/../../../packages/models-library/requirements/../../../packages/common-library/requirements/../../../requirements/constraints.txt

packages/simcore-sdk/requirements/_test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ aiohappyeyeballs==2.6.1
1010
# via
1111
# -c requirements/_base.txt
1212
# aiohttp
13-
aiohttp==3.12.7
13+
aiohttp==3.11.18
1414
# via
1515
# -c requirements/../../../requirements/constraints.txt
1616
# -c requirements/_base.txt

packages/simcore-sdk/src/simcore_sdk/node_ports_common/file_io_utils.py

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from aiohttp import (
1111
ClientConnectionError,
1212
ClientError,
13+
ClientPayloadError,
1314
ClientResponse,
1415
ClientResponseError,
1516
ClientSession,
@@ -31,11 +32,7 @@
3132
from tenacity.after import after_log
3233
from tenacity.asyncio import AsyncRetrying
3334
from tenacity.before_sleep import before_sleep_log
34-
from tenacity.retry import (
35-
retry_if_exception,
36-
retry_if_exception_type,
37-
retry_if_not_exception_type,
38-
)
35+
from tenacity.retry import retry_if_exception, retry_if_exception_type
3936
from tenacity.stop import stop_after_attempt
4037
from tenacity.wait import wait_exponential
4138
from tqdm import tqdm
@@ -157,7 +154,7 @@ async def _file_chunk_writer(
157154
progress_bar: ProgressBarData,
158155
):
159156
async with aiofiles.open(file, "wb") as file_pointer:
160-
async for chunk in response.content.iter_chunked(CHUNK_SIZE):
157+
while chunk := await response.content.read(CHUNK_SIZE):
161158
await file_pointer.write(chunk)
162159
if io_log_redirect_cb and pbar.update(len(chunk)):
163160
with log_catch(_logger, reraise=False):
@@ -184,28 +181,25 @@ async def download_link_to_file(
184181
progress_bar: ProgressBarData,
185182
):
186183
_logger.debug("Downloading from %s to %s", url, file_path)
187-
try:
188-
async for attempt in AsyncRetrying(
189-
reraise=True,
190-
wait=wait_exponential(min=1, max=10),
191-
stop=stop_after_attempt(num_retries),
192-
retry=retry_if_not_exception_type(
193-
(exceptions.InvalidDownloadLinkError, exceptions.TransferError)
194-
),
195-
before_sleep=before_sleep_log(_logger, logging.WARNING, exc_info=True),
196-
after=after_log(_logger, log_level=logging.ERROR),
197-
):
198-
with attempt:
199-
async with AsyncExitStack() as stack:
200-
response = await stack.enter_async_context(session.get(url))
201-
if response.status == status.HTTP_404_NOT_FOUND:
202-
raise exceptions.InvalidDownloadLinkError(url)
203-
if response.status > _VALID_HTTP_STATUS_CODES:
204-
raise exceptions.TransferError(url)
205-
file_path.parent.mkdir(parents=True, exist_ok=True)
206-
# SEE https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Length
207-
file_size = int(response.headers.get("Content-Length", 0)) or None
208-
184+
async for attempt in AsyncRetrying(
185+
reraise=True,
186+
wait=wait_exponential(min=1, max=10),
187+
stop=stop_after_attempt(num_retries),
188+
retry=retry_if_exception_type(ClientConnectionError),
189+
before_sleep=before_sleep_log(_logger, logging.WARNING, exc_info=True),
190+
after=after_log(_logger, log_level=logging.ERROR),
191+
):
192+
with attempt:
193+
async with AsyncExitStack() as stack:
194+
response = await stack.enter_async_context(session.get(url))
195+
if response.status == status.HTTP_404_NOT_FOUND:
196+
raise exceptions.InvalidDownloadLinkError(url)
197+
if response.status > _VALID_HTTP_STATUS_CODES:
198+
raise exceptions.TransferError(url)
199+
file_path.parent.mkdir(parents=True, exist_ok=True)
200+
# SEE https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Length
201+
file_size = int(response.headers.get("Content-Length", 0)) or None
202+
try:
209203
tqdm_progress = stack.enter_context(
210204
tqdm_logging_redirect(
211205
desc=f"downloading {url.path} --> {file_path.name}\n",
@@ -237,8 +231,8 @@ async def download_link_to_file(
237231
sub_progress,
238232
)
239233
_logger.debug("Download complete")
240-
except Exception as exc:
241-
raise exceptions.TransferError(url) from exc
234+
except ClientPayloadError as exc:
235+
raise exceptions.TransferError(url) from exc
242236

243237

244238
def _check_for_aws_http_errors(exc: BaseException) -> bool:

0 commit comments

Comments
 (0)