Skip to content

Commit b138a1b

Browse files
authored
weekly maintenance and changes on makefile recipes (#1804)
* Upgraded packages test dependencies * Drafts dockerfile to pip-compile * Updates package and tests reqs * upgrades pytest-docker and docker-compose 1.27.3 * removes depends_on since ignored when docker stack deploy * removed constraint in sidecar * Splits webserver in travis * Documented * Adds variable to service commons * common for packages * make install-* moved to common-service * Moves tests recipes to common base
1 parent 6b6b71e commit b138a1b

File tree

38 files changed

+401
-328
lines changed

38 files changed

+401
-328
lines changed

.travis.yml

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888

8989
# test python, webserver ----------------------------------------------------------------------
9090
- stage: build / unit-testing
91-
name: webserver
91+
name: webserver-isolated
9292
language: python
9393
python:
9494
- "3.6"
@@ -101,7 +101,67 @@ jobs:
101101
before_script:
102102
- unbuffer bash ci/travis/unit-testing/webserver.bash before_script
103103
script:
104-
- unbuffer bash ci/travis/unit-testing/webserver.bash script
104+
- unbuffer bash ci/travis/unit-testing/webserver.bash test_isolated
105+
after_success:
106+
- unbuffer bash ci/travis/unit-testing/webserver.bash after_success
107+
after_failure:
108+
- unbuffer bash ci/travis/unit-testing/webserver.bash after_failure
109+
110+
- stage: build / unit-testing
111+
name: webserver-with-db-slow
112+
language: python
113+
python:
114+
- "3.6"
115+
sudo: required
116+
cache: pip
117+
before_install:
118+
- sudo bash ci/travis/unit-testing/webserver.bash before_install
119+
install:
120+
- unbuffer bash ci/travis/unit-testing/webserver.bash install
121+
before_script:
122+
- unbuffer bash ci/travis/unit-testing/webserver.bash before_script
123+
script:
124+
- unbuffer bash ci/travis/unit-testing/webserver.bash test_with_db_slow
125+
after_success:
126+
- unbuffer bash ci/travis/unit-testing/webserver.bash after_success
127+
after_failure:
128+
- unbuffer bash ci/travis/unit-testing/webserver.bash after_failure
129+
130+
- stage: build / unit-testing
131+
name: webserver-with-db-medium
132+
language: python
133+
python:
134+
- "3.6"
135+
sudo: required
136+
cache: pip
137+
before_install:
138+
- sudo bash ci/travis/unit-testing/webserver.bash before_install
139+
install:
140+
- unbuffer bash ci/travis/unit-testing/webserver.bash install
141+
before_script:
142+
- unbuffer bash ci/travis/unit-testing/webserver.bash before_script
143+
script:
144+
- unbuffer bash ci/travis/unit-testing/webserver.bash test_with_db_medium
145+
after_success:
146+
- unbuffer bash ci/travis/unit-testing/webserver.bash after_success
147+
after_failure:
148+
- unbuffer bash ci/travis/unit-testing/webserver.bash after_failure
149+
150+
- stage: build / unit-testing
151+
name: webserver-with-db-fast
152+
language: python
153+
python:
154+
- "3.6"
155+
sudo: required
156+
cache: pip
157+
before_install:
158+
- sudo bash ci/travis/unit-testing/webserver.bash before_install
159+
install:
160+
- unbuffer bash ci/travis/unit-testing/webserver.bash install
161+
before_script:
162+
- unbuffer bash ci/travis/unit-testing/webserver.bash before_script
163+
script:
164+
- unbuffer bash ci/travis/unit-testing/webserver.bash test_with_db_fast
105165
after_success:
106166
- unbuffer bash ci/travis/unit-testing/webserver.bash after_success
107167
after_failure:

api/tests/requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ aiohttp==3.6.2 # via -r requirements.in, pytest-aiohttp
88
async-timeout==3.0.1 # via aiohttp
99
attrs==20.2.0 # via aiohttp, jsonschema, openapi-core, pytest
1010
chardet==3.0.4 # via aiohttp
11-
coverage==5.2.1 # via -r requirements.in, pytest-cov
11+
coverage==5.3 # via -r requirements.in, pytest-cov
1212
idna-ssl==1.1.0 # via aiohttp
1313
idna==2.10 # via idna-ssl, yarl
1414
importlib-metadata==1.7.0 # via jsonschema, pluggy, pytest
@@ -22,16 +22,16 @@ openapi-core==0.13.4 # via -r requirements.in
2222
openapi-schema-validator==0.1.1 # via openapi-core
2323
openapi-spec-validator==0.2.9 # via openapi-core
2424
packaging==20.4 # via pytest, pytest-sugar
25-
parse==1.17.0 # via openapi-core
25+
parse==1.18.0 # via openapi-core
2626
pluggy==0.13.1 # via pytest
2727
py==1.9.0 # via pytest
2828
pyparsing==2.4.7 # via packaging
29-
pyrsistent==0.16.0 # via jsonschema
29+
pyrsistent==0.17.3 # via jsonschema
3030
pytest-aiohttp==0.3.0 # via -r requirements.in
3131
pytest-cov==2.10.1 # via -r requirements.in
3232
pytest-instafail==0.4.2 # via -r requirements.in
3333
pytest-sugar==0.9.4 # via -r requirements.in
34-
pytest==6.0.1 # via -r requirements.in, pytest-aiohttp, pytest-cov, pytest-instafail, pytest-sugar
34+
pytest==6.0.2 # via -r requirements.in, pytest-aiohttp, pytest-cov, pytest-instafail, pytest-sugar
3535
pyyaml==5.3.1 # via openapi-spec-validator
3636
six==1.15.0 # via isodate, jsonschema, openapi-core, openapi-schema-validator, openapi-spec-validator, packaging
3737
strict-rfc3339==0.7 # via openapi-schema-validator

ci/github/helpers/setup_docker_compose.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ set -o pipefail # don't hide errors within pipes
66
IFS=$'\n\t'
77

88
# when changing the DOCKER_COMPOSE_VERSION please compute the sha256sum on an ubuntu box (macOS has different checksum)
9-
DOCKER_COMPOSE_VERSION="1.26.2"
10-
DOCKER_COMPOSE_SHA256SUM="13e50875393decdb047993c3c0192b0a3825613e6dfc0fa271efed4f5dbdd6eb"
9+
DOCKER_COMPOSE_VERSION="1.27.3"
10+
DOCKER_COMPOSE_SHA256SUM="92055c48e1514c0377b76ed3df87f505c50099145d86835b06fa5109811b6a83"
1111
DOCKER_COMPOSE_BIN=/usr/local/bin/docker-compose
1212
curl -L "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o $DOCKER_COMPOSE_BIN
1313
chmod +x $DOCKER_COMPOSE_BIN

ci/travis/unit-testing/webserver.bash

Lines changed: 65 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,54 +6,88 @@ IFS=$'\n\t'
66
FOLDER_CHECKS=(api/ webserver packages/ services/web .travis.yml)
77

88
before_install() {
9-
if bash ci/travis/helpers/test-for-changes.bash "${FOLDER_CHECKS[@]}";
10-
then
11-
bash ci/travis/helpers/update-docker.bash
12-
bash ci/travis/helpers/install-docker-compose.bash
13-
bash ci/helpers/show_system_versions.bash
14-
fi
9+
if bash ci/travis/helpers/test-for-changes.bash "${FOLDER_CHECKS[@]}"; then
10+
bash ci/travis/helpers/update-docker.bash
11+
bash ci/travis/helpers/install-docker-compose.bash
12+
bash ci/helpers/show_system_versions.bash
13+
fi
1514
}
1615

1716
install() {
18-
if bash ci/travis/helpers/test-for-changes.bash "${FOLDER_CHECKS[@]}";
19-
then
20-
bash ci/helpers/ensure_python_pip.bash
21-
pushd services/web/server; pip3 install -r requirements/ci.txt; popd;
22-
fi
17+
if bash ci/travis/helpers/test-for-changes.bash "${FOLDER_CHECKS[@]}"; then
18+
bash ci/helpers/ensure_python_pip.bash
19+
pushd services/web/server
20+
pip3 install -r requirements/ci.txt
21+
popd
22+
fi
2323
}
2424

2525
before_script() {
26-
if bash ci/travis/helpers/test-for-changes.bash "${FOLDER_CHECKS[@]}";
27-
then
28-
pip list -v
29-
fi
26+
if bash ci/travis/helpers/test-for-changes.bash "${FOLDER_CHECKS[@]}"; then
27+
pip list -v
28+
fi
3029
}
3130

32-
script() {
33-
if bash ci/travis/helpers/test-for-changes.bash "${FOLDER_CHECKS[@]}";
34-
then
35-
pytest --cov=simcore_service_webserver --durations=10 --cov-append \
36-
--color=yes --cov-report=term-missing --cov-report=xml --cov-config=.coveragerc \
37-
-v -m "not travis" services/web/server/tests/unit
38-
else
39-
echo "No changes detected. Skipping unit-testing of webserver."
40-
fi
31+
test_isolated() {
32+
if bash ci/travis/helpers/test-for-changes.bash "${FOLDER_CHECKS[@]}"; then
33+
34+
pytest --cov=simcore_service_webserver --durations=10 --cov-append \
35+
--color=yes --cov-report=term-missing --cov-report=xml --cov-config=.coveragerc \
36+
-v -m "not travis" services/web/server/tests/unit/isolated
37+
else
38+
echo "No changes detected. Skipping unit-testing of webserver."
39+
fi
40+
41+
}
42+
43+
test_with_db_slow() {
44+
if bash ci/travis/helpers/test-for-changes.bash "${FOLDER_CHECKS[@]}"; then
45+
46+
pytest --cov=simcore_service_webserver --durations=10 --cov-append \
47+
--color=yes --cov-report=term-missing --cov-report=xml --cov-config=.coveragerc \
48+
-v -m "not travis" services/web/server/tests/unit/with_dbs/slow
49+
else
50+
echo "No changes detected. Skipping unit-testing of webserver."
51+
fi
52+
53+
}
54+
55+
test_with_db_medium() {
56+
if bash ci/travis/helpers/test-for-changes.bash "${FOLDER_CHECKS[@]}"; then
57+
58+
pytest --cov=simcore_service_webserver --durations=10 --cov-append \
59+
--color=yes --cov-report=term-missing --cov-report=xml --cov-config=.coveragerc \
60+
-v -m "not travis" services/web/server/tests/unit/with_dbs/medium
61+
else
62+
echo "No changes detected. Skipping unit-testing of webserver."
63+
fi
64+
65+
}
66+
67+
test_with_db_fast() {
68+
if bash ci/travis/helpers/test-for-changes.bash "${FOLDER_CHECKS[@]}"; then
69+
70+
pytest --cov=simcore_service_webserver --durations=10 --cov-append \
71+
--color=yes --cov-report=term-missing --cov-report=xml --cov-config=.coveragerc \
72+
-v -m "not travis" services/web/server/tests/unit/with_dbs/fast
73+
else
74+
echo "No changes detected. Skipping unit-testing of webserver."
75+
fi
76+
4177
}
4278

4379
after_success() {
44-
if bash ci/travis/helpers/test-for-changes.bash "${FOLDER_CHECKS[@]}";
45-
then
46-
coveralls
47-
fi
80+
if bash ci/travis/helpers/test-for-changes.bash "${FOLDER_CHECKS[@]}"; then
81+
coveralls
82+
fi
4883
}
4984

5085
after_failure() {
51-
echo "failure... you can always write something more interesting here..."
86+
echo "failure... you can always write something more interesting here..."
5287
}
5388

5489
# Check if the function exists (bash specific)
55-
if declare -f "$1" > /dev/null
56-
then
90+
if declare -f "$1" >/dev/null; then
5791
# call arguments verbatim
5892
"$@"
5993
else

packages/postgres-database/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Targets for DEVELOPMENT of postgres-database
33
#
44
include ../../scripts/common.Makefile
5+
include ../../scripts/common-package.Makefile
56

67

78
.PHONY: requirements

packages/postgres-database/requirements/_migration.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# pip-compile --output-file=requirements/_migration.txt requirements/_migration.in
66
#
7-
alembic==1.4.2 # via -r requirements/_migration.in
7+
alembic==1.4.3 # via -r requirements/_migration.in
88
certifi==2020.6.20 # via requests
99
chardet==3.0.4 # via requests
1010
click==7.1.2 # via -r requirements/_migration.in

packages/postgres-database/requirements/_test.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,30 @@
66
#
77
aiohttp==3.6.2 # via pytest-aiohttp
88
aiopg[sa]==1.0.0 # via -r requirements/_test.in
9-
alembic==1.4.2 # via -r requirements/_migration.txt
9+
alembic==1.4.3 # via -r requirements/_migration.txt
1010
astroid==2.4.2 # via pylint
1111
async-timeout==3.0.1 # via aiohttp
1212
attrs==19.3.0 # via aiohttp, jsonschema, pytest, pytest-docker
1313
bcrypt==3.2.0 # via paramiko
1414
cached-property==1.5.1 # via docker-compose
1515
certifi==2020.6.20 # via -r requirements/_migration.txt, requests
16-
cffi==1.14.2 # via bcrypt, cryptography, pynacl
16+
cffi==1.14.3 # via bcrypt, cryptography, pynacl
1717
chardet==3.0.4 # via -r requirements/_migration.txt, aiohttp, requests
1818
click==7.1.2 # via -r requirements/_migration.txt
19-
coverage==5.2.1 # via -r requirements/_test.in, coveralls, pytest-cov
19+
coverage==5.3 # via -r requirements/_test.in, coveralls, pytest-cov
2020
coveralls==2.1.2 # via -r requirements/_test.in
2121
cryptography==3.1 # via paramiko
2222
distro==1.5.0 # via docker-compose
23-
docker-compose==1.26.2 # via pytest-docker
23+
docker-compose==1.27.3 # via pytest-docker
2424
docker[ssh]==4.3.1 # via -r requirements/_migration.txt, docker-compose
2525
dockerpty==0.4.1 # via docker-compose
2626
docopt==0.6.2 # via coveralls, docker-compose
27-
faker==4.1.2 # via -r requirements/_test.in
27+
faker==4.1.3 # via -r requirements/_test.in
2828
idna-ssl==1.1.0 # via aiohttp
2929
idna==2.10 # via -r requirements/_migration.txt, idna-ssl, requests, yarl
3030
importlib-metadata==1.7.0 # via jsonschema, pluggy, pytest
31-
isort==5.5.1 # via pylint
31+
iniconfig==1.0.1 # via pytest
32+
isort==5.5.3 # via pylint
3233
jsonschema==3.2.0 # via docker-compose
3334
lazy-object-proxy==1.4.3 # via astroid
3435
mako==1.1.3 # via -r requirements/_migration.txt, alembic
@@ -45,28 +46,27 @@ pycparser==2.20 # via cffi
4546
pylint==2.6.0 # via -r requirements/_test.in
4647
pynacl==1.4.0 # via paramiko
4748
pyparsing==2.4.7 # via packaging
48-
pyrsistent==0.16.0 # via jsonschema
49+
pyrsistent==0.17.3 # via jsonschema
4950
pytest-aiohttp==0.3.0 # via -r requirements/_test.in
5051
pytest-cov==2.10.1 # via -r requirements/_test.in
51-
pytest-docker==0.8.0 # via -r requirements/_test.in
52+
pytest-docker==0.10.0 # via -r requirements/_test.in
5253
pytest-instafail==0.4.2 # via -r requirements/_test.in
5354
pytest-runner==5.2 # via -r requirements/_test.in
54-
pytest==5.4.3 # via -r requirements/_test.in, pytest-aiohttp, pytest-cov, pytest-docker, pytest-instafail
55+
pytest==6.0.2 # via -r requirements/_test.in, pytest-aiohttp, pytest-cov, pytest-docker, pytest-instafail
5556
python-dateutil==2.8.1 # via -r requirements/_migration.txt, alembic, faker
5657
python-dotenv==0.14.0 # via docker-compose
5758
python-editor==1.0.4 # via -r requirements/_migration.txt, alembic
5859
pyyaml==5.3.1 # via -r requirements/_test.in, docker-compose
5960
requests==2.24.0 # via -r requirements/_migration.txt, coveralls, docker, docker-compose
60-
six==1.15.0 # via -r requirements/_migration.txt, astroid, bcrypt, cryptography, docker, docker-compose, dockerpty, jsonschema, packaging, pynacl, pyrsistent, python-dateutil, tenacity, websocket-client
61+
six==1.15.0 # via -r requirements/_migration.txt, astroid, bcrypt, cryptography, docker, dockerpty, jsonschema, packaging, pynacl, python-dateutil, tenacity, websocket-client
6162
sqlalchemy[postgresql_psycopg2binary]==1.3.19 # via -r requirements/_migration.txt, aiopg, alembic
6263
tenacity==6.2.0 # via -r requirements/_migration.txt
6364
text-unidecode==1.3 # via faker
6465
texttable==1.6.3 # via docker-compose
65-
toml==0.10.1 # via pylint
66+
toml==0.10.1 # via pylint, pytest
6667
typed-ast==1.4.1 # via astroid
6768
typing-extensions==3.7.4.3 # via -r requirements/_migration.txt, aiohttp, yarl
6869
urllib3==1.25.10 # via -r requirements/_migration.txt, requests
69-
wcwidth==0.2.5 # via pytest
7070
websocket-client==0.57.0 # via -r requirements/_migration.txt, docker, docker-compose
7171
wrapt==1.12.1 # via astroid
7272
yarl==1.5.1 # via -r requirements/_migration.txt, aiohttp

packages/s3wrapper/requirements/_test.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,21 @@ attrs==19.3.0 # via jsonschema, pytest, pytest-docker
99
bcrypt==3.2.0 # via paramiko
1010
cached-property==1.5.1 # via docker-compose
1111
certifi==2020.6.20 # via -r requirements/_base.txt, minio, requests
12-
cffi==1.14.2 # via bcrypt, cryptography, pynacl
12+
cffi==1.14.3 # via bcrypt, cryptography, pynacl
1313
chardet==3.0.4 # via requests
1414
configparser==5.0.0 # via -r requirements/_base.txt, minio
15-
coverage==5.2.1 # via -r requirements/_test.in, coveralls, pytest-cov
15+
coverage==5.3 # via -r requirements/_test.in, coveralls, pytest-cov
1616
coveralls==2.1.2 # via -r requirements/_test.in
1717
cryptography==3.1 # via paramiko
1818
distro==1.5.0 # via docker-compose
19-
docker-compose==1.26.2 # via pytest-docker
19+
docker-compose==1.27.3 # via pytest-docker
2020
docker[ssh]==4.3.1 # via docker-compose
2121
dockerpty==0.4.1 # via docker-compose
2222
docopt==0.6.2 # via coveralls, docker-compose
2323
idna==2.10 # via requests
2424
importlib-metadata==1.7.0 # via jsonschema, pluggy, pytest
25-
isort==5.5.1 # via pylint
25+
iniconfig==1.0.1 # via pytest
26+
isort==5.5.3 # via pylint
2627
jsonschema==3.2.0 # via docker-compose
2728
lazy-object-proxy==1.4.3 # via astroid
2829
mccabe==0.6.1 # via pylint
@@ -36,22 +37,21 @@ pycparser==2.20 # via cffi
3637
pylint==2.6.0 # via -r requirements/_test.in
3738
pynacl==1.4.0 # via paramiko
3839
pyparsing==2.4.7 # via packaging
39-
pyrsistent==0.16.0 # via jsonschema
40+
pyrsistent==0.17.3 # via jsonschema
4041
pytest-cov==2.10.1 # via -r requirements/_test.in
41-
pytest-docker==0.8.0 # via -r requirements/_test.in
42+
pytest-docker==0.10.0 # via -r requirements/_test.in
4243
pytest-runner==5.2 # via -r requirements/_test.in
43-
pytest==5.4.3 # via -r requirements/_test.in, pytest-cov, pytest-docker
44+
pytest==6.0.2 # via -r requirements/_test.in, pytest-cov, pytest-docker
4445
python-dateutil==2.8.1 # via -r requirements/_base.txt, minio
4546
python-dotenv==0.14.0 # via docker-compose
4647
pytz==2020.1 # via -r requirements/_base.txt, minio
4748
pyyaml==5.3.1 # via docker-compose
4849
requests==2.24.0 # via -r requirements/_test.in, coveralls, docker, docker-compose
49-
six==1.15.0 # via -r requirements/_base.txt, astroid, bcrypt, cryptography, docker, docker-compose, dockerpty, jsonschema, packaging, pynacl, pyrsistent, python-dateutil, websocket-client
50+
six==1.15.0 # via -r requirements/_base.txt, astroid, bcrypt, cryptography, docker, dockerpty, jsonschema, packaging, pynacl, python-dateutil, websocket-client
5051
texttable==1.6.3 # via docker-compose
51-
toml==0.10.1 # via pylint
52+
toml==0.10.1 # via pylint, pytest
5253
typed-ast==1.4.1 # via astroid
5354
urllib3==1.25.10 # via -r requirements/_base.txt, minio, requests
54-
wcwidth==0.2.5 # via pytest
5555
websocket-client==0.57.0 # via docker, docker-compose
5656
wrapt==1.12.1 # via astroid
5757
zipp==3.1.0 # via importlib-metadata

packages/service-library/requirements/_base.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ openapi-core==0.12.0 # via -r requirements/_base.in
2020
openapi-spec-validator==0.2.9 # via openapi-core
2121
prometheus-client==0.8.0 # via -r requirements/_base.in
2222
psycopg2-binary==2.8.6 # via -r requirements/_base.in, aiopg, sqlalchemy
23-
pyrsistent==0.16.0 # via jsonschema
23+
pyrsistent==0.17.3 # via jsonschema
2424
pyyaml==5.3.1 # via -r requirements/_base.in, openapi-spec-validator
25-
six==1.15.0 # via isodate, jsonschema, openapi-core, openapi-spec-validator, pyrsistent, tenacity
25+
six==1.15.0 # via isodate, jsonschema, openapi-core, openapi-spec-validator, tenacity
2626
sqlalchemy[postgresql_psycopg2binary]==1.3.19 # via -r requirements/_base.in, aiopg
2727
strict-rfc3339==0.7 # via openapi-core
2828
tenacity==6.2.0 # via -r requirements/_base.in
29-
trafaret==2.0.2 # via -r requirements/_base.in
30-
ujson==3.1.0 # via -r requirements/_base.in
29+
trafaret==2.1.0 # via -r requirements/_base.in
30+
typing-extensions==3.7.4.3 # via aiohttp, yarl
31+
ujson==3.2.0 # via -r requirements/_base.in
3132
werkzeug==1.0.1 # via -r requirements/_base.in
3233
yarl==1.5.1 # via aiohttp
3334

0 commit comments

Comments
 (0)