forked from lix-project/hydra
Update to latest Lix main
This commit is contained in:
parent
cbe527a3ee
commit
e9d0a3a754
16
flake.lock
16
flake.lock
|
@ -27,11 +27,11 @@
|
||||||
"pre-commit-hooks": "pre-commit-hooks"
|
"pre-commit-hooks": "pre-commit-hooks"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1718081112,
|
"lastModified": 1719211568,
|
||||||
"narHash": "sha256-3cpIVHuyo6yz9n7U/7U/p2Lmwjj1xHdTJR2RkT5JntY=",
|
"narHash": "sha256-oIgmvhe3CV/36LC0KXgqWnKXma39wabks8U9JBMDfO4=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "8a3d063a494c4b8c767190a5ce3e4075a75f9d07",
|
"rev": "4c3d93611f2848c56ebc69c85f2b1e18001ed3c7",
|
||||||
"revCount": 15756,
|
"revCount": 15877,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git@git.lix.systems/lix-project/lix"
|
"url": "https://git@git.lix.systems/lix-project/lix"
|
||||||
},
|
},
|
||||||
|
@ -58,16 +58,16 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1715218190,
|
"lastModified": 1719145550,
|
||||||
"narHash": "sha256-R98WOBHkk8wIi103JUVQF3ei3oui4HvoZcz9tYOAwlk=",
|
"narHash": "sha256-K0i/coxxTEl30tgt4oALaylQfxqbotTSNb1/+g+mKMQ=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "9a9960b98418f8c385f52de3b09a63f9c561427a",
|
"rev": "e4509b3a560c87a8d4cb6f9992b8915abf9e36d8",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"ref": "nixos-23.11",
|
"ref": "nixos-24.05",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
description = "A Nix-based continuous build system";
|
description = "A Nix-based continuous build system";
|
||||||
|
|
||||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
|
||||||
inputs.nix.url = "git+https://git@git.lix.systems/lix-project/lix";
|
inputs.nix.url = "git+https://git@git.lix.systems/lix-project/lix";
|
||||||
inputs.nix.inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
|
|
|
@ -349,14 +349,14 @@ int main(int argc, char * * argv)
|
||||||
/* Start a handler thread per worker process. */
|
/* Start a handler thread per worker process. */
|
||||||
auto handler = [&]()
|
auto handler = [&]()
|
||||||
{
|
{
|
||||||
pid_t pid = -1;
|
Pid pid;
|
||||||
try {
|
try {
|
||||||
AutoCloseFD from, to;
|
AutoCloseFD from, to;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
||||||
/* Start a new worker process if necessary. */
|
/* Start a new worker process if necessary. */
|
||||||
if (pid == -1) {
|
if (!pid) {
|
||||||
Pipe toPipe, fromPipe;
|
Pipe toPipe, fromPipe;
|
||||||
toPipe.create();
|
toPipe.create();
|
||||||
fromPipe.create();
|
fromPipe.create();
|
||||||
|
@ -383,13 +383,13 @@ int main(int argc, char * * argv)
|
||||||
});
|
});
|
||||||
from = std::move(fromPipe.readSide);
|
from = std::move(fromPipe.readSide);
|
||||||
to = std::move(toPipe.writeSide);
|
to = std::move(toPipe.writeSide);
|
||||||
debug("created worker process %d", pid);
|
debug("created worker process %d", pid.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check whether the existing worker process is still there. */
|
/* Check whether the existing worker process is still there. */
|
||||||
auto s = readLine(from.get());
|
auto s = readLine(from.get());
|
||||||
if (s == "restart") {
|
if (s == "restart") {
|
||||||
pid = -1;
|
pid.wait();
|
||||||
continue;
|
continue;
|
||||||
} else if (s != "next") {
|
} else if (s != "next") {
|
||||||
auto json = nlohmann::json::parse(s);
|
auto json = nlohmann::json::parse(s);
|
||||||
|
@ -455,7 +455,7 @@ int main(int argc, char * * argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
check_pid_status_nonblocking(pid);
|
check_pid_status_nonblocking(pid.release());
|
||||||
auto state(state_.lock());
|
auto state(state_.lock());
|
||||||
state->exc = std::current_exception();
|
state->exc = std::current_exception();
|
||||||
wakeup.notify_all();
|
wakeup.notify_all();
|
||||||
|
|
|
@ -191,7 +191,7 @@ struct Evaluator
|
||||||
txn.commit();
|
txn.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(jobset.pid == -1);
|
assert(jobset.pid);
|
||||||
|
|
||||||
jobset.pid = startProcess([&]() {
|
jobset.pid = startProcess([&]() {
|
||||||
Strings args = { "hydra-eval-jobset", jobset.name.project, jobset.name.jobset };
|
Strings args = { "hydra-eval-jobset", jobset.name.project, jobset.name.jobset };
|
||||||
|
@ -206,7 +206,7 @@ struct Evaluator
|
||||||
|
|
||||||
bool shouldEvaluate(Jobset & jobset)
|
bool shouldEvaluate(Jobset & jobset)
|
||||||
{
|
{
|
||||||
if (jobset.pid != -1) {
|
if (jobset.pid) {
|
||||||
// Already running.
|
// Already running.
|
||||||
debug("shouldEvaluate %s? no: already running",
|
debug("shouldEvaluate %s? no: already running",
|
||||||
jobset.name.display());
|
jobset.name.display());
|
||||||
|
@ -330,7 +330,7 @@ struct Evaluator
|
||||||
|
|
||||||
if (state->runningEvals < maxEvals) {
|
if (state->runningEvals < maxEvals) {
|
||||||
for (auto & i : state->jobsets)
|
for (auto & i : state->jobsets)
|
||||||
if (i.second.pid == -1 &&
|
if (!i.second.pid &&
|
||||||
i.second.checkInterval > 0)
|
i.second.checkInterval > 0)
|
||||||
sleepTime = std::min(sleepTime, std::chrono::seconds(
|
sleepTime = std::min(sleepTime, std::chrono::seconds(
|
||||||
std::max((time_t) 1, i.second.lastCheckedTime - now + i.second.checkInterval)));
|
std::max((time_t) 1, i.second.lastCheckedTime - now + i.second.checkInterval)));
|
||||||
|
@ -407,7 +407,7 @@ struct Evaluator
|
||||||
for (auto & i : state->jobsets) {
|
for (auto & i : state->jobsets) {
|
||||||
auto & jobset(i.second);
|
auto & jobset(i.second);
|
||||||
|
|
||||||
if (jobset.pid == pid) {
|
if (jobset.pid.get() == pid) {
|
||||||
printInfo("evaluation of jobset ‘%s’ %s",
|
printInfo("evaluation of jobset ‘%s’ %s",
|
||||||
jobset.name.display(), statusToString(status));
|
jobset.name.display(), statusToString(status));
|
||||||
|
|
||||||
|
|
|
@ -531,7 +531,7 @@ void State::buildRemote(ref<Store> destStore,
|
||||||
{
|
{
|
||||||
auto activeStepState(activeStep->state_.lock());
|
auto activeStepState(activeStep->state_.lock());
|
||||||
if (activeStepState->cancelled) throw Error("step cancelled");
|
if (activeStepState->cancelled) throw Error("step cancelled");
|
||||||
activeStepState->pid = child.sshPid;
|
activeStepState->pid = child.sshPid.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
Finally clearPid([&]() {
|
Finally clearPid([&]() {
|
||||||
|
|
Loading…
Reference in a new issue