Commit Graph
67 Commits
Author SHA1 Message Date
Greg Von Kuster 3de877519e Migrate cleanup_datasets script to work with new db schema. 2008-07-10 19:54:46 +00:00
Daniel Blankenberg 28b89d686f Change database schema to separate Dataset and HistoryDatasetAssociation. This is a significant change, be sure to follow the migration notes exactly.
Make sure to backup your database before updating.


Also fix a long standing bug in the async controller dealing with updating output datasets upon job completion.


Credit for database migration directions go to Greg.

*** This is a significant change, be sure to follow the migration steps below exactly and in order: ***

---------------

0. Stop Galaxy server

---------------

1. Backup database and galaxy_root/database directory

---------------

2. The current validation_error table is not being used, it is left over from Ian's work that was not made functional.  However, if we want to keep it around, we should drop the old version of the table so it will get re-created correctly when the Galaxy server is restarted:

any database - sql command(s):
------------------------------
DROP TABLE validation_error;

---------------

3. Stop server, perform svn update to get latest code, start server to create new history_dataset_association and implicitly_converted_dataset_association tables

---------------

4. Add new columns to dataset table:

postgres sql command(s):
------------------------
ALTER TABLE dataset ADD COLUMN purgable boolean DEFAULT 't';
ALTER TABLE dataset ADD COLUMN external_filename text;
ALTER TABLE dataset ADD COLUMN _extra_files_path text;

mysql sql command(s):
---------------------
ALTER TABLE dataset ADD COLUMN purgable boolean DEFAULT TRUE;
ALTER TABLE dataset ADD COLUMN external_filename text;
ALTER TABLE dataset ADD COLUMN _extra_files_path text;

sqlite sql command(s):
----------------------
ALTER TABLE dataset ADD COLUMN purgable boolean DEFAULT 0;
ALTER TABLE dataset ADD COLUMN external_filename text;
ALTER TABLE dataset ADD COLUMN _extra_files_path text;

---------------

5. Populate new columns:

postgres sql command(s):
------------------------
UPDATE
dataset
SET
external_filename = dataset_filename.filename,
_extra_files_path = dataset_filename.extra_files_path
FROM
dataset_filename
WHERE
dataset.filename_id = dataset_filename.id;

mysql or sqlite sql command(s):
-------------------------------
UPDATE
dataset,
dataset_filename
SET
dataset.external_filename = dataset_filename.filename,
dataset._extra_files_path = dataset_filename.extra_files_path
WHERE
dataset.filename_id = dataset_filename.id;

---------------

6. Populate dataset table with info from dataset_child_association table:

postgres sql command(s):
------------------------
UPDATE
dataset
SET
parent_id = dataset_child_association.parent_dataset_id
FROM
dataset_child_association
WHERE
dataset.id = dataset_child_association.child_dataset_id;

mysql or sqlite sql command(s):
-------------------------------
UPDATE
dataset,
dataset_child_association
SET
dataset.parent_id = dataset_child_association.parent_dataset_id
WHERE
dataset.id = dataset_child_association.child_dataset_id;

---------------

7. Drop dataset_child_association table:

any database - sql command(s):
------------------------------
DROP TABLE dataset_child_association;

---------------

8. Copy parts of the current dataset table to the new history_dataset_association table:

postgres sql command(s):
------------------------
INSERT INTO history_dataset_association
SELECT
id,
history_id,
id AS dataset_id,
create_time,
update_time,
hid,
name,
info,
blurb,
peek,
extension,
metadata,
parent_id,
designation,
deleted,
visible
FROM dataset
ORDER BY id;

mysql or sqlite sql command(s):
-------------------------------
INSERT INTO
history_dataset_association
(
history_id,
dataset_id,
create_time,
update_time,
hid,
name,
info,
blurb,
peek,
extension,
metadata,
parent_id,
designation,
deleted,
visible
)
SELECT
history_id,
id,
create_time,
update_time,
hid,
name,
info,
blurb,
peek,
extension,
metadata,
parent_id,
designation,
deleted,
visible
FROM
dataset
ORDER BY
id;

---------------

9. Update the nextval value of the primary key sequence in the history_dataset_association table

NOTE: THIS IS NOT NECESSARY FOR MYSQL OR SQLITE!

postgres sql command(s):
------------------------
SELECT
setval('history_dataset_association_id_seq', max(id))
FROM
history_dataset_association;

---------------

10. Update dataset table to mark dataset_associated_file dataset as deleted:

postgres sql command(s):
------------------------
UPDATE dataset
SET
deleted = 't'
WHERE
id IN
(SELECT dataset_id FROM dataset_associated_file ORDER BY dataset_id DESC);

mysql or sqlite sql command(s):
-------------------------------
UPDATE dataset
SET
deleted = TRUE
WHERE
id IN
(SELECT dataset_id FROM dataset_associated_file ORDER BY dataset_id DESC);

---------------

11. Drop the dataset_associated_file table:

any database - sql command(s):
------------------------------
DROP TABLE dataset_associated_file;

---------------

12. Alter foreign keys on job_to_input_dataset table:

postgres or sqlite sql command(s):
------------------------
ALTER TABLE
job_to_input_dataset
DROP CONSTRAINT
job_to_input_dataset_dataset_id_fkey;

ALTER TABLE
job_to_input_dataset
ADD CONSTRAINT job_to_input_dataset_dataset_id_fkey
FOREIGN KEY
(dataset_id)
REFERENCES
history_dataset_association(id);


mysql sql command(s):
-------------------------------
ALTER TABLE
job_to_input_dataset
DROP FOREIGN KEY
ix_job_to_input_dataset_dataset_id;

ALTER TABLE
job_to_input_dataset
ADD FOREIGN KEY
ix_job_to_input_dataset_dataset_id (dataset_id)
REFERENCES
history_dataset_association(id);

---------------

13. Alter foreign keys on job_to_output_dataset table:

postgres or sqlite sql command(s):
------------------------
ALTER TABLE
job_to_output_dataset
DROP CONSTRAINT
job_to_output_dataset_dataset_id_fkey;

ALTER TABLE
job_to_output_dataset
ADD CONSTRAINT
job_to_output_dataset_dataset_id_fkey
FOREIGN KEY (dataset_id)
REFERENCES history_dataset_association(id);

mysql sql command(s):
-------------------------------
ALTER TABLE
job_to_output_dataset
DROP FOREIGN KEY
ix_job_to_output_dataset_dataset_id;

ALTER TABLE
job_to_output_dataset
ADD FOREIGN KEY
ix_job_to_output_dataset_dataset_id
FOREIGN KEY (dataset_id)
REFERENCES history_dataset_association(id);

---------------

14. Eliminate columns from the dataset table previously copied to history_dataset_association:

any database - sql command(s):
------------------------------
ALTER TABLE dataset DROP COLUMN hid;
ALTER TABLE dataset DROP COLUMN history_id;
ALTER TABLE dataset DROP COLUMN name;
ALTER TABLE dataset DROP COLUMN info;
ALTER TABLE dataset DROP COLUMN blurb;
ALTER TABLE dataset DROP COLUMN peek;
ALTER TABLE dataset DROP COLUMN extension;
ALTER TABLE dataset DROP COLUMN dbkey;
ALTER TABLE dataset DROP COLUMN metadata;
ALTER TABLE dataset DROP COLUMN parent_id;
ALTER TABLE dataset DROP COLUMN designation;
ALTER TABLE dataset DROP COLUMN visible;
ALTER TABLE dataset DROP COLUMN filename_id;
2008-07-09 17:41:08 +00:00
Greg Von Kuster aa66fa9a61 Missed a place in cleanup_datasets.py where I wanted to turn off logging. 2008-06-27 13:16:36 +00:00
Greg Von Kuster 55cbdf9905 Tweak to cleanup_datasets script, only log error messages. 2008-06-20 13:45:38 +00:00
Nate Coraor 83daeb74bb It doesn't make sense to even distribute DRMAA_python eggs. So instead
of downloading its own SGE and linking, scramble now just links to a
user-supplied SGE in $SGE_ROOT.

Added a seperate script to make it build right on sparc/x86 32/64
Solaris.
2008-05-30 20:18:03 +00:00
Greg Von Kuster 94917f5fe0 Added some important info to cleanup_datasets.py script. 2008-05-15 20:40:19 +00:00
Daniel Blankenberg a7ea9357f2 Add implicit datatype conversions.
If a dataset is not the proper format required by a tool, but there is a converter available, the dataset will appear as a valid option in DataToolParameters.

The converted dataset will be created (and subsequently reused) when the job is executed. Conversion utilizes the job runner, and will run on the cluster.

Setting metadata will invalidate the converted dataset, and a new one will be automatically generated as needed.
2008-05-15 19:09:17 +00:00
Nate Coraor 76e128a6ee monitor: Instead of creating a new history with -n, delete the old
history (which creates a new history...).
2008-05-15 17:33:34 +00:00
Greg Von Kuster bf0a8cc462 Added another wrapper around bx to handle exceptions, all gops tools affected. Added 2 new tests to gops_intersect. 2008-05-07 14:07:23 +00:00
Nate Coraor 38cc984df3 Bugfix, save cookies after creating a new history (otherwise the next
time you run the monitor, it uses the old history).
2008-05-05 16:51:26 +00:00
Nate Coraor ba4411e667 Add -n option to check_galaxy to create a new history. 2008-05-05 16:03:40 +00:00
Nate Coraor be224a4a38 dist-scramble, scrambles eggs for distribution. 2008-05-02 17:05:40 +00:00
James Taylor 980e79c669 Upgrade yuicompresor to version 2.3.5 2008-05-01 15:05:30 +00:00
Greg Von Kuster 3f01a6dd2a Necessary cron changes for cleanup dataset scripts for main. 2008-04-24 20:31:27 +00:00
Nate Coraor 1d5f59a3c3 Updated dataset cleanup scripts to use eggs lib. 2008-04-18 13:53:15 +00:00
Nate Coraor 04127ff3d5 DRMAA build scripts, eggs.ini entry.
And a minor bugfix to eggs.require.
2008-04-16 20:53:27 +00:00
Nate Coraor 746fa583d0 Update pkg_resources to 0.6c8 to fix the cygwin non-executable dll
bug.  Also, fix the setup script to create database/tmp and
database/files.
2008-04-14 19:25:35 +00:00
Nate Coraor 7560751dc8 Separate framework and tool environments.
Whether running locally or via PBS, $PATH should now be handled in your
user's environment.

This also fixes problems like PYTHONPATH on the new blast nodes being
wrong (because they are x86_64 and the frontends are i686).

Note that you can actually start Galaxy without having an eggs dir now.
2008-04-11 20:11:21 +00:00
Nate Coraor feff769b6f Build script for Cheetah on Python 2.5. 2008-04-04 13:38:46 +00:00
Greg Von Kuster a9db5f0e43 Moved all dataset related shell and python scripts to new ~/<galaxy root>/scripts/cleanup_datasets directory. 2008-04-03 18:33:09 +00:00
Nate Coraor 480f701764 Update monitor to delete datasets, not histories. 2008-04-02 15:40:42 +00:00
Nate Coraor 83389f54eb pbs_python egg changed from static to dynamic for the reasons explained
here:

http://g2.trac.bx.psu.edu/wiki/ClusteringGalaxy#Anoteonlibtorque

Also includes a rather ridiculous fix for compiling a fat dynamic
libtorque on OS X due to some autoconf/libtool weirdness.
2008-03-28 21:22:10 +00:00
Greg Von Kuster af3b0669aa Eliminated all Python2.4 references, added necessary assert statements to ensure minimum version of Python 2.4. 2008-03-28 15:24:50 +00:00
Nate Coraor 5f189e45c3 The enormous eggs-out-of-svn commit. More details at:
http://g2.trac.bx.psu.edu/wiki/GalaxyEggs
2008-03-27 19:27:05 +00:00
Wen-Yu Chung 78802fa73b add scripts for preparing nt and wgs databases.
update blastdb location file, wgs is available now.
2008-03-27 17:41:40 +00:00
Daniel Blankenberg 254077c4e3 Add scripts required to fetch and process data for the Microbial Genome Datasource Tool. 2008-03-27 15:36:13 +00:00
Anton Nekrutenko a262ac1754 Finalizing taxonomy. Removed taxonomy processing from scripts. This does not require sqlite anymore. Script for fetching taxonomy now uses flat files directly and is much faster 2008-03-20 19:38:31 +00:00
Anton Nekrutenko 447be81be8 Cleanup of taxonomy processing scripts. Now only one is left 2008-03-18 19:29:51 +00:00
Nate Coraor d7172bc329 A couple small tweaks to the monitor. 2008-03-14 16:49:42 +00:00
Nate Coraor f675e37400 The Galaxy Monitor, and its cron wrapper. 2008-03-14 16:07:30 +00:00
Greg Von Kuster 5392fc0ab8 Fix for history item html for taxonomy data type, eliminated the type from the registry-not quite ready for prime time. Fix for cleanup_datasets script. 2008-03-05 13:22:01 +00:00
Anton Nekrutenko d25b346130 Changes to taxonomy fetches and two new datatypes: taxonomy and newick 2008-03-04 20:30:26 +00:00
Greg Von Kuster 512084b543 Some tweaks to the cleanup_dataset script. 2008-03-04 14:49:55 +00:00
Greg Von Kuster 52047c1b09 Use local CleanupDatasetsApplication class rather than galaxy's main UniverseApplication class for cleanup_datasets.py script. 2008-02-25 21:16:34 +00:00
Anton Nekrutenko f607e77b6a Tool for changing case 2008-02-25 15:15:18 +00:00
Greg Von Kuster f2a38411c4 Fix for cleanup_datasets script. 2008-02-23 14:56:55 +00:00
Greg Von Kuster 9565139b39 Some tweaks to the cleanup dataset scripts. 2008-02-21 13:23:39 +00:00
Greg Von Kuster 560e98d7fd Optimized data retrieval / update for cleanup datasets script and system reports. 2008-02-20 18:02:34 +00:00
Greg Von Kuster 6792e273db Added a new script to remove renamed datasets from disk. 2008-02-06 19:16:25 +00:00
Anton Nekrutenko 2596523c4d typo; 2008-02-06 19:00:34 +00:00
Anton Nekrutenko 77c094d2af readme.txt for taxonomy scripts 2008-02-06 18:59:00 +00:00
Anton Nekrutenko b9d3d02303 Scripts for creating taxonomy database 2008-02-06 18:27:10 +00:00
Greg Von Kuster ef249b0e11 Fixes for shell scripts to clean up histories, datasets. 2008-02-02 15:40:58 +00:00
Greg Von Kuster bac7fc59be New script to rename purged datasets. 2008-02-02 01:59:44 +00:00
Greg Von Kuster cdd0f9c1e1 Next pass at cleaning up datasets and histories.
- Added an option to remove dataset from disk when purging, or leave them for renaming and later removal
- Moved History.purge() and Dataset.purge() methods to the cleanup_datasets.py script
2008-02-01 20:07:11 +00:00
Greg Von Kuster 8d07f84003 Another pass at the cleanup datasets stuff.
- Eliminated duplicate functionality from admin controller, moving appropriate components to Galaxy reports.
- Re-implemented the long-term process we will use for deleting / purging histories and datasets
  (we will initially write external shell scripts to rename dataset files rather then deleting them)
2008-01-30 20:12:43 +00:00
Greg Von Kuster c8ee253ba6 Missed committing similar fixes to cleanup_datasets script and admin controller. 2008-01-27 16:41:29 +00:00
Nate Coraor 7d8656b55c First draft of the fetch_eggs.py script, this will download eggs from a
distribution point and copy them to Galaxy's eggs/ directory.

fetch_eggs_tarball.py and check_python_platform.py are mostly for offline
systems.  fetch_eggs_tarball.py fetches eggs for your platform (or a
specified platform) and then tars them up, for copying to another system.
check_python_platform.py returns the string for your platform/interpreter
that will be used to download from the egg distribution site.
2008-01-25 18:39:00 +00:00
Greg Von Kuster be461b0c8a Eliminated "removed" state from dataset lifecycle, require db schema update for those that installed rev 2256.
For those that may have installed revision 2256, use the following SQL command to evolve your schema:
alter table dataset drop column removed;

We have changed direction again on the process we will use to cleanup datasets and histories.
- When we are comfortable with the purge process, the Dataset.purge() function will be modified to delete the file from disk rather than simply renaming it, and the Dataset.remove_from_disk() function will be eliminated.
- The entire process below must be executed at least 1 time ( prior to making these changes ) to ensure that purged files are properly removed from disk.  This process is:

delete_userless_histories() -> purge_histories() -> purge_datasets() -> remove_datasets()

Shell scripts have been added for each of these stages with the exception of remove_datasets(), which will eventually be eliminated.
2008-01-24 13:56:09 +00:00
Greg Von Kuster 5ea5d75da5 Enhancements to history and dataset cleanup (requires db schema change).
SQL commands to alter schema:
alter table dataset add column removed boolean default 'f';
alter history add column purged boolean default 'f';

- The lifecycle of a history after creation is now deleted -> purged
- Deleting a history will delete all associated datasets (only the database is update, nothing removed from disk).
- Purging a history will purge all associated datasets (datasets are renamed, nothing removed from disk).
- The lifecycle of a dataset after creation is now deleted -> purged -> removed
- Deleting a dataset will only update the database.
- Purging a dataset will rename the file on disk and update the database.
- Removing a dataset will remove the renamed, purged file from disk and update the database.
- Also reverted the behavior of history_delete() to pre-rev 2250 so that no datasets are deleted at teh time the history was deleted by the user.
- The admin controller and the cleanup_datasets.py script include all of the above functionality.
2008-01-22 20:47:04 +00:00