Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl-hive
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
7
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl-hive
Commits
611790a2
Commit
611790a2
authored
11 years ago
by
Leo Gordon
Browse files
Options
Downloads
Patches
Plain Diff
The main scripts now report code and DB schema versions via calling a centralized Utils method
parent
ef236a47
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
modules/Bio/EnsEMBL/Hive/Utils.pm
+9
-1
9 additions, 1 deletion
modules/Bio/EnsEMBL/Hive/Utils.pm
scripts/beekeeper.pl
+14
-6
14 additions, 6 deletions
scripts/beekeeper.pl
scripts/db_cmd.pl
+9
-2
9 additions, 2 deletions
scripts/db_cmd.pl
scripts/runWorker.pl
+10
-2
10 additions, 2 deletions
scripts/runWorker.pl
with
42 additions
and
11 deletions
modules/Bio/EnsEMBL/Hive/Utils.pm
+
9
−
1
View file @
611790a2
...
@@ -53,10 +53,12 @@ package Bio::EnsEMBL::Hive::Utils;
...
@@ -53,10 +53,12 @@ package Bio::EnsEMBL::Hive::Utils;
use
strict
;
use
strict
;
use
warnings
;
use
warnings
;
use
Data::
Dumper
;
use
Data::
Dumper
;
use
Bio::EnsEMBL::Hive::
Version
;
use
Bio::EnsEMBL::Hive::DBSQL::
SqlSchemaAdaptor
;
use
Bio::EnsEMBL::Hive::DBSQL::
DBConnection
;
use
Bio::EnsEMBL::Hive::DBSQL::
DBConnection
;
use
Exporter
'
import
';
use
Exporter
'
import
';
our
@EXPORT_OK
=
qw(stringify destringify dir_revhash parse_cmdline_options find_submodules load_file_or_module script_usage url2dbconn_hash go_figure_dbc)
;
our
@EXPORT_OK
=
qw(stringify destringify dir_revhash parse_cmdline_options find_submodules load_file_or_module script_usage url2dbconn_hash go_figure_dbc
report_versions
)
;
=head2 stringify
=head2 stringify
...
@@ -323,5 +325,11 @@ sub go_figure_dbc {
...
@@ -323,5 +325,11 @@ sub go_figure_dbc {
}
}
}
}
sub
report_versions
{
print
"
CodeVersion
\t
"
.
Bio::EnsEMBL::Hive::
Version
->
get_code_version
()
.
"
\n
";
print
"
CompatibleHiveDatabaseSchemaVersion
\t
"
.
Bio::EnsEMBL::Hive::DBSQL::
SqlSchemaAdaptor
->
get_code_sql_schema_version
()
.
"
\n
";
}
1
;
1
;
This diff is collapsed.
Click to expand it.
scripts/beekeeper.pl
+
14
−
6
View file @
611790a2
...
@@ -14,7 +14,7 @@ BEGIN {
...
@@ -14,7 +14,7 @@ BEGIN {
use
Getopt::
Long
;
use
Getopt::
Long
;
use
File::
Path
'
make_path
';
use
File::
Path
'
make_path
';
use
Bio::EnsEMBL::Hive::
Utils
('
script_usage
',
'
destringify
');
use
Bio::EnsEMBL::Hive::
Utils
('
script_usage
',
'
destringify
'
,
'
report_versions
'
);
use
Bio::EnsEMBL::Hive::Utils::
Config
;
use
Bio::EnsEMBL::Hive::Utils::
Config
;
use
Bio::EnsEMBL::Hive::DBSQL::
DBAdaptor
;
use
Bio::EnsEMBL::Hive::DBSQL::
DBAdaptor
;
use
Bio::EnsEMBL::Hive::
Queen
;
use
Bio::EnsEMBL::Hive::
Queen
;
...
@@ -33,7 +33,8 @@ sub main {
...
@@ -33,7 +33,8 @@ sub main {
# the globals into a nice '$self' package
# the globals into a nice '$self' package
my
$self
=
{};
my
$self
=
{};
my
$help
;
my
$help
=
0
;
my
$report_versions
=
0
;
my
$loopit
=
0
;
my
$loopit
=
0
;
my
$sync
=
0
;
my
$sync
=
0
;
my
$local
=
0
;
my
$local
=
0
;
...
@@ -108,11 +109,12 @@ sub main {
...
@@ -108,11 +109,12 @@ sub main {
'
submit_log_dir=s
'
=>
\
$self
->
{'
submit_log_dir
'},
'
submit_log_dir=s
'
=>
\
$self
->
{'
submit_log_dir
'},
# other commands/options
# other commands/options
'
h|help
'
=>
\
$help
,
'
h|help!
'
=>
\
$help
,
'
sync
'
=>
\
$sync
,
'
v|versions!
'
=>
\
$report_versions
,
'
dead
'
=>
\
$check_for_dead
,
'
sync!
'
=>
\
$sync
,
'
dead!
'
=>
\
$check_for_dead
,
'
killworker=i
'
=>
\
$kill_worker_id
,
'
killworker=i
'
=>
\
$kill_worker_id
,
'
alldead
'
=>
\
$all_dead
,
'
alldead
!
'
=>
\
$all_dead
,
'
balance_semaphores
'
=>
\
$balance_semaphores
,
'
balance_semaphores
'
=>
\
$balance_semaphores
,
'
no_analysis_stats
'
=>
\
$self
->
{'
no_analysis_stats
'},
'
no_analysis_stats
'
=>
\
$self
->
{'
no_analysis_stats
'},
'
worker_stats
'
=>
\
$show_worker_stats
,
'
worker_stats
'
=>
\
$show_worker_stats
,
...
@@ -126,6 +128,11 @@ sub main {
...
@@ -126,6 +128,11 @@ sub main {
if
(
$help
)
{
script_usage
(
0
);
}
if
(
$help
)
{
script_usage
(
0
);
}
if
(
$report_versions
)
{
report_versions
();
exit
(
0
);
}
my
$config
=
Bio::EnsEMBL::Hive::Utils::
Config
->
new
();
# will probably add a config_file option later
my
$config
=
Bio::EnsEMBL::Hive::Utils::
Config
->
new
();
# will probably add a config_file option later
if
(
$run
or
$run_job_id
)
{
if
(
$run
or
$run_job_id
)
{
...
@@ -491,6 +498,7 @@ __DATA__
...
@@ -491,6 +498,7 @@ __DATA__
=head2 Other commands/options
=head2 Other commands/options
-help : print this help
-help : print this help
-versions : report both Hive code version and Hive database schema version
-dead : detect all unaccounted dead workers and reset their jobs for resubmission
-dead : detect all unaccounted dead workers and reset their jobs for resubmission
-alldead : tell the database all workers are dead (no checks are performed in this mode, so be very careful!)
-alldead : tell the database all workers are dead (no checks are performed in this mode, so be very careful!)
-balance_semaphores : set all semaphore_counts to the numbers of unDONE fan jobs (emergency use only)
-balance_semaphores : set all semaphore_counts to the numbers of unDONE fan jobs (emergency use only)
...
...
This diff is collapsed.
Click to expand it.
scripts/db_cmd.pl
+
9
−
2
View file @
611790a2
...
@@ -14,11 +14,11 @@ BEGIN {
...
@@ -14,11 +14,11 @@ BEGIN {
use
Getopt::
Long
;
use
Getopt::
Long
;
use
Bio::EnsEMBL::
Registry
;
use
Bio::EnsEMBL::
Registry
;
use
Bio::EnsEMBL::Hive::Utils::
URL
;
use
Bio::EnsEMBL::Hive::Utils::
URL
;
use
Bio::EnsEMBL::Hive::
Utils
('
script_usage
');
use
Bio::EnsEMBL::Hive::
Utils
('
script_usage
'
,
'
report_versions
'
);
sub
main
{
sub
main
{
my
(
$reg_conf
,
$reg_type
,
$reg_alias
,
$url
,
$sqlcmd
,
$extra
,
$to_params
,
$verbose
,
$help
);
my
(
$reg_conf
,
$reg_type
,
$reg_alias
,
$url
,
$sqlcmd
,
$extra
,
$to_params
,
$verbose
,
$help
,
$report_versions
);
GetOptions
(
GetOptions
(
# connect to the database:
# connect to the database:
...
@@ -34,13 +34,20 @@ sub main {
...
@@ -34,13 +34,20 @@ sub main {
'
verbose!
'
=>
\
$verbose
,
'
verbose!
'
=>
\
$verbose
,
'
help!
'
=>
\
$help
,
'
help!
'
=>
\
$help
,
'
v|versions!
'
=>
\
$report_versions
,
);
);
my
$dbc_hash
;
my
$dbc_hash
;
if
(
$help
)
{
if
(
$help
)
{
script_usage
(
0
);
script_usage
(
0
);
}
elsif
(
$report_versions
)
{
report_versions
();
exit
(
0
);
}
elsif
(
$reg_alias
)
{
}
elsif
(
$reg_alias
)
{
script_usage
(
1
)
if
$url
;
script_usage
(
1
)
if
$url
;
Bio::EnsEMBL::
Registry
->
load_all
(
$reg_conf
);
Bio::EnsEMBL::
Registry
->
load_all
(
$reg_conf
);
...
...
This diff is collapsed.
Click to expand it.
scripts/runWorker.pl
+
10
−
2
View file @
611790a2
...
@@ -13,7 +13,7 @@ BEGIN {
...
@@ -13,7 +13,7 @@ BEGIN {
use
Getopt::
Long
;
use
Getopt::
Long
;
use
Bio::EnsEMBL::Hive::
Utils
('
script_usage
');
use
Bio::EnsEMBL::Hive::
Utils
('
script_usage
'
,
'
report_versions
'
);
use
Bio::EnsEMBL::
Registry
;
use
Bio::EnsEMBL::
Registry
;
use
Bio::EnsEMBL::Hive::DBSQL::
DBAdaptor
;
use
Bio::EnsEMBL::Hive::DBSQL::
DBAdaptor
;
use
Bio::EnsEMBL::Hive::
Queen
;
use
Bio::EnsEMBL::Hive::
Queen
;
...
@@ -24,7 +24,7 @@ Bio::EnsEMBL::Registry->no_version_check(1);
...
@@ -24,7 +24,7 @@ Bio::EnsEMBL::Registry->no_version_check(1);
my
(
$url
,
$reg_conf
,
$reg_type
,
$reg_alias
,
$nosqlvc
);
# Connection parameters
my
(
$url
,
$reg_conf
,
$reg_type
,
$reg_alias
,
$nosqlvc
);
# Connection parameters
my
(
$resource_class_id
,
$resource_class_name
,
$analysis_id
,
$logic_name
,
$job_id
,
$force
);
# Task specification parameters
my
(
$resource_class_id
,
$resource_class_name
,
$analysis_id
,
$logic_name
,
$job_id
,
$force
);
# Task specification parameters
my
(
$job_limit
,
$life_span
,
$no_cleanup
,
$no_write
,
$hive_log_dir
,
$worker_log_dir
,
$retry_throwing_jobs
,
$can_respecialize
);
# Worker control parameters
my
(
$job_limit
,
$life_span
,
$no_cleanup
,
$no_write
,
$hive_log_dir
,
$worker_log_dir
,
$retry_throwing_jobs
,
$can_respecialize
);
# Worker control parameters
my
(
$help
,
$debug
);
my
(
$help
,
$report_versions
,
$debug
);
GetOptions
(
GetOptions
(
...
@@ -55,11 +55,18 @@ GetOptions(
...
@@ -55,11 +55,18 @@ GetOptions(
# Other commands
# Other commands
'
h|help
'
=>
\
$help
,
'
h|help
'
=>
\
$help
,
'
v|versions
'
=>
\
$report_versions
,
'
debug=i
'
=>
\
$debug
,
'
debug=i
'
=>
\
$debug
,
);
);
if
(
$help
)
{
script_usage
(
0
);
}
if
(
$help
)
{
script_usage
(
0
);
}
if
(
$report_versions
)
{
report_versions
();
exit
(
0
);
}
if
(
$reg_conf
)
{
# if reg_conf is defined, we load it regardless of whether it is used to connect to the Hive database or not:
if
(
$reg_conf
)
{
# if reg_conf is defined, we load it regardless of whether it is used to connect to the Hive database or not:
Bio::EnsEMBL::
Registry
->
load_all
(
$reg_conf
);
Bio::EnsEMBL::
Registry
->
load_all
(
$reg_conf
);
}
}
...
@@ -195,6 +202,7 @@ __DATA__
...
@@ -195,6 +202,7 @@ __DATA__
=head2 Other options:
=head2 Other options:
-help : print this help
-help : print this help
-versions : report both Hive code version and Hive database schema version
-debug <level> : turn on debug messages at <level>
-debug <level> : turn on debug messages at <level>
-analysis_stats : show status of each analysis in hive
-analysis_stats : show status of each analysis in hive
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment