Skip to content

Commit ec24c7e

Browse files
authored
[maintenance] Various improvements on logs to assist debugging (#1763)
* e2e - timeout logs to avoid e2e hanging while creating docker logs - logs print time-stamps - fine-grained steps in e2e to reduce logs * webserver - Adds app settings [add pydantic (will replace traferet in a new PR) ] - More metadata: passes build and git commit versions - Public metadata published via static.json to the front-end and in v0/config entrypoint - Settings logged in console for reference purposes - cleanup * sidecar - cleanup *requirements - weekly update of package requirements - upgrades to fix vulnerability GHSA-p9pc-299p-vxgp
1 parent e9c5373 commit ec24c7e

File tree

46 files changed

+782
-560
lines changed

Some content is hidden

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

46 files changed

+782
-560
lines changed

.github/workflows/ci-testing-deploy.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,8 @@ jobs:
10581058
${{ runner.os }}-node-
10591059
- name: setup images
10601060
run: ./ci/github/system-testing/e2e.bash setup_images
1061+
- name: setup and start swarm
1062+
run: ./ci/github/system-testing/e2e.bash setup_and_run_stack
10611063
- name: setup environment
10621064
run: ./ci/github/system-testing/e2e.bash setup_environment
10631065
- name: setup registry
@@ -1070,7 +1072,7 @@ jobs:
10701072
- name: recover docker logs
10711073
id: logs_recovery
10721074
if: always()
1073-
run: ./ci/github/system-testing/e2e.bash recover_artifacts
1075+
run: ./ci/github/system-testing/e2e.bash dump_docker_logs
10741076
- name: upload docker logs
10751077
if: always()
10761078
uses: actions/upload-artifact@v2

Makefile

+10-1
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ push-version: tag-version
318318

319319
## ENVIRONMENT -------------------------------
320320

321-
.PHONY: devenv devenv-all
321+
.PHONY: devenv devenv-all node-env
322322

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

340340

341+
node_modules: package.json
342+
# checking npm installed
343+
@npm --version
344+
# installing package.json
345+
npm install --package-lock
346+
347+
nodenv: node_modules ## builds node_modules local environ (TODO)
348+
349+
341350
.env: .env-devel ## creates .env file from defaults in .env-devel
342351
$(if $(wildcard $@), \
343352
@echo "WARNING ##### $< is newer than $@ ####"; diff -uN $@ $<; false;,\

api/tests/requirements.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
aiohttp==3.6.2 # via -r requirements.in, pytest-aiohttp
88
async-timeout==3.0.1 # via aiohttp
9-
attrs==20.1.0 # via aiohttp, jsonschema, openapi-core, pytest
9+
attrs==20.2.0 # via aiohttp, jsonschema, openapi-core, pytest
1010
chardet==3.0.4 # via aiohttp
1111
coverage==5.2.1 # via -r requirements.in, pytest-cov
1212
idna-ssl==1.1.0 # via aiohttp
@@ -16,13 +16,13 @@ iniconfig==1.0.1 # via pytest
1616
isodate==0.6.0 # via openapi-core, openapi-schema-validator
1717
jsonschema==3.2.0 # via openapi-schema-validator, openapi-spec-validator
1818
lazy-object-proxy==1.5.1 # via openapi-core
19-
more-itertools==8.4.0 # via openapi-core, pytest
19+
more-itertools==8.5.0 # via openapi-core, pytest
2020
multidict==4.7.6 # via aiohttp, yarl
2121
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.16.0 # via openapi-core
25+
parse==1.17.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

ci/github/system-testing/e2e.bash

+17-10
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,17 @@ uninstall_insecure_registry() {
7474
}
7575

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

81+
}
82+
83+
setup_and_run_stack() {
8184
# configure simcore for testing with a private registry
8285
install_insecure_registry
8386

87+
echo "--------------- starting swarm ..."
8488
# start simcore and set log-level
8589
export LOG_LEVEL=WARNING
8690
make up-version
@@ -135,29 +139,32 @@ setup_database() {
135139
install() {
136140
## shortcut
137141
setup_images
142+
setup_and_run_stack
138143
setup_environment
139144
setup_registry
140145
setup_database
141146
}
142147

143148
test() {
149+
sleep 5
144150
pushd tests/e2e
145151
make test
146152
popd
147-
148153
}
149154

150-
recover_artifacts() {
155+
dump_docker_logs() {
151156
# all screenshots are in tests/e2e/screenshots if any
152157

153158
# get docker logs.
154-
# WARNING: dumping long logs might take hours!!
155-
mkdir simcore_logs
156-
(docker service logs --timestamps --tail=300 --details ${SWARM_STACK_NAME}_webserver >simcore_logs/webserver.log 2>&1) || true
157-
(docker service logs --timestamps --tail=200 --details ${SWARM_STACK_NAME}_director >simcore_logs/director.log 2>&1) || true
158-
(docker service logs --timestamps --tail=200 --details ${SWARM_STACK_NAME}_storage >simcore_logs/storage.log 2>&1) || true
159-
(docker service logs --timestamps --tail=200 --details ${SWARM_STACK_NAME}_sidecar >simcore_logs/sidecar.log 2>&1) || true
160-
(docker service logs --timestamps --tail=200 --details ${SWARM_STACK_NAME}_catalog >simcore_logs/catalog.log 2>&1) || true
159+
# NOTE: dumping logs sometimes hangs. Introducing a timeout
160+
mkdir --parents simcore_logs
161+
(timeout 30 docker service logs --timestamps --tail=300 --details ${SWARM_STACK_NAME}_webserver >simcore_logs/webserver.log 2>&1) || true
162+
(timeout 30 docker service logs --timestamps --tail=200 --details ${SWARM_STACK_NAME}_director >simcore_logs/director.log 2>&1) || true
163+
(timeout 30 docker service logs --timestamps --tail=200 --details ${SWARM_STACK_NAME}_storage >simcore_logs/storage.log 2>&1) || true
164+
(timeout 30 docker service logs --timestamps --tail=200 --details ${SWARM_STACK_NAME}_sidecar >simcore_logs/sidecar.log 2>&1) || true
165+
(timeout 30 docker service logs --timestamps --tail=200 --details ${SWARM_STACK_NAME}_catalog >simcore_logs/catalog.log 2>&1) || true
166+
(timeout 30 docker service logs --timestamps --tail=200 --details ${SWARM_STACK_NAME}_migration >simcore_logs/migration.log 2>&1) || true
167+
(timeout 30 docker service logs --timestamps --tail=200 --details ${SWARM_STACK_NAME}_postgres >simcore_logs/postgres.log 2>&1) || true
161168
}
162169

163170
clean_up() {
66.9 KB
Loading

package-lock.json

+15-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"eslint-plugin-qx-rules": "^0.1.0",
1010
"puppeteer": "^1.19.0",
1111
"puppeteer-to-istanbul": "^1.2.2",
12-
"yargs": "^13.3.0"
12+
"yargs": "^13.3.0",
13+
"yargs-parser": ">=13.1.2"
1314
}
1415
}

packages/postgres-database/Makefile

+9-1
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,19 @@ migrate: $(DOT_ENV_FILE) ## basic migration update (use ONLY for development pur
8989

9090

9191

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

9897
down-pg down-prod: $(docker-compose-configs) ## stops pg server
9998
docker-compose -f tests/docker-compose.yml $(if $(findstring -prod,$@),-f tests/docker-compose.prod.yml,) down
99+
100+
101+
102+
.PHONY: auto-doc
103+
auto-doc: install-dev ## Creates entity relationship diagram (ERD) defined under ``simcore_postgres_database.models``
104+
# installing doc dependencies (install-doc)
105+
pip install eralchemy
106+
# running script
107+
python scripts/create_erd.py

0 commit comments

Comments
 (0)