github.com/smithx10/nomad@v0.9.1-rc1/jobspec/test-fixtures/basic.hcl (about)

     1  job "binstore-storagelocker" {
     2    region      = "fooregion"
     3    namespace   = "foonamespace"
     4    type        = "batch"
     5    priority    = 52
     6    all_at_once = true
     7    datacenters = ["us2", "eu1"]
     8    vault_token = "foo"
     9  
    10    meta {
    11      foo = "bar"
    12    }
    13  
    14    constraint {
    15      attribute = "kernel.os"
    16      value     = "windows"
    17    }
    18  
    19    affinity {
    20      attribute = "${meta.team}"
    21      value = "mobile"
    22      operator = "="
    23      weight = 50
    24    }
    25  
    26     spread {
    27       attribute = "${meta.rack}"
    28       weight = 100
    29       target "r1" {
    30         percent = 40
    31       }
    32       target "r2" {
    33         percent = 60
    34       }
    35     }
    36  
    37    update {
    38      stagger      = "60s"
    39      max_parallel = 2
    40      health_check = "manual"
    41      min_healthy_time = "10s"
    42      healthy_deadline = "10m"
    43      progress_deadline = "10m"
    44      auto_revert = true
    45      canary = 1
    46    }
    47  
    48    task "outside" {
    49      driver = "java"
    50  
    51      config {
    52        jar_path = "s3://my-cool-store/foo.jar"
    53      }
    54  
    55      meta {
    56        my-cool-key = "foobar"
    57      }
    58    }
    59  
    60    group "binsl" {
    61      count = 5
    62  
    63      restart {
    64        attempts = 5
    65        interval = "10m"
    66        delay    = "15s"
    67        mode     = "delay"
    68      }
    69  
    70      reschedule {
    71         attempts = 5
    72         interval = "12h"
    73      }
    74  
    75      ephemeral_disk {
    76          sticky = true
    77          size = 150
    78      }
    79  
    80      update {
    81          max_parallel = 3
    82          health_check = "checks"
    83          min_healthy_time = "1s"
    84          healthy_deadline = "1m"
    85          progress_deadline = "1m"
    86          auto_revert = false
    87          canary = 2
    88      }
    89  
    90      migrate {
    91          max_parallel = 2
    92          health_check = "task_states"
    93          min_healthy_time = "11s"
    94          healthy_deadline = "11m"
    95      }
    96  
    97      affinity {
    98        attribute = "${node.datacenter}"
    99        value = "dc2"
   100        operator = "="
   101        weight = 100
   102      }
   103      
   104      spread {
   105        attribute = "${node.datacenter}"
   106        weight = 50
   107        target "dc1" {
   108          percent = 50
   109        }
   110        target "dc2" {
   111          percent = 25
   112        }
   113        target "dc3" {
   114          percent = 25
   115        }
   116      }
   117  
   118  
   119      task "binstore" {
   120        driver = "docker"
   121        user   = "bob"
   122        leader = true
   123  
   124        affinity {
   125          attribute = "${meta.foo}"
   126          value = "a,b,c"
   127          operator = "set_contains"
   128          weight = 25
   129        }
   130  
   131        config {
   132          image = "hashicorp/binstore"
   133  
   134          labels {
   135            FOO = "bar"
   136          }
   137        }
   138  
   139        logs {
   140          max_files     = 14
   141          max_file_size = 101
   142        }
   143  
   144        env {
   145          HELLO = "world"
   146          LOREM = "ipsum"
   147        }
   148  
   149        service {
   150          tags = ["foo", "bar"]
   151          canary_tags = ["canary", "bam"]
   152          port = "http"
   153  
   154          check {
   155            name         = "check-name"
   156            type         = "tcp"
   157            interval     = "10s"
   158            timeout      = "2s"
   159            port         = "admin"
   160            grpc_service = "foo.Bar"
   161            grpc_use_tls = true
   162  
   163            check_restart {
   164              limit = 3
   165              grace = "10s"
   166              ignore_warnings = true
   167            }
   168          }
   169        }
   170  
   171        resources {
   172          cpu    = 500
   173          memory = 128
   174  
   175          network {
   176            mbits = "100"
   177  
   178            port "one" {
   179              static = 1
   180            }
   181  
   182            port "two" {
   183              static = 2
   184            }
   185  
   186            port "three" {
   187              static = 3
   188            }
   189  
   190            port "http" {
   191            }
   192  
   193            port "https" {
   194            }
   195  
   196            port "admin" {
   197            }
   198          }
   199  
   200          device "nvidia/gpu" {
   201              count = 10
   202              constraint {
   203                attribute = "${device.attr.memory}"
   204                value = "2GB"
   205                operator = ">"
   206              }
   207  
   208              affinity {
   209                attribute = "${device.model}"
   210                value     = "1080ti"
   211                weight = 50
   212              }
   213          }
   214          
   215          device "intel/gpu" {}
   216        }
   217  
   218        kill_timeout = "22s"
   219  
   220        shutdown_delay = "11s"
   221  
   222        artifact {
   223          source = "http://foo.com/artifact"
   224  
   225          options {
   226            checksum = "md5:b8a4f3f72ecab0510a6a31e997461c5f"
   227          }
   228        }
   229  
   230        artifact {
   231          source = "http://bar.com/artifact"
   232          destination = "test/foo/"
   233          mode = "file"
   234  
   235          options {
   236            checksum = "md5:ff1cc0d3432dad54d607c1505fb7245c"
   237          }
   238        }
   239  
   240        vault {
   241          policies = ["foo", "bar"]
   242        }
   243  
   244        template {
   245          source = "foo"
   246          destination = "foo"
   247          change_mode = "foo"
   248          change_signal = "foo"
   249          splay = "10s"
   250          env = true
   251          vault_grace = "33s"
   252        }
   253  
   254        template {
   255          source = "bar"
   256          destination = "bar"
   257          perms = "777"
   258          left_delimiter = "--"
   259          right_delimiter = "__"
   260        }
   261      }
   262  
   263      task "storagelocker" {
   264        driver = "docker"
   265  
   266        config {
   267          image = "hashicorp/storagelocker"
   268        }
   269  
   270        resources {
   271          cpu    = 500
   272          memory = 128
   273        }
   274  
   275        constraint {
   276          attribute = "kernel.arch"
   277          value     = "amd64"
   278        }
   279  
   280        vault {
   281          policies = ["foo", "bar"]
   282          env = false
   283          change_mode = "signal"
   284          change_signal = "SIGUSR1"
   285        }
   286      }
   287  
   288      constraint {
   289        attribute = "kernel.os"
   290        value     = "linux"
   291      }
   292  
   293      meta {
   294        elb_mode     = "tcp"
   295        elb_interval = 10
   296        elb_checks   = 3
   297      }
   298    }
   299  }