Skip to content

Commit 294611d

Browse files
authored
Maintenance/upgrades and tooling (#1546)
* script to create invitations * ujson 2.0.3 -> 3.0.0 in ALL packages * Upgrades webserver * Upgrades packages * Autoformats web-server
1 parent 1b7a47e commit 294611d

Some content is hidden

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

65 files changed

+277
-250
lines changed

Makefile

+59-48
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
# - In windows, only WSL is supported
77
#
88
# by sanderegg, pcrespov
9+
#
910
.DEFAULT_GOAL := help
10-
SHELL := /bin/bash
1111

12+
SHELL := /bin/bash
1213

13-
# TOOLS --------------------------------------
1414

1515
MAKE_C := $(MAKE) --no-print-directory --directory
1616

@@ -60,7 +60,9 @@ export SWARM_STACK_NAME ?= simcore
6060
export DOCKER_IMAGE_TAG ?= latest
6161
export DOCKER_REGISTRY ?= itisfoundation
6262

63+
6364
.PHONY: help
65+
6466
help: ## help on rule's targets
6567
ifeq ($(IS_WIN),)
6668
@awk --posix 'BEGIN {FS = ":.*?## "} /^[[:alpha:][:space:]_-]+:.*?## / {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
@@ -70,7 +72,7 @@ endif
7072

7173

7274

73-
## docker BUILD -------------------------------
75+
## DOCKER BUILD -------------------------------
7476
#
7577
# - all builds are inmediatly tagged as 'local/{service}:${BUILD_TARGET}' where BUILD_TARGET='development', 'production', 'cache'
7678
# - only production and cache images are released (i.e. tagged pushed into registry)
@@ -127,7 +129,6 @@ endif
127129
endif
128130

129131

130-
# TODO: should download cache if any??
131132
build-cache build-cache-nc build-cache-kit build-cache-x: .env ## Build cache images and tags them as 'local/{service-name}:cache'
132133
ifeq ($(target),)
133134
# Compiling front-end
@@ -152,7 +153,7 @@ shell:
152153
docker run -it local/$(target):production /bin/sh
153154

154155

155-
## docker SWARM -------------------------------
156+
## DOCKER SWARM -------------------------------
156157
#
157158
# - All resolved configuration are named as .stack-${name}-*.yml to distinguish from docker-compose files which can be parametrized
158159
#
@@ -179,6 +180,7 @@ docker-compose-configs = $(wildcard services/docker-compose*.yml)
179180
# Creating config for ops stack to $@
180181
@docker-compose -f services/docker-compose-ops.yml --log-level=ERROR config > $@
181182

183+
182184
.PHONY: up-devel up-prod up-version up-latest .deploy-ops
183185

184186
.deploy-ops: .stack-ops.yml
@@ -235,7 +237,7 @@ leave: ## Forces to stop all services, networks, etc by the node leaving the swa
235237
$(if $(SWARM_HOSTS),,docker swarm init)
236238

237239

238-
## docker TAGS -------------------------------
240+
## DOCKER TAGS -------------------------------
239241

240242
.PHONY: tag-local tag-cache tag-version tag-latest
241243

@@ -263,10 +265,10 @@ tag-latest: ## Tags last locally built production images as '${DOCKER_REGISTRY}/
263265

264266

265267

266-
## docker PULL/PUSH -------------------------------
268+
## DOCKER PULL/PUSH -------------------------------
267269
#
268-
# TODO: cannot push modified/untracke
269-
# TODO: cannot push discetedD
270+
# TODO: cannot push modified/untracked
271+
# TODO: cannot push disceted
270272
#
271273
.PHONY: pull-cache pull-version
272274
pull-cache: .env
@@ -296,21 +298,7 @@ push-version: tag-version
296298
)
297299

298300

299-
## PYTHON -------------------------------
300-
.PHONY: pylint
301-
302-
pylint: ## Runs python linter framework's wide
303-
# See exit codes and command line https://pylint.readthedocs.io/en/latest/user_guide/run.html#exit-codes
304-
# TODO: NOT windows friendly
305-
/bin/bash -c "pylint --jobs=0 --rcfile=.pylintrc $(strip $(shell find services packages -iname '*.py' \
306-
-not -path "*egg*" \
307-
-not -path "*migration*" \
308-
-not -path "*datcore.py" \
309-
-not -path "*sandbox*" \
310-
-not -path "*-sdk/python*" \
311-
-not -path "*generated_code*" \
312-
-not -path "*datcore.py" \
313-
-not -path "*web/server*"))"
301+
## ENVIRONMENT -------------------------------
314302

