Skip to content

Commit acf3f6d

Browse files
authored
Fix/catalog service request non-responsive (#1846)
Should fix non-responsive catalog service observed in staging environment. Catalog service retrieval is very time consuming. Multiple requests might collapse the service that blocks because it cannot acquire new db connections * Handles cancellation errors in catalog submodule at the webserver * increases number of pool connections in the catalog service and logs acquire and release of db connections * make product header required * Fixes stop order in catalog service In addition: * Adds models-lib soft reqs to catalog and webserver * Adds exclude __pycache__ in vscode settings * skips monitoring socket io * BooModeEnum renamed entries * added more integration tests to avoid error run * Minor fixes and renamed catalog extra dc * fixes lint errors by hadolint * Probably fixes random failure in CI int sidecar: https://github.com/ITISFoundation/osparc-simcore/runs/1210324772#step:9:614 * Set extra as local:production and update OAS doc * Upgraded ALL isort to 5.5.4 * upgrades isort and pylint in director service
1 parent a0c0cec commit acf3f6d

File tree

39 files changed

+422
-215
lines changed

39 files changed

+422
-215
lines changed

.vscode/settings.template.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
"*Makefile": "makefile"
1414
},
1515
"files.eol": "\n",
16+
"files.exclude": {
17+
"**/__pycache__": true
18+
},
1619
"files.insertFinalNewline": true,
1720
"files.trimFinalNewlines": true,
1821
"files.trimTrailingWhitespace": true,

docs/releasing-workflow-instructions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Once ready, the release-hotfix process starts by leveraging *Github* release me
116116

117117
Each docker build marked as released are tagged as described in the Release process.
118118

119-
see ![img/git-release-workflow.svg](img/git-release-workflow.svg)
119+
See ![img/git-release-workflow.svg](img/git-release-workflow.svg)
120120

121121
### Hotfix example
122122

@@ -141,4 +141,4 @@ A bug was found in version 1.2.0 of the simcore stack. The team decides to fix i
141141
3. Press the **Publish release** button
142142
4. The CI will be automatically triggered and will deploy the staging release
143143

144-
see ![img/git-hotfix-workflow.svg](img/git-hotfix-workflow.svg)
144+
See ![img/git-hotfix-workflow.svg](img/git-hotfix-workflow.svg)

packages/postgres-database/docker/Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,16 @@ ENV PATH="${VIRTUAL_ENV}/bin:$PATH"
1414

1515
FROM base as build
1616

