Use pre-built jar and v2 tag to bypass Gradle permission issue

- Call java -jar synthea-with-dependencies.jar directly instead of
  run_synthea which invokes Gradle at runtime
- Tag image as v2 to force K8s to pull fresh image
This commit is contained in:
2026-03-25 13:30:24 +01:00
parent a871107728
commit f29323323b
2 changed files with 5 additions and 14 deletions

17
main.nf
View File

@@ -22,7 +22,7 @@ if (!params.outdir) {
// Process to generate synthetic patients // Process to generate synthetic patients
process generatePatients { process generatePatients {
container 'harbor.cluster.omic.ai/omic/synthea-alldiseases:latest' container 'harbor.cluster.omic.ai/omic/synthea-alldiseases:v2'
publishDir params.outdir, mode: 'copy' publishDir params.outdir, mode: 'copy'
input: input:
@@ -37,21 +37,12 @@ process generatePatients {
def genderArg = params.gender < 0.5 ? "M" : (params.gender > 0.5 ? "F" : "B") def genderArg = params.gender < 0.5 ? "M" : (params.gender > 0.5 ? "F" : "B")
def seedArg = params.seed ? "-s ${params.seed}" : "" def seedArg = params.seed ? "-s ${params.seed}" : ""
""" """
# Check if a custom module exists, otherwise use built-in Synthea modules # Use pre-built jar directly (bypasses Gradle which needs write access to .gradle)
MODULE_FILE="/app/src/main/resources/modules/${moduleBasename}.json" cd /app && java -jar /app/build/libs/synthea-with-dependencies.jar \
if [ -f "\${MODULE_FILE}" ]; then
echo "Found custom module: \${MODULE_FILE}" | tee run.log
else
echo "Using built-in Synthea modules for: ${diseaseName}" | tee run.log
fi
# Run Synthea patient generation
cd /app && ./run_synthea \
-p ${params.population} \ -p ${params.population} \
-g ${genderArg} \ -g ${genderArg} \
-a ${params.min_age}-${params.max_age} \ -a ${params.min_age}-${params.max_age} \
${seedArg} \ ${seedArg} 2>&1 | tee run.log
-- ${diseaseName} 2>&1 | tee -a run.log
# Collect FHIR output # Collect FHIR output
mkdir -p fhir mkdir -p fhir

View File

@@ -26,7 +26,7 @@ profiles {
k8s { k8s {
process { process {
executor = 'k8s' executor = 'k8s'
container = 'harbor.cluster.omic.ai/omic/synthea-alldiseases:latest' container = 'harbor.cluster.omic.ai/omic/synthea-alldiseases:v2'
} }
docker { docker {
enabled = true enabled = true