Add instasync cronjob and plumbing for nodejs on nomad clients.
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
nodejs_20
|
||||||
vim
|
vim
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,10 +22,16 @@ in
|
|||||||
interface = "tailscale0";
|
interface = "tailscale0";
|
||||||
cidr = "100.64.0.0/10";
|
cidr = "100.64.0.0/10";
|
||||||
};
|
};
|
||||||
host_volume.code = {
|
host_volume = {
|
||||||
|
code = {
|
||||||
path = "/data/compute/code";
|
path = "/data/compute/code";
|
||||||
read_only = true;
|
read_only = true;
|
||||||
};
|
};
|
||||||
|
nix-store = {
|
||||||
|
path = "/nix/store";
|
||||||
|
read_only = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
server = {
|
server = {
|
||||||
|
|||||||
41
services/instasync.hcl
Normal file
41
services/instasync.hcl
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
job "instasync" {
|
||||||
|
datacenters = ["alo"]
|
||||||
|
|
||||||
|
type = "batch"
|
||||||
|
|
||||||
|
periodic {
|
||||||
|
cron = "*/5 * * * *"
|
||||||
|
prohibit_overlap = true
|
||||||
|
}
|
||||||
|
|
||||||
|
group "cron" {
|
||||||
|
volume "code" {
|
||||||
|
type = "host"
|
||||||
|
read_only = true
|
||||||
|
source = "code"
|
||||||
|
}
|
||||||
|
volume "nix-store" {
|
||||||
|
type = "host"
|
||||||
|
read_only = true
|
||||||
|
source = "nix-store"
|
||||||
|
}
|
||||||
|
|
||||||
|
task "sync" {
|
||||||
|
driver = "exec"
|
||||||
|
|
||||||
|
config {
|
||||||
|
command = "/nix/store/2y52nmyfpsq497cppgc43x9v6lkp3q25-nodejs-20.5.1/bin/node"
|
||||||
|
args = ["/code/instasync/sync.js"]
|
||||||
|
}
|
||||||
|
|
||||||
|
volume_mount {
|
||||||
|
volume = "code"
|
||||||
|
destination = "/code"
|
||||||
|
}
|
||||||
|
volume_mount {
|
||||||
|
volume = "nix-store"
|
||||||
|
destination = "/nix/store"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user