RunCommandLogs: init table

[?]
Nov 17, 2021, 5:34 PM
2GNJU4VFSYWUXS3JG3XZZFM3QSN3ILOIJVJFA75TKBIFS2WFNXBQC

Dependencies

  • [2] 6JYDU2DM TaskRetries: init table
  • [3] 3ZCEPLNO
  • [4] BD3GRK4B * Get rid of "positive failures" and separate log phases.
  • [5] BHZXGT2H * Channels: provide an index page that lists all the packages in the
  • [6] H7CNGK4O * Log evaluation errors etc. in the DB.
  • [7] L2E6EVE2 * Merged the Build and Job tables.
  • [8] TWVSALRL * Allow the maximum number of concurrent builds per platform to be
  • [9] 3E6IP3R3 * Add the name of the jobset to ReleaseSetJobs, otherwise we can't
  • [10] YTIDBFGU Drop unused "disabled" columns
  • [11] V4RNHJNR * Add a link to each project's homepage. Suggested by karltk.
  • [12] TLZ2SPBR
  • [13] ITJWNQEZ Update Hydra schema, otherwise hydra-notify will not work.
  • [14] ECBA3GQO * Make the schema class names match the case of the SQL table names.
  • [15] G2T4WAHI Store the inputs of each evaluation in the database
  • [16] B72GLND4
  • [17] ICRGXEPI Builds.jobset_id: make not-null
  • [18] SJLEZFC4 check getHydraPath in stead of Envvar HYDRA_DBI directly
  • [19] QUMWPGCU Add flake configuration to the web interface
  • [20] TPNHTE5V Remove obsolete Builds columns and provide accurate "Running builds"
  • [21] SHBLLAVH * More global substitution.
  • [22] D3DIBMOK * For products that are directories (like manuals), allow a default
  • [23] Y6AHH4TH Remove the logfile and logSize columns from the database
  • [24] MB5INTIQ Normalize nixexpr{input,path} from builds to jobsetevals.
  • [25] AHTEIK7G * Added a maintainers field to the Builds table.
  • [26] 4S5JF5JP Use latest DBIx::Class::Schema::Loader
  • [27] S5PV6IIM * Represent jobs explicitly in the DB.
  • [28] WE5Q2NVI Allow build to be bumped to the front of the queue via the web interface
  • [29] JTHWA6AM Rename aggregate members to constituents
  • [30] PMNWRTGJ Add multiple output support
  • [31] YTZOC7C5 * Editing of jobset inputs.
  • [32] IK53RV4V
  • [33] IGR322YP sql: Generate models from postgresql
  • [34] 6BLUKEQ2 * Caching of "path" inputs, and fake a revision number for those.
  • [35] GNIEG2GC * Disambiguate jobs by jobset name. I.e. jobs with the same name in
  • [36] RU7AQO7U * Role-based access control. Only admins can create projects. Only
  • [37] TQKGQ5R3
  • [38] FTPCV25M Store aggregate members in the database
  • [39] WQ3QMV3D DBIx::Class: migrate to use_namespaces
  • [40] YAPITGB3 * Boolean inputs.
  • [41] LZVO64YG Merge in the first bits of the API work
  • [42] T5BIOVJE Add support for tracking custom metrics
  • [43] EYNG4EL4 * Regenerate the bindings from a clean sqlite database.
  • [44] 4CELXP7P Remove the longDescription field
  • [45] R5D7DZPE
  • [46] LCKWLQW3 * In Sqlite "release" is now a keyword, so use "release_" instead.
  • [47] S66BOMVU * Added authentication.
  • [48] ZI535LI6 * hydra: 'new' UI for project/jobset/job/build
  • [49] ZVTSOVHN * Support Subversion checkouts.
  • [50] SJPEC375 Builds: add a nullable jobset_id foreign key to Jobsets.
  • [51] CLJQCY2X * Store info about all the build actions and allow them to be
  • [52] VJHIHMEH * Store the meta.longDescription and meta.license attributes in the
  • [53] KOTB7BKV
  • [54] 26PYNDXV Remove the errorMsg column from the Builds table
  • [55] P3M6UFMP Merge remote-tracking branch 'origin/master' into flake
  • [56] FHF6IZJQ * Basic release management: releases are now dynamically computed as
  • [57] 53IMJNBB Add isChannel column and meta attribute.
  • [58] N74SRHS6 Remove the "releases" feature
  • [59] NZXX6PLD Remove the Jobs table
  • [60] CMU3YKOU * Store the release name.
  • [61] 37R34XJO * Negative caching: don't perform a build if a dependency already
  • [*] J5UVLXOK * Start of a basic Catalyst web interface.
  • [*] RFE6T5LG * Store jobset evaluations in the database explicitly. This includes
  • [*] N22GPKYT * Put info about logs / build products in the DB.
  • [*] RYTQLATY Keep track of failed paths in the Hydra database
  • [*] OZ2XXTT4 update-dbix.pl: correct indentation

