Skip to content

Commit

Permalink
try fixing the jobs with persistence
Browse files Browse the repository at this point in the history
  • Loading branch information
manveru committed Oct 26, 2020
1 parent 93a57d5 commit e5ef319
Show file tree
Hide file tree
Showing 12 changed files with 253 additions and 325 deletions.
9 changes: 4 additions & 5 deletions clusters/vit/testnet/default.nix
Expand Up @@ -64,7 +64,7 @@ in {
desiredCapacity = 1;
instanceType = "t3a.large";
associatePublicIP = true;
maxInstanceLifetime = 604800;
maxInstanceLifetime = 0;
iam.role = cluster.iam.roles.client;
iam.instanceProfile.role = cluster.iam.roles.client;

Expand Down Expand Up @@ -167,9 +167,7 @@ in {
privateIP = "172.16.0.20";
subnet = cluster.vpc.subnets.core-1;
volumeSize = 40;
route53.domains = [
"*.${cluster.domain}"
];
route53.domains = [ "*.${cluster.domain}" ];

modules = let
extraConfig = pkgs.writeText "extra-config.nix" ''
Expand All @@ -188,7 +186,8 @@ in {
];

securityGroupRules = {
inherit (securityGroupRules) internet internal ssh http https vit-public-rpc;
inherit (securityGroupRules)
internet internal ssh http https vit-public-rpc;
};
};
};
Expand Down
3 changes: 2 additions & 1 deletion clusters/vit/testnet/host_volumes.nix
@@ -1,4 +1,5 @@
{ ... }: {
{ ... }:
{
# services.nomad.client = {
# host_volume = [{
# name = "ca-certificates";
Expand Down
21 changes: 2 additions & 19 deletions clusters/vit/testnet/seaweedfs.nix
@@ -1,22 +1,6 @@
{ config, lib, ... }:
let cores = [ "core-1" "core-2" "core-3" ];
in {
# services.cockroachdb = {
# enable = true;
# insecure = true;
# listen.address = "0.0.0.0";
# join = lib.concatStringsSep "," (lib.forEach cores (core:
# "${config.cluster.instances.${core}.privateIP}:${
# toString config.services.cockroachdb.listen.port
# }"));
# };

# seaweed+ 10911 weed -v 4 filer -port 8888 -ip 172.16.2.10 -ip.bind 172.16.2.10 -master 172.16.0.10:9333,172.16.1.10:9333 -s3.port 8333
#
# seaweed+ 3775 weed -v 4 volume -port 8080 -dir /var/lib/seaweedfs-volume -metricsPort 9334 -minFreeSpacePercent 1 -dataCenter eu-central-1 -max 0 -mserver 172.16.0.10:9333,172.16.1.10:9333 -ip 172.16.2.10 -ip.bind 172.16.2.10
#
# seaweed+ 9697 weed -v 3 master -port 9333 -mdir /var/lib/seaweedfs-master -peers 172.16.0.10:9333,172.16.1.10:9333 -ip 172.16.2.10 -ip.bind 172.16.2.10 -volumeSizeLimitMB 1000 -volumePreallocate

services.seaweedfs.filer = {
enable = true;

Expand All @@ -25,7 +9,7 @@ in {
toString config.services.seaweedfs.master.port
}");

peers = lib.forEach ["core-3"] (core:
peers = lib.forEach [ "core-3" ] (core:
"${config.cluster.instances.${core}.privateIP}:${
toString config.services.seaweedfs.filer.http.port
}");
Expand All @@ -38,8 +22,7 @@ in {
services.seaweedfs.mount = {
enable = true;
mounts = {
# nomad-vit-testnet = "vit-testnet";
"nomad-vit-store" = "vit-store";
nomad = "nomad";
};
};
}
3 changes: 1 addition & 2 deletions clusters/vit/testnet/security-group-rules.nix
Expand Up @@ -5,8 +5,7 @@ let
vpcs = pkgs.terralib.vpcs config.cluster;

global = [ "0.0.0.0/0" ];
internal = [ config.cluster.vpc.cidr ]
++ (lib.forEach vpcs (vpc: vpc.cidr));
internal = [ config.cluster.vpc.cidr ] ++ (lib.forEach vpcs (vpc: vpc.cidr));
in {
# TODO: derive needed security groups from networking.firewall?
securityGroupRules = {
Expand Down
2 changes: 1 addition & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Expand Up @@ -12,7 +12,7 @@
"github:input-output-hk/rust-libs.nix/vit-servicing-station";
ops-lib.url = "github:input-output-hk/ops-lib/zfs-image?dir=zfs";
jormungandr-nix = {
url ="github:input-output-hk/jormungandr-nix";
url = "github:input-output-hk/jormungandr-nix";
flake = false;
};
vit-servicing-station = {
Expand Down
Binary file removed jobs/block0.bin
Binary file not shown.
8 changes: 3 additions & 5 deletions jobs/store.nix
Expand Up @@ -6,9 +6,7 @@ in {
taskGroups = {
${jobPrefix} = {
tasks.${jobPrefix} = systemdSandbox {
mountPaths = {
"${jobPrefix}" = "/persistent";
};
mountPaths = { "${jobPrefix}" = "/persistent"; };

name = jobPrefix;

Expand All @@ -17,14 +15,14 @@ in {
set -x
echo Attempt 6
echo Attempt 7
for i in $(seq 1 120); do
echo "$i $(date)"
ls -laR
cat persistent/goodbye || true
echo $i $RANDOM > persistent/goodbye || true
sleep 1
sleep 10
done
'';

Expand Down

0 comments on commit e5ef319

Please sign in to comment.