Skip to content

Commit 3a3a12a

Browse files
authored
Merge branch 'master' into feature/listen-to-ports
2 parents a26c99b + 2e1f0ec commit 3a3a12a

File tree

51 files changed

+406
-335
lines changed

Some content is hidden

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

51 files changed

+406
-335
lines changed

Makefile

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -685,9 +685,9 @@ info-registry: ## info on local registry (if any)
685685

686686
## INFO -------------------------------
687687

688-
.PHONY: info info-images info-swarm info-tools
688+
.PHONY: info info-images info-swarm
689689
info: ## displays setup information
690-
# setup info:
690+
@echo setup info --------------------------------
691691
@echo ' Detected OS : $(IS_LINUX)$(IS_OSX)$(IS_WSL)$(IS_WSL2)$(IS_WIN)'
692692
@echo ' SWARM_STACK_NAME : ${SWARM_STACK_NAME}'
693693
@echo ' DOCKER_REGISTRY : $(DOCKER_REGISTRY)'
@@ -697,19 +697,23 @@ info: ## displays setup information
697697
@echo ' - ULR : ${VCS_URL}'
698698
@echo ' - REF : ${VCS_REF}'
699699
@echo ' - (STATUS)REF_CLIENT : (${VCS_STATUS_CLIENT}) ${VCS_REF_CLIENT}'
700-
@echo ' DIRECTOR_API_VERSION : ${DIRECTOR_API_VERSION}'
701-
@echo ' STORAGE_API_VERSION : ${STORAGE_API_VERSION}'
702-
@echo ' DATCORE_ADAPTER_API_VERSION : ${DATCORE_ADAPTER_API_VERSION}'
703-
@echo ' WEBSERVER_API_VERSION : ${WEBSERVER_API_VERSION}'
704-
# dev tools version
705-
@echo ' make : $(shell make --version 2>&1 | head -n 1)'
706-
@echo ' jq : $(shell jq --version)'
700+
@make --silent info-tools
701+
702+
703+
.PHONY: show-tools
704+
info-tools: ## displays tools versions
705+
@echo dev-tools versions -------------------------
707706
@echo ' awk : $(shell awk -W version 2>&1 | head -n 1)'
708-
@echo ' python : $(shell python3 --version)'
709-
@echo ' node : $(shell node --version 2> /dev/null || echo ERROR nodejs missing)'
710707
@echo ' docker : $(shell docker --version)'
711708
@echo ' docker buildx : $(shell docker buildx version)'
712709
@echo ' docker compose: $(shell docker compose version)'
710+
@echo ' jq : $(shell jq --version)'
711+
@echo ' make : $(shell make --version 2>&1 | head -n 1)'
712+
@echo ' node : $(shell node --version 2> /dev/null || echo ERROR nodejs missing)'
713+
@echo ' python : $(shell python3 --version)'
714+
@echo ' uv : $(shell uv --version 2> /dev/null || echo ERROR uv missing)'
715+
@echo ' ubuntu : $(shell lsb_release --description --short 2> /dev/null | tail || echo ERROR Not an Ubuntu OS )'
716+
713717

714718

715719
define show-meta

packages/aws-library/requirements/_base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ pyyaml==6.0.2
210210
# -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt
211211
# -c requirements/../../../requirements/constraints.txt
212212
# -r requirements/../../../packages/service-library/requirements/_base.in
213-
redis==5.0.8
213+
redis==5.0.4
214214
# via
215215
# -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt
216216
# -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt

packages/postgres-database/docker/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# syntax=docker/dockerfile:1
2-
FROM python:3.6-slim as base
2+
FROM python:3.6-slim AS base
33

44
LABEL maintainer=sanderegg
55

@@ -13,7 +13,7 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
1313
ENV PATH="${VIRTUAL_ENV}/bin:$PATH"
1414

1515

16-
FROM base as build
16+
FROM base AS build
1717

1818
RUN apt-get update \
1919
&& apt-get install -y --no-install-recommends \
@@ -41,7 +41,7 @@ ARG GIT_REPOSITORY
4141
RUN git clone --single-branch --branch ${GIT_BRANCH} ${GIT_REPOSITORY} osparc-simcore\
4242
&& uv pip install osparc-simcore/packages/postgres-database[migration]
4343

44-
FROM base as production
44+
FROM base AS production
4545

4646
ENV PYTHONOPTIMIZE=TRUE
4747

packages/postgres-database/scripts/erd/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:1
22
ARG PYTHON_VERSION="3.11.9"
3-
FROM python:${PYTHON_VERSION}-slim-bookworm as base
3+
FROM python:${PYTHON_VERSION}-slim-bookworm AS base
44

55
RUN apt-get update \
66
&& apt-get -y install --no-install-recommends\

packages/service-integration/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:1
22
ARG PYTHON_VERSION="3.11.9"
3-
FROM python:${PYTHON_VERSION}-slim-bookworm as base
3+
FROM python:${PYTHON_VERSION}-slim-bookworm AS base
44

55
LABEL maintainer=pcrespov
66

@@ -46,7 +46,7 @@ ENV PATH="${VIRTUAL_ENV}/bin:$PATH"
4646

4747
# -------------------------- Build stage -------------------
4848

49-
FROM base as build
49+
FROM base AS build
5050

5151
RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \
5252
--mount=type=cache,target=/var/lib/apt,mode=0755,sharing=private \
@@ -82,9 +82,9 @@ RUN \
8282

8383
# -------------------------- Build stage -------------------
8484

85-
FROM base as development
85+
FROM base AS development
8686
# NOTE: this is necessary to allow to build development images but is the same as production here
87-
FROM base as production
87+
FROM base AS production
8888

8989
ENV PYTHONOPTIMIZE=TRUE
9090

packages/service-library/requirements/_base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ pyyaml==6.0.2
161161
# -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt
162162
# -c requirements/../../../requirements/constraints.txt
163163
# -r requirements/_base.in
164-
redis==5.0.8
164+
redis==5.0.4
165165
# via
166166
# -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt
167167
# -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt

packages/service-library/src/servicelib/aiohttp/tracing.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
from opentelemetry.instrumentation.aiohttp_client import ( # pylint:disable=no-name-in-module
1313
AioHttpClientInstrumentor,
1414
)
15-
from opentelemetry.instrumentation.aiohttp_server import ( # pylint:disable=no-name-in-module
16-
AioHttpServerInstrumentor,
15+
from opentelemetry.instrumentation.aiohttp_server import (
16+
middleware as aiohttp_server_opentelemetry_middleware, # pylint:disable=no-name-in-module
1717
)
1818
from opentelemetry.instrumentation.aiopg import ( # pylint:disable=no-name-in-module
1919
AiopgInstrumentor,
@@ -72,8 +72,24 @@ def setup_tracing(
7272

7373
# Add the span processor to the tracer provider
7474
tracer_provider.add_span_processor(BatchSpanProcessor(otlp_exporter)) # type: ignore[attr-defined] # https://github.com/open-telemetry/opentelemetry-python/issues/3713
75-
# Instrument aiohttp server and client
76-
AioHttpServerInstrumentor().instrument()
75+
# Instrument aiohttp server
76+
# Explanation for custom middleware call DK 10/2024:
77+
# OpenTelemetry Aiohttp autoinstrumentation is meant to be used by only calling `AioHttpServerInstrumentor().instrument()`
78+
# The call `AioHttpServerInstrumentor().instrument()` monkeypatches the __init__() of aiohttp's web.application() to inject the tracing middleware, in it's `__init__()`.
79+
# In simcore, we want to switch tracing on or off using the simcore-settings-library.
80+
# The simcore-settings library in turn depends on the instance of web.application(), i.e. the aiohttp webserver, to exist. So here we face a hen-and-egg problem.
81+
# At the time when the instrumentation should be configured, the instance of web.application already exists and the overwrite to the __init__() is never called
82+
#
83+
# Since the code that is provided (monkeypatched) in the __init__ that the opentelemetry-autoinstrumentation-library provides is only 4 lines,
84+
# just adding a middleware, we are free to simply execute this "missed call" [since we can't call the monkeypatch'ed __init__()] in this following line:
85+
app.middlewares.insert(0, aiohttp_server_opentelemetry_middleware)
86+
# Code of the aiohttp server instrumentation: github.com/open-telemetry/opentelemetry-python-contrib/blob/eccb05c808a7d797ef5b6ecefed3590664426fbf/instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/__init__.py#L246
87+
# For reference, the above statement was written for:
88+
# - osparc-simcore 1.77.x
89+
# - opentelemetry-api==1.27.0
90+
# - opentelemetry-instrumentation==0.48b0
91+
92+
# Instrument aiohttp client
7793
AioHttpClientInstrumentor().instrument()
7894
if instrument_aiopg:
7995
AiopgInstrumentor().instrument()

packages/simcore-sdk/requirements/_base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ pyyaml==6.0.2
232232
# -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt
233233
# -c requirements/../../../requirements/constraints.txt
234234
# -r requirements/../../../packages/service-library/requirements/_base.in
235-
redis==5.0.8
235+
redis==5.0.4
236236
# via
237237
# -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt
238238
# -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt

requirements/tools/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#
1010
#
1111
ARG PYTHON_VERSION="3.11.9"
12-
FROM python:${PYTHON_VERSION}-slim-bookworm as base
12+
FROM python:${PYTHON_VERSION}-slim-bookworm AS base
1313

1414
ENV VIRTUAL_ENV=/home/scu/.venv
1515

scripts/apt-packages-versions/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:1
22
ARG PYTHON_VERSION="3.11.9"
3-
FROM python:${PYTHON_VERSION}-slim-bookworm as base
3+
FROM python:${PYTHON_VERSION}-slim-bookworm AS base
44

55
RUN \
66
apt-get update && \

0 commit comments

Comments
 (0)