github.com/hernad/nomad@v1.6.112/e2e/isolation/input/raw_exec.hcl (about)

     1  # Copyright (c) HashiCorp, Inc.
     2  # SPDX-License-Identifier: MPL-2.0
     3  
     4  job "raw_exec" {
     5    type = "batch"
     6  
     7    constraint {
     8      attribute = "${attr.kernel.name}"
     9      value     = "linux"
    10    }
    11  
    12    group "group" {
    13  
    14      reschedule {
    15        attempts  = 0
    16        unlimited = false
    17      }
    18  
    19      restart {
    20        attempts = 0
    21        mode     = "fail"
    22      }
    23  
    24  
    25      task "bash" {
    26        driver = "raw_exec"
    27  
    28        config {
    29          command = "bash"
    30          args = [
    31            "-c", "local/pid.sh"
    32          ]
    33        }
    34  
    35        template {
    36          data = <<EOF
    37  #!/usr/bin/env bash
    38  echo my pid is $BASHPID
    39  EOF
    40  
    41          destination = "local/pid.sh"
    42          perms       = "755"
    43          change_mode = "noop"
    44        }
    45  
    46        resources {
    47          cpu    = 10
    48          memory = 64
    49        }
    50      }
    51    }
    52  }