Skip to content

[maintenance] Upgrades webserver's requirements #1444

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 55 commits into from
Apr 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
65879fc
Full upgrade of postgres-database package
pcrespov Apr 7, 2020
fbc062e
upgraded servicelib reqs
pcrespov Apr 7, 2020
59e445f
upgrades s3wrapper reqs
pcrespov Apr 7, 2020
e6b2b46
Upgrades simcore-sdk
pcrespov Apr 7, 2020
3d2b059
Added recipe to account for in-repo dependencies
pcrespov Apr 8, 2020
bdf1d01
Cleanup webserver in-reqs
pcrespov Apr 8, 2020
60a6b21
Compiled webserver reqs
pcrespov Apr 8, 2020
289f343
Upgrade webserver service setup
pcrespov Apr 8, 2020
c65c999
Fixes fixtures creating error in engineio
pcrespov Apr 8, 2020
2e9dd53
Cleanup
pcrespov Apr 8, 2020
12ed209
Fixed clean in makefiles
pcrespov Apr 8, 2020
6c99a66
Cleanup main makefile: too noisy
pcrespov Apr 8, 2020
29bdc6b
Makes pip install quiet and add clean-ps
pcrespov Apr 8, 2020
05b5244
Added extra checks but test issue still unsolved
pcrespov Apr 8, 2020
16b0b47
Reverts back to python-socketio to 4.3.1
pcrespov Apr 8, 2020
ac64545
Commented
pcrespov Apr 8, 2020
0e57455
Last upgrade of sqlalchemy
pcrespov Apr 8, 2020
0b055cb
Scripts to help upgrade
pcrespov Apr 8, 2020
f7e640f
Extra cleanup with makefiles
pcrespov Apr 8, 2020
eedb9fd
Added doc about dependencies
pcrespov Apr 8, 2020
9cf4fe2
Fixed version check
pcrespov Apr 8, 2020
59f7f37
Now is fixed
pcrespov Apr 8, 2020
0c0f9a5
Silent all make -c
pcrespov Apr 8, 2020
012402d
Upgrades base image to py-slim and booting scripts
pcrespov Apr 8, 2020
e93ea2d
Minor typo
pcrespov Apr 8, 2020
f119992
Fixes pip in devel mode and cleanup
pcrespov Apr 8, 2020
07a4f87
Formatted and cleanup
pcrespov Apr 14, 2020
2e44a4a
Latest updates in packages
pcrespov Apr 14, 2020
ee485a8
Latest updates in webserver
pcrespov Apr 14, 2020
f9dd3ad
Fixes in scripts
pcrespov Apr 14, 2020
088d662
Upgrades tests reqs coverage to 5.1 in packages
pcrespov Apr 14, 2020
4d01e1e
Upgrades coverage to 5.1 in test reqs at webserver
pcrespov Apr 14, 2020
758a7e3
upgrades package requirements:
pcrespov Apr 20, 2020
bee5891
Adding dev tools in requirements/dev.txt
pcrespov Apr 20, 2020
4640131
doc
pcrespov Apr 20, 2020
5aa72d8
Added common tools in requirements/dev.txt in services
pcrespov Apr 20, 2020
98d1703
removed pinned dependencies (#26)
GitHK Apr 23, 2020
2482ca5
Merge branch 'master' into maintenance/reqs
pcrespov Apr 23, 2020
c1dff95
Merge branch 'master' into maintenance/reqs
pcrespov Apr 24, 2020
b4cd410
Fixes hanging test
pcrespov Apr 24, 2020
a48cd1b
Increases diagnotics latency
pcrespov Apr 24, 2020
717fd8e
Fixes webserver restart failure
pcrespov Apr 24, 2020
98b8912
Cleanup ignore lists
pcrespov Apr 24, 2020
396d0fe
Using gosu in webserver
pcrespov Apr 27, 2020
fd9d8f5
Patch updates in packages: sugar, pydantic
pcrespov Apr 27, 2020
cd41a2d
Patch updates in webserver:
pcrespov Apr 27, 2020
0d985d4
Added gosu in director service
pcrespov Apr 27, 2020
c035056
Fixes cmd arguents
pcrespov Apr 27, 2020
74c990b
Tmp disabled test for director
pcrespov Apr 27, 2020
c34430f
Updates pylint and fixes warning
pcrespov Apr 27, 2020
01fcaae
Updates pylint to 2.5.0
pcrespov Apr 27, 2020
6e379af
Fixes pylint error in webserver
pcrespov Apr 27, 2020
af2ba2c
Fixes linter errors
pcrespov Apr 27, 2020
f1c8878
Applies update patch for click
pcrespov Apr 28, 2020
0e9951b
Merge branch 'master' into maintenance/reqs
pcrespov Apr 29, 2020
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
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ services/docker-compose.stack.*.yml

# Any generated output folder (e.g. codegen, build, ...)
out/
tmp/
**/tmp/

# See .vscode-template
pytest.ini
Expand All @@ -149,4 +149,3 @@ prof/

# outputs from make
.stack-*.yml
services/web/server/tests/data/static/resource/statics.json
48 changes: 24 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ endef

rebuild: build-nc # alias
build build-nc build-kit build-x: .env ## Builds production images and tags them as 'local/{service-name}:production'. For single target e.g. 'make target=webserver build'
ifeq ($(target),)
ifeq ($(target),)
# Compiling front-end

@$(if $(findstring -kit,$@),export DOCKER_BUILDKIT=1;export COMPOSE_DOCKER_CLI_BUILD=1;,) \
$(MAKE_C) services/web/client compile$(if $(findstring -x,$@),-x,)

# Building services
@$(if $(findstring -kit,$@),export DOCKER_BUILDKIT=1;export COMPOSE_DOCKER_CLI_BUILD=1;,) \
$(_docker_compose_build)
Expand Down Expand Up @@ -126,7 +126,7 @@ endif


# TODO: should download cache if any??
build-cache build-cache-nc build-cache-kit build-cache-x: .env ## Build cache images and tags them as 'local/{service-name}:cache'
build-cache build-cache-nc build-cache-kit build-cache-x: .env ## Build cache images and tags them as 'local/{service-name}:cache'
ifeq ($(target),)
# Compiling front-end
@$(if $(findstring -kit,$@),export DOCKER_BUILDKIT=1;export COMPOSE_DOCKER_CLI_BUILD=1;,)
Expand Down Expand Up @@ -189,13 +189,13 @@ endif


up-devel: .stack-simcore-development.yml .init-swarm $(CLIENT_WEB_OUTPUT) ## Deploys local development stack, qx-compile+watch and ops stack (pass 'make ops_disabled=1 up-...' to disable)
# Start compile+watch front-end container [front-end]
# Start compile+watch front-end container [front-end]
$(MAKE_C) services/web/client compile-dev flags=--watch
# Deploy stack $(SWARM_STACK_NAME) [back-end]
@docker stack deploy -c $< $(SWARM_STACK_NAME)
$(MAKE) .deploy-ops
$(MAKE_C) services/web/client follow-dev-logs


up-prod: .stack-simcore-production.yml .init-swarm ## Deploys local production stack and ops stack (pass 'make ops_disabled=1 up-...' to disable)
# Deploy stack $(SWARM_STACK_NAME)
Expand Down Expand Up @@ -297,8 +297,6 @@ push-version: tag-version
## PYTHON -------------------------------
.PHONY: pylint

PY_PIP = $(if $(IS_WIN),cd .venv/Scripts && pip.exe,.venv/bin/pip3)

pylint: ## Runs python linter framework's wide
# See exit codes and command line https://pylint.readthedocs.io/en/latest/user_guide/run.html#exit-codes
# TODO: NOT windows friendly
Expand All @@ -315,13 +313,13 @@ pylint: ## Runs python linter framework's wide

.venv:
python3 -m venv $@
$@/bin/pip3 install --upgrade \
$@/bin/pip3 --quiet install --upgrade \
pip \
wheel \
setuptools

devenv: .venv ## create a python virtual environment with dev tools (e.g. linters, etc)
$</bin/pip3 install -r requirements.txt
$</bin/pip3 --quiet install -r requirements.txt
@echo "To activate the venv, execute 'source .venv/bin/activate'"

devenv-all: devenv ## sets up extra development tools (everything else besides python)
Expand All @@ -335,7 +333,7 @@ devenv-all: devenv ## sets up extra development tools (everything else besides p

.PHONY: new-service
new-service: .venv ## Bakes a new project from cookiecutter-simcore-pyservice and drops it under services/ [UNDER DEV]
$</bin/pip3 install cookiecutter
$</bin/pip3 --quiet install cookiecutter
.venv/bin/cookiecutter gh:itisfoundation/cookiecutter-simcore-pyservice --output-dir $(CURDIR)/services

# TODO: NOT windows friendly
Expand Down Expand Up @@ -422,39 +420,40 @@ ifneq ($(SWARM_HOSTS), )
endif


.PHONY: clean clean-images clean-venv clean-all

git_clean_args := -dxf -e .vscode -e TODO.md -e .venv
.PHONY: clean clean-images clean-venv clean-all clean-ps

_git_clean_args := -dxf -e .vscode -e TODO.md -e .venv
_running_containers = $(shell docker ps -aq)

.check-clean:
@git clean -n $(git_clean_args)
@git clean -n $(_git_clean_args)
@echo -n "Are you sure? [y/N] " && read ans && [ $${ans:-N} = y ]
@echo -n "$(shell whoami), are you REALLY sure? [y/N] " && read ans && [ $${ans:-N} = y ]

clean-venv: ## Purges .venv into original configuration
clean-venv: devenv ## Purges .venv into original configuration
# Cleaning your venv
pip-sync $(CURDIR)/requirements.txt
.venv/bin/pip-sync --quiet $(CURDIR)/requirements.txt
@pip list

clean: .check-clean clean-venv ## cleans all unversioned files in project and temp files create by this makefile
clean: .check-clean ## cleans all unversioned files in project and temp files create by this makefile
# Cleaning unversioned
@git clean $(git_clean_args)
@git clean $(_git_clean_args)
# Cleaning web/client
@$(MAKE_C) services/web/client clean
# Cleaning postgres maintenance
@$(MAKE_C) packages/postgres-database/docker clean
@$(MAKE_C) services/web/client clean-files

clean-ps: ## stops and deletes running containers
$(if $(_running_containers), docker rm -f $(_running_containers),)

clean-images: ## removes all created images
# Cleaning all service images
-$(foreach service,$(SERVICES_LIST)\
,docker image rm -f $(shell docker images */$(service):* -q);)
# Cleaning webclient
@$(MAKE_C) services/web/client clean
@$(MAKE_C) services/web/client clean-images
# Cleaning postgres maintenance
@$(MAKE_C) packages/postgres-database/docker clean

clean-all: clean clean-images # Deep clean including .venv and produced images
clean-all: clean clean-ps clean-images # Deep clean including .venv and produced images
-rm -rf .venv


Expand All @@ -463,6 +462,7 @@ postgres-upgrade: ## initalize or upgrade postgres db to latest state
@$(MAKE_C) packages/postgres-database/docker build
@$(MAKE_C) packages/postgres-database/docker upgrade


.PHONY: reset
reset: ## restart docker daemon (LINUX ONLY)
sudo systemctl restart docker
30 changes: 30 additions & 0 deletions docs/python-dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,36 @@ TODO: finish!
- The dependencies have to be kept up-to-date regularly (e.g. due to security patches; new feature in our package might add new direct dependencies to our requirements)
- Inter-dependent libraries typically have different release cycles creating in time version conflicts (e.g. package A and B strictly depend on different versions of C)


- packages uses input requirements as install-requirements (i.e. entry in setup and in requirements/ci.txt) NOT compiled ones
- services use compiled requirements



- tests packages with the latest (i.e. compile requirements to lastest version)
- if tests fails, then add constraints in input requirements
- try adding tests that check inter-library compatibility
- if tests succeed, you can use them in services
- if at least one service has a problem, we need to decide whether to add a constraint:
a) at the package level => will ensure is tested but is constraining all services
b) at the service level => only affects service but cannot do isolate tests against latests upgrades


