Skip to content

Commit

Permalink
refactor: remove preprocessing_config and instead supply all argument…
Browse files Browse the repository at this point in the history
…s directly in the call to `silo preprocessing`j

refactor: remove preprocessing_config and instead supply all arguments directly in the call to `silo preprocessing`
  • Loading branch information
Taepper committed Jan 16, 2025
1 parent a05ff33 commit 7e6edbc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 22 deletions.
21 changes: 6 additions & 15 deletions kubernetes/loculus/silo_import_job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ set -e
root_dir=""
last_etag=""
lineage_definition_file=/preprocessing/input/lineage_definitions.yaml
preprocessing_config_file=preprocessing_config.yaml
preprocessing_config_file_merged=preprocessing_config_merged.yaml

# Parse command-line arguments
usage() {
Expand Down Expand Up @@ -151,14 +149,9 @@ download_data() {
echo
}

# Generate the preprocessing config file with the lineage file for the current pipeline version.
# the lineage definition file needs to be downloaded first.
prepare_preprocessing_config() {
rm -f $lineage_definition_file $preprocessing_config_file_merged

download_lineage_definitions() {
if [[ -z "$LINEAGE_DEFINITIONS" ]]; then
echo "No LINEAGE_DEFINITIONS given, nothing to configure;"
cp $preprocessing_config_file $preprocessing_config_file_merged
return
fi

Expand Down Expand Up @@ -186,11 +179,6 @@ prepare_preprocessing_config() {
echo "Multiple pipeline versions in data to import: $pipelineVersion"
exit 1
fi

# the lineage definition filename needs to be set in the config
# Once https://github.com/GenSpectrum/LAPIS-SILO/pull/633 is merged, it can be done as a commandline arg
cp $preprocessing_config_file $preprocessing_config_file_merged
echo -e "lineageDefinitionsFilename: \"$lineage_definition_file\"\n" >> $preprocessing_config_file_merged
}

preprocessing() {
Expand All @@ -203,7 +191,10 @@ preprocessing() {
cp "$new_input_data_path" "$silo_input_data_path"

set +e
time /app/silo preprocessing --preprocessing-config=$preprocessing_config_file_merged
time /app/silo preprocessing \
--lineage-definitions-filename "$lineage_definition_file" \
--ndjson-input-filename "$silo_input_data_path" \
--reference-genome-filename reference_genomes.json
exit_code=$?
set -e

Expand Down Expand Up @@ -274,7 +265,7 @@ main() {
# cleanup at start in case we fail later
cleanup_output_data
download_data
prepare_preprocessing_config
download_lineage_definitions
preprocessing

echo "done"
Expand Down
4 changes: 0 additions & 4 deletions kubernetes/loculus/templates/lapis-silo-database-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ data:
{{ include "loculus.siloDatabaseConfig" $args | nindent 4 }}
{{- end }}

preprocessing_config.yaml: |
ndjsonInputFilename: data.ndjson.zst
referenceGenomeFilename: reference_genomes.json
reference_genomes.json: |
{{ $referenceGenomes | toJson }}
Expand Down
3 changes: 0 additions & 3 deletions kubernetes/loculus/templates/lapis-silo-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,6 @@ spec:
- name: lapis-silo-database-config-processed
mountPath: /preprocessing/input/database_config.yaml
subPath: database_config.yaml
- name: lapis-silo-database-config-processed
mountPath: /app/preprocessing_config.yaml
subPath: preprocessing_config.yaml
- name: lapis-silo-shared-data
mountPath: /preprocessing/output
- name: lapis-silo-input-data-cache
Expand Down

0 comments on commit 7e6edbc

Please sign in to comment.