Support diffing against cluster state (#120)

* Support diffing against cluster state

* Upgrade dev agent docker image

* Add metrics ENV var

* lint
pull/125/head
Nam Chu Hoai 3 years ago committed by GitHub
parent 0cd3c5e4e8
commit 42a0d8fb11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      typescript/optics-deploy/config/environments/dev/agent.ts
  2. 16
      typescript/optics-deploy/scripts/dev/update-agents-diff.ts
  3. 16
      typescript/optics-deploy/scripts/testnet/update-agents-diff.ts
  4. 10
      typescript/optics-deploy/src/agents.ts

@ -6,6 +6,6 @@ export const agentConfig: AgentConfig = {
runEnv: 'dev',
docker: {
repo: 'gcr.io/clabs-optics/optics-agent',
tag: 'dev-2021-12-20',
tag: '0cd3c5e4e856f6eb77f04276eee411de5809e03c',
},
};

@ -0,0 +1,16 @@
import { HelmCommand, runAgentHelmCommand } from '../../src/agents';
import { chains } from '../../config/environments/dev/chains';
import { agentConfig } from '../../config/environments/dev/agent';
async function deploy() {
for (const chain of chains) {
await runAgentHelmCommand(
HelmCommand.UpgradeDiff,
agentConfig,
chain,
chains,
);
}
}
deploy().then(console.log).catch(console.error);

@ -0,0 +1,16 @@
import { HelmCommand, runAgentHelmCommand } from '../../src/agents';
import { chains } from '../../config/environments/testnet/chains';
import { agentConfig } from '../../config/environments/testnet/agent';
async function deploy() {
for (const chain of chains) {
await runAgentHelmCommand(
HelmCommand.UpgradeDiff,
agentConfig,
chain,
chains,
);
}
}
deploy().then(console.log).catch(console.error);

@ -33,6 +33,7 @@ export const KEY_ROLES = [
export enum HelmCommand {
Install = 'install',
Upgrade = 'upgrade',
UpgradeDiff = 'template --debug',
}
async function helmValuesForChain(
@ -158,6 +159,7 @@ export async function getAgentEnvVars(
}`,
);
});
envVars.push(`OPT_BASE_METRICS=9090`);
try {
const gcpKeys = await fetchAgentGCPKeys(
@ -233,12 +235,18 @@ export async function runAgentHelmCommand(
chains,
);
const values = helmifyValues(valueDict);
const extraPipe =
action === HelmCommand.UpgradeDiff
? ` | kubectl diff -n ${agentConfig.namespace} --field-manager="Go-http-client" -f - || true`
: '';
return execCmd(
`helm ${action} ${
homeChainConfig.name
} ../../rust/helm/optics-agent/ --namespace ${
agentConfig.namespace
} ${values.join(' ')}`,
} ${values.join(' ')} ${extraPipe}`,
{},
false,
true,

Loading…
Cancel
Save