This repository has been archived by the owner on Dec 11, 2023. It is now read-only.
forked from NixOS/hydra
-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mic92
reviewed
Dec 15, 2021
grahamc
force-pushed
the
runcommand/dynamic
branch
3 times, most recently
from
December 15, 2021 17:06
6b0a2af
to
7462a6f
Compare
cole-h
force-pushed
the
runcommand/dynamic
branch
8 times, most recently
from
December 20, 2021 22:14
814c2d0
to
cf5d1fd
Compare
grahamc
force-pushed
the
runcommand-logs
branch
from
January 3, 2022 16:02
e41bbe1
to
441539a
Compare
grahamc
force-pushed
the
runcommand/dynamic
branch
from
January 3, 2022 16:07
cf5d1fd
to
478b14c
Compare
grahamc
force-pushed
the
runcommand-logs
branch
from
January 7, 2022 20:18
441539a
to
1505a56
Compare
This in-progress feature will run a dynamically generated set of buildFinished hooks, which must be nested under the `runCommandHook.*` attribute set. This implementation is not very good, with some to-dos: 1. Only run if the build succeeded 2. Verify the output is named $out and that it is an executable file (or a symlink to a file) 3. Require the jobset itself have a flag enabling the feature, since this feature can be a bit dangerous if various people of different trust levels can create the jobs.
eligible for execution under dynamic run commands.
… points to a file) which is executable.
…et agree they should be enabled
grahamc
force-pushed
the
runcommand/dynamic
branch
from
January 10, 2022 14:23
478b14c
to
e124c3b
Compare
grahamc
commented
Jan 10, 2022
src/lib/Hydra/Plugin/GithubStatus.pm
Outdated
@@ -94,7 +94,7 @@ sub common { | |||
if (defined $eval->flake) { | |||
my $fl = $eval->flake; | |||
print STDERR "Flake is $fl\n"; | |||
if ($eval->flake =~ m!github:([^/]+)/([^/]+)/([[:xdigit:]]{40})$! or $eval->flake =~ m!git\+ssh://git\@github.com/([^/]+)/([^/]+)\?.*rev=([[:xdigit:]]{40})$!) { | |||
if ($eval->flake =~ m!github:([^/]+)/([^/]+)/([[:xdigit:]]{40})$! or $eval->flake =~ m!git\+ssh://git\@github[^/]+/([^/]+)/([^/]+)\?.*rev=([[:xdigit:]]{40})$!) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should break this matcher out in to a separate function, write some tests for it, and upstream it separately. The bit about doCheck should be dropped.
grahamc
commented
Jan 10, 2022
src/lib/Hydra/Controller/Jobset.pm
Outdated
Comment on lines
264
to
270
my $enable_dynamic_run_command = defined $c->stash->{params}->{enable_dynamic_run_command} ? 1 : 0; | ||
if ($enable_dynamic_run_command | ||
&& !($c->config->{dynamicruncommand}->{enable} | ||
&& $jobset->project->enable_dynamic_run_command)) | ||
{ | ||
badRequest($c, "Dynamic RunCommand is not enabled by the server or the parent project."); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what the right thing here is, but this pattern of checking has been peppered around. Instead we should probably have a single function which implements "is dynamic run command enabled?" and use that everywhere.
cole-h
force-pushed
the
runcommand/dynamic
branch
from
January 10, 2022 20:26
e124c3b
to
ef6df46
Compare
Moved my commits to a separate PR (and also copied over your comments): #4. |
cole-h
pushed a commit
that referenced
this pull request
Apr 7, 2022
On hydra.nixos.org the queue runner had child processes that were stuck handling an exception: Thread 1 (Thread 0x7f501f7fe640 (LWP 1413473) "bld~v54h5zkhmb3"): #0 futex_wait (private=0, expected=2, futex_word=0x7f50c27969b0 <_rtld_local+2480>) at ../sysdeps/nptl/futex-internal.h:146 #1 __lll_lock_wait (futex=0x7f50c27969b0 <_rtld_local+2480>, private=0) at lowlevellock.c:52 #2 0x00007f50c21eaee4 in __GI___pthread_mutex_lock (mutex=0x7f50c27969b0 <_rtld_local+2480>) at ../nptl/pthread_mutex_lock.c:115 #3 0x00007f50c1854bef in __GI___dl_iterate_phdr (callback=0x7f50c190c020 <_Unwind_IteratePhdrCallback>, data=0x7f501f7fb040) at dl-iteratephdr.c:40 #4 0x00007f50c190d2d1 in _Unwind_Find_FDE () from /nix/store/65hafbsx91127farbmyyv4r5ifgjdg43-glibc-2.33-117/lib/libgcc_s.so.1 #5 0x00007f50c19099b3 in uw_frame_state_for () from /nix/store/65hafbsx91127farbmyyv4r5ifgjdg43-glibc-2.33-117/lib/libgcc_s.so.1 #6 0x00007f50c190ab90 in uw_init_context_1 () from /nix/store/65hafbsx91127farbmyyv4r5ifgjdg43-glibc-2.33-117/lib/libgcc_s.so.1 #7 0x00007f50c190b08e in _Unwind_RaiseException () from /nix/store/65hafbsx91127farbmyyv4r5ifgjdg43-glibc-2.33-117/lib/libgcc_s.so.1 #8 0x00007f50c1b02ab7 in __cxa_throw () from /nix/store/dd8swlwhpdhn6bv219562vyxhi8278hs-gcc-10.3.0-lib/lib/libstdc++.so.6 #9 0x00007f50c1d01abe in nix::parseURL (url="[email protected]") at src/libutil/url.cc:53 NixOS#10 0x0000000000484f55 in extraStoreArgs (machine="[email protected]") at build-remote.cc:35 NixOS#11 operator() (__closure=0x7f4fe9fe0420) at build-remote.cc:79 ... Maybe the fork happened while another thread was holding some global stack unwinding lock (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71744). Anyway, since the hanging child inherits all file descriptors to SSH clients, shutting down remote builds (via 'child.to = -1' in State::buildRemote()) doesn't work and 'child.pid.wait()' hangs forever. So let's not do any significant work between fork and exec.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Dynamically define jobs within a jobset by:
enable_dynamic_run_command
to true on the project record and the jobset record in the databaselead-up PRs to this:
Includes:
TODO