Change contents

  • edit in src/lib/Hydra/Schema/Result/Builds.pm at line 501
    [3.3422]
    [64.1050]
    =head2 runcommandlogs
    Type: has_many
    Related object: L<Hydra::Schema::Result::RunCommandLogs>
  • edit in src/lib/Hydra/Schema/Result/Builds.pm at line 508
    [64.1051]
    [3.3976]
    =cut
    __PACKAGE__->has_many(
    "runcommandlogs",
    "Hydra::Schema::Result::RunCommandLogs",
    { "foreign.build_id" => "self.id" },
    undef,
    );
  • replacement in src/lib/Hydra/Schema/Result/Builds.pm at line 546
    [3.3378][3.4744:4886]()
    # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 12:02:36
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WHdSVHhQykmUz0tR/TExVg
    [3.3378]
    [3.4481]
    # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-11-17 12:42:34
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ylttv/NTMDcSZumBXRCOCw
  • file addition: RunCommandLogs.pm (----------)
    [3.1]
    use utf8;
    package Hydra::Schema::Result::RunCommandLogs;
    # Created by DBIx::Class::Schema::Loader
    # DO NOT MODIFY THE FIRST PART OF THIS FILE
    =head1 NAME
    Hydra::Schema::Result::RunCommandLogs
    =cut
    use strict;
    use warnings;
    use base 'DBIx::Class::Core';
    =head1 COMPONENTS LOADED
    =over 4
    =item * L<Hydra::Component::ToJSON>
    =back
    =cut
    __PACKAGE__->load_components("+Hydra::Component::ToJSON");
    =head1 TABLE: C<runcommandlogs>
    =cut
    __PACKAGE__->table("runcommandlogs");
    =head1 ACCESSORS
    =head2 id
    data_type: 'integer'
    is_auto_increment: 1
    is_nullable: 0
    sequence: 'runcommandlogs_id_seq'
    =head2 job_matcher
    data_type: 'text'
    is_nullable: 0
    =head2 build_id
    data_type: 'integer'
    is_foreign_key: 1
    is_nullable: 0
    =head2 command
    data_type: 'text'
    is_nullable: 0
    =head2 start_time
    data_type: 'integer'
    is_nullable: 1
    =head2 end_time
    data_type: 'integer'
    is_nullable: 1
    =head2 error_number
    data_type: 'integer'
    is_nullable: 1
    =head2 exit_code
    data_type: 'integer'
    is_nullable: 1
    =head2 signal
    data_type: 'integer'
    is_nullable: 1
    =head2 core_dumped
    data_type: 'boolean'
    is_nullable: 1
    =cut
    __PACKAGE__->add_columns(
    "id",
    {
    data_type => "integer",
    is_auto_increment => 1,
    is_nullable => 0,
    sequence => "runcommandlogs_id_seq",
    },
    "job_matcher",
    { data_type => "text", is_nullable => 0 },
    "build_id",
    { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
    "command",
    { data_type => "text", is_nullable => 0 },
    "start_time",
    { data_type => "integer", is_nullable => 1 },
    "end_time",
    { data_type => "integer", is_nullable => 1 },
    "error_number",
    { data_type => "integer", is_nullable => 1 },
    "exit_code",
    { data_type => "integer", is_nullable => 1 },
    "signal",
    { data_type => "integer", is_nullable => 1 },
    "core_dumped",
    { data_type => "boolean", is_nullable => 1 },
    );
    =head1 PRIMARY KEY
    =over 4
    =item * L</id>
    =back
    =cut
    __PACKAGE__->set_primary_key("id");
    =head1 RELATIONS
    =head2 build
    Type: belongs_to
    Related object: L<Hydra::Schema::Result::Builds>
    =cut
    __PACKAGE__->belongs_to(
    "build",
    "Hydra::Schema::Result::Builds",
    { id => "build_id" },
    { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
    );
    # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-11-18 12:35:52
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:N0G71diB8DNDgkYgaSQrFA
    # You can replace this text with custom code or comments, and it will be preserved on regeneration
    1;
  • edit in src/sql/hydra.sql at line 564
    [2.2328]
    [66.4073]
  • edit in src/sql/hydra.sql at line 566
    [66.4074]
    [66.4074]
    -- Records of RunCommand executions
    --
    -- The intended flow is:
    --
    -- 1. Create a RunCommandLogs entry when the task is "queued" to run
    -- 2. Update the start_time when it begins
    -- 3. Update the end_time and exit_code when it completes
    create table RunCommandLogs (
    id serial primary key not null,
    job_matcher text not null,
    build_id integer not null,
    -- TODO: evaluation_id integer not null,
    -- can we do this in a principled way? a build can be part of many evaluations
    -- but a "bug" of RunCommand, imho, is that it should probably run per evaluation?
    command text not null,
    start_time integer,
    end_time integer,
    error_number integer,
    exit_code integer,
    signal integer,
    core_dumped boolean,
    foreign key (build_id) references Builds(id) on delete cascade,
    -- foreign key (evaluation_id) references Builds(id) on delete cascade,
    constraint RunCommandLogs_not_started_no_exit_time_no_code check (
    -- If start time is null, then end_time, exit_code, signal, and core_dumped should be null.
    -- A logical implication operator would be nice :).
    (start_time is not null) or (
    end_time is null
    and error_number is null
    and exit_code is null
    and signal is null
    and core_dumped is null
    )
    ),
    constraint RunCommandLogs_end_time_has_start_time check (
    -- If end time is not null, then end_time, exit_code, and core_dumped should not be null
    (end_time is null) or (start_time is not null)
    )
    -- Note: if exit_code is not null then signal and core_dumped must be null.
    -- Similarly, if signal is not null then exit_code must be null and
    -- core_dumped must not be null. However, these semantics are tricky
    -- to encode as constraints and probably provide limited actual value.
    );
  • edit in src/sql/update-dbix.pl at line 41
    [67.1194]
    [67.1194]
    "runcommandlogs" => "RunCommandLogs",