Skip to content

Commit

Permalink
HPCC-32683 Add comments to scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Jake Smith <[email protected]>
  • Loading branch information
jakesmith committed Dec 3, 2024
1 parent 99b7b5c commit 69675a9
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
4 changes: 2 additions & 2 deletions helm/hpcc/templates/thor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ data:
spec:
{{- include "hpcc.placementsByJobTargetType" (dict "root" .root "job" $eclAgentJobName "target" .me.name "type" "thor") | indent 10 }}
serviceAccountName: "hpcc-agent"
terminationGracePeriodSeconds: {{ .terminationGracePeriodSeconds | default 60 }}
terminationGracePeriodSeconds: {{ .terminationGracePeriodSeconds | default 600 }}
initContainers:
{{- include "hpcc.createConfigInitContainers" . | indent 10 }}
{{- include "hpcc.addImagePullSecrets" . | nindent 10 -}}
Expand Down Expand Up @@ -241,7 +241,7 @@ data:
spec:
{{- include "hpcc.placementsByJobTargetType" (dict "root" .root "job" $thorWorkerJobName "target" .me.name "type" "thor") | indent 10 }}
serviceAccountName: hpcc-default
terminationGracePeriodSeconds: {{ .terminationGracePeriodSeconds | default 60 }}
terminationGracePeriodSeconds: {{ .terminationGracePeriodSeconds | default 600 }}
initContainers:
{{- include "hpcc.createConfigInitContainers" . | indent 10 }}
{{- include "hpcc.addImagePullSecrets" . | nindent 10 -}}
Expand Down
9 changes: 9 additions & 0 deletions initfiles/bin/check_executes.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#!/bin/bash

# ----------------------------------------------------------------------------
# This script is the main entry point for all HPCC helm components.
# It will launch the component process and check its exist status.
# If the process exits with a non-zero status, it will collect post-mortem
# information and associate with the workunit if specified.
# It is also responsible for periodically updating the running file that
# the postrun sidecar monitors (see container_watch.sh).
# ----------------------------------------------------------------------------

# The yaml passes in all arguments as a single string, due to the way the args are built up,
# and additional args _HPCC_ARGS_ are substituted in.
# Split the single string argument into individual arguments
Expand Down
9 changes: 9 additions & 0 deletions initfiles/bin/collect_postmortem.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#!/bin/bash

# ----------------------------------------------------------------------------
# This script collects various post-mortem information and writes it to a unique
# subdirectory with the specified output directory (which should be on persistent
# storage, e.g. the debug plane).
# It will then associate this new directory with the workunit if available.
# It is either launched from the main container's entrypoint script (check_executes.sh),
# or from the 'postrun' sidecar container (container_watch.sh).
# ----------------------------------------------------------------------------

container=""
daliServer=""
directory=""
Expand Down
13 changes: 13 additions & 0 deletions initfiles/bin/container_watch.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
#!/bin/bash

# ----------------------------------------------------------------------------
# This script is used by the 'postrun' sidecar container to monitor the
# main containers by tracking their 'running' and 'stopped' files.
# If a 'running' file is not updated within a certain time period, the
# script will trigger a postmortem collection.
# This can happen if the main containers are abruptly halted by k8s,
# e.g. due to k8s OOM evictions.
# NB: The isJob option causes the script to exit if it detects that the
# job has finished (i.e. the main container has stopped). Otherwise, it
# will continue to loop and wait for a new instance of the main container to
# restart.
# ----------------------------------------------------------------------------

config=""
daliServer=""
directory=""
Expand Down

0 comments on commit 69675a9

Please sign in to comment.