Skip to content

Commit

Permalink
Merge branch 'main' into update-pjs
Browse files Browse the repository at this point in the history
  • Loading branch information
pepoviola authored Oct 3, 2024
2 parents b545374 + 6c56366 commit b1de90c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/k8s-cleaner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
export_default_credentials: true

- name: Login to GCP
uses: google-github-actions/[email protected].5
uses: google-github-actions/[email protected].6
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}

Expand Down
37 changes: 19 additions & 18 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
15 changes: 11 additions & 4 deletions javascript/packages/orchestrator/src/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,17 +162,24 @@ export class Network {
async dumpLogs(showLogPath = true): Promise<string> {
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),
[],
);

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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
const dstFileName = `${path}/logs/${podName}.log`;
const logs = await this.getNodeLogs(podName);
await fs.writeFile(dstFileName, logs);
Expand Down

0 comments on commit b1de90c

Please sign in to comment.