Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
11aa79d
Mitigate ecoli/multigen parts from wcEcoli to vEcoli
Shu-Feather Jun 24, 2025
edb539c
Fix dimension mismatch in average_monomer_counts
Shu-Feather Jun 25, 2025
134f88b
Modification and Add configs
Shu-Feather Jun 25, 2025
4f1200f
Merge remote-tracking branch 'origin/master' into GetStart
Shu-Feather Jun 25, 2025
ad329d5
Migration
Shu-Feather Jun 26, 2025
ca8003e
Merge remote-tracking branch 'origin' into GetStart
Shu-Feather Jun 26, 2025
8cc9be9
Delete personal Config
Shu-Feather Jun 26, 2025
024d0bb
Add actions read permission to Docker image security scan
thalassemia Jun 27, 2025
37096ed
Test docker scan in PR
thalassemia Jun 27, 2025
bc63c13
More informative error message for existing output directory
thalassemia Jun 28, 2025
673924c
Fix typo
thalassemia Jun 28, 2025
2527d95
Add curl for authentication on Google Cloud
thalassemia Jun 28, 2025
cf57b31
Clarify Google Cloud setup
thalassemia Jun 28, 2025
b54750c
Make outdirs for Nextflow config and workflow files to be copied
thalassemia Jun 28, 2025
43bac0d
Fix outdir determination
thalassemia Jun 28, 2025
223e533
Fixes to ParquetEmitter finalization
thalassemia Jun 28, 2025
54731fc
Give sim chance to finish cleanly in runscripts/sim.py
thalassemia Jun 28, 2025
839521e
Add multigeneration analysis focused on replication, transcription an…
Shu-Feather Jun 28, 2025
1e32d84
Explicilty finalize Parquet emitter instead of relying on atexit hook
thalassemia Jun 28, 2025
8125da8
Remove unused atexit import
thalassemia Jun 28, 2025
cd05466
Add rna_decay_03_high analysis method in multigen
Shu-Feather Jun 29, 2025
3f6d2c9
Do not set success flag if exception raised
thalassemia Jun 29, 2025
28345d4
Ensure emits are finalized even if wrapper is interrupted
thalassemia Jun 29, 2025
a3bfd05
Cleanup documentation for EcoliSim
thalassemia Jun 29, 2025
8a44960
Handle keyboard interrupt in engine process
thalassemia Jun 29, 2025
bb604d5
BUG FIX at ecoli_master_sim.py
Shu-Feather Jun 30, 2025
cad3044
Specify uv install method
thalassemia Jun 30, 2025
1572e25
File_path modification for analysis.py
Shu-Feather Jul 1, 2025
9fbe9fd
Modification for 5 multigeneration analysing methods
Shu-Feather Jul 1, 2025
930e8af
Delete wrong-named files
Shu-Feather Jul 1, 2025
433e632
Add multigeneration analysis into ecoli-glucose-minimal simulation
Shu-Feather Jul 1, 2025
d3bf0db
Modification for array
Shu-Feather Jul 1, 2025
73dd221
More polished pip-audit action
thalassemia Jul 2, 2025
5ba125f
Run audit on master branch only
thalassemia Jul 2, 2025
0f3c694
Added a new tip to Step 4 to account for troubleshooting issues assoc…
mpg19 Jul 2, 2025
d6b881a
Merge pull request #338 from CovertLab/pip-audit
thalassemia Jul 2, 2025
aa49300
Merge branch 'master' into read-me-quick-fix
thalassemia Jul 2, 2025
17bd5c1
Merge pull request #340 from CovertLab/read-me-quick-fix
thalassemia Jul 2, 2025
d70c13a
Merge branch 'master' into minor-fix
thalassemia Jul 2, 2025
c53efd5
Merge pull request #335 from CovertLab/minor-fix
thalassemia Jul 2, 2025
e4adb26
fix(security): update package versions
github-actions[bot] Jul 2, 2025
12bdd5e
Merge pull request #341 from CovertLab/security-updates
thalassemia Jul 2, 2025
2dceefd
Delete Redundance
Shu-Feather Jul 3, 2025
41c8549
Delete to.panda()
Shu-Feather Jul 3, 2025
9b145b6
Remove calling Bulk in ribosome_production.py
Shu-Feather Jul 3, 2025
1b6973a
Remove calling Bulk in ribosome_usage.py
Shu-Feather Jul 3, 2025
2747599
Modification for 2 passes through the data
Shu-Feather Jul 3, 2025
bbd540c
Use unpivot to simplify the loop in ribosome_crowding.py
Shu-Feather Jul 3, 2025
d893352
Delete redundant column
Shu-Feather Jul 3, 2025
1d43de9
Modification for plot and explanation
Shu-Feather Jul 3, 2025
7047520
Merge branch 'master' into GetStart
thalassemia Jul 3, 2025
6c94c6d
update
Shu-Feather Jul 3, 2025
a4b7476
Merge remote-tracking branch 'refs/remotes/origin/GetStart' into GetS…
Shu-Feather Jul 3, 2025
fe28cd2
Merge pull request #336 from CovertLab/GetStart, about multigeneratio…
Shu-Feather Jul 3, 2025
cd8b2fa
Add cell_mass analysis used for multivariant simulation
Shu-Feather Jul 7, 2025
b109161
Merge remote-tracking branch 'origin' into GetStart
Shu-Feather Jul 7, 2025
13cad89
Modification
Shu-Feather Jul 7, 2025
2cd3804
Modification
Shu-Feather Jul 7, 2025
46ce7cc
Modification
Shu-Feather Jul 7, 2025
0c790c0
Add vl-convert dependency
thalassemia Jul 8, 2025
5b3426c
Corret the logic for SQL requirement and plot
Shu-Feather Jul 8, 2025
4e2b360
Merge pull request #343 from CovertLab/vl-convert
thalassemia Jul 8, 2025
84fc318
Correct the legend in ribosome_usage plot
Shu-Feather Jul 8, 2025
fc5e779
Merge with update Master
Shu-Feather Jul 8, 2025
e7e993a
Merge pull request #342 from CovertLab/GetStart
Shu-Feather Jul 9, 2025
b3ef046
Safer method of cleaning exponent and base
thalassemia Jul 9, 2025
0d5c79a
Prevent unintentional overwriting of analysis metadata
thalassemia Jul 9, 2025
e1a5ba3
Merge pull request #344 from CovertLab/table-fix
thalassemia Jul 9, 2025
469f960
Reminder to set shared binary permissions after updating
thalassemia Jul 9, 2025
148d2af
Merge pull request #345 from CovertLab/update-bin
thalassemia Jul 9, 2025
a78640b
Add cell mass analysis to Jenkins test
thalassemia Jul 10, 2025
3b35a80
Merge pull request #346 from CovertLab/add-jenkins
thalassemia Jul 10, 2025
ebfd336
fix(security): update package versions
github-actions[bot] Jul 22, 2025
9357e4a
Merge pull request #347 from CovertLab/security-updates
thalassemia Aug 1, 2025
ab5f4fb
Doc. update on experiments and hpc part
Shu-Feather Aug 2, 2025
4971f7d
Modification for hpc documentation
Shu-Feather Aug 5, 2025
deeddff
Merge pull request #350 from CovertLab/Doc_Curation
Shu-Feather Aug 6, 2025
68b0ef1
small edit to documentation
afowler2 Aug 22, 2025
db73593
Create archive of files to include in Apptainer image
thalassemia Aug 5, 2025
ac5342c
Try substituting Apptainer env vars
thalassemia Aug 5, 2025
5fd29d4
Handle multiple vars in .env and reduce output
thalassemia Aug 6, 2025
c972c2c
Fix heading underline
thalassemia Aug 23, 2025
079c43c
Merge pull request #352 from CovertLab/sherlock-documentation-update
thalassemia Aug 23, 2025
13feaa1
More robust `runscripts/analysis.py` option handling and docs
thalassemia Aug 23, 2025
c475eea
More robust image path handling and docs
thalassemia Aug 23, 2025
e1e70b5
Link docs in template configs
thalassemia Aug 23, 2025
434b767
Document variant_data_dir generic path
thalassemia Aug 25, 2025
4188de1
Better error handling to address Copilot review
thalassemia Aug 25, 2025
3c8d02d
Exclude test_sherlock output from later images
thalassemia Aug 25, 2025
d417942
Merge pull request #353 from CovertLab/analysis_qol
thalassemia Aug 26, 2025
86feaf8
Merge branch 'master' into app-image
thalassemia Aug 26, 2025
5877c82
Get absolute path for Sherlock image dir
thalassemia Aug 26, 2025
5be839b
Merge pull request #351 from CovertLab/app-image
thalassemia Aug 26, 2025
0e9bc4e
Configurable generation skipping for protein counts validation
thalassemia Sep 4, 2025
bc1c711
Fix generation skipping logic
thalassemia Sep 4, 2025
0d01998
Merge pull request #354 from CovertLab/validation_skip_gens
mpg19 Sep 8, 2025
7f4124e
Update media_recipes.tsv
HSMSC Sep 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,7 @@ trace-*
# uv venv #
###########
.venv/

