Skip to content

Instantly share code, notes, and snippets.

View schmichael's full-sized avatar

Michael Schurter schmichael

View GitHub Profile
$ biscuit keypair --only-private-key > private-key-file
$ biscuit keypair --from-private-key-file private-key-file --only-public-key > public-key-file
$ echo 'right("file1");' | biscuit generate --private-key-file private-key-file - > biscuit-file.bc
$ biscuit inspect --raw-input biscuit-file.bc --public-key-file public-key-file
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Format(DeserializationError("deserialization error: DecodeError { description: \"unexpected end group tag\", stack: [] }"))', /home/schmichael/.cargo/registry/src/github.com-1ecc6299db9ec823/biscuit-cli-0.2.0/src/main.rs:193:42
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@schmichael
schmichael / limits.hcl
Created April 25, 2022 23:52
Diagnosing preemption bug
client {
cpu_total_compute = 1000
memory_total_mb = 1000
}
job "sysinfo" {
datacenters = ["dc1"]
type = "batch"
group "sysinfo" {
task "sysinfo" {
driver = "docker"
config {
// Windows 2019
job "example" {
datacenters = ["dc1"]
group "cache" {
network {
port "db" {
to = 6379
}
}
client {
host_network "public" {
cidr = "192.168.86.227/32"
}
}
job "hello" {
datacenters = ["dc1"]
type = "batch"
periodic {
cron = "* * * * * *"
}
task "hello" {
job "example" {
type = "service"
datacenters = ["dc1"]
group "cache" {
task "redis" {
driver = "raw_exec"
config {

nomad job restart RFC

While Nomad has the ability to restart individual allocations and tasks, it lack the ability to restart entire jobs.

A new `nomad job restart command will fill this gap by adding the ability to restart all allocations for a job.

Behavior

Functionally job restart will be as if the user scripted a rolling nomad alloc restart for all allocs of a given job. Importantly job restart will not reschedule any allocations. It can be thought of an inplace update with nothing being updated.

job "workdir" {
type = "batch"
datacenters = ["dc1"]
task "workdir" {
driver = "exec"
config {
work_dir = "/etc"
command = "/usr/bin/pwd"
@schmichael
schmichael / simple.hcl
Last active August 11, 2021 22:25
Simple Nomad Hello World Job
job "example" {
datacenters = ["dc1"]
group "hello" {
task "hello" {
driver = "docker"
config {
image = "redis:3.2"
command = "/bin/bash"