diff options
author | pmikus <peter.mikus@protonmail.ch> | 2024-03-25 14:49:25 +0100 |
---|---|---|
committer | Peter Mikus <peter.mikus@protonmail.ch> | 2024-03-25 14:06:43 +0000 |
commit | 83dc3b1b116725fd8b76890df275f868d7414c30 (patch) | |
tree | b626b4a3b6bbf9cd00a62a6825786a2af806e4e3 /fdio.infra.terraform/terraform-nomad-vpp-device/conf | |
parent | c10dee4d03643120bc43483fa95cf50d407c7915 (diff) |
fix(terraform): vpp-device files
Signed-off-by: Peter Mikus <peter.mikus@protonmail.ch>
Change-Id: I7f640aa28ecf3a60696676b0cf8afb7a080e1b12
Diffstat (limited to 'fdio.infra.terraform/terraform-nomad-vpp-device/conf')
-rw-r--r-- | fdio.infra.terraform/terraform-nomad-vpp-device/conf/nomad/device-shim.hcl.tftpl | 78 | ||||
-rw-r--r-- | fdio.infra.terraform/terraform-nomad-vpp-device/conf/nomad/vpp-device.hcl.tftpl | 188 |
2 files changed, 78 insertions, 188 deletions
diff --git a/fdio.infra.terraform/terraform-nomad-vpp-device/conf/nomad/device-shim.hcl.tftpl b/fdio.infra.terraform/terraform-nomad-vpp-device/conf/nomad/device-shim.hcl.tftpl new file mode 100644 index 0000000000..28e38a2d0b --- /dev/null +++ b/fdio.infra.terraform/terraform-nomad-vpp-device/conf/nomad/device-shim.hcl.tftpl @@ -0,0 +1,78 @@ +job "${job_name}" { + datacenters = ["${datacenters}"] + type = "system" + group "${job_name}-amd" { + count = ${group_count} + constraint { + attribute = "$${node.class}" + value = "csit" + } + restart { + interval = "1m" + attempts = 3 + delay = "15s" + mode = "delay" + } + network { + port "ssh" { + static = 6022 + } + port "ssh2" { + static = 6023 + } + } + task "${job_name}-amd" { + driver = "docker" + config { + image = "${image_x86_64}" + network_mode = "host" + pid_mode = "host" + volumes = [ + "/var/run/docker.sock:/var/run/docker.sock" + ] + privileged = true + } + resources { + cpu = ${cpu} + memory = ${memory} + } + } + } + group "${job_name}-arm" { + count = ${group_count} + constraint { + attribute = "$${node.class}" + value = "csitarm" + } + restart { + interval = "1m" + attempts = 3 + delay = "15s" + mode = "delay" + } + network { + port "ssh" { + static = 6022 + } + port "ssh2" { + static = 6023 + } + } + task "${job_name}-arm" { + driver = "docker" + config { + image = "${image_aarch64}" + network_mode = "host" + pid_mode = "host" + volumes = [ + "/var/run/docker.sock:/var/run/docker.sock" + ] + privileged = true + } + resources { + cpu = ${cpu} + memory = ${memory} + } + } + } +} diff --git a/fdio.infra.terraform/terraform-nomad-vpp-device/conf/nomad/vpp-device.hcl.tftpl b/fdio.infra.terraform/terraform-nomad-vpp-device/conf/nomad/vpp-device.hcl.tftpl deleted file mode 100644 index aac1a46165..0000000000 --- a/fdio.infra.terraform/terraform-nomad-vpp-device/conf/nomad/vpp-device.hcl.tftpl +++ /dev/null @@ -1,188 +0,0 @@ -job "${job_name}" { - # The "region" parameter specifies the region in which to execute the job. - # If omitted, this inherits the default region name of "global". - # region = "global" - # - # The "datacenters" parameter specifies the list of datacenters which should - # be considered when placing this task. This must be provided. - datacenters = "${datacenters}" - - # The "type" parameter controls the type of job, which impacts the scheduler's - # decision on placement. This configuration is optional and defaults to - # "service". For a full list of job types and their differences, please see - # the online documentation. - # - type = "system" - - # The "group" stanza defines a series of tasks that should be co-located on - # the same Nomad client. Any task within a group will be placed on the same - # client. - # - # https://www.nomadproject.io/docs/job-specification/group - # - group "csit-shim-amd-group-1" { - # The "count" parameter specifies the number of the task groups that should - # be running under this group. This value must be non-negative. - count = ${group_count} - - # The constraint allows restricting the set of eligible nodes. Constraints - # may filter on attributes or client metadata. - # - # https://www.nomadproject.io/docs/job-specification/constraint - # - constraint { - attribute = "$${node.class}" - value = "csit" - } - - # The restart stanza configures a tasks's behavior on task failure. Restarts - # happen on the client that is running the task. - # - # https://www.nomadproject.io/docs/job-specification/restart - # - restart { - interval = "1m" - attempts = 3 - delay = "15s" - mode = "delay" - } - - # The network stanza specifies the networking requirements for the task - # group, including the network mode and port allocations. When scheduling - # jobs in Nomad they are provisioned across your fleet of machines along - # with other jobs and services. Because you don't know in advance what host - # your job will be provisioned on, Nomad will provide your tasks with - # network configuration when they start up. - # - # https://www.nomadproject.io/docs/job-specification/network - # - network { - port "ssh" { - static = 6022 - } - port "ssh2" { - static = 6023 - } - } - - # The "task" stanza creates an individual unit of work, such as a Docker - # container, web application, or batch processing. - # - # https://www.nomadproject.io/docs/job-specification/task - # - task "csit-shim-amd-task-1" { - # The "driver" parameter specifies the task driver that should be used to - # run the task. - driver = "docker" - - # The "config" stanza specifies the driver configuration, which is passed - # directly to the driver to start the task. The details of configurations - # are specific to each driver, so please see specific driver - # documentation for more information. - config { - image = "${image_x86_64}" - network_mode = "host" - pid_mode = "host" - volumes = [ - "/var/run/docker.sock:/var/run/docker.sock" - ] - privileged = true - } - - # The "resources" stanza describes the requirements a task needs to - # execute. Resource requirements include memory, network, cpu, and more. - # This ensures the task will execute on a machine that contains enough - # resource capacity. - # - # https://www.nomadproject.io/docs/job-specification/resources - # - resources { - cpu = ${cpu} - memory = ${memory} - } - } - } - - group "csit-shim-arm-group-1" { - # The "count" parameter specifies the number of the task groups that should - # be running under this group. This value must be non-negative. - count = ${group_count} - - # The constraint allows restricting the set of eligible nodes. Constraints - # may filter on attributes or client metadata. - # - # https://www.nomadproject.io/docs/job-specification/constraint - # - constraint { - attribute = "$${node.class}" - value = "csitarm" - } - - # The restart stanza configures a tasks's behavior on task failure. Restarts - # happen on the client that is running the task. - # - # https://www.nomadproject.io/docs/job-specification/restart - # - restart { - interval = "1m" - attempts = 3 - delay = "15s" - mode = "delay" - } - - # The network stanza specifies the networking requirements for the task - # group, including the network mode and port allocations. When scheduling - # jobs in Nomad they are provisioned across your fleet of machines along - # with other jobs and services. Because you don't know in advance what host - # your job will be provisioned on, Nomad will provide your tasks with - # network configuration when they start up. - # - # https://www.nomadproject.io/docs/job-specification/network - # - network { - port "ssh" { - static = 6022 - } - port "ssh2" { - static = 6023 - } - } - - # The "task" stanza creates an individual unit of work, such as a Docker - # container, web application, or batch processing. - # - # https://www.nomadproject.io/docs/job-specification/task - # - task "csit-shim-arm-task-1" { - # The "driver" parameter specifies the task driver that should be used to - # run the task. - driver = "docker" - - # The "config" stanza specifies the driver configuration, which is passed - # directly to the driver to start the task. The details of configurations - # are specific to each driver, so please see specific driver - # documentation for more information. - config { - image = "${image_aarch64}" - network_mode = "host" - pid_mode = "host" - volumes = [ - "/var/run/docker.sock:/var/run/docker.sock" - ] - privileged = true - } - - # The "resources" stanza describes the requirements a task needs to - # execute. Resource requirements include memory, network, cpu, and more. - # This ensures the task will execute on a machine that contains enough - # resource capacity. - # - # https://www.nomadproject.io/docs/job-specification/resources - # - resources { - cpu = ${cpu} - memory = ${memory} - } - } - } -}
\ No newline at end of file |