Skip to content

[bugfix] ujson missing dependency in director service #1353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ $(CLIENT_WEB_OUTPUT):
-mkdir $(if $(IS_WIN),,-p) $(CLIENT_WEB_OUTPUT)


.PHONY: shell
shell:
docker run -it local/$(target):production /bin/sh


## docker SWARM -------------------------------
#
# - All resolved configuration are named as .stack-${name}-*.yml to distinguish from docker-compose files which can be parametrized
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
[![storage]](https://microbadger.com/images/itisfoundation/storage "More on itisfoundation/storage:staging-latest image")
-->


<!-- ADD HERE ALL BADGE URLS -->
[Requires.io]:https://img.shields.io/requires/github/ITISFoundation/osparc-simcore.svg
[travis-ci]:https://travis-ci.org/ITISFoundation/osparc-simcore.svg?branch=master
Expand Down
14 changes: 8 additions & 6 deletions services/director/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,21 @@ ENV SC_BUILD_TARGET build

# Installing client libraries and any other package you need
#
# - client library for PostgreSQL https://www.postgresql.org/docs/9.5/libpq.html
# libpq: client library for PostgreSQL https://www.postgresql.org/docs/9.5/libpq.html
# libstdc++: needed in ujson https://github.com/kohlschutter/junixsocket/issues/33
#
RUN apk update && \
apk add --no-cache \
libpq
libpq \
libstdc++




# Installing build dependencies (will be deleted in production)
RUN apk add --virtual .build-deps \
git \
gcc \
g++ \
libc-dev \
python-dev \
musl-dev \
Expand Down Expand Up @@ -150,9 +155,6 @@ FROM build as development
ENV SC_BUILD_TARGET development


# WORKDIR /build
# NOTE: can copy from /build if necessary

WORKDIR /devel
VOLUME /devel/packages
VOLUME /devel/services/director/
Expand Down
4 changes: 4 additions & 0 deletions services/director/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ build: openapi-specs ## builds docker image (using main services/docker-compose-
@$(MAKE) -C ${REPO_BASE_DIR} target=${APP_NAME} $@


.PHONY: shell
shell: ## runs shell in production container
@$(MAKE) --directory ${REPO_BASE_DIR} $@ target=${APP_NAME}

.PHONY: version-patch version-minor
version-patch version-minor: ## commits version as patch (bug fixes not affecting the API), minor/minor (backwards-compatible/INcompatible API addition or changes)
# upgrades as $(subst version-,,$@) version, commits and tags
Expand Down
26 changes: 26 additions & 0 deletions tests/swarm-deploy/test_service_images.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name

import subprocess
from typing import Dict
import pytest


# search ujson in all _base.txt and add here all services that contains it
@pytest.mark.parametrize("service", [
'director',
'webserver',
'storage',
'catalog'
])
def test_ujson_installation(service:str, osparc_deploy: Dict):
# tets failing installation undetected
# and fixed in PR https://github.com/ITISFoundation/osparc-simcore/pull/1353
image_name = osparc_deploy['simcore']['services'][service]['image']

assert subprocess.run(
f'docker run -t --rm {image_name} python -c "import ujson; print(ujson.__version__)"',
shell=True,
check=True,
)