315303
.PHONY: devenv devenv-all
316304

@@ -332,25 +320,42 @@ devenv-all: devenv ## sets up extra development tools (everything else besides p
332320
@$(MAKE_C) scripts/json-schema-to-openapi-schema
333321

334322

335-
## MISC -------------------------------
336-
337-
.PHONY: new-service
338-
new-service: .venv ## Bakes a new project from cookiecutter-simcore-pyservice and drops it under services/ [UNDER DEV]
339-
$</bin/pip3 --quiet install cookiecutter
340-
.venv/bin/cookiecutter gh:itisfoundation/cookiecutter-simcore-pyservice --output-dir $(CURDIR)/services
341-
342-
# TODO: NOT windows friendly
343323
.env: .env-devel ## creates .env file from defaults in .env-devel
344324
$(if $(wildcard $@), \
345325
@echo "WARNING ##### $< is newer than $@ ####"; diff -uN $@ $<; false;,\
346-
@echo "WARNING ##### $@ does not exist, copying $< ############"; cp $< $@)
326+
@echo "WARNING ##### $@ does not exist, cloning $< as $@ ############"; cp $< $@)
327+
347328

348-
# TODO: NOT windows friendly
349329
.vscode/settings.json: .vscode-template/settings.json
350330
$(info WARNING: ##### $< is newer than $@ ####)
351331
@diff -uN $@ $<
352332
@false
353333

334+
335+
336+
## TOOLS -------------------------------
337+
338+
.PHONY: pylint
339+
340+
pylint: ## Runs python linter framework's wide
341+
/bin/bash -c "pylint --jobs=0 --rcfile=.pylintrc $(strip $(shell find services packages -iname '*.py' \
342+
-not -path "*egg*" \
343+
-not -path "*migration*" \
344+
-not -path "*datcore.py" \
345+
-not -path "*sandbox*" \
346+
-not -path "*-sdk/python*" \
347+
-not -path "*generated_code*" \
348+
-not -path "*datcore.py" \
349+
-not -path "*web/server*"))"
350+
# See exit codes and command line https://pylint.readthedocs.io/en/latest/user_guide/run.html#exit-codes
351+
352+
353+
.PHONY: new-service
354+
new-service: .venv ## Bakes a new project from cookiecutter-simcore-pyservice and drops it under services/ [UNDER DEV]
355+
$</bin/pip3 --quiet install cookiecutter
356+
.venv/bin/cookiecutter gh:itisfoundation/cookiecutter-simcore-pyservice --output-dir $(CURDIR)/services
357+
358+
354359
.PHONY: openapi-specs
355360
openapi-specs: ## bundles and validates openapi specifications and schemas of ALL service's API
356361
@$(MAKE_C) services/web/server $@
@@ -366,6 +371,23 @@ code-analysis: .codeclimate.yml ## runs code-climate analysis
366371
./scripts/code-climate.bash analyze
367372

368373

374+
.PHONY: auto-doc
375+
auto-doc: .stack-simcore-version.yml ## updates diagrams for README.md
376+
# Parsing docker-compose config $< and creating graph
377+
@./scripts/docker-compose-viz.bash $<
378+
# Updating docs/img
379+
@mv --verbose $<.png docs/img/
380+
381+
382+
.PHONY: postgres-upgrade
383+
postgres-upgrade: ## initalize or upgrade postgres db to latest state
384+
@$(MAKE_C) packages/postgres-database/docker build
385+
@$(MAKE_C) packages/postgres-database/docker upgrade
386+
387+
388+
389+
## INFO -------------------------------
390+
369391
.PHONY: info info-images info-swarm info-tools
370392
info: ## displays setup information
371393
# setup info:
@@ -388,7 +410,6 @@ info: ## displays setup information
388410
@echo ' python : $(shell python3 --version)'
389411

390412

391-
392413
define show-meta
393414
$(foreach iid,$(shell docker images */$(1):* -q | sort | uniq),\
394415
docker image inspect $(iid) | jq '.[0] | .RepoTags, .ContainerConfig.Labels';)
@@ -423,6 +444,9 @@ ifneq ($(SWARM_HOSTS), )
423444
endif
424445

425446

447+
448+
## CLEAN -------------------------------
449+
426450
.PHONY: clean clean-images clean-venv clean-all clean-ps
427451