# Sherlock test #
#################
test_sherlock/
3 changes: 3 additions & 0 deletions .github/workflows/docker_security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ permissions:
contents: read
security-events: write
pull-requests: write
actions: read

on:
push:
branches:
- master
pull_request:
branches: [master]
schedule:
- cron: "0 0 * * *" # Runs daily at midnight UTC

Expand Down
323 changes: 19 additions & 304 deletions .github/workflows/pip_audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ on:
- cron: '00 00 * * *'
push:
branches: [master]
pull_request:
branches: [master]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -28,317 +26,34 @@ jobs:
enable-cache: true
version: "0.7.12"

- name: Configure Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'

- name: Audit dependencies and identify vulnerabilities
id: audit
run: |
# Export requirements for pip-audit to analyze
uv export --all-extras --format requirements-txt --no-emit-project > requirements.txt

# Run pip-audit but don't fail if vulnerabilities are found
uvx pip-audit -r requirements.txt --disable-pip -v > pip_audit_results.txt || true

# Check if vulnerabilities were found
if [ ! -s pip_audit_results.txt ]; then
echo "has_vulnerabilities=false" >> $GITHUB_OUTPUT
else
echo "has_vulnerabilities=true" >> $GITHUB_OUTPUT

# Create a detailed mapping of all vulnerabilities for later use
{
# Add a header row for the CSV format
echo "pkg_name,current_ver,vuln_id,fixed_ver"

# Extract all vulnerabilities with their details
grep -v "^Name\|^------" pip_audit_results.txt | while read -r line; do
if [[ -n "$line" ]]; then
# Extract fields: package name, current version, vulnerability ID, fixed version
pkg_name=$(echo "$line" | awk '{print $1}')
current_ver=$(echo "$line" | awk '{print $2}')
vuln_id=$(echo "$line" | awk '{print $3}')
fixed_ver=$(echo "$line" | awk '{print $NF}')

# Output as CSV
echo "$pkg_name,$current_ver,$vuln_id,$fixed_ver"
fi
done
} > all_vulnerabilities.csv

