-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HPCC-30306 Allow arbitrary script based plane validation #17785
HPCC-30306 Allow arbitrary script based plane validation #17785
Conversation
https://track.hpccsystems.com/browse/HPCC-30306 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jakesmith a few comments/questions.
helm/hpcc/values.schema.json
Outdated
@@ -544,6 +544,9 @@ | |||
"waitForMount": { | |||
"type": "boolean" | |||
}, | |||
"validatePlaneScript": { | |||
"type": "array" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should include a description about how this is used. Also is it worth restricting the element type:
"items": { "type": "string" }
Does it need an associated documentation jira. (And similar for exception hooks, are they documeted?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exceptionHandler are documented in helm/hpcc/docs/expert.md - probably enough?
validatePlaneScript isn't - and it feels like an expert setting too, perhaps it should go under a new expert: level under the plane to make it clear it is of that ilk - and then be documented in expert.md ..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should include a description about how this is used. Also is it worth restricting the element type:
"items": { "type": "string" }
will change and add a description
args: | ||
- | | ||
{{- range $cmd := .cmds }} | ||
{{ $cmd }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be a ; after each command?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, it's because the block scalar passes it as a script (complete with line breaks) which bash interprets as individual commands (as it would in a script.
e.g. it's the equivalent of:
/bin/bash -c "
echo 'command 1'
echo 'command 2'
echo 'command 3'
"
The example in the JIRA is generated as:
initContainers:
- args:
- |
echo "Hello, World!"
ls -l
df -h
end_time=$((SECONDS + 1200)); while [ $SECONDS -lt $end_time ]; do if mountpoint -q '/var/lib/HPCCSystems/hpcc-data'; then device=$(df /var/lib/HPCCSystems/hpcc-data | awk 'NR==2 {print $1}'); if [[ "$device" == "/dev/md0" ]]; then echo "correct mount device"; exit 0; else echo "wrong mount device \"$device\", will look again!"; fi; fi; echo waiting for mount point; sleep 5; done; echo failed; exit 1
command:
- /bin/bash
- -c
.. and executes as expected.
Pass in dict with volumeName, volumePath and cmds | ||
*/}} | ||
{{- define "hpcc.validatePlaneScript" -}} | ||
- name: {{ printf "validate-plane-script-container-%s" .volumeName }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be worth combining this into the wait for mount container if possible? What is the extra overhead starting a new container?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well both are a kludge, but I wouldn't see both being used in tandem.
I was talking to the person behind the TF module that provisions the raided nvme on the nodes, and he thinks that it may require a new CSI behind the persistent volume to correctly wait for the mount to be fully ready.
But in the short term, in the next release, he is adding a marker file in the mount this mechanism could look for.
All less than ideal, once k8s pods see the pvc, that should be it - we shouldn't have to wait or check like this, but I think the provisioning of these raided nvme's is unusual and not fully supported by AKS out of the box.
helm/hpcc/templates/_helpers.tpl
Outdated
{{- define "hpcc.validatePlaneScript" -}} | ||
- name: {{ printf "validate-plane-script-container-%s" .volumeName }} | ||
{{- include "hpcc.addImageAttrs" . | nindent 2 }} | ||
command: ["/bin/bash", "-c"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: Slightly strange inconsistency between this and the wait for mount container - sh v bash and the way -c is passed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree, but there's about 50% use cases of /bin/sh vs /bin/bash in various places in _helpers.tpl
It is the only place that has "-c" as part of the command list though, I'll move it to 1st arg to be more consistent.
bash is more rich, I think it's okay to use here - perhaps should unify on it elsewhere?
@ghalliday - please see responses and new commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jakesmith please squash
This can be used catch problems with plane mounts Signed-off-by: Jake Smith <[email protected]>
4ec4ad2
to
8f00aa5
Compare
This can be used catch problems with plane mounts
Type of change:
Checklist:
Smoketest:
Testing: