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