# Store all_vulnerabilities.csv as an artifact
echo "all_vulns_data<<EOF" >> $GITHUB_OUTPUT
cat all_vulnerabilities.csv >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

# Get unique packages with their highest fixed version
{
echo "Processing unique packages with highest fixed versions:"

# Use awk to process the CSV and find highest versions
awk -F, 'BEGIN {OFS=","}
# Custom function for semantic version comparison
function version_gt(v1, v2) {
n1 = split(v1, a, "[.-]")
n2 = split(v2, b, "[.-]")

# Compare each version component
for (i = 1; i <= n1 && i <= n2; i++) {
if (a[i] == b[i]) continue
return (a[i]+0) > (b[i]+0)
}
return n1 > n2
}
NR == 1 {next} # Skip header
{
pkg = $1
curr_ver = $2
vuln = $3
fix_ver = $4

print "Found=" pkg, "current=" curr_ver, "vuln=" vuln, "fix=" fix_ver

# Check if we have seen this package before
if (!(pkg in highest_ver) || version_gt(fix_ver, highest_ver[pkg])) {
highest_ver[pkg] = fix_ver
print " Updated highest version for", pkg, "to", fix_ver
}
}
END {
# Output unique packages with highest versions
for (pkg in highest_ver) {
print pkg "==" highest_ver[pkg]
}
}' all_vulnerabilities.csv
} > unique_packages.txt

