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.

質問済み 1年前241ビュー
1回答
3

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

回答済み 1年前
  • 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.

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