support for variables inside parallelCluster yaml configuration

0

I have seen example configurations where certain items, such as HeadNode.Ssh.KeyName or HeadNode.CustomActions.OnNodeConfigured.Script, need to be modified for specific use cases or cluster instances. These items are currently distributed throughout the yaml files. Is it possible to define variables for such items at the top of the yaml file, then refer to variable names throughout the yaml document. I am thinking of a syntax similar to ansible variables or, in terms of a (hypothetical) parallelCluster configuration

Vars:
  ssh_key_name: key123
  postinstall_path: s3://example123/postinstall.sh
[..]
HeadNode:
  Ssh:
    KeyName: "{{ ssh_key_name }}" 
  CustomActions:
    OnNodeConfigured:
      Script: "{{ postinstall_path }}"

Support for variables would allow one to focus on the top of the yaml configuration during adjustments for specific use cases instead of having to comb through the entire configuration.

gefragt vor einem Jahr243 Aufrufe
1 Antwort
3

Please use YAML nodes anchors for reference https://yaml.org/spec/1.2.2/#692-node-anchors

beantwortet vor einem Jahr
  • Thanks for this excellent pointer. Does parallelcluster tolerate "non-canonical" keys such that one could place a sequence of anchor definitions under a key like MyVars: at the beginning of the yaml file?

  • I've run a quick test and it looks like node anchors work with the ParallelCluster CLI, but you can't define a new section in the YAML file with your MyVars structure. Just define the anchor at the first occurrence of your variable and then refer to it later in the rest of the config file.

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen