Changeset 42387
- Timestamp:
- Feb 8, 2023, 12:14:39 PM (3 years ago)
- Location:
- trunk/ippTools
- Files:
-
- 11 edited
- 14 copied
-
. (modified) (1 prop)
-
scripts/ippadmin (modified) (3 diffs)
-
share (modified) (1 prop)
-
share/Makefile.am (modified) (1 diff)
-
share/fpcamtool_find_cam_and_chip_id.sql (copied) (copied from branches/eam_branches/ipp-20220316/ippTools/share/fpcamtool_find_cam_and_chip_id.sql )
-
share/fpcamtool_find_cam_id.sql (copied) (copied from branches/eam_branches/ipp-20220316/ippTools/share/fpcamtool_find_cam_id.sql )
-
share/fpcamtool_find_processedexp.sql (copied) (copied from branches/eam_branches/ipp-20220316/ippTools/share/fpcamtool_find_processedexp.sql )
-
share/fpcamtool_inputastrom.sql (copied) (copied from branches/eam_branches/ipp-20220316/ippTools/share/fpcamtool_inputastrom.sql )
-
share/fpcamtool_inputchips.sql (copied) (copied from branches/eam_branches/ipp-20220316/ippTools/share/fpcamtool_inputchips.sql )
-
share/fpcamtool_pendingexp.sql (copied) (copied from branches/eam_branches/ipp-20220316/ippTools/share/fpcamtool_pendingexp.sql )
-
share/fpcamtool_queue_cam_id.sql (copied) (copied from branches/eam_branches/ipp-20220316/ippTools/share/fpcamtool_queue_cam_id.sql )
-
share/fpcamtool_revertprocessedexp.sql (copied) (copied from branches/eam_branches/ipp-20220316/ippTools/share/fpcamtool_revertprocessedexp.sql )
-
share/fpcamtool_revertupdatedexp.sql (copied) (copied from branches/eam_branches/ipp-20220316/ippTools/share/fpcamtool_revertupdatedexp.sql )
-
share/pxadmin_create_tables.sql (modified) (1 diff)
-
share/pxadmin_drop_tables.sql (modified) (1 diff)
-
src (modified) (2 props)
-
src/Makefile.am (modified) (5 diffs)
-
src/fpcamtool.c (copied) (copied from branches/eam_branches/ipp-20220316/ippTools/src/fpcamtool.c )
-
src/fpcamtool.h (copied) (copied from branches/eam_branches/ipp-20220316/ippTools/src/fpcamtool.h )
-
src/fpcamtoolConfig.c (copied) (copied from branches/eam_branches/ipp-20220316/ippTools/src/fpcamtoolConfig.c )
-
src/pxadmin.c (modified) (1 diff)
-
src/pxcam.c (modified) (1 diff)
-
src/pxfpcam.c (copied) (copied from branches/eam_branches/ipp-20220316/ippTools/src/pxfpcam.c )
-
src/pxfpcam.h (copied) (copied from branches/eam_branches/ipp-20220316/ippTools/src/pxfpcam.h )
-
src/pzgetexp.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20220316/ippTools (added) merged: 42166,42193,42195-42197,42205-42207,42213,42258,42367
- Property svn:mergeinfo changed
-
trunk/ippTools/scripts/ippadmin
r20933 r42387 6 6 7 7 if ("$1" == "init") then 8 if ($#argv != 4) goto usage;8 if ($#argv != 5) goto usage; 9 9 set dbserver = $2 10 set dbuser = $3 11 set dbpass = $4 10 set rootuser = $3 11 set dbuser = $4 12 set dbpass = $5 12 13 13 mysql -h $dbserver -u root-p <<EOF14 mysql -h $dbserver -u $rootuser -p <<EOF 14 15 create database $IPPADMIN; 15 16 use $IPPADMIN; … … 17 18 create table cookies (cookie_id BIGINT AUTO_INCREMENT, username char(255) not null, cookie varchar(255), primary key (cookie_id)); 18 19 create table projects (proj_id BIGINT AUTO_INCREMENT, projname char(255) not null, primary key (proj_id)); 19 grant all on *.* to $dbuser@localhost identified by '$dbpass'; 20 create user '$dbuser'@'$dbserver' identified by '$dbpass'; 21 grant all on *.* to '$dbuser'@'$dbserver'; 22 flush privileges; 23 EOF 24 exit 0; 25 endif 26 27 if ("$1" == "project") then 28 if ($#argv != 4) goto usage; 29 set dbserver = $2 30 set dbuser = $3 31 set dbname = $4 32 33 mysql -h $dbserver -u $dbuser -p $IPPADMIN <<EOF 34 insert into projects (projname) values ('$dbname'); 35 create database $dbname; 36 EOF 37 exit 0; 38 endif 39 40 if ("$1" == "user") then 41 if ($#argv != 5) goto usage; 42 set dbserver = $2 43 set dbuser = $3 44 set user = $4 45 set pass = $5 46 47 mysql -h $dbserver -u $dbuser -p $IPPADMIN <<EOF 48 insert into users (username, password) values ('$user', '$pass'); 20 49 EOF 21 50 exit 0; … … 35 64 endif 36 65 37 if ("$1" == "user") then38 if ($#argv != 5) goto usage;39 set dbserver = $240 set dbuser = $341 set user = $442 set pass = $543 44 mysql -h $dbserver -u $dbuser -p $IPPADMIN <<EOF45 insert into users (username, password) values ('$user', '$pass');46 EOF47 exit 0;48 endif49 50 if ("$1" == "project") then51 if ($#argv != 4) goto usage;52 set dbserver = $253 set dbuser = $354 set dbname = $455 56 mysql -h $dbserver -u $dbuser -p $IPPADMIN <<EOF57 insert into projects (projname) values ('$dbname');58 create database $dbname;59 EOF60 exit 0;61 endif62 63 if ("$1" == "upgrade") then64 echo "$#argv"65 66 if ($#argv != 3) goto usage;67 set dbserver = $268 set stage = $369 70 if ("$stage" == "1") then71 mysql -h $dbserver -u root -p $IPPADMIN <<EOF72 ALTER TABLE users add column user_id BIGINT NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (user_id);73 ALTER TABLE users change column username username varchar(255);74 75 ALTER TABLE cookies add column cookie_id BIGINT AUTO_INCREMENT FIRST, ADD PRIMARY KEY (cookie_id);76 ALTER TABLE cookies change column username username varchar(255);77 78 ALTER TABLE projects add column proj_id BIGINT AUTO_INCREMENT FIRST, ADD PRIMARY KEY (proj_id);79 ALTER TABLE projects change column projname projname varchar(255);80 EOF81 exit 0;82 endif83 84 echo "unknown upgrade stage $stage"85 exit 1;86 endif87 88 66 usage: 89 67 echo "USAGE: ippadmin (options)" 90 68 echo "" 91 echo " ippadmin init (dbserver) (dbuser) (dbpassword)" 92 echo " creates admin tables, basic db user -- requires root password" 69 echo " ippadmin init (dbserver) (rootuser) (dbuser) (dbpassword)" 70 echo " creates admin tables, basic db user -- requires mysql (rootuser) password" 71 echo " (rootuser) is a mysql user with global privileges" 93 72 echo "" 94 echo " ippadmin upgrade (dbserver) (stage)" 95 echo " upgrade existing database for given stage [1] -- requires root password" 73 echo " ippadmin project (dbserver) (dbuser) (dbname)" 74 echo " create a new ipp project (database)" 75 echo " (need to run pxadmin -create after it is created)" 76 echo "" 77 echo " ippadmin user (dbserver) (dbuser) (username) (password)" 78 echo " create a new www user and password" 96 79 echo "" 97 80 echo " ippadmin client (dbserver) (dbuser) (dbpassword) (client)" 98 81 echo " add client name or regex" 99 82 echo "" 100 echo " ippadmin user (dbserver) (dbuser) (username) (password)"101 echo " create a new www user and password"102 echo ""103 echo " ippadmin project (dbserver) (dbuser) (dbname)"104 echo " create a new ipp project (database)"105 echo ""106 83 exit 2 -
trunk/ippTools/share
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20220316/ippTools/share (added) merged: 42193,42195,42197,42207,42213,42367
- Property svn:mergeinfo changed
-
trunk/ippTools/share/Makefile.am
r42097 r42387 543 543 remotetool_listcomponent.sql \ 544 544 remotetool_doneprep.sql \ 545 remotetool_updatepoll.sql 545 remotetool_updatepoll.sql \ 546 fpcamtool_find_cam_and_chip_id.sql \ 547 fpcamtool_find_cam_id.sql \ 548 fpcamtool_find_processedexp.sql \ 549 fpcamtool_pendingexp.sql \ 550 fpcamtool_inputchips.sql \ 551 fpcamtool_inputastrom.sql \ 552 fpcamtool_queue_cam_id.sql \ 553 fpcamtool_revertprocessedexp.sql \ 554 fpcamtool_revertupdatedexp.sql 555 -
trunk/ippTools/share/pxadmin_create_tables.sql
r42097 r42387 2427 2427 ) ENGINE=innodb DEFAULT CHARSET=latin1; 2428 2428 2429 CREATE TABLE fpcamRun ( 2430 fpcam_id BIGINT AUTO_INCREMENT, 2431 cam_id BIGINT, 2432 chip_id BIGINT, 2433 state VARCHAR(64), 2434 workdir VARCHAR(255), 2435 workdir_state VARCHAR(64), 2436 label VARCHAR(64), 2437 data_group VARCHAR(64), 2438 dist_group VARCHAR(64), 2439 reduction VARCHAR(64), 2440 dvodb VARCHAR(255), 2441 software_ver VARCHAR(16), 2442 note VARCHAR(255), 2443 PRIMARY KEY(fpcam_id), 2444 KEY(cam_id), 2445 KEY(chip_id), 2446 KEY(state), 2447 KEY(label), 2448 INDEX(chip_id, cam_id), 2449 FOREIGN KEY (cam_id) REFERENCES camRun(cam_id), 2450 FOREIGN KEY (chip_id) REFERENCES chipRun(chip_id)) 2451 ENGINE=innodb DEFAULT CHARSET=latin1; 2452 2453 CREATE TABLE fpcamProcessedExp ( 2454 fpcam_id BIGINT, 2455 path_base VARCHAR(255), 2456 2457 zpt_obs FLOAT, 2458 zpt_stdev FLOAT, 2459 zpt_lq FLOAT, 2460 zpt_uq FLOAT, 2461 2462 dtime_script FLOAT, 2463 2464 hostname VARCHAR(64), 2465 n_stars INT, 2466 fault SMALLINT NOT NULL, 2467 epoch TIMESTAMP DEFAULT CURRENT_TIMESTAMP, 2468 2469 software_ver VARCHAR(16), 2470 2471 deteff_obs FLOAT, 2472 deteff_err FLOAT, 2473 deteff_lq FLOAT, 2474 deteff_uq FLOAT, 2475 2476 quality SMALLINT, 2477 2478 PRIMARY KEY(fpcam_id), 2479 KEY(fault), 2480 FOREIGN KEY (fpcam_id) REFERENCES fpcamRun(fpcam_id) 2481 ) ENGINE=innodb DEFAULT CHARSET=latin1; 2482 2429 2483 -- These comment lines are here to avoid an empty query error. 2430 2484 -- Another way to avoid that problem is to omit the semicolon above but I think that is untidy. -
trunk/ippTools/share/pxadmin_drop_tables.sql
r38157 r42387 129 129 DROP TABLE IF EXISTS remoteComponent; 130 130 DROP TABLE IF EXISTS remoteRun; 131 131 DROP TABLE IF EXISTS fpcamProcessedExp; 132 DROP TABLE IF EXISTS fpcamRun; 132 133 133 134 SET FOREIGN_KEY_CHECKS=1 -
trunk/ippTools/src
- Property svn:ignore
-
old new 49 49 fftool 50 50 remotetool 51 51 fpcamtool
-
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20220316/ippTools/src (added) merged: 42166,42195-42197,42205,42207,42258,42367
- Property svn:ignore
-
trunk/ippTools/src/Makefile.am
r36511 r42387 35 35 releasetool \ 36 36 fftool \ 37 fpcamtool \ 37 38 remotetool 38 39 … … 55 56 pxtoolsErrorCodes.h \ 56 57 pxtree.h \ 58 pxfpcam.h \ 57 59 pxwarp.h 58 60 … … 91 93 releasetool.h \ 92 94 fftool.h \ 95 fpcamtool.h \ 93 96 remotetool.h 94 97 … … 116 119 pxtoolsErrorCodes.c \ 117 120 pxtree.c \ 121 pxfpcam.c \ 118 122 pxwarp.c 119 123 … … 174 178 camtool.c \ 175 179 camtoolConfig.c 180 181 fpcamtool_CFLAGS = $(PSLIB_CFLAGS) $(PSMODULES_CFLAGS) $(IPPDB_CFLAGS) 182 fpcamtool_LDADD = $(PSLIB_LIBS) $(PSMODULES_LIBS) $(IPPDB_LIBS) libpxtools.la 183 fpcamtool_SOURCES = \ 184 fpcamtool.c \ 185 fpcamtoolConfig.c 176 186 177 187 faketool_CFLAGS = $(PSLIB_CFLAGS) $(PSMODULES_CFLAGS) $(IPPDB_CFLAGS) -
trunk/ippTools/src/pxadmin.c
r26981 r42387 184 184 psString dbName = name->data.str; 185 185 186 // if name is e.g., gpc1, strcasecmp returns FALSE 187 bool allowDelete = true; 188 allowDelete = allowDelete && strcasecmp(dbName, "gpc1"); 189 allowDelete = allowDelete && strcasecmp(dbName, "gpc2"); 190 allowDelete = allowDelete && strcasecmp(dbName, "nebulous"); 191 allowDelete = allowDelete && strcasecmp(dbName, "isp"); 192 allowDelete = allowDelete && strcasecmp(dbName, "ssp"); 193 allowDelete = allowDelete && strcasecmp(dbName, "uic"); 194 allowDelete = allowDelete && strcasecmp(dbName, "hsc_v1"); 195 allowDelete = allowDelete && strcasecmp(dbName, "megacam_v1"); 196 197 if (!allowDelete) { 198 fprintf (stdout, "**** WARNING: not allowed to delete database %s.\n", dbName); 199 return false; 200 } 201 186 202 fprintf(stdout, "*** delete the tables from database %s? ***\n", dbName); 187 203 fprintf(stdout, "*** to delete the tables, answer YES, and give password ***\n"); -
trunk/ippTools/src/pxcam.c
r41213 r42387 174 174 "new", // state 175 175 workdir ? workdir : "NULL", 176 "dirty", // workdir_state176 "dirty", // workdir_state 177 177 label ? label : "NULL", 178 178 data_group ? data_group : "NULL", -
trunk/ippTools/src/pzgetexp.c
r31038 r42387 136 136 psFree(cmdOutput); 137 137 if (!newSummitExps) { 138 // XXX not ne ssicarily an error138 // XXX not necessarily an error? 139 139 psError(PS_ERR_UNKNOWN, true, "no new fileSet/exp IDs"); 140 140 return false; … … 145 145 return true; 146 146 } 147 // If we supply an unknown last_fileset (exposure name) to the summit datastore, 148 // it will return all filesets it knows about. This can cause problems (table overflow) 149 // if this is too large a number. Raise an error and let the user fix the underlying 150 // problem (last exposure not known to the summit datastore) 151 // Do we need to be able to configure this number? 152 if (psArrayLength(newSummitExps) > 10000) { 153 psError(PS_ERR_UNKNOWN, true, "too many new fileSet/exp IDs? unknown exposure? problem with summitExp table?"); 154 return false; 155 } 147 156 148 157 // start a transaction so it's all rows or nothing … … 153 162 } 154 163 155 // increase memory table size limits; deafult is 16MB 156 { 164 // increase memory table size limits; default is 16MB, but our current (2022) config 165 // in /etc/mysql/my.cnf sets to default to 1024M. 166 // This command sets the max_heap_table_size within the transaction, and does not 167 // apparently stick. But this is not really needed, so we are deactivating it. 168 if (0) { 157 169 // 512MB 158 170 char *query = "SET max_heap_table_size = 1024*1024*512";
Note:
See TracChangeset
for help on using the changeset viewer.
