Skip to content

[maintenance] Various improvements on logs to assist debugging #1763

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 25 commits into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
155a61c
adds time snapshots in log
pcrespov Aug 31, 2020
3d9f5e8
adds timeout to docker service logs to avoid blocking
pcrespov Aug 31, 2020
f1be8e2
doc
pcrespov Sep 1, 2020
238d7c2
adds pydantic
pcrespov Sep 2, 2020
b5e4afb
adds build-time metadatawritten in statics.json for front-end and pri…
pcrespov Sep 2, 2020
098e3ac
Removed downgrade pg on teardown in postgres_db fixture
pcrespov Sep 4, 2020
d74ea0d
Fixing tests on setup_settings
pcrespov Sep 4, 2020
33f60a7
fixed typos
pcrespov Sep 4, 2020
a169549
Cleanup
pcrespov Sep 4, 2020
eb1fbc2
Fixed typos
pcrespov Sep 4, 2020
71fbe4b
adds check on sensitive info
pcrespov Sep 4, 2020
ef2d380
Restored pg downgrade and described fix
pcrespov Sep 7, 2020
7e90b41
Minor changes in sidecar
pcrespov Sep 7, 2020
49a733b
Cleanup webserver's project_*
pcrespov Sep 7, 2020
863373e
updates dependencies of postgres-database package
pcrespov Sep 7, 2020
68dbe49
updates dependencies of s3wrapper
pcrespov Sep 7, 2020
5242011
updates tester dependencies
pcrespov Sep 7, 2020
0c96c5a
updates dependencies of servicelib package
pcrespov Sep 7, 2020
b9d0eb7
Updates dependencies of simcore-sdk package
pcrespov Sep 7, 2020
78700ab
adds recipe to install and recreate package-lock
pcrespov Sep 7, 2020
0db56fd
Fixing vulnerability https://github.com/advisories/GHSA-p9pc-299p-vxgp
pcrespov Sep 7, 2020
afd2629
Upgrades service diagram
pcrespov Sep 7, 2020
b60a1e3
Updates database ERD
pcrespov Sep 7, 2020
855322c
@sanderegg comments
pcrespov Sep 9, 2020
4b05310
Subdivided e2e recipe with more steps
pcrespov Sep 9, 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
4 changes: 3 additions & 1 deletion .github/workflows/ci-testing-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,8 @@ jobs:
${{ runner.os }}-node-
- name: setup images
run: ./ci/github/system-testing/e2e.bash setup_images
- name: setup and start swarm
run: ./ci/github/system-testing/e2e.bash setup_and_run_stack
- name: setup environment
run: ./ci/github/system-testing/e2e.bash setup_environment
- name: setup registry
Expand All @@ -1070,7 +1072,7 @@ jobs:
- name: recover docker logs
id: logs_recovery
if: always()
run: ./ci/github/system-testing/e2e.bash recover_artifacts
run: ./ci/github/system-testing/e2e.bash dump_docker_logs
- name: upload docker logs
if: always()
uses: actions/upload-artifact@v2
Expand Down
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ push-version: tag-version

## ENVIRONMENT -------------------------------

.PHONY: devenv devenv-all
.PHONY: devenv devenv-all node-env

.venv:
python3 -m venv $@
Expand All @@ -338,6 +338,15 @@ devenv-all: devenv ## sets up extra development tools (everything else besides p
@$(MAKE_C) scripts/json-schema-to-openapi-schema


node_modules: package.json
# checking npm installed
@npm --version
# installing package.json
npm install --package-lock

nodenv: node_modules ## builds node_modules local environ (TODO)


