-
Notifications
You must be signed in to change notification settings - Fork 92
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
Add eslint and configuration #893
Conversation
Looks good! I think we need to order the prs since this one modify several files that are pending to merge in others prs. |
PR is not done yet. I prefer to merge this last, as it changes a HUGE amount of files (plus I need to add the log as discussed), so I would not worry at this point. Once it is done we can align on when to merge |
How about letting this PR with console log and setup the logger/console log rule in a new PR ? |
javascript/packages/orchestrator/src/providers/k8s/chain-spec.ts
Outdated
Show resolved
Hide resolved
javascript/packages/orchestrator/src/providers/k8s/chain-spec.ts
Outdated
Show resolved
Hide resolved
javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts
Outdated
Show resolved
Hide resolved
localFilePath: parachainSpecPath, | ||
remoteFilePath: `${client.remoteDir}/${node.chain}-${paraId}.json`, | ||
}); | ||
parachainSpecId = await getChainIdFromSpec(parachainSpecPath); | ||
} | ||
for (const override of node.overrides) { | ||
finalFilesToCopyToNode.push({ | ||
localFilePath: override.local_path, | ||
remoteFilePath: `${client.remoteDir}/${override.remote_name}`, | ||
}); | ||
} | ||
|
||
let keystoreLocalDir; | ||
if (node.accounts) { | ||
// check if the node directory exists if not create (e.g for k8s provider) | ||
let nodeFilesPath = tmpDir.path; | ||
if (parachain && parachain.name) nodeFilesPath += `/${parachain.name}`; | ||
nodeFilesPath += `/${node.name}`; | ||
|
||
await makeDir(nodeFilesPath, true); | ||
|
||
const isStatemint = parachain && parachain.chain?.includes("statemint"); | ||
const keystoreFiles = await generateKeystoreFiles( | ||
node, | ||
nodeFilesPath, | ||
isStatemint, | ||
); | ||
keystoreLocalDir = path.dirname(keystoreFiles[0]); | ||
} | ||
|
||
// replace all network references in command | ||
replaceNetworkRef(podDef, network); | ||
|
||
await client.spawnFromDef( | ||
podDef, | ||
finalFilesToCopyToNode, | ||
keystoreLocalDir, | ||
parachainSpecId || client.chainId, | ||
node.dbSnapshot, | ||
); | ||
|
||
const [nodeIp, nodePort] = await client.getNodeInfo(podDef.metadata.name); | ||
const nodeMultiAddress = await generateBootnodeString( | ||
node.key!, | ||
node.args, | ||
nodeIp, | ||
nodePort, | ||
true, | ||
node.p2pCertHash, | ||
); | ||
multiAddressByNode[podDef.metadata.name] = nodeMultiAddress; | ||
|
||
if (node.addToBootnodes) { | ||
bootnodes.push(nodeMultiAddress); | ||
await addBootNodes(chainSpecFullPath, bootnodes); | ||
} | ||
|
||
let networkNode: NetworkNode; | ||
|
||
const endpointPort = RPC_WS_PORT; | ||
if (options?.inCI) { | ||
const nodeIp = await client.getNodeIP(podDef.metadata.name); | ||
networkNode = new NetworkNode( | ||
node.name, | ||
WS_URI_PATTERN.replace("{{IP}}", nodeIp).replace( | ||
"{{PORT}}", | ||
endpointPort.toString(), | ||
), | ||
METRICS_URI_PATTERN.replace("{{IP}}", nodeIp).replace( | ||
"{{PORT}}", | ||
PROMETHEUS_PORT.toString(), | ||
), | ||
nodeMultiAddress, | ||
userDefinedTypes, | ||
); | ||
} else { | ||
const nodeIdentifier = `${podDef.kind}/${podDef.metadata.name}`; | ||
const fwdPort = await client.startPortForwarding( | ||
endpointPort, | ||
nodeIdentifier, | ||
); | ||
const nodePrometheusPort = await client.startPortForwarding( | ||
PROMETHEUS_PORT, | ||
nodeIdentifier, | ||
); | ||
|
||
const listeningIp = networkSpec.settings.local_ip || LOCALHOST; | ||
|
||
networkNode = new NetworkNode( | ||
node.name, | ||
WS_URI_PATTERN.replace("{{IP}}", listeningIp).replace( | ||
"{{PORT}}", | ||
fwdPort.toString(), | ||
), | ||
METRICS_URI_PATTERN.replace("{{IP}}", listeningIp).replace( | ||
"{{PORT}}", | ||
nodePrometheusPort.toString(), | ||
), | ||
nodeMultiAddress, | ||
userDefinedTypes, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where all this code went ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 Isnt this the code that @pepoviola moved to spawner
through the PR #879 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, is part of the spawner now.
No description provided.