Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc. minor dev #181

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/Bio/EnsEMBL/Hive/Worker.pm
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ sub toString {
$include_analysis ? ( 'analysis='.($current_role ? $current_role->analysis->logic_name.'('.$current_role->analysis_id.')' : 'UNSPECIALIZED') ) : (),
'resource_class_id='.($self->resource_class_id // 'NULL'),
'meadow='.$self->meadow_type.'/'.$self->meadow_name,
'process='.$self->meadow_user.'@'.$self->meadow_host.'#'.$self->process_id,
'process='.$self->meadow_user.($self->meadow_host ? '@'.$self->meadow_host : 'UNALLOCATED').'#'.$self->process_id,
'when_checked_in='.($self->when_checked_in // 'NEVER'),
'batch_size='.($current_role ? $current_role->analysis->stats->get_or_estimate_batch_size() : 'UNSPECIALIZED'),
'job_limit='.($self->job_limiter->available_capacity() // 'NONE'),
Expand Down
33 changes: 32 additions & 1 deletion sql/procedures.mysql
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ CONTACT
--
-- Usage:
-- select * from progress; # the whole table (may take ages to generate, depending on the size of your pipeline)
-- select * from progress where logic_name like 'family_blast%'; # only show family_blast-related analyses
-- select * from progress where analysis_name_and_id like 'family_blast%'; # only show family_blast-related analyses
-- select * from progress where retry_count>1; # only show jobs that have been tried more than once

CREATE OR REPLACE VIEW progress AS
Expand All @@ -49,6 +49,37 @@ CREATE OR REPLACE VIEW progress AS
ORDER BY a.analysis_id, j.status;


-- show the hierarchy of hive jobs (which analysis seeded jobs where) ----------------------------
--
-- Usage:
-- select * from job_hierarchy; # the whole table (may take ages to generate, depending on the size of your pipeline)
-- select * from job_hierarchy where retry_count>1; # only show jobs that have been tried more than once

CREATE OR REPLACE VIEW job_hierarchy AS
SELECT
CONCAT(a1.logic_name, '(', a1.analysis_id, ')') AS analysis_name_and_id,
CONCAT(a2.logic_name, '(', a2.analysis_id, ')') AS parent_analysis_name_and_id,
j1.status AS status,
j1.retry_count AS retry_count,
COUNT(0) AS cnt,
MIN(j1.job_id) AS example_job_id
FROM
job j1
LEFT JOIN job j2 ON (j1.prev_job_id = j2.job_id)
LEFT JOIN analysis_base a1 ON (j1.analysis_id = a1.analysis_id)
LEFT JOIN analysis_base a2 ON (j2.analysis_id = a2.analysis_id)
GROUP BY
a1.logic_name,
a2.logic_name,
j1.status,
j1.retry_count
ORDER BY
a1.analysis_id,
a2.analysis_id,
j1.retry_count;
DROP VIEW job_hierarchy;


-- a convenient view that also incorporates (otherwise redundant) analysis_id and logic_name ------------
--
-- Usage:
Expand Down
33 changes: 32 additions & 1 deletion sql/procedures.pgsql
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ CONTACT
--
-- Usage:
-- select * from progress; # the whole table (may take ages to generate, depending on the size of your pipeline)
-- select * from progress where logic_name like 'family_blast%'; # only show family_blast-related analyses
-- select * from progress where analysis_name_and_id like 'family_blast%'; # only show family_blast-related analyses
-- select * from progress where retry_count>1; # only show jobs that have been tried more than once

CREATE OR REPLACE VIEW progress AS
Expand All @@ -49,6 +49,37 @@ CREATE OR REPLACE VIEW progress AS
ORDER BY a.analysis_id, j.status;


-- show the hierarchy of hive jobs (which analysis seeded jobs where) ----------------------------
--
-- Usage:
-- select * from job_hierarchy; # the whole table (may take ages to generate, depending on the size of your pipeline)
-- select * from job_hierarchy where retry_count>1; # only show jobs that have been tried more than once

CREATE OR REPLACE VIEW job_hierarchy AS
SELECT
a1.logic_name || '(' || a1.analysis_id || ')' AS analysis_name_and_id,
a2.logic_name || '(' || a2.analysis_id || ')' AS parent_analysis_name_and_id,
j1.status AS status,
j1.retry_count AS retry_count,
COUNT(0) AS cnt,
MIN(j1.job_id) AS example_job_id
FROM
job j1
LEFT JOIN job j2 ON (j1.prev_job_id = j2.job_id)
LEFT JOIN analysis_base a1 ON (j1.analysis_id = a1.analysis_id)
LEFT JOIN analysis_base a2 ON (j2.analysis_id = a2.analysis_id)
GROUP BY
a1.logic_name,
a2.logic_name,
j1.status,
j1.retry_count
ORDER BY
a1.analysis_id,
a2.analysis_id,
j1.retry_count;
DROP VIEW job_hierarchy;


-- a convenient view that also incorporates (otherwise redundant) analysis_id and logic_name ------------
--
-- Usage:
Expand Down
34 changes: 33 additions & 1 deletion sql/procedures.sqlite
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ CONTACT
--
-- Usage:
-- select * from progress; # the whole table (may take ages to generate, depending on the size of your pipeline)
-- select * from progress where logic_name like 'family_blast%'; # only show family_blast-related analyses
-- select * from progress where analysis_name_and_id like 'family_blast%'; # only show family_blast-related analyses
-- select * from progress where retry_count>1; # only show jobs that have been tried more than once

DROP VIEW IF EXISTS progress;
Expand All @@ -50,6 +50,38 @@ CREATE VIEW IF NOT EXISTS progress AS
ORDER BY a.analysis_id, j.status;


-- show the hierarchy of hive jobs (which analysis seeded jobs where) ----------------------------
--
-- Usage:
-- select * from job_hierarchy; # the whole table (may take ages to generate, depending on the size of your pipeline)
-- select * from job_hierarchy where retry_count>1; # only show jobs that have been tried more than once

DROP VIEW IF EXISTS job_hierarchy;
CREATE VIEW IF NOT EXISTS job_hierarchy AS
SELECT
a1.logic_name || '(' || a1.analysis_id || ')' AS analysis_name_and_id,
a2.logic_name || '(' || a2.analysis_id || ')' AS parent_analysis_name_and_id,
j1.status AS status,
j1.retry_count AS retry_count,
COUNT(0) AS cnt,
MIN(j1.job_id) AS example_job_id
FROM
job j1
LEFT JOIN job j2 ON (j1.prev_job_id = j2.job_id)
LEFT JOIN analysis_base a1 ON (j1.analysis_id = a1.analysis_id)
LEFT JOIN analysis_base a2 ON (j2.analysis_id = a2.analysis_id)
GROUP BY
a1.logic_name,
a2.logic_name,
j1.status,
j1.retry_count
ORDER BY
a1.analysis_id,
a2.analysis_id,
j1.retry_count;
DROP VIEW job_hierarchy;


-- a convenient view that also incorporates (otherwise redundant) analysis_id and logic_name ------------
--
-- Usage:
Expand Down
2 changes: 1 addition & 1 deletion t/apache2.t → t/00.housekeeping/apache2.t
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ my $original_dir = cwd();
chdir($file_dir);
my $cur_dir = cwd();
chdir($original_dir);
my $root = File::Spec->catdir($cur_dir, File::Spec->updir());
my $root = File::Spec->catdir($cur_dir, File::Spec->updir(), File::Spec->updir());


=head2 has_apache2_licence
Expand Down
2 changes: 1 addition & 1 deletion t/ascii.t → t/00.housekeeping/ascii.t
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ my $original_dir = cwd();
chdir($file_dir);
my $cur_dir = cwd();
chdir($original_dir);
my $root = File::Spec->catdir($cur_dir, File::Spec->updir());
my $root = File::Spec->catdir($cur_dir, File::Spec->updir(), File::Spec->updir());


sub is_ascii {
Expand Down
2 changes: 1 addition & 1 deletion t/perlcritic.t → t/00.housekeeping/perlcritic.t
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ my $original_dir = cwd();
chdir($file_dir);
my $cur_dir = cwd();
chdir($original_dir);
my $root = File::Spec->catdir($cur_dir, File::Spec->updir());
my $root = File::Spec->catdir($cur_dir, File::Spec->updir(), File::Spec->updir());

# Configure critic
Test::Perl::Critic->import(-profile => File::Spec->catfile($root, 'perlcriticrc'), -severity => 5, -verbose => 8);
Expand Down
Empty file modified t/03.scripts/peekJob_output.t
100644 → 100755
Empty file.
Empty file modified t/03.scripts/tweak_pipeline_output.t
100644 → 100755
Empty file.