From e9b13935587dc8850f44ca5d3cb5fb15b1bb4a47 Mon Sep 17 00:00:00 2001 From: dachengx Date: Sat, 21 Sep 2024 13:53:22 -0500 Subject: [PATCH] Use `install.sh` from utilix --- alea/submitters/combine.sh | 2 +- alea/submitters/htcondor.py | 5 ++-- alea/submitters/install.sh | 34 ---------------------------- alea/submitters/run_toymc_wrapper.sh | 2 +- 4 files changed, 5 insertions(+), 38 deletions(-) delete mode 100644 alea/submitters/install.sh diff --git a/alea/submitters/combine.sh b/alea/submitters/combine.sh index e3c3258..f26ab52 100644 --- a/alea/submitters/combine.sh +++ b/alea/submitters/combine.sh @@ -13,7 +13,7 @@ ls -lh output_filename=$workflow_id-combined_output.tar.gz # Tar all the .h5 files into the output file -tar -czf $output_filename *.h5 *.h5.log +tar czfv $output_filename *.h5 *.h5.log # Check the output echo "Checking the output" diff --git a/alea/submitters/htcondor.py b/alea/submitters/htcondor.py index b27f2a6..156f0d2 100644 --- a/alea/submitters/htcondor.py +++ b/alea/submitters/htcondor.py @@ -7,6 +7,7 @@ import shutil from pathlib import Path from tqdm import tqdm +import utilix from utilix.x509 import _validate_x509_proxy from utilix.tarball import Tarball from Pegasus.api import ( @@ -66,8 +67,8 @@ def __init__(self, *args, **kwargs): self.combine_disk = self.htcondor_configurations.pop("combine_disk", 20_000) # Dagman configurations - self.dagman_maxidle = self.htcondor_configurations.pop("dagman_maxidle", 100_000) self.dagman_retry = self.htcondor_configurations.pop("dagman_retry", 2) + self.dagman_maxidle = self.htcondor_configurations.pop("dagman_maxidle", 100_000) self.dagman_maxjobs = self.htcondor_configurations.pop("dagman_maxjobs", 100_000) super().__init__(*args, **kwargs) @@ -383,7 +384,7 @@ def _generate_rc(self): rc.add_replica( "local", "install.sh", - "file://{}".format(self.top_dir / "alea/submitters/install.sh"), + f"file://{os.path.join(os.path.dirname(utilix.__file__), 'install.sh')}", ) return rc diff --git a/alea/submitters/install.sh b/alea/submitters/install.sh deleted file mode 100644 index 96e6d02..0000000 --- a/alea/submitters/install.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -set -e - -# List of packages -packages=("alea") - -# Loop through each package -for package in "${packages[@]}" -do - # Check if the tarball exists - if [ ! -f "$package.tar.gz" ]; then - echo "Tarball $package.tar.gz not found. Skipping $package." - echo - continue - fi - - echo "Installing $package:" - - # Create a directory for the package - mkdir -p $package - - # Extract the tarball to the package directory - tar -xzf $package.tar.gz -C $package --strip-components=1 - - # Install the package in very quiet mode by -qq - pip install ./$package --user --no-deps -qq - - # Verify the installation by importing the package - python -c "import $package; print($package.__file__)" - - echo "$package installation complete." - echo -done diff --git a/alea/submitters/run_toymc_wrapper.sh b/alea/submitters/run_toymc_wrapper.sh index dd7e917..0dea254 100644 --- a/alea/submitters/run_toymc_wrapper.sh +++ b/alea/submitters/run_toymc_wrapper.sh @@ -92,7 +92,7 @@ SEED=$(echo "$seed" | sed "s/'/\"/g") METADATA=$(echo "$metadata" | sed "s/'/\"/g") # Installing customized packages -. install.sh +. install.sh alea # Extract tarballs input mkdir -p templates