Skip to content

Commit f649383

Browse files
committed
bug fixes
1 parent fa4a0ed commit f649383

File tree

10 files changed

+27
-21
lines changed

10 files changed

+27
-21
lines changed

default.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ rec {
2323
desktopPhpLaravelCli = import ./desktop/PHP/laravel-cli/ci.nix {};
2424

2525
# distributed
26+
# FIXME not always reproducible
2627
distributedSparkPi = import ./distributed/Spark/pi/ci.nix {};
2728

2829
# mobile
@@ -51,7 +52,7 @@ rec {
5152

5253
# all pipelines jobs
5354
examplesPipelinesJobs = forEach (attrValues examples) (example: example.pipelineJob);
54-
#examplesPipelines = catAttrs "pipelineJob" (attrValues examples);
55+
#examplesPipelinesJobs = catAttrs "pipelineJob" (attrValues examples);
5556

5657
# all pipelines phases merged
5758
examplesPipelinesZipped =

distributed/Spark/pi/app.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ let
3838
outputHashMode = "recursive";
3939
outputHashAlgo = "sha256";
4040
#outputHash = stdenv.lib.fakeSha256;
41-
outputHash = "0dk96374ls9jrw9dp85k4nq87nrnq2wvx20rn81ihxglg957hpig";
41+
outputHash = "0kr2g4nbr5l00sd3z1z6yawcfiwhwb7fq2pnnk4nm1a9r373w6sa";
4242
};
4343
in
4444
stdenv.mkDerivation rec {

distributed/Spark/pi/cd-vbox.nix

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,28 @@ in
1616

1717
network.description = "Spark Pi deployed to VirtualBox";
1818

19-
master = {
19+
master = { config, ... }: {
2020

2121
imports = [ deploymentNodes.master ];
2222

23-
services.pi.masterIp = "192.168.56.101";
23+
services.pi.masterIp = config.networking.privateIPv4;
2424
services.pi.submitArgs = "--executor-memory 512M --driver-memory 512M";
2525

2626
deployment.targetEnv = "virtualbox";
27-
deployment.virtualbox.memorySize = 1536; # megabytes
28-
deployment.virtualbox.vcpu = 2; # number of cpus
27+
deployment.virtualbox.memorySize = 1536;
28+
deployment.virtualbox.vcpu = 2;
2929
};
3030

31-
} // lib.listToAttrs (map (n: lib.nameValuePair "worker${lib.fixedWidthNumber 2 n}" {
31+
} // lib.listToAttrs (map (n: lib.nameValuePair "worker${lib.fixedWidthNumber 2 n}" ({ config, ... }: {
3232

3333
imports = [ deploymentNodes."worker${lib.fixedWidthNumber 2 n}" ];
3434

3535
services.pi.workerArgs = "--memory 768M";
36-
services.pi.workerIp = "192.168.56.1${lib.fixedWidthNumber 2 (n+1)}";
36+
services.pi.workerIp = config.networking.privateIPv4;
3737

3838
deployment.targetEnv = "virtualbox";
39-
deployment.virtualbox.memorySize = 1536; # megabytes
40-
deployment.virtualbox.vcpu = 2; # number of cpus
39+
deployment.virtualbox.memorySize = 1536;
40+
deployment.virtualbox.vcpu = 2;
41+
42+
})) (lib.range 1 workersCount))
4143

42-
}) (lib.range 1 workersCount))

distributed/Spark/pi/cicd.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ if [ $1 = "deploy-test" ]; then
1818
nixops set-args --arg workersCount 2 -d ${DEPLOYMENT_VBOX_NAME}
1919
nixops deploy -d ${DEPLOYMENT_VBOX_NAME} --force-reboot
2020
sleep 30s
21-
nixops ssh master -- systemctl status pi --no-pager -l | grep "Pi is roughly 3.1"
21+
nixops ssh -d ${DEPLOYMENT_VBOX_NAME} master -- systemctl status pi --no-pager -l | grep "Pi is roughly 3.1"
2222
nixops destroy -d ${DEPLOYMENT_VBOX_NAME} --confirm
2323
nixops delete -d ${DEPLOYMENT_VBOX_NAME}
2424
exit 0

