0

次のようなものがmolecule.ymlあります。

dependency:
  name: galaxy
driver:
  name: docker
platforms:
  - name: testohpc-compute-0
    image: docker.io/pycontribs/centos:7
    pre_build_image: true
    groups:
      - testohpc_compute
    command: /sbin/init
    tmpfs:
      - /run
      - /tmp
    volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    networks:
      - name: net1

testohpc-compute-2名前以外はまったく同じであると言う、別のインスタンスを定義するにはどうすればよいですか? -1すべての定義をもう一度コピーする必要がありますか?

さらに、インスタンス定義を再利用する方法があれば、シナリオ間で共有できますか?

4

2 に答える 2

0

でまったく同じ構成が本当に必要な場合はtestohpc-compute-2、環境変数を使用できます。

dependency:
  name: galaxy
driver:
  name: docker
platforms:
  - name: testohpc-compute-${NUMBER:-0}
    image: docker.io/pycontribs/centos:7
    pre_build_image: true
    groups:
      - testohpc_compute
    command: /sbin/init
    tmpfs:
      - /run
      - /tmp
    volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    networks:
      - name: net1

次に、2 つのインスタンスを実行します。

~|⇒  mol test
# Executes instance testohpc-compute-0
~|⇒  NUMBER=2 mol test
# Executes instance testohpc-compute-2
于 2020-11-16T09:15:21.267 に答える