428452
_git_clean_args := -dxf -e .vscode -e TODO.md -e .venv
@@ -460,19 +484,6 @@ clean-all: clean clean-ps clean-images # Deep clean including .venv and produced
460484
-rm -rf .venv
461485

462486

463-
.PHONY: postgres-upgrade
464-
postgres-upgrade: ## initalize or upgrade postgres db to latest state
465-
@$(MAKE_C) packages/postgres-database/docker build
466-
@$(MAKE_C) packages/postgres-database/docker upgrade
467-
468-
469487
.PHONY: reset
470488
reset: ## restart docker daemon (LINUX ONLY)
471489
sudo systemctl restart docker
472-
473-
.PHONY: auto-doc
474-
auto-doc: .stack-simcore-version.yml ## updates diagrams for README.md
475-
# Parsing docker-compose config $< and creating graph
476-
@./scripts/docker-compose-viz.bash $<
477-
# Updating docs/img
478-
@mv --verbose $<.png docs/img/

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# osparc-simcore platform
22

33
<p align="center">
4-
<img src="https://user-images.githubusercontent.com/32800795/61083844-ff48fb00-a42c-11e9-8e63-fa2d709c8baf.png" width="700">
4+
<img src="https://user-images.githubusercontent.com/32800795/61083844-ff48fb00-a42c-11e9-8e63-fa2d709c8baf.png" width="500">
55
</p>
66