# Store the consolidated package list
consolidated_packages=$(cat unique_packages.txt | grep -v "^Processing\|^Found\|^ Updated" | sort)
echo "vulnerable_packages<<EOF" >> $GITHUB_OUTPUT
echo "$consolidated_packages" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
fi

- name: Process vulnerable packages individually
if: steps.audit.outputs.has_vulnerabilities == 'true'
id: process_packages
run: |
# Build the JSON array in a variable first
json_data="["
first_item=true

# Store all vulnerability data for reference
all_vulns="${{ steps.audit.outputs.all_vulns_data }}"

while IFS= read -r line; do
if [[ -n "$line" && $line =~ ([^=]+)==(.+) ]]; then
pkg_name="${BASH_REMATCH[1]}"
pkg_version="${BASH_REMATCH[2]}"

echo "Processing package: $pkg_name -> $pkg_version"

# Get current version from the first vulnerability entry
current_ver=$(echo "$all_vulns" | grep -m 1 "^$pkg_name," | cut -d',' -f2)

# Get all vulnerability IDs for this package
vuln_ids=$(echo "$all_vulns" | grep "^$pkg_name," | cut -d',' -f3 | sort -u | paste -sd "," -)

# Create signature specific to this package
pkg_signature=$(echo "$pkg_name-$pkg_version" | md5sum | cut -d ' ' -f1)

echo " Current version: $current_ver"
echo " Vulnerabilities: $vuln_ids"
echo " Signature: $pkg_signature"

# Add to JSON (with comma if not first)
if [ "$first_item" = "true" ]; then
first_item=false
else
json_data+=","
fi

# Escape any special characters in the values
pkg_name_esc=$(echo "$pkg_name" | jq -R .)
pkg_version_esc=$(echo "$pkg_version" | jq -R .)
current_ver_esc=$(echo "$current_ver" | jq -R .)
vuln_ids_esc=$(echo "$vuln_ids" | jq -R .)

# Build the JSON object with proper escaping
json_data+="{\"name\":${pkg_name_esc},\"version\":${pkg_version_esc},\"current_version\":${current_ver_esc},\"vuln_id\":${vuln_ids_esc},\"signature\":\"$pkg_signature\"}"
fi
done <<< "${{ steps.audit.outputs.vulnerable_packages }}"

# Close the JSON array
json_data+="]"

# Use the multiline delimiter syntax for GitHub Actions outputs
echo "package_data<<EOF" >> $GITHUB_OUTPUT
echo "$json_data" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

outputs:
has_vulnerabilities: ${{ steps.audit.outputs.has_vulnerabilities }}
package_data: ${{ steps.process_packages.outputs.package_data }}
all_vulns_data: ${{ steps.audit.outputs.all_vulns_data }}

update_packages:
needs: build
if: needs.build.outputs.has_vulnerabilities == 'true'
runs-on: ubuntu-latest
strategy:
matrix:
package: ${{ fromJSON(needs.build.outputs.package_data) }}
# Allow other package updates to continue if one fails
fail-fast: false
# Limit concurrent jobs to avoid API rate limits
max-parallel: 5

steps:
- uses: actions/checkout@v4

- name: Set up uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
version: "0.7.12"

- name: Check for existing PRs
id: check_prs
run: |
# Check for existing PRs with this package name
pkg_name="${{ matrix.package.name }}"
existing_pr=$(gh pr list --json number,title,body --search "in:title security update for $pkg_name" --jq '.[0]')

if [[ -n "$existing_pr" ]]; then
pr_number=$(echo "$existing_pr" | jq -r '.number')
echo "Found existing PR #$pr_number for $pkg_name"

# Check if PR contains an older version of the same package
pr_body=$(echo "$existing_pr" | jq -r '.body')
if echo "$pr_body" | grep -q "Package signature: ${{ matrix.package.signature }}"; then
echo "Found PR with identical package version - skipping"
echo "skip_pr_creation=true" >> $GITHUB_OUTPUT
exit 0
fi

# PR exists but for a different version - we'll close it and create new one
echo "PR exists for different version - will close and create new PR"
gh pr close $pr_number --comment "Closing in favor of PR with newer version ${pkg_name}==${matrix.package.version}"
fi

echo "Will create new PR for ${pkg_name}==${{ matrix.package.version }}"
echo "skip_pr_creation=false" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Configure Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'

