Skip to content

Commit

Permalink
do not copy nomad jobs to cache by default anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
manveru committed Nov 24, 2020
1 parent f47ac0d commit fda49ce
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions lib/run-nomad-job.nix
Expand Up @@ -59,15 +59,17 @@ writeShellScriptBin "nomad-run" ''
export CONSUL_HTTP_TOKEN
fi
cache="$(nix eval ".#clusters.$BITTE_CLUSTER.proto.config.cluster.s3Cache" --raw)"
if [ -n "''${COPY_NIX_CACHE:-}" ]; then
cache="$(nix eval ".#clusters.$BITTE_CLUSTER.proto.config.cluster.s3Cache" --raw)"
if [ ! -s secrets/nix-secret-key-file ]; then
mkdir -p secrets
vault kv get -field private kv/cache/nix-key > secrets/nix-secret-key-file
fi
if [ ! -s secrets/nix-secret-key-file ]; then
mkdir -p secrets
vault kv get -field private kv/cache/nix-key > secrets/nix-secret-key-file
fi
echo "Copying closure to the binary cache..."
nix copy --to "$cache&secret-key=secrets/nix-secret-key-file" ${json}
echo "Copying closure to the binary cache..."
nix copy --to "$cache&secret-key=secrets/nix-secret-key-file" ${json}
fi
echo "Submitting Job..."
jq --arg token "$CONSUL_HTTP_TOKEN" '.Job.ConsulToken = $token' < ${json} \
Expand Down
2 changes: 1 addition & 1 deletion profiles/monitoring/consul.json
Expand Up @@ -960,7 +960,7 @@
"list": []
},
"time": {
"from": "now-12h",
"from": "now-30m",
"to": "now"
},
"timepicker": {
Expand Down

0 comments on commit fda49ce

Please sign in to comment.