17-
RUN apt-get update &&\
18-
apt-get install -y --no-install-recommends \
19-
build-essential \
20-
git
17+
RUN apt-get update \
18+
&& apt-get install -y --no-install-recommends \
19+
build-essential \
20+
git \
21+
&& apt-get clean \
22+
&& rm -rf /var/lib/apt/lists/*
23+
2124

2225
# NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv
23-
RUN python -m venv ${VIRTUAL_ENV}
26+
RUN python -m venv "${VIRTUAL_ENV}"
2427

2528
RUN pip --no-cache-dir install --upgrade \
2629
pip~=20.2.2 \

packages/postgres-database/requirements/_test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ idna-ssl==1.1.0 # via aiohttp
2929
idna==2.10 # via -r requirements/_migration.txt, idna-ssl, requests, yarl
3030
importlib-metadata==2.0.0 # via jsonschema, pluggy, pytest
3131
iniconfig==1.0.1 # via pytest
32-
isort==5.5.3 # via pylint
32+
isort==5.5.4 # via pylint
3333
jsonschema==3.2.0 # via docker-compose
3434
lazy-object-proxy==1.4.3 # via astroid
3535
mako==1.1.3 # via -r requirements/_migration.txt, alembic

packages/pytest-simcore/src/pytest_simcore/rabbit_service.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44

55
import os
66
import socket
7-
from typing import Dict, Optional, Tuple
7+
from typing import Any, Dict, Optional, Tuple
88

99
import aio_pika
1010
import pytest
1111
import tenacity
12-
1312
from servicelib.rabbitmq_utils import RabbitMQRetryPolicyUponInitialization
1413
from simcore_sdk.config.rabbit import Config
1514

@@ -54,7 +53,8 @@ def reconnect_callback():
5453
pytest.fail("rabbit reconnected")
5554

5655
# create connection
57-
# NOTE: to show the connection name in the rabbitMQ UI see there [https://www.bountysource.com/issues/89342433-setting-custom-connection-name-via-client_properties-doesn-t-work-when-connecting-using-an-amqp-url]
56+
# NOTE: to show the connection name in the rabbitMQ UI see there
57+
# https://www.bountysource.com/issues/89342433-setting-custom-connection-name-via-client_properties-doesn-t-work-when-connecting-using-an-amqp-url
5858
connection = await aio_pika.connect_robust(
5959
rabbit_service + f"?name={__name__}_{id(socket.gethostname())}",
6060
client_properties={"connection_name": "pytest read connection"},
@@ -73,9 +73,11 @@ def reconnect_callback():
7373
async def rabbit_channel(
7474
rabbit_connection: aio_pika.RobustConnection,
7575
) -> aio_pika.Channel:
76-
def channel_close_callback(exc: Optional[BaseException]):
76+
def channel_close_callback(sender: Any, exc: Optional[BaseException] = None):
7777
if exc:
7878
pytest.fail("rabbit channel closed!")
79+
else:
80+
print("sender was %s", sender)
7981

8082
# create channel
8183
channel = await rabbit_connection.channel()

packages/s3wrapper/requirements/_test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ docopt==0.6.2 # via coveralls, docker-compose
2323
idna==2.10 # via requests
2424
importlib-metadata==2.0.0 # via jsonschema, pluggy, pytest
2525
iniconfig==1.0.1 # via pytest
26-
isort==5.5.3 # via pylint
26+
isort==5.5.4 # via pylint
2727
jsonschema==3.2.0 # via docker-compose
2828
lazy-object-proxy==1.4.3 # via astroid
2929
mccabe==0.6.1 # via pylint

packages/service-library/requirements/_test.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ docker-compose==1.27.4 # via pytest-docker
2424
docker[ssh]==4.3.1 # via docker-compose
2525
dockerpty==0.4.1 # via docker-compose
2626
docopt==0.6.2 # via coveralls, docker-compose
27-
idna-ssl==1.1.0 # via -r requirements/_base.txt
27+
idna-ssl==1.1.0 # via -r requirements/_base.txt, aiohttp
2828
idna==2.10 # via -r requirements/_base.txt, idna-ssl, requests, yarl
29-
importlib-metadata==2.0.0 # via -r requirements/_base.txt
29+
importlib-metadata==2.0.0 # via -r requirements/_base.txt, jsonschema, pluggy, pytest
3030
iniconfig==1.0.1 # via pytest
3131
isodate==0.6.0 # via -r requirements/_base.txt, openapi-core
3232
isort==5.5.4 # via pylint
@@ -66,7 +66,8 @@ termcolor==1.1.0 # via pytest-sugar
6666
texttable==1.6.3 # via docker-compose
6767
toml==0.10.1 # via pylint, pytest
6868
trafaret==2.1.0 # via -r requirements/_base.txt
69-
typing-extensions==3.7.4.3 # via -r requirements/_base.txt
69+
typed-ast==1.4.1 # via astroid
70+
typing-extensions==3.7.4.3 # via -r requirements/_base.txt, aiohttp, yarl
7071
ujson==3.2.0 # via -r requirements/_base.txt
7172
urllib3==1.25.10 # via requests
7273
websocket-client==0.57.0 # via docker, docker-compose

packages/simcore-sdk/requirements/_test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ idna-ssl==1.1.0 # via -r requirements/_base.txt, aiohttp
2929
idna==2.10 # via -r requirements/_base.txt, idna-ssl, requests, yarl
3030
importlib-metadata==2.0.0 # via jsonschema, pluggy, pytest
3131
iniconfig==1.0.1 # via pytest
32-
isort==5.5.3 # via pylint
32+
isort==5.5.4 # via pylint
3333
jsonschema==3.2.0 # via docker-compose
3434
lazy-object-proxy==1.4.3 # via astroid
3535
mccabe==0.6.1 # via pylint

requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@
1515

1616
# formatter
1717
black
18-
isort>=4.2.5,<6 # pylint==2.5.3 constraints isort [required: >=4.2.5,<5, installed: 4.3.21]
18+
isort
1919
# dependency manager
2020
pip-tools
2121
# version manager
2222
bump2version
2323
# renaming
2424
rope
25-

services/api-server/Dockerfile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,18 @@ FROM base as build
5555

5656
ENV SC_BUILD_TARGET=build
5757

58-
RUN apt-get update &&\
59-
apt-get install -y --no-install-recommends \
60-
build-essential
58+
RUN apt-get update \
59+
&& apt-get install -y --no-install-recommends \
60+
build-essential \
61+
&& apt-get clean \
62+
&& rm -rf /var/lib/apt/lists/*
63+
6164

6265
# NOTE: python virtualenv is used here such that installed
6366
# packages may be moved to production image easily by copying the venv
64-
RUN python -m venv ${VIRTUAL_ENV}
67+
RUN python -m venv "${VIRTUAL_ENV}"
6568

66-
RUN pip install --upgrade --no-cache-dir \
69+
RUN pip install --no-cache-dir --upgrade \
6770
pip~=20.2.2 \
6871
wheel \
6972
setuptools
@@ -142,7 +145,7 @@ ENV SC_BUILD_TARGET=development
142145

143146
WORKDIR /devel
144147

145-
RUN chown -R scu:scu ${VIRTUAL_ENV}
148+
RUN chown -R scu:scu "${VIRTUAL_ENV}"
146149

147150
ENTRYPOINT ["/bin/sh", "services/api-server/docker/entrypoint.sh"]
148151
CMD ["/bin/sh", "services/api-server/docker/boot.sh"]

0 commit comments

Comments
 (0)