- name: Update package
if: steps.check_prs.outputs.skip_pr_creation == 'false'
id: update
continue-on-error: true # Continue to cleanup step even if this fails
run: |
# Create a unique branch name for this package
branch_name="security-update-${{ matrix.package.name }}-${{ github.run_id }}"
echo "branch_name=$branch_name" >> $GITHUB_OUTPUT

# Ensure we're on master and it's up-to-date
git fetch origin master
git checkout master
git pull origin master

# Create new branch for this package only
git checkout -b $branch_name

echo "Setting up uv environment..."
uv sync --frozen --all-extras

# Update only this specific package in the lock file
echo "Updating ${{ matrix.package.name }} to ${{ matrix.package.version }}"
uv lock --upgrade-package "${{ matrix.package.name }}==${{ matrix.package.version }}"

# Verify changes were made
if git diff --quiet uv.lock; then
echo "No changes detected in uv.lock file. This might indicate an issue with the update process."
exit 1
fi

# Commit changes
git add uv.lock
git commit -m "fix(security): update ${{ matrix.package.name }} to ${{ matrix.package.version }}"

# Push to the remote branch
git push origin $branch_name
uvx pip-audit -r requirements.txt --disable-pip --desc off --format json > pip_audit_results.txt || true

- name: Create package-specific PR report with all vulnerabilities
if: steps.check_prs.outputs.skip_pr_creation == 'false' && steps.update.outcome == 'success'
id: create_report
- name: Process audit information
run: |
# Get all vulnerability details for this package from the CSV
all_vulns="${{ needs.build.outputs.all_vulns_data }}"

# Create PR description with comprehensive vulnerability information
{
echo "# Security Update: ${{ matrix.package.name }}"
echo ""
echo "This PR updates **${{ matrix.package.name }}** from version ${{ matrix.package.current_version }} to **${{ matrix.package.version }}** to fix the following security vulnerabilities:"
echo ""

# List all vulnerabilities for this package
echo "## Vulnerability Details"
echo ""
echo "| Vulnerability ID | Affected Version | Fixed Version |"
echo "| --------------- | --------------- | ------------ |"

# Parse the CSV data to extract vulnerabilities for this package
echo "$all_vulns" | grep -v "^pkg_name" | grep "^${{ matrix.package.name }}," | while IFS=, read -r pkg curr_ver vuln_id fixed_ver; do
# If the vulnerability is fixed by the version we're updating to, include it
echo "| $vuln_id | $curr_ver | $fixed_ver |"
done
# Avoid downloading and installing entire project and all dependencies
uv run --no-sync --isolated --with packaging runscripts/debug/process_vulnerabilities.py pip_audit_results.txt

echo ""
echo "Close and reopen this PR to trigger the CI/CD pipelines before merging."
echo ""
- name: Apply package updates
run: |
./apply_security_upgrades.sh

echo ""
echo "<!-- Package signature: ${{ matrix.package.signature }} -->"
} > pr_description.md

cat pr_description.md

- name: Create Pull Request
if: steps.check_prs.outputs.skip_pr_creation == 'false' && steps.update.outcome == 'success'
id: create_pr
continue-on-error: true
run: |
gh pr create \
--title "Security update for ${{ matrix.package.name }} to ${{ matrix.package.version }}" \
--body-file pr_description.md \
--base master \
--head ${{ steps.update.outputs.branch_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Cleanup on failure
if: |
steps.check_prs.outputs.skip_pr_creation == 'false' &&
(steps.update.outcome == 'failure' || steps.create_pr.outcome == 'failure') &&
steps.update.outputs.branch_name != ''
run: |
echo "Cleaning up branch due to workflow failure..."
branch_name="${{ steps.update.outputs.branch_name }}"

# Check if branch exists before attempting to delete
if git ls-remote --heads origin $branch_name | grep -q $branch_name; then
echo "Deleting branch: $branch_name"
git push origin --delete $branch_name
else
echo "Branch $branch_name does not exist or was not created"
fi
uses: peter-evans/create-pull-request@v7
with:
commit-message: |
fix(security): update package versions
sign-commits: true
title: |
Security updates
body-path: vulnerability_report.md
delete-branch: true
branch: security-updates
add-paths: uv.lock
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,7 @@ trace-*
#######################
.venv/

# Sherlock test #
#################
test_sherlock/

Loading