Skip to content

Commit 736d3a3

Browse files
authored
switch to gitleaks (#1518)
Switch to https://github.com/gitleaks/gitleaks, which seems to be faster and less error-prone than the detect-secrets hook we previously were using --------- Signed-off-by: Peter St. John <pstjohn@nvidia.com>
1 parent 46112e7 commit 736d3a3

30 files changed

Lines changed: 88 additions & 384 deletions

File tree

.gitleaks.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Gitleaks configuration
2+
# https://github.com/gitleaks/gitleaks
3+
4+
title = "BioNeMo Framework Gitleaks Config"
5+
6+
[extend]
7+
useDefault = true
8+
9+
[allowlist]
10+
paths = [
11+
'''3rdparty/''',
12+
]

.gitleaksignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Gitleaks ignore file - fingerprints of known false positives
2+
# https://github.com/gitleaks/gitleaks#gitleaksignore
3+
4+
# False positive: training hyperparameter string `lr=3e-4` matches generic-api-key rule
5+
bionemo-recipes/interpretability/sparse_autoencoders/recipes/esm2/README.md:generic-api-key:116

.pre-commit-config.yaml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,7 @@ repos:
4040
- mdformat-black
4141
- mdformat-frontmatter
4242
- black==25.12.0
43-
- repo: https://github.com/Yelp/detect-secrets
44-
rev: v1.5.0
43+
- repo: https://github.com/gitleaks/gitleaks
44+
rev: v8.24.2
4545
hooks:
46-
- id: detect-secrets
47-
name: detect-secrets (everything but notebooks)
48-
args: ['--baseline', '.secrets.baseline', '--exclude-files', '(.*\.ipynb|.*\.baseline)$', ]
49-
exclude: package.lock.json
50-
- id: detect-secrets
51-
name: detect-secrets (notebooks only)
52-
args: ['--baseline', '.secrets-nb.baseline', '--exclude-files', '^.(?!.*\.ipynb)', '--exclude-lines', '"(hash|id|image/\w+)":.*|<.*at 0x[0-9a-f]+>|object at 0x[0-9a-f]+', ]
46+
- id: gitleaks

.secrets-nb.baseline

Lines changed: 0 additions & 143 deletions
This file was deleted.

.secrets.baseline

Lines changed: 0 additions & 165 deletions
This file was deleted.

bionemo-recipes/recipes/eden_megatron/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ override-dependencies = [
8282
# Internal dependencies
8383
bionemo-recipeutils = { git = "https://github.com/NVIDIA/bionemo-framework.git", branch = "main", subdirectory = "sub-packages/bionemo-recipeutils" }
8484
bionemo-core = { git = "https://github.com/NVIDIA/bionemo-framework.git", branch = "main", subdirectory = "sub-packages/bionemo-core" }
85-
nvidia-resiliency-ext = { git = "https://github.com/NVIDIA/nvidia-resiliency-ext.git", rev = "54f85fe422d296cf04ea524130014bd3a2c3add1" } # pragma: allowlist secret
85+
nvidia-resiliency-ext = { git = "https://github.com/NVIDIA/nvidia-resiliency-ext.git", rev = "54f85fe422d296cf04ea524130014bd3a2c3add1" }
8686

8787
# Megatron Bundle. This points to a version that still supports the deprecated no_weight_decay_cond field until the API for an alternative has been finalized.
88-
megatron-bridge = { git = "https://github.com/NVIDIA-NeMo/Megatron-Bridge.git", rev = "549e3cb970c170b1d7a86d021261efe05e8a5d9f" } # pragma: allowlist secret
89-
megatron-core = { git = "https://github.com/NVIDIA-NeMo/Megatron-Bridge.git", rev = "549e3cb970c170b1d7a86d021261efe05e8a5d9f", subdirectory = "3rdparty/Megatron-LM" } # pragma: allowlist secret
88+
megatron-bridge = { git = "https://github.com/NVIDIA-NeMo/Megatron-Bridge.git", rev = "549e3cb970c170b1d7a86d021261efe05e8a5d9f" }
89+
megatron-core = { git = "https://github.com/NVIDIA-NeMo/Megatron-Bridge.git", rev = "549e3cb970c170b1d7a86d021261efe05e8a5d9f", subdirectory = "3rdparty/Megatron-LM" }
9090

9191
[tool.uv.extra-build-dependencies]
9292
warp-lang = ["wheel_stub"]

bionemo-recipes/recipes/esm2_peft_te/data/prepare_porter6_dataset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131
DATASET_FILES = {
3232
"dataset_train55k_80%.txt": {
3333
"output": "porter6_train_dataset_55k.parquet",
34-
"sha256": "4b1c011d8cea0b892743053eb4234db80344b8d9c90243f19b4637781ce8922b", # pragma: allowlist secret
34+
"sha256": "4b1c011d8cea0b892743053eb4234db80344b8d9c90243f19b4637781ce8922b",
3535
},
3636
"2024Testset_692.adataset": {
3737
"output": "porter6_val_dataset_2024_692.parquet",
38-
"sha256": "b4a1b69f2003a66a62eb106aded784f9938fc734e876458223459fd9a10f1ca2", # pragma: allowlist secret
38+
"sha256": "b4a1b69f2003a66a62eb106aded784f9938fc734e876458223459fd9a10f1ca2",
3939
},
4040
}
4141

bionemo-recipes/recipes/esm2_peft_te/hydra_config/L0_sanity_infer.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ defaults:
33
- _self_
44

55
model_tag: "nvidia/esm2_t6_8M_UR50D"
6-
base_model_config_dir: "<checkpoint.ckpt_dir>/train_ddp/final_model" # pragma: allowlist secret
6+
base_model_config_dir: "<checkpoint.ckpt_dir>/train_ddp/final_model"
77

88
output_file: preds.csv
99

bionemo-recipes/recipes/esm2_peft_te/hydra_config/L1_fb_15B.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ lr_scheduler_kwargs:
4242
num_training_steps: 1_000
4343

4444
checkpoint:
45-
ckpt_dir: "checkpoints/facebook_esm2_t48_15B_UR50D" # pragma: allowlist secret
45+
ckpt_dir: "checkpoints/facebook_esm2_t48_15B_UR50D"
4646
save_final_model: false
4747

4848
logger:

0 commit comments

Comments
 (0)