multitier/Python/helloanswer/cd-vbox.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ in
2121
imports = [ deploymentNodes.server ];
2222

2323
deployment.targetEnv = "virtualbox";
24-
deployment.virtualbox.memorySize = 1024; # megabytes
25-
deployment.virtualbox.vcpu = 2; # number of cpus
24+
deployment.virtualbox.memorySize = 1024;
25+
deployment.virtualbox.vcpu = 2;
2626
};
2727

2828
client = {
2929

3030
imports = [ deploymentNodes.client ];
3131

3232
deployment.targetEnv = "virtualbox";
33-
deployment.virtualbox.memorySize = 1024; # megabytes
34-
deployment.virtualbox.vcpu = 2; # number of cpus
33+
deployment.virtualbox.memorySize = 1024;
34+
deployment.virtualbox.vcpu = 2;
3535
};
3636

3737
}

multitier/Python/helloanswer/cicd.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if [ $1 = "deploy-test" ]; then
1616
fi
1717
nixops create ./cd-vbox.nix -d ${DEPLOYMENT_VBOX_NAME}
1818
nixops deploy -d ${DEPLOYMENT_VBOX_NAME} --force-reboot
19-
nixops ssh server -- client-wrapped | grep "Hello World!"
19+
nixops ssh -d ${DEPLOYMENT_VBOX_NAME} server -- client-wrapped | grep "Hello World!"
2020
nixops destroy -d ${DEPLOYMENT_VBOX_NAME} --confirm
2121
nixops delete -d ${DEPLOYMENT_VBOX_NAME}
2222
exit 0

template/cd.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ in
1919
imports = [
2020
./module.nix
2121
];
22+
23+
services.example.enable = true;
24+
services.example.someSecreFile = someSecreFile;
25+
2226
};
2327

2428
}

template/cicd.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if [ $1 = "deploy-test" ]; then
1717
nixops create ./cd-vbox.nix -d ${DEPLOYMENT_VBOX_NAME}
1818
nixops deploy -d ${DEPLOYMENT_VBOX_NAME} --force-reboot
1919
echo "Hello, world!" > expected
20-
nixops ssh server -- example > given
20+
nixops ssh -d ${DEPLOYMENT_VBOX_NAME} server -- example > given
2121
diff expected given
2222
nixops destroy -d ${DEPLOYMENT_VBOX_NAME} --confirm
2323
nixops delete -d ${DEPLOYMENT_VBOX_NAME}

web/Laravel/laravel/cd-vbox.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ in
4848
};
4949

5050
deployment.targetEnv = "virtualbox";
51-
deployment.virtualbox.memorySize = 1024; # megabytes
52-
deployment.virtualbox.vcpu = 2; # number of cpus
51+
deployment.virtualbox.memorySize = 1024;
52+
deployment.virtualbox.vcpu = 2;
5353
};
5454

5555
} // lib.optionalAttrs (!storageLocally) {

web/Laravel/laravel/cicd.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if [ $1 = "deploy-test" ]; then
1919
nixops deploy -d ${DEPLOYMENT_VBOX_NAME} --force-reboot
2020
nixops info -d ${DEPLOYMENT_VBOX_NAME}
2121
# get webserver IP address
22-
WEBSERVER_IP=$(nixops info --deployment laravel-vbox --no-eval --plain | awk '{print $1 " " $(NF)}' | grep webserver | awk '{print $(NF)}')
22+
WEBSERVER_IP=$(nixops info -d ${DEPLOYMENT_VBOX_NAME} --no-eval --plain | awk '{print $1 " " $(NF)}' | grep webserver | awk '{print $(NF)}')
2323
curl --insecure https://${WEBSERVER_IP}
2424
nixops destroy -d ${DEPLOYMENT_VBOX_NAME} --confirm
2525
nixops delete -d ${DEPLOYMENT_VBOX_NAME}

0 commit comments

Comments
 (0)