remove wrapper ecg

This commit is contained in:
Quentin Guilloteau 2024-08-29 11:23:54 +02:00
parent 20c7238581
commit d8d2a2e8e2
3 changed files with 16 additions and 18 deletions

View File

@ -79,8 +79,7 @@ rule run_ecg:
input:
"flake.nix",
"flake.lock",
ecg="ecg.py",
ecg_wrapper="workflow/scripts/ecg_wrapper.sh",
ecg="ecg/app/ecg.py",
execo_wrapper="workflow/scripts/submission_g5k.py",
oar_wrapper="workflow/scripts/ecg_oar_wrapper.oar.bash",
artifact=f"{ARTIFACTS_FOLDER_JSON}/{{artifact}}.{EXTENSION}"
@ -90,7 +89,20 @@ rule run_ecg:
build_status = f"{PREFIX}/build_status/{{artifact}}/{{date}}.csv",
artifact_hash = f"{PREFIX}/artifact_hash/{{artifact}}/{{date}}.csv",
shell:
(SHELLS_ECG["g5k"] if SYSTEM == "g5k" else "") + SHELLS_ECG["local"] + ("'" if SYSTEM == "g5k" else "")
(f"python3 {{input.execo_wrapper}} --path {os.getcwd()} \
--script {{input.oar_wrapper}} \
--site {config['site']} \
--cluster {config['cluster']} \
--max-duration {config['max_duration']} \
--checkpoint {config['checkpoint']} \
{'--besteffort' if config['besteffort'] else ''} \
--sleep_time {config['sleep_time']} \
--build_status_file {{output.build_status}} \
--artifact {{wildcards.artifact}} -- '" if SYSTEM == "g5k" else "") + \
"""
nix develop .#ecg-shell --command ecg -p {output.pkg} -b {output.build_status} -a {output.artifact_hash} {output.artifact} &> {output.log} || echo "{input.artifact}, `date +%s.%N`, script_crash" > {output.build_status}
""" + \
("'" if SYSTEM == "g5k" else "")
rule update_blacklist:
input:

View File

@ -17,7 +17,7 @@ export PATH=~/.local/bin:$PATH
g5k-setup-docker -t
handler() {
echo "${ARTIFACT_FILE}, `date +%s.%N`, job_time_exceeded" >> ${BUILD_STATUS_FILE}; exit 0;
echo "${ARTIFACT_FILE}, `date +%s.%N`, job_time_exceeded" > ${BUILD_STATUS_FILE}; exit 0;
}
trap handler SIGUSR2

View File

@ -1,14 +0,0 @@
#!/bin/bash
ECG=$1
CONFIG=$2
PKGLIST=$3
BUILD_STATUS=$4
ARTHASH_LOG=$5
OUTPUT_LOG=$6
python3 $ECG -p $PKGLIST -b $BUILD_STATUS -a $ARTHASH_LOG $CONFIG > $OUTPUT_LOG 2> $OUTPUT_LOG
if [ $? -ne 0 ]
then
echo "${CONFIG}, `date +%s.%N`, script_crash" >> ${BUILD_STATUS}; exit 0;
fi