7+
78
<!-- NOTE: when branched replace `master` in urls -->
8-
[`master`](https://github.com/itisfoundation/osparc-simcore/tree/master)
99
[![Code style: black]](https://github.com/psf/black)
1010
[![Requires.io]](https://requires.io/github/ITISFoundation/osparc-simcore/requirements/?branch=master "State of third party python dependencies")
1111
[![travis-ci]](https://travis-ci.org/ITISFoundation/osparc-simcore "State of CI: build, test and pushing images")
@@ -14,19 +14,19 @@
1414
[![codecov.io]](https://codecov.io/gh/ITISFoundation/osparc-simcore)
1515
[![github.io]](https://itisfoundation.github.io/)
1616
[![itis.dockerhub]](https://hub.docker.com/u/itisfoundation)
17+
[![license]](./LICENSE)
1718

1819

19-
20-
<!-- ADD HERE ALL BADGE URLS -->
20+
<!-- ADD HERE ALL BADGE URLS. Use https://shields.io/ -->
2121
[Code style: black]:https://img.shields.io/badge/code%20style-black-000000.svg
2222
[Requires.io]:https://img.shields.io/requires/github/ITISFoundation/osparc-simcore.svg
2323
[travis-ci]:https://travis-ci.org/ITISFoundation/osparc-simcore.svg?branch=master
2424
[github.io]:https://img.shields.io/website-up-down-green-red/https/itisfoundation.github.io.svg?label=documentation
2525
[itis.dockerhub]:https://img.shields.io/website/https/hub.docker.com/u/itisfoundation.svg?down_color=red&label=dockerhub%20repos&up_color=green
2626
[coveralls.io]:https://coveralls.io/repos/github/ITISFoundation/osparc-simcore/badge.svg?branch=master
2727
[codecov.io]:https://codecov.io/gh/ITISFoundation/osparc-simcore/branch/master/graph/badge.svg
28-
29-
<!---------------------------->
28+
[license]:https://img.shields.io/github/license/ITISFoundation/osparc-simcore
29+
<!------------------------------------------------------>
3030

3131

3232
The SIM-CORE, named **o<sup>2</sup>S<sup>2</sup>PARC****O**pen **O**nline **S**imulations for **S**timulating **P**eripheral **A**ctivity to **R**elieve **C**onditions – is one of the three integrative cores of the SPARC program’s Data Resource Center (DRC).

api/tests/requirements.txt

+7-7
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,32 @@ chardet==3.0.4 # via aiohttp
1111
coverage==5.1 # via -r requirements.in, pytest-cov
1212
idna-ssl==1.1.0 # via aiohttp
1313
idna==2.9 # via idna-ssl, yarl
14-
importlib-metadata==1.6.0 # via jsonschema, pluggy, pytest
14+
importlib-metadata==1.6.1 # via jsonschema, pluggy, pytest
1515
isodate==0.6.0 # via openapi-schema-validator
1616
jsonschema==3.2.0 # via openapi-schema-validator, openapi-spec-validator
17-
lazy-object-proxy==1.4.3 # via openapi-core
18-
more-itertools==8.3.0 # via openapi-core, pytest
17+
lazy-object-proxy==1.5.0 # via openapi-core
18+
more-itertools==8.4.0 # via openapi-core, pytest
1919
multidict==4.7.6 # via aiohttp, yarl
2020
openapi-core==0.13.3 # via -r requirements.in
2121
openapi-schema-validator==0.1.1 # via openapi-core
2222
openapi-spec-validator==0.2.8 # via openapi-core
2323
packaging==20.4 # via pytest, pytest-sugar
2424
parse==1.15.0 # via openapi-core
2525
pluggy==0.13.1 # via pytest
26-
py==1.8.1 # via pytest
26+
py==1.8.2 # via pytest
2727
pyparsing==2.4.7 # via packaging
2828
pyrsistent==0.16.0 # via jsonschema
2929
pytest-aiohttp==0.3.0 # via -r requirements.in
30-
pytest-cov==2.9.0 # via -r requirements.in
31-
pytest-instafail==0.4.1.post0 # via -r requirements.in
30+
pytest-cov==2.10.0 # via -r requirements.in
31+
pytest-instafail==0.4.2 # via -r requirements.in
3232
pytest-sugar==0.9.3 # via -r requirements.in
3333
pytest==5.4.3 # via -r requirements.in, pytest-aiohttp, pytest-cov, pytest-instafail, pytest-sugar
3434
pyyaml==5.3.1 # via openapi-spec-validator
3535
six==1.15.0 # via isodate, jsonschema, openapi-core, openapi-schema-validator, openapi-spec-validator, packaging
3636
strict-rfc3339==0.7 # via openapi-schema-validator
3737
termcolor==1.1.0 # via pytest-sugar
3838
typing-extensions==3.7.4.2 # via aiohttp
39-
wcwidth==0.1.9 # via pytest
39+
wcwidth==0.2.4 # via pytest
4040
werkzeug==1.0.1 # via openapi-core
4141
yarl==1.4.2 # via aiohttp
4242
zipp==3.1.0 # via importlib-metadata

packages/postgres-database/requirements/_migration.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
# pip-compile --output-file=requirements/_migration.txt requirements/_migration.in
66
#
77
alembic==1.4.2 # via -r requirements/_migration.in
8-
certifi==2020.4.5.1 # via requests
8+
certifi==2020.6.20 # via requests
99
chardet==3.0.4 # via requests
1010
click==7.1.2 # via -r requirements/_migration.in
1111
docker==4.2.1 # via -r requirements/_migration.in
1212
idna==2.9 # via -r requirements/_base.txt, requests, yarl
13-
mako==1.1.2 # via alembic
13+
mako==1.1.3 # via alembic
1414
markupsafe==1.1.1 # via mako
1515
multidict==4.7.6 # via -r requirements/_base.txt, yarl
1616
psycopg2-binary==2.8.5 # via -r requirements/_base.txt, sqlalchemy
1717
python-dateutil==2.8.1 # via alembic
1818
python-editor==1.0.4 # via alembic
19-
requests==2.23.0 # via docker
19+
requests==2.24.0 # via docker
2020
six==1.15.0 # via docker, python-dateutil, tenacity, websocket-client
2121
sqlalchemy[postgresql_psycopg2binary]==1.3.17 # via -r requirements/_base.txt, alembic
2222
tenacity==6.2.0 # via -r requirements/_migration.in

packages/postgres-database/requirements/_test.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ pytest-runner
2020
pytest-docker
2121

2222
# CI
23-
pylint==2.5.0 # 2.5.3 fails to run in parallel
23+
pylint
2424
coveralls

packages/postgres-database/requirements/_test.txt

+15-10
Original file line numberDiff line numberDiff line change
@@ -7,48 +7,53 @@
77
aiohttp==3.6.2 # via pytest-aiohttp
88
aiopg[sa]==1.0.0 # via -r requirements/_test.in
99
alembic==1.4.2 # via -r requirements/_migration.txt
10-
astroid==2.4.1 # via pylint
10+
astroid==2.4.2 # via pylint
1111
async-timeout==3.0.1 # via aiohttp
1212
attrs==19.3.0 # via aiohttp, pytest, pytest-docker
13-
certifi==2020.4.5.1 # via -r requirements/_migration.txt, requests
13+
certifi==2020.6.20 # via -r requirements/_migration.txt, requests
1414
chardet==3.0.4 # via -r requirements/_migration.txt, aiohttp, requests
1515
click==7.1.2 # via -r requirements/_migration.txt
1616
coverage==5.1 # via -r requirements/_test.in, coveralls, pytest-cov
1717
coveralls==2.0.0 # via -r requirements/_test.in
1818
docker==4.2.1 # via -r requirements/_migration.txt
1919
docopt==0.6.2 # via coveralls
2020
faker==4.1.1 # via -r requirements/_test.in
21+
idna-ssl==1.1.0 # via aiohttp
2122
idna==2.9 # via -r requirements/_migration.txt, requests, yarl
23+
importlib-metadata==1.6.1 # via pluggy, pytest
2224
isort==4.3.21 # via pylint
2325
lazy-object-proxy==1.4.3 # via astroid
24-
mako==1.1.2 # via -r requirements/_migration.txt, alembic
26+
mako==1.1.3 # via -r requirements/_migration.txt, alembic
2527
markupsafe==1.1.1 # via -r requirements/_migration.txt, mako
2628
mccabe==0.6.1 # via pylint
27-
more-itertools==8.3.0 # via pytest
29+
more-itertools==8.4.0 # via pytest
2830
multidict==4.7.6 # via -r requirements/_migration.txt, aiohttp, yarl
2931
packaging==20.4 # via pytest
3032
pluggy==0.13.1 # via pytest
3133
psycopg2-binary==2.8.5 # via -r requirements/_migration.txt, aiopg, sqlalchemy
32-
py==1.8.1 # via pytest
33-
pylint==2.5.0 # via -r requirements/_test.in
34+
py==1.8.2 # via pytest
35+
pylint==2.5.3 # via -r requirements/_test.in
3436
pyparsing==2.4.7 # via packaging
3537
pytest-aiohttp==0.3.0 # via -r requirements/_test.in
36-
pytest-cov==2.9.0 # via -r requirements/_test.in
38+
pytest-cov==2.10.0 # via -r requirements/_test.in
3739
pytest-docker==0.7.2 # via -r requirements/_test.in
38-
pytest-instafail==0.4.1.post0 # via -r requirements/_test.in
40+
pytest-instafail==0.4.2 # via -r requirements/_test.in
3941
pytest-runner==5.2 # via -r requirements/_test.in
4042
pytest==5.4.3 # via -r requirements/_test.in, pytest-aiohttp, pytest-cov, pytest-instafail
4143
python-dateutil==2.8.1 # via -r requirements/_migration.txt, alembic, faker
4244
python-editor==1.0.4 # via -r requirements/_migration.txt, alembic
4345
pyyaml==5.3.1 # via -r requirements/_test.in
44-
requests==2.23.0 # via -r requirements/_migration.txt, coveralls, docker
46+
requests==2.24.0 # via -r requirements/_migration.txt, coveralls, docker
4547
six==1.15.0 # via -r requirements/_migration.txt, astroid, docker, packaging, python-dateutil, tenacity, websocket-client
4648
sqlalchemy[postgresql_psycopg2binary]==1.3.17 # via -r requirements/_migration.txt, aiopg, alembic
4749
tenacity==6.2.0 # via -r requirements/_migration.txt
4850
text-unidecode==1.3 # via faker
4951
toml==0.10.1 # via pylint
52+
typed-ast==1.4.1 # via astroid
53+
typing-extensions==3.7.4.2 # via aiohttp
5054
urllib3==1.25.9 # via -r requirements/_migration.txt, requests
51-
wcwidth==0.1.9 # via pytest
55+
wcwidth==0.2.4 # via pytest
5256
websocket-client==0.57.0 # via -r requirements/_migration.txt, docker
5357
wrapt==1.12.1 # via astroid
5458
yarl==1.4.2 # via -r requirements/_migration.txt, aiohttp
59+
zipp==3.1.0 # via importlib-metadata

packages/pytest-simcore/src/pytest_simcore/helpers/utils_pylint.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def assert_pylint_is_passing(pylintrc, package_dir, number_of_jobs: int = AUTODE
1313
command = f"pylint --jobs={number_of_jobs} --rcfile {pylintrc} -v {package_dir}".split(
1414
" "
1515
)
16-
pipes = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
16+
pipes = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
1717
std_out, _ = pipes.communicate()
1818
if pipes.returncode != 0:
1919
print(f'>>>> Exit code "{pipes.returncode}"\n{std_out.decode("utf-8")}\n<<<<')

0 commit comments

Comments
 (0)