### How to purge unused requirements?


### Propagation of constraints

- Situation: upgrading one package the developer finds an issue, e.g.
```
coverage==5.0.3 # TODO: Downgraded because of a bug https://github.com/nedbat/coveragepy/issues/716

pytest~=5.3.5 # Bug in pytest-sugar https://github.com/Teemu/pytest-sugar/issues/187
pytest-aiohttp # incompatible with pytest-asyncio. See https://github.com/pytest-dev/pytest-asyncio/issues/76
```
- Question: how to make sure this is also taken into account in other places?


!-->

## Rationale
Expand Down
2 changes: 1 addition & 1 deletion packages/postgres-database/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include ../../scripts/common.Makefile

.PHONY: requirements
requirements: ## compiles pip requirements (.in -> .txt)
@$(MAKE) --directory requirements reqs
@$(MAKE_C) requirements reqs


.PHONY: install-dev install-prod install-ci
Expand Down
1 change: 0 additions & 1 deletion packages/postgres-database/requirements/_base.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
# Specifies third-party dependencies for 'simcore-postgres-database'
#
sqlalchemy[postgresql_psycopg2binary]>=1.3.3 # binary + Vulnerability

yarl
10 changes: 5 additions & 5 deletions packages/postgres-database/requirements/_base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#
# pip-compile --output-file=_base.txt _base.in
#
idna==2.8 # via yarl
multidict==4.5.2 # via yarl
psycopg2-binary==2.8.4 # via sqlalchemy
sqlalchemy[postgresql_psycopg2binary]==1.3.5 # via -r requirements/_base.in
yarl==1.4.2 # via -r requirements/_base.in
idna==2.9 # via yarl
multidict==4.7.5 # via yarl
psycopg2-binary==2.8.5 # via sqlalchemy
sqlalchemy[postgresql_psycopg2binary]==1.3.16 # via -r _base.in
yarl==1.4.2 # via -r _base.in
32 changes: 16 additions & 16 deletions packages/postgres-database/requirements/_migration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
#
# pip-compile --output-file=_migration.txt _migration.in
#
alembic==1.4.2 # via -r requirements/_migration.in
certifi==2019.11.28 # via -r requirements/_migration.in, requests
alembic==1.4.2 # via -r _migration.in
certifi==2019.11.28 # via -r _migration.in, requests
chardet==3.0.4 # via requests
click==7.1.1 # via -r requirements/_migration.in
docker==4.2.0 # via -r requirements/_migration.in
idna==2.8 # via -r requirements/_base.txt, requests, yarl
mako==1.0.12 # via alembic
click==7.1.2 # via -r _migration.in
docker==4.2.0 # via -r _migration.in
idna==2.9 # via -r _base.txt, requests, yarl
mako==1.1.2 # via alembic
markupsafe==1.1.1 # via mako
multidict==4.5.2 # via -r requirements/_base.txt, yarl
psycopg2-binary==2.8.4 # via -r requirements/_base.txt, sqlalchemy
python-dateutil==2.8.0 # via alembic
multidict==4.7.5 # via -r _base.txt, yarl
psycopg2-binary==2.8.5 # via -r _base.txt, sqlalchemy
python-dateutil==2.8.1 # via alembic
python-editor==1.0.4 # via alembic
requests==2.22.0 # via docker
six==1.12.0 # via docker, python-dateutil, tenacity, websocket-client
sqlalchemy[postgresql_psycopg2binary]==1.3.5 # via -r requirements/_base.txt, alembic
tenacity==6.1.0 # via -r requirements/_migration.in
urllib3==1.25.8 # via -r requirements/_migration.in, requests
websocket-client==0.56.0 # via docker
yarl==1.4.2 # via -r requirements/_base.txt
requests==2.23.0 # via docker
six==1.14.0 # via docker, python-dateutil, tenacity, websocket-client
sqlalchemy[postgresql_psycopg2binary]==1.3.16 # via -r _base.txt, alembic
tenacity==6.1.0 # via -r _migration.in
urllib3==1.25.9 # via -r _migration.in, requests
websocket-client==0.57.0 # via docker
yarl==1.4.2 # via -r _base.txt
5 changes: 2 additions & 3 deletions packages/postgres-database/requirements/_test.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ aiopg[sa]
faker

