Skip to content

Instantly share code, notes, and snippets.

View schmichael's full-sized avatar

Michael Schurter schmichael

View GitHub Profile
package main
import (
"fmt"
"testing"
"github.com/hashicorp/nomad/ci"
"github.com/hashicorp/nomad/client/lib/idset"
"github.com/hashicorp/nomad/client/lib/numalib"
"github.com/hashicorp/nomad/client/lib/numalib/hw"

18 cores, 2k/core, no config

Allocated Resources
CPU             Memory          Disk            Alloc Count
5000/36000 MHz  512 MiB/16 GiB  600 MiB/12 GiB  2

...

Attributes
job "example-core" {
type = "batch"
group "cache" {
task "redis" {
driver = "raw_exec"
config {
command = "/bin/bash"
args = ["-c", "sleep 9000"]
package main
import (
"crypto/tls"
"crypto/x509"
"log"
"net/http"
"net/http/httputil"
"net/url"
"os"

Limited the memory used by the client by adding this to my server config:

client {
  memory_total_mb = 2000
}

Generated test jobs:

./generate.sh baz 10 1000 600
acl {
enabled = true
}
package main
import (
"context"
"log"
"github.com/hashicorp/nomad/api"
)
func main() {

FEATURES:

  • scheduler: Enable deployments for system jobs [GH-26708]
  • secrets: Adds secret block for fetching and interpolating secrets in job spec [GH-26681]

BREAKING CHANGES:

  • metrics: Eval broker metrics that previously used the job ID as a label will now use the parent ID of dispatch and periodic jobs [GH-26737]
  • sysbatch: Submitting a sysbatch job with a reschedule block will now return an error instead of being silently ignored [GH-26279]
# There can only be a single job definition per file. This job is named
# "example" so it will create a job with the ID and Name "example".
# The "job" block is the top-most configuration option in the job
# specification. A job is a declarative specification of tasks that Nomad
# should run. Jobs have a globally unique name, one or many task groups, which
# are themselves collections of one or many tasks.
#
# For more information and examples on the "job" block, please see
# the online documentation at:
package main
import (
"bufio"
"bytes"
"fmt"
"log"
"net"
"strings"
"time"