.env: .env-devel ## creates .env file from defaults in .env-devel
$(if $(wildcard $@), \
@echo "WARNING ##### $< is newer than $@ ####"; diff -uN $@ $<; false;,\
Expand Down
6 changes: 3 additions & 3 deletions api/tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
aiohttp==3.6.2 # via -r requirements.in, pytest-aiohttp
async-timeout==3.0.1 # via aiohttp
attrs==20.1.0 # via aiohttp, jsonschema, openapi-core, pytest
attrs==20.2.0 # via aiohttp, jsonschema, openapi-core, pytest
chardet==3.0.4 # via aiohttp
coverage==5.2.1 # via -r requirements.in, pytest-cov
idna-ssl==1.1.0 # via aiohttp
Expand All @@ -16,13 +16,13 @@ iniconfig==1.0.1 # via pytest
isodate==0.6.0 # via openapi-core, openapi-schema-validator
jsonschema==3.2.0 # via openapi-schema-validator, openapi-spec-validator
lazy-object-proxy==1.5.1 # via openapi-core
more-itertools==8.4.0 # via openapi-core, pytest
more-itertools==8.5.0 # via openapi-core, pytest
multidict==4.7.6 # via aiohttp, yarl
openapi-core==0.13.4 # via -r requirements.in
openapi-schema-validator==0.1.1 # via openapi-core
openapi-spec-validator==0.2.9 # via openapi-core
packaging==20.4 # via pytest, pytest-sugar
parse==1.16.0 # via openapi-core
parse==1.17.0 # via openapi-core
pluggy==0.13.1 # via pytest
py==1.9.0 # via pytest
pyparsing==2.4.7 # via packaging
Expand Down
27 changes: 17 additions & 10 deletions ci/github/system-testing/e2e.bash
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,17 @@ uninstall_insecure_registry() {
}

setup_images() {
echo "--------------- getting simcore docker images..."
echo "--------------- preparing docker images..."
make pull-version || ( (make pull-cache || true) && make build-x tag-version)
make info-images

}

setup_and_run_stack() {
# configure simcore for testing with a private registry
install_insecure_registry

echo "--------------- starting swarm ..."
# start simcore and set log-level
export LOG_LEVEL=WARNING
make up-version
Expand Down Expand Up @@ -135,29 +139,32 @@ setup_database() {
install() {
## shortcut
setup_images
setup_and_run_stack
setup_environment
setup_registry
setup_database
}

test() {
sleep 5
pushd tests/e2e
make test
popd

}

recover_artifacts() {
dump_docker_logs() {
# all screenshots are in tests/e2e/screenshots if any

# get docker logs.
# WARNING: dumping long logs might take hours!!
mkdir simcore_logs
(docker service logs --timestamps --tail=300 --details ${SWARM_STACK_NAME}_webserver >simcore_logs/webserver.log 2>&1) || true
(docker service logs --timestamps --tail=200 --details ${SWARM_STACK_NAME}_director >simcore_logs/director.log 2>&1) || true
(docker service logs --timestamps --tail=200 --details ${SWARM_STACK_NAME}_storage >simcore_logs/storage.log 2>&1) || true
(docker service logs --timestamps --tail=200 --details ${SWARM_STACK_NAME}_sidecar >simcore_logs/sidecar.log 2>&1) || true
(docker service logs --timestamps --tail=200 --details ${SWARM_STACK_NAME}_catalog >simcore_logs/catalog.log 2>&1) || true
# NOTE: dumping logs sometimes hangs. Introducing a timeout
mkdir --parents simcore_logs
(timeout 30 docker service logs --timestamps --tail=300 --details ${SWARM_STACK_NAME}_webserver >simcore_logs/webserver.log 2>&1) || true
(timeout 30 docker service logs --timestamps --tail=200 --details ${SWARM_STACK_NAME}_director >simcore_logs/director.log 2>&1) || true
(timeout 30 docker service logs --timestamps --tail=200 --details ${SWARM_STACK_NAME}_storage >simcore_logs/storage.log 2>&1) || true
(timeout 30 docker service logs --timestamps --tail=200 --details ${SWARM_STACK_NAME}_sidecar >simcore_logs/sidecar.log 2>&1) || true
(timeout 30 docker service logs --timestamps --tail=200 --details ${SWARM_STACK_NAME}_catalog >simcore_logs/catalog.log 2>&1) || true
(timeout 30 docker service logs --timestamps --tail=200 --details ${SWARM_STACK_NAME}_migration >simcore_logs/migration.log 2>&1) || true
(timeout 30 docker service logs --timestamps --tail=200 --details ${SWARM_STACK_NAME}_postgres >simcore_logs/postgres.log 2>&1) || true
}

clean_up() {
Expand Down
Binary file modified docs/img/.stack-simcore-version.yml.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 15 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"eslint-plugin-qx-rules": "^0.1.0",
"puppeteer": "^1.19.0",
"puppeteer-to-istanbul": "^1.2.2",
"yargs": "^13.3.0"
"yargs": "^13.3.0",
"yargs-parser": ">=13.1.2"
}
}
10 changes: 9 additions & 1 deletion packages/postgres-database/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,19 @@ migrate: $(DOT_ENV_FILE) ## basic migration update (use ONLY for development pur




.PHONY: up-pg down-pg up-prod down-prod
docker-compose-configs = $(wildcard tests/docker-compose*.yml)
up-pg up-prod: $(docker-compose-configs) ## starts pg server
docker-compose -f tests/docker-compose.yml $(if $(findstring -prod,$@),-f tests/docker-compose.prod.yml,) up -d

down-pg down-prod: $(docker-compose-configs) ## stops pg server
docker-compose -f tests/docker-compose.yml $(if $(findstring -prod,$@),-f tests/docker-compose.prod.yml,) down



.PHONY: auto-doc
auto-doc: install-dev ## Creates entity relationship diagram (ERD) defined under ``simcore_postgres_database.models``
# installing doc dependencies (install-doc)
pip install eralchemy
# running script
python scripts/create_erd.py
Loading