# testing
coverage==5.0.3 # TODO: Downgraded because of a bug https://github.com/nedbat/coveragepy/issues/716
coverage
pytest~=5.3.5 # Bug in pytest-sugar https://github.com/Teemu/pytest-sugar/issues/187
pytest-cov
pytest-aiohttp # incompatible with pytest-asyncio. See https://github.com/pytest-dev/pytest-asyncio/issues/76
pytest-instafail
pytest-runner
pytest-docker

# tools
-r ../../../requirements.txt
# CI
pylint
coveralls
85 changes: 39 additions & 46 deletions packages/postgres-database/requirements/_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,65 +2,58 @@
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile requirements/_test.in
# pip-compile --output-file=_test.txt _test.in
#
aiohttp==3.6.2 # via pytest-aiohttp
aiopg[sa]==1.0.0 # via -r requirements/_test.in
alembic==1.4.2 # via -r requirements/_migration.txt
appdirs==1.4.3 # via black
astroid==2.3.3 # via pylint
aiopg[sa]==1.0.0 # via -r _test.in
alembic==1.4.2 # via -r _migration.txt
astroid==2.4.0 # via pylint
async-timeout==3.0.1 # via aiohttp
attrs==19.3.0 # via aiohttp, black, pytest, pytest-docker
black==19.10b0 # via -r requirements/../../../requirements.txt
bump2version==1.0.0 # via -r requirements/../../../requirements.txt
certifi==2019.11.28 # via -r requirements/_migration.txt, requests
chardet==3.0.4 # via -r requirements/_migration.txt, aiohttp, requests
click==7.1.1 # via -r requirements/_migration.txt, black, pip-tools
coverage==5.0.3 # via -r requirements/_test.in, coveralls, pytest-cov
coveralls==1.11.1 # via -r requirements/_test.in
docker==4.2.0 # via -r requirements/_migration.txt
attrs==19.3.0 # via aiohttp, pytest, pytest-docker
certifi==2019.11.28 # via -r _migration.txt, requests
chardet==3.0.4 # via -r _migration.txt, aiohttp, requests
click==7.1.2 # via -r _migration.txt
coverage==5.1 # via -r _test.in, coveralls, pytest-cov
coveralls==2.0.0 # via -r _test.in
docker==4.2.0 # via -r _migration.txt
docopt==0.6.2 # via coveralls
faker==4.0.2 # via -r requirements/_test.in
faker==4.0.3 # via -r _test.in
idna-ssl==1.1.0 # via aiohttp
idna==2.8 # via -r requirements/_migration.txt, requests, yarl
idna==2.9 # via -r _migration.txt, requests, yarl
importlib-metadata==1.6.0 # via pluggy, pytest
isort==4.3.21 # via pylint
lazy-object-proxy==1.4.3 # via astroid
mako==1.0.12 # via -r requirements/_migration.txt, alembic
markupsafe==1.1.1 # via -r requirements/_migration.txt, mako
mako==1.1.2 # via -r _migration.txt, alembic
markupsafe==1.1.1 # via -r _migration.txt, mako
mccabe==0.6.1 # via pylint
more-itertools==8.2.0 # via pytest
multidict==4.5.2 # via -r requirements/_migration.txt, aiohttp, yarl
multidict==4.7.5 # via -r _migration.txt, aiohttp, yarl
packaging==20.3 # via pytest
pathspec==0.7.0 # via black
pip-tools==4.5.1 # via -r requirements/../../../requirements.txt
pluggy==0.13.1 # via pytest
psycopg2-binary==2.8.4 # via -r requirements/_migration.txt, aiopg, sqlalchemy
psycopg2-binary==2.8.5 # via -r _migration.txt, aiopg, sqlalchemy
py==1.8.1 # via pytest
pylint==2.4.4 # via -r requirements/../../../requirements.txt, -r requirements/_test.in
pyparsing==2.4.6 # via packaging
pytest-aiohttp==0.3.0 # via -r requirements/_test.in
pytest-cov==2.8.1 # via -r requirements/_test.in
pytest-docker==0.7.2 # via -r requirements/_test.in
pytest-instafail==0.4.1.post0 # via -r requirements/_test.in
pytest-runner==5.2 # via -r requirements/_test.in
pytest==5.3.5 # via -r requirements/_test.in, pytest-aiohttp, pytest-cov, pytest-instafail
python-dateutil==2.8.0 # via -r requirements/_migration.txt, alembic, faker
python-editor==1.0.4 # via -r requirements/_migration.txt, alembic
pyyaml==5.3.1 # via -r requirements/_test.in
regex==2020.2.20 # via black
requests==2.22.0 # via -r requirements/_migration.txt, coveralls, docker
rope==0.16.0 # via -r requirements/../../../requirements.txt
six==1.12.0 # via -r requirements/_migration.txt, astroid, docker, packaging, pip-tools, python-dateutil, tenacity, websocket-client
sqlalchemy[postgresql_psycopg2binary]==1.3.5 # via -r requirements/_migration.txt, aiopg, alembic
tenacity==6.1.0 # via -r requirements/_migration.txt
pylint==2.5.0 # via -r _test.in
pyparsing==2.4.7 # via packaging
pytest-aiohttp==0.3.0 # via -r _test.in
pytest-cov==2.8.1 # via -r _test.in
pytest-docker==0.7.2 # via -r _test.in
pytest-instafail==0.4.1.post0 # via -r _test.in
pytest-runner==5.2 # via -r _test.in
pytest==5.3.5 # via -r _test.in, pytest-aiohttp, pytest-cov, pytest-instafail
python-dateutil==2.8.1 # via -r _migration.txt, alembic, faker
python-editor==1.0.4 # via -r _migration.txt, alembic
pyyaml==5.3.1 # via -r _test.in
requests==2.23.0 # via -r _migration.txt, coveralls, docker
six==1.14.0 # via -r _migration.txt, astroid, docker, packaging, python-dateutil, tenacity, websocket-client
sqlalchemy[postgresql_psycopg2binary]==1.3.16 # via -r _migration.txt, aiopg, alembic
tenacity==6.1.0 # via -r _migration.txt
text-unidecode==1.3 # via faker
toml==0.10.0 # via black
typed-ast==1.4.1 # via astroid, black
toml==0.10.0 # via pylint
typed-ast==1.4.1 # via astroid
typing-extensions==3.7.4.2 # via aiohttp
urllib3==1.25.8 # via -r requirements/_migration.txt, requests
wcwidth==0.1.8 # via pytest
websocket-client==0.56.0 # via -r requirements/_migration.txt, docker
wrapt==1.11.2 # via astroid
yarl==1.4.2 # via -r requirements/_migration.txt, aiohttp
urllib3==1.25.9 # via -r _migration.txt, requests
wcwidth==0.1.9 # via pytest
websocket-client==0.57.0 # via -r _migration.txt, docker
wrapt==1.12.1 # via astroid
yarl==1.4.2 # via -r _migration.txt, aiohttp
zipp==3.1.0 # via importlib-metadata
3 changes: 3 additions & 0 deletions packages/postgres-database/requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@

# current module
-e .[migration]

# basic dev tools
-r ../../../requirements.txt
Loading