diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b5c9eddb1..c5456268b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,6 +27,7 @@ variables: CACHE_COMPRESSION_LEVEL: "fastest" FF_USE_FASTZIP: "true" PUSHGATEWAY_URL: "http://zombienet-prometheus-pushgateway.managed-monitoring:9091/metrics/job/zombie-metrics" + DEBUG: "zombie,zombie::network-node,zombie::kube::client::logs" cache: - key: @@ -249,26 +250,26 @@ zombienet-upgrade-node: --local-dir="${LOCAL_DIR}" --test="0001-upgrade-node.zndsl" -paras: - extends: - - .zombienet-common - variables: - GH_DIR: "https://github.com/paritytech/zombienet/tree/${CI_COMMIT_SHORT_SHA}/tests/paras" +# paras: +# extends: +# - .zombienet-common +# variables: +# GH_DIR: "https://github.com/paritytech/zombienet/tree/${CI_COMMIT_SHORT_SHA}/tests/paras" - before_script: - - echo "Zombienet Paras smoke test" - - echo "paritypr/zombienet:${CI_COMMIT_SHORT_SHA}" - - echo "${GH_DIR}" - - export DEBUG=zombie - - export ZOMBIENET_INTEGRATION_TEST_IMAGE="docker.io/paritypr/polkadot-debug:master" - - export BIFROST_COL_IMAGE=docker.io/bifrostnetwork/bifrost:latest - - export MOONBEAM_COL_IMAGE=docker.io/purestake/moonbeam:v0.26 - - export OAK_COL_IMAGE=docker.io/oaknetwork/turing:latest +# before_script: +# - echo "Zombienet Paras smoke test" +# - echo "paritypr/zombienet:${CI_COMMIT_SHORT_SHA}" +# - echo "${GH_DIR}" +# - export DEBUG=zombie +# - export ZOMBIENET_INTEGRATION_TEST_IMAGE="docker.io/paritypr/polkadot-debug:master" +# - export BIFROST_COL_IMAGE=docker.io/bifrostnetwork/bifrost:latest +# - export MOONBEAM_COL_IMAGE=docker.io/purestake/moonbeam:v0.26 +# - export OAK_COL_IMAGE=docker.io/oaknetwork/turing:latest - script: - - /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh - --local-dir="${LOCAL_DIR}" - --test="paras.zndsl" +# script: +# - /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh +# --local-dir="${LOCAL_DIR}" +# --test="paras.zndsl" # db-snapshot: # extends: diff --git a/javascript/packages/orchestrator/src/network.ts b/javascript/packages/orchestrator/src/network.ts index bfb0f8115..6b3732fe6 100644 --- a/javascript/packages/orchestrator/src/network.ts +++ b/javascript/packages/orchestrator/src/network.ts @@ -162,7 +162,16 @@ export class Network { async dumpLogs(showLogPath = true): Promise { const logsPath = this.tmpDir + "/logs"; // create dump directory in local temp - if (!fs.existsSync(logsPath)) fs.mkdirSync(logsPath); + try { + await fs.promises.access( + logsPath, + fs.promises.constants.R_OK | fs.promises.constants.W_OK, + ); + } catch { + // create dir + await fs.promises.mkdir(logsPath); + } + const paraNodes: NetworkNode[] = Object.values(this.paras).reduce( (memo: NetworkNode[], value) => memo.concat(value.nodes), [], @@ -170,9 +179,7 @@ export class Network { const dumpsNodes = this.relay.concat(paraNodes); await Promise.allSettled( - dumpsNodes.map((node) => { - this.client.dumpLogs(this.tmpDir, node.name); - }), + dumpsNodes.map((node) => this.client.dumpLogs(this.tmpDir, node.name)), ); if (showLogPath) diff --git a/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts b/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts index f27d41258..d5a884389 100644 --- a/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts +++ b/javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts @@ -851,7 +851,7 @@ export class KubeClient extends Client { return result.stdout.split(","); } - async dumpLogs(path: string, podName: string) { + async dumpLogs(path: string, podName: string): Promise { const dstFileName = `${path}/logs/${podName}.log`; const logs = await this.getNodeLogs(podName); await fs.writeFile(dstFileName, logs);