@cryptotaxi247 / infra / commits / adceabe4

Get rid of some cron jobs

Eelco Dolstra committed Feb 24, 2015 at 13:30 UTC adceabe43f79e82c9818548c6296bbfe499038c4
1 file changed +13 -16
delft/hydra.nix
+13 -16
@@ -156,7 +156,7 @@ in
156 build-compress-log = false
157 '';
158
159 - jobs."hydra-init" =
159 + jobs.hydra-init =
160 { wantedBy = [ "multi-user.target" ];
161 script = ''
162 mkdir -m 0750 -p ${cfg.baseDir}
@@ -165,7 +165,7 @@ in
165 task = true;
166 };
167
168 - systemd.services."hydra-server" =
168 + systemd.services.hydra-server =
169 { wantedBy = [ "multi-user.target" ];
170 wants = [ "hydra-init.service" ];
171 after = [ "hydra-init.service" ];
@@ -183,7 +183,7 @@ in
183 };
184 };
185
186 - systemd.services."hydra-queue-runner" =
186 + systemd.services.hydra-queue-runner =
187 { #wantedBy = [ "multi-user.target" ];
188 wants = [ "hydra-init.service" ];
189 after = [ "hydra-init.service" "network.target" ];
@@ -198,8 +198,8 @@ in
198 };
199 };
200
201 - systemd.services."hydra-evaluator" =
202 - { #wantedBy = [ "multi-user.target" ];
201 + systemd.services.hydra-evaluator =
202 + { wantedBy = [ "multi-user.target" ];
203 wants = [ "hydra-init.service" ];
204 after = [ "hydra-init.service" "network.target" ];
205 path = [ pkgs.nettools pkgs.ssmtp ];
@@ -211,7 +211,7 @@ in
211 };
212 };
213
214 - systemd.services."hydra-update-gc-roots" =
214 + systemd.services.hydra-update-gc-roots =
215 { wants = [ "hydra-init.service" ];
216 after = [ "hydra-init.service" ];
217 environment = env;
@@ -219,15 +219,14 @@ in
219 { ExecStart = "@${hydra}/bin/hydra-update-gc-roots hydra-update-gc-roots";
220 User = "hydra";
221 };
222 + startAt = "2,14:15";
223 };
224
224 - services.cron.systemCronJobs =
225 - let
226 - # If there is less than ... GiB of free disk space, stop the queue
227 - # to prevent builds from failing or aborting.
228 - checkSpace = pkgs.writeScript "hydra-check-space"
225 + # If there is less than ... GiB of free disk space, stop the queue
226 + # to prevent builds from failing or aborting.
227 + systemd.services.hydra-check-space =
228 + { script =
229 ''
230 - #! /bin/sh
230 if [ $(($(stat -f -c '%a' /nix/store) * $(stat -f -c '%S' /nix/store))) -lt $((${toString cfg.minimumDiskFree} * 1024**3)) ]; then
231 systemctl stop hydra-queue-runner
232 fi
@@ -235,10 +234,8 @@ in
234 systemctl stop hydra-evaluator
235 fi
236 '';
238 - in
239 - [ "*/5 * * * * root ${checkSpace} &> ${cfg.baseDir}/checkspace.log"
240 - "15 2,14 * * * root ${pkgs.systemd}/bin/systemctl start hydra-update-gc-roots.service"
241 - ];
237 + startAt = "*:0/5";
238 + };
239
240 };
241 }