Skip to content

Commit ac51c73

Browse files
authored
[bugfix] ujson missing dependency in director service (#1353)
* fixes ujson missing dependency * adds target to access shell * Fixes ujson missing dependency * Adds shell access for manual testing * Adds minimal testing to avoid ujson to fail again * Moved docker test to system * Refactor test_service_images Uses osparc_deploy fixture * Refined test_ujson_installation
1 parent a056bd2 commit ac51c73

File tree

5 files changed

+44
-6
lines changed

5 files changed

+44
-6
lines changed

Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ $(CLIENT_WEB_OUTPUT):
126126
-mkdir $(if $(IS_WIN),,-p) $(CLIENT_WEB_OUTPUT)
127127

128128

129+
.PHONY: shell
130+
shell:
131+
docker run -it local/$(target):production /bin/sh
132+
133+
129134
## docker SWARM -------------------------------
130135
#
131136
# - All resolved configuration are named as .stack-${name}-*.yml to distinguish from docker-compose files which can be parametrized

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
[![storage]](https://microbadger.com/images/itisfoundation/storage "More on itisfoundation/storage:staging-latest image")
1919
-->
2020

21+
2122
<!-- ADD HERE ALL BADGE URLS -->
2223
[Requires.io]:https://img.shields.io/requires/github/ITISFoundation/osparc-simcore.svg
2324
[travis-ci]:https://travis-ci.org/ITISFoundation/osparc-simcore.svg?branch=master

services/director/Dockerfile

+8-6
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,21 @@ ENV SC_BUILD_TARGET build
4747

4848
# Installing client libraries and any other package you need
4949
#
50-
# - client library for PostgreSQL https://www.postgresql.org/docs/9.5/libpq.html
50+
# libpq: client library for PostgreSQL https://www.postgresql.org/docs/9.5/libpq.html
51+
# libstdc++: needed in ujson https://github.com/kohlschutter/junixsocket/issues/33
5152
#
5253
RUN apk update && \
5354
apk add --no-cache \
54-
libpq
55+
libpq \
56+
libstdc++
57+
58+
59+
5560

5661
# Installing build dependencies (will be deleted in production)
5762
RUN apk add --virtual .build-deps \
5863
git \
59-
gcc \
64+
g++ \
6065
libc-dev \
6166
python-dev \
6267
musl-dev \
@@ -150,9 +155,6 @@ FROM build as development
150155
ENV SC_BUILD_TARGET development
151156

152157

153-
# WORKDIR /build
154-
# NOTE: can copy from /build if necessary
155-
156158
WORKDIR /devel
157159
VOLUME /devel/packages
158160
VOLUME /devel/services/director/

services/director/Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ build: openapi-specs ## builds docker image (using main services/docker-compose-
3434
@$(MAKE) -C ${REPO_BASE_DIR} target=${APP_NAME} $@
3535

3636

37+
.PHONY: shell
38+
shell: ## runs shell in production container
39+
@$(MAKE) --directory ${REPO_BASE_DIR} $@ target=${APP_NAME}
40+
3741
.PHONY: version-patch version-minor
3842
version-patch version-minor: ## commits version as patch (bug fixes not affecting the API), minor/minor (backwards-compatible/INcompatible API addition or changes)
3943
# upgrades as $(subst version-,,$@) version, commits and tags
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# pylint:disable=unused-variable
2+
# pylint:disable=unused-argument
3+
# pylint:disable=redefined-outer-name
4+
5+
import subprocess
6+
from typing import Dict
7+
import pytest
8+
9+
10+
# search ujson in all _base.txt and add here all services that contains it
11+
@pytest.mark.parametrize("service", [
12+
'director',
13+
'webserver',
14+
'storage',
15+
'catalog'
16+
])
17+
def test_ujson_installation(service:str, osparc_deploy: Dict):
18+
# tets failing installation undetected
19+
# and fixed in PR https://github.com/ITISFoundation/osparc-simcore/pull/1353
20+
image_name = osparc_deploy['simcore']['services'][service]['image']
21+
22+
assert subprocess.run(
23+
f'docker run -t --rm {image_name} python -c "import ujson; print(ujson.__version__)"',
24+
shell=True,
25+
check=True,
26+
)

0 commit comments

Comments
 (0)