Skip to content

Commit

Permalink
Remove observability changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gianbelinche committed Oct 8, 2024
1 parent acb8b4e commit 1c5fcca
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 49 deletions.
42 changes: 2 additions & 40 deletions infrastructure/zk/src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,9 @@ import * as run from './run';
import * as server from './server';
import { createVolumes, up } from './up';

const fs = require('fs');
const yaml = require('yaml');

// Checks if all required tools are installed with the correct versions
const checkEnv = async (runObservability: boolean): Promise<void> => {
const checkEnv = async (): Promise<void> => {
const tools = ['node', 'yarn', 'docker', 'cargo'];

for (const tool of tools) {
await utils.exec(`which ${tool}`);
}
Expand All @@ -41,36 +37,6 @@ const submoduleUpdate = async (): Promise<void> => {
await utils.exec('git submodule update');
};

// clone dockprom and zksync-era dashboards
const setupObservability = async (): Promise<void> => {
// clone dockprom, era-observability repos and export era dashboards to dockprom
await utils.spawn(
`rm -rf ./target/dockprom && git clone https://github.com/stefanprodan/dockprom.git ./target/dockprom \
&& rm -rf ./target/era-observability && git clone https://github.com/matter-labs/era-observability.git ./target/era-observability \
&& cp ./target/era-observability/dashboards/* ./target/dockprom/grafana/provisioning/dashboards
`
);

const fileContents = fs.readFileSync('./target/dockprom/prometheus/prometheus.yml', 'utf8');
let config = yaml.parse(fileContents);
config.scrape_configs.push({
job_name: 'proxy-blob-retriever',
scrape_interval: '5s',
honor_labels: true,
static_configs: [{ targets: ['host.docker.internal:7070'] }]
});
config.scrape_configs.push({
job_name: 'zksync',
scrape_interval: '5s',
honor_labels: true,
static_configs: [{ targets: ['host.docker.internal:3312'] }]
});
const newYaml = yaml.stringify(config);
fs.writeFileSync('./target/dockprom/prometheus/prometheus.yml', newYaml, 'utf8');

await utils.spawn('cp EigenDA.json ./target/dockprom/grafana/provisioning/dashboards/EigenDA.json');
};

// Sets up docker environment and compiles contracts
type InitSetupOptions = {
skipEnvSetup: boolean;
Expand All @@ -84,10 +50,6 @@ const initSetup = async ({
runObservability,
deploymentMode
}: InitSetupOptions): Promise<void> => {
if (runObservability) {
await announced('Pulling observability repos', setupObservability());
}

await announced(
`Initializing in ${deploymentMode == contract.DeploymentMode.Validium ? 'Validium mode' : 'Roll-up mode'}`
);
Expand All @@ -96,7 +58,7 @@ const initSetup = async ({
}
if (!process.env.CI && !skipEnvSetup) {
await announced('Pulling images', docker.pull());
await announced('Checking environment', checkEnv(runObservability));
await announced('Checking environment', checkEnv());
await announced('Checking git hooks', env.gitHooks());
await announced('Create volumes', createVolumes());
await announced('Setting up containers', up(runObservability));
Expand Down
6 changes: 0 additions & 6 deletions zk_toolbox/crates/common/src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,3 @@ pub fn pull(shell: &Shell, link_to_code: PathBuf) -> anyhow::Result<()> {
Cmd::new(cmd!(shell, "git pull origin {current_branch}")).run()?;
Ok(())
}

pub fn checkout(shell: &Shell, path: PathBuf, branch: &str) -> anyhow::Result<()> {
let _dir_guard = shell.push_dir(path);
Cmd::new(cmd!(shell, "git checkout {branch}")).run()?;
Ok(())
}
2 changes: 1 addition & 1 deletion zk_toolbox/crates/config/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub const ERA_OBSERVABILITY_COMPOSE_FILE: &str = "era-observability/docker-compo
/// Path to era observability repository
pub const ERA_OBSERBAVILITY_DIR: &str = "era-observability";
/// Era observability repo link
pub const ERA_OBSERBAVILITY_GIT_REPO: &str = "https://github.com/lambdaclass/era-observability";
pub const ERA_OBSERBAVILITY_GIT_REPO: &str = "https://github.com/matter-labs/era-observability";
pub(crate) const LOCAL_APPS_PATH: &str = "apps/";
pub(crate) const LOCAL_CHAINS_PATH: &str = "chains/";
pub(crate) const LOCAL_CONFIGS_PATH: &str = "configs/";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ pub fn run(shell: &Shell) -> anyhow::Result<()> {
ERA_OBSERBAVILITY_GIT_REPO,
ERA_OBSERBAVILITY_DIR,
)?;

git::checkout(shell, path_to_era_observability, "eigenda")?;
spinner.finish();

Ok(())
Expand Down

0 comments on commit 1c5fcca

Please sign in to comment.