diff --git a/README.md b/README.md index 7ac23a0..50fa240 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,12 @@ helm upgrade -n hwitw hwitw ./helm You may want to modify the values passed to the application to set appropriate mount points for persistent storage and other relevant configuration variables. See the `values.yaml` file for details. +To manually start a job from the cronjob to update the CDS data through today, create a job with: + +```sh +kubectl create job --from=cronjob.batch/hwitw-cdstool-cronjob cdstool-job +``` + ## Docker image builds and publication to GHCR An open source versions of the `docker` commandline tool is `nerdctl`, which works pretty much as diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 81afba6..31794dc 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.8.0 +version: 0.8.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.8.0" +appVersion: "0.8.2" diff --git a/helm/templates/cronjob-cdstool.yaml b/helm/templates/cronjob-cdstool.yaml index eb1cbcb..de16055 100644 --- a/helm/templates/cronjob-cdstool.yaml +++ b/helm/templates/cronjob-cdstool.yaml @@ -35,7 +35,7 @@ spec: readOnly: false #command: ['sh', '-c', 'echo "TRON Liftoff!" > {{ .Values.persistence.mountPath }}/testfile.txt && cat {{ .Values.persistence.mountPath }}/testfile.txt'] #command: ['sh', '-c', 'cd {{ .Values.persistence.mountPath }} && python /cdstotile/cdstool.py --startyear 2023'] - command: ['sh', '-c', '/cdstotile/hwitw_update.sh'] + command: ['sh', '-c', 'cd {{ .Values.persistence.mountPath }} && /cdstotile/hwitw_update.sh'] volumes: - name: config secret: diff --git a/src/cdstotile/hwitw_update.sh b/src/cdstotile/hwitw_update.sh index 90ac1a8..1286051 100755 --- a/src/cdstotile/hwitw_update.sh +++ b/src/cdstotile/hwitw_update.sh @@ -7,14 +7,14 @@ # (some tricky bash to give variable a default value if not set) : ${CDS_DOWNLOAD_DIR:='.'} : ${DATA_OUTPUT_DIR:='.'} -: ${CDSTOOL_DIR:=.} +: ${CDS_TOOL_DIR:=.} # Start from the current year, or from $CDS_START_YEAR if it is already set : ${CDS_START_YEAR:=$(date +%Y)} set -e # Download the latest Copernicus CDS data from $CDS_START_YEAR forward. -python3 ${CDSTOOL_DIR}/cdstool.py --startyear ${CDS_START_YEAR} --output "$CDS_DOWNLOAD_DIR" +python3 ${CDS_TOOL_DIR}/cdstool.py --startyear ${CDS_START_YEAR} --output "$CDS_DOWNLOAD_DIR" # Process the data into our custom netcdfs and then into the wxdb -python3 ${CDSTOOL_DIR}/tiletool.py --start ${CDS_START_YEAR} --update --input "$CDS_DOWNLOAD_DIR" --output "$DATA_OUTPUT_DIR" +python3 ${CDS_TOOL_DIR}/tiletool.py --start ${CDS_START_YEAR} --update --input "$CDS_DOWNLOAD_DIR" --output "$DATA_OUTPUT_DIR"