Infra: Configurable CSIT SHIM image
[csit.git] / terraform-ci-infra / 1n_nmd / vpp_device / conf / nomad / csit_shim.hcl
1 job "${job_name}" {
2   # The "region" parameter specifies the region in which to execute the job.
3   # If omitted, this inherits the default region name of "global".
4   # region = "global"
5   #
6   # The "datacenters" parameter specifies the list of datacenters which should
7   # be considered when placing this task. This must be provided.
8   datacenters = "${datacenters}"
9
10   # The "type" parameter controls the type of job, which impacts the scheduler's
11   # decision on placement. This configuration is optional and defaults to
12   # "service". For a full list of job types and their differences, please see
13   # the online documentation.
14   #
15   # For more information, please see the online documentation at:
16   #
17   #     https://www.nomadproject.io/docs/jobspec/schedulers.html
18   #
19   type        = "system"
20
21   # The "group" stanza defines a series of tasks that should be co-located on
22   # the same Nomad client. Any task within a group will be placed on the same
23   # client.
24   #
25   # For more information and examples on the "group" stanza, please see
26   # the online documentation at:
27   #
28   #     https://www.nomadproject.io/docs/job-specification/group.html
29   #
30   group "prod-group1-csit-shim-amd" {
31     # The "count" parameter specifies the number of the task groups that should
32     # be running under this group. This value must be non-negative and defaults
33     # to 1.
34     count            = ${group_count}
35
36     constraint {
37       attribute      = "$${node.class}"
38       value          = "csit"
39     }
40
41     restart {
42       interval       = "1m"
43       attempts       = 3
44       delay          = "15s"
45       mode           = "delay"
46     }
47
48     # The "task" stanza creates an individual unit of work, such as a Docker
49     # container, web application, or batch processing.
50     #
51     # For more information and examples on the "task" stanza, please see
52     # the online documentation at:
53     #
54     #     https://www.nomadproject.io/docs/job-specification/task.html
55     #
56     task "prod-task1-csit-shim-amd" {
57       # The "driver" parameter specifies the task driver that should be used to
58       # run the task.
59       driver         = "docker"
60
61       # The "config" stanza specifies the driver configuration, which is passed
62       # directly to the driver to start the task. The details of configurations
63       # are specific to each driver, so please see specific driver
64       # documentation for more information.
65       config {
66         image        = "${image_x86_64}"
67         network_mode = "host"
68         pid_mode     = "host"
69         volumes      = [
70           "/var/run/docker.sock:/var/run/docker.sock"
71         ]
72         privileged   = true
73       }
74
75       # The "resources" stanza describes the requirements a task needs to
76       # execute. Resource requirements include memory, network, cpu, and more.
77       # This ensures the task will execute on a machine that contains enough
78       # resource capacity.
79       #
80       # For more information and examples on the "resources" stanza, please see
81       # the online documentation at:
82       #
83       #     https://www.nomadproject.io/docs/job-specification/resources.html
84       #
85       resources {
86         cpu          = ${cpu}
87         memory       = ${mem}
88         network {
89           port "ssh" {
90               static = 6022
91           }
92           port "ssh2" {
93               static = 6023
94           }
95         }
96       }
97     }
98   }
99
100   group "prod-group1-csit-shim-arm" {
101     # The "count" parameter specifies the number of the task groups that should
102     # be running under this group. This value must be non-negative and defaults
103     # to 1.
104     count            = ${group_count}
105
106     constraint {
107       attribute      = "$${node.class}"
108       value          = "csitarm"
109     }
110
111     restart {
112       interval       = "1m"
113       attempts       = 3
114       delay          = "15s"
115       mode           = "delay"
116     }
117
118     # The "task" stanza creates an individual unit of work, such as a Docker
119     # container, web application, or batch processing.
120     #
121     # For more information and examples on the "task" stanza, please see
122     # the online documentation at:
123     #
124     #     https://www.nomadproject.io/docs/job-specification/task.html
125     #
126     task "prod-task1-csit-shim-arm" {
127       # The "driver" parameter specifies the task driver that should be used to
128       # run the task.
129       driver         = "docker"
130
131       # The "config" stanza specifies the driver configuration, which is passed
132       # directly to the driver to start the task. The details of configurations
133       # are specific to each driver, so please see specific driver
134       # documentation for more information.
135       config {
136         image        = "${image_aarch64}"
137         network_mode = "host"
138         pid_mode     = "host"
139         volumes      = [
140           "/var/run/docker.sock:/var/run/docker.sock"
141         ]
142         privileged   = true
143       }
144
145       # The "resources" stanza describes the requirements a task needs to
146       # execute. Resource requirements include memory, network, cpu, and more.
147       # This ensures the task will execute on a machine that contains enough
148       # resource capacity.
149       #
150       # For more information and examples on the "resources" stanza, please see
151       # the online documentation at:
152       #
153       #     https://www.nomadproject.io/docs/job-specification/resources.html
154       #
155       resources {
156         cpu          = ${cpu}
157         memory       = ${mem}
158         network {
159           port "ssh" {
160               static = 6022
161           }
162           port "ssh2" {
163               static = 6023
164           }
165         }
166       }
167     }
168   }
169 }