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

Benchmark cache #955

Open
wants to merge 56 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
323b113
changed database structure for benchmarks. Added a Benchmark table an…
Apr 27, 2023
2f5cd16
Added the models for benchmark caching
Apr 27, 2023
d5885e6
Changed getchunk, sendbenchmark and updateclientinformation API to ma…
Apr 27, 2023
174e791
Added benchmarkUtils and HardwareGroupUtils
Apr 27, 2023
57483af
Changed Agent templates to use hardwareGroups
Apr 27, 2023
6f53747
Added frontend to view the cached benchmarks
Apr 27, 2023
75cedf4
fixed bug in benchmarkUtils
May 3, 2023
a5cf430
fixed bug in registerAgent, wasnt updated to hardwaregroup
May 8, 2023
0c3f561
updated install/hashtopolis.sql for benchmark cache
Jul 5, 2023
0c2509b
Added update script for database update
Jul 5, 2023
e06fb1f
Fixed errors in hashtopolis.sql file
Jul 5, 2023
f01d790
fixed bug in hashtopolis.sql
Jul 7, 2023
3a2d0db
fixed bug in hashtopolis.sql again
Jul 7, 2023
588e1ea
fixed bug in hashtopolis.sql, again
Jul 7, 2023
6049f50
fixed another bug in hashtopolis.sql, again
Jul 7, 2023
468a50b
added hashmode and benchmarktype to Benchmark object in hashtopolis.sql
Jul 7, 2023
bd7043e
fixed bug in hashtopolis.sql, creat table benchmark didnt work
Jul 9, 2023
a1e8b7b
updated the update script
Jul 9, 2023
df1f34c
fixed bug in hashtopolis.sql, defined hardwareGroup primary key twice
Jul 9, 2023
99d9aec
fixed typo in hashtopolis.sql
Jul 9, 2023
31991fd
Made hardwareGroupId in agent table nullable
Jul 10, 2023
19c9f4c
updated cache code to latest version
Jul 10, 2023
8f64838
Updated benchmark.utils
Jul 10, 2023
9b23f5b
removed foreignkey from agent to hardwareGroup becasue of bug
Jul 10, 2023
d173c1c
updated frontend
Jul 10, 2023
4194533
uncommented the ttl
Jul 10, 2023
17c8956
Removed foreignkey from agent to hardwareGroup in updatescript becaus…
Jul 10, 2023
cf390fd
Added crackerBinary to cached benchmarks
Jul 14, 2023
579c8f9
Formatted the hardware of the benchmark prettier in the frontend
Jul 15, 2023
164bc95
Added the crackerbinary to the benchmark frontend
Jul 15, 2023
dec578c
Fixed bug in commandline parameters parsing where arguments in format…
Jul 15, 2023
a99be7d
made small changes to hardwareGroupUtils
Jul 17, 2023
a835fd0
Added tests for the benchmarks
Jul 18, 2023
8be58e5
Fixed bug where hardware wasnt properly shown in agent detail page
Jul 18, 2023
91330df
Added the needed utils to the run.php test file
Jul 18, 2023
929350b
Added the benchmark cache to the menu
Jul 20, 2023
973d64d
Removed accidently created files
Jul 25, 2023
741a901
Removed more accidently created files
Jul 25, 2023
a4ec3fc
Merge branch 'master' into master
jessevz Jul 25, 2023
85ade75
Removed old comments
Jul 27, 2023
d15498c
Updated codestyle in benchmarkUtils
Aug 11, 2023
ecff047
Added docStrings in benchmarkUtils
Aug 11, 2023
502dbe1
Made the update script working
Aug 11, 2023
a1b04d6
removed comments from install script and renamed update script to cor…
Aug 11, 2023
2d13640
Made benchmarkcache ttl conifgurable by using the configs
Aug 16, 2023
5b769de
Added efault hardwaregroup so that foreignkey constraint wouldnt fail…
Aug 21, 2023
7b31337
Added default hardwaregroup so that foreignkey constraint wouldnt fai…
Aug 21, 2023
864693e
Added the option to disable caching by setting ttl to 0
Aug 21, 2023
580a08d
Added the changes to the changelog
Aug 23, 2023
3849695
cleaned up benchmark handler
Aug 23, 2023
cdcecc3
Updated code based on code review
Aug 25, 2023
4798414
Added accidently removed code
Aug 25, 2023
5cca11a
Made the benchmark cache also use the agent specific CMD parameters
Aug 26, 2023
5d30ad2
Fixed benchmarktests
Aug 26, 2023
18dbd90
Fixed agent API
Aug 26, 2023
dd03d7d
Added code to make benchmark working with new ui and API v2
Aug 30, 2023
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
Prev Previous commit
Next Next commit
Removed old comments
  • Loading branch information
jessevanzutphen7@hotmail.com committed Jul 27, 2023
commit 85ade75e23f544b81cd99cdcb4d43edbf5966a1d
1 change: 0 additions & 1 deletion src/inc/api/APIGetChunk.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public function execute($QUERY = array()) {
);
}
else if ($assignment->getBenchmark() == 0 && $task->getIsSmall() == 0 && $task->getStaticChunks() == DTaskStaticChunking::NORMAL) { // benchmark only required on non-small tasks and on non-special chunk tasks
//toegevoegde code voor cache
$taskWrapper = Factory::getTaskWrapperFactory()->get($task->getTaskWrapperId());
$hashlist = Factory::getHashlistFactory()->get($taskWrapper->getHashlistId());

Expand Down
6 changes: 0 additions & 6 deletions src/inc/utils/BenchmarkUtils.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
use DBA\Benchmark;

define("ttl", 216000);
// define("size", 50);

// enum BenchmarkType {
// case SpeedBenchmark;
// case RuntimeBenchmark;
// }

class BenchmarkUtils
{
Expand Down
72 changes: 36 additions & 36 deletions src/install/updates/update_v0.14.x_v0.14.0.php
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While the release is not fixed and in preparation, the update files typically are named ./update_v0.14.x_v0.x.x.php.

Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,42 @@
}

//change Agent table
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this should not be commented out? Otherwise I think this would break existing installations as the Agent table would not be as expected with the benchmark caching code.

The same probably applies for the Benchmark table and the adding of the foreign key constraints.

Factory::getAgentFactory()->getDB()->query("ALTER TABLE `Agent`
DROP COLUMN devices;
");
Factory::getAgentFactory()->getDB()->query("ALTER TABLE `Agent`
ADD COLUMN hardwareGroupId INT(11) DEFAULT NULL;
");
Factory::getAgentFactory()->getDB()->query("ALTER TABLE `Agent` ADD CONSTRAINT FOREIGN KEY (`hardwareGroupId`) REFERENCES `HardwareGroup` (`hardwareGroupId`);");


if (!Util::databaseTableExists("Benchmark")) {
Factory::getAgentFactory()->getDB()->query("CREATE TABLE `Benchmark` (
`benchmarkId` INT(11) NOT NULL,
`benchmarkValue` VARCHAR(256) NOT NULL,
`hardwareGroupId` INT(11) NOT NULL,
`crackerBinaryId` INT(11) NOT NULL,
`attackParameters` VARCHAR(512) NOT NULL,
`ttl` INT(11) NULL,
`hashMode` INT(11) NULL,
`benchmarkType` VARCHAR(10) NULL
) ENGINE=InnoDB;"
);

Factory::getAgentFactory()->getDB()->query("ALTER TABLE `Benchmark` MODIFY `benchmarkId` int(11) NOT NULL AUTO_INCREMENT;");

Factory::getAgentFactory()->getDB()->query("
ALTER TABLE `Benchmark`
ADD PRIMARY KEY (`benchmarkId`);");
// ADD KEY `hardwareGroupId` (`hardwareGroupId`);");

Factory::getAgentFactory()->getDB()->query("ALTER TABLE `Benchmark`
ADD CONSTRAINT `Benchmark_ibfk_1` FOREIGN KEY (`hardwareGroupId`) REFERENCES `HardwareGroup` (`hardwareGroupId`);");
}

// Factory::getAgentFactory()->getDB()->query("ALTER TABLE `Agent` ADD CONSTRAINT `Agent_ibfk_2`
// Factory::getAgentFactory()->getDB()->query("ALTER TABLE `Agent`
// DROP COLUMN devices;
// ");
// Factory::getAgentFactory()->getDB()->query("ALTER TABLE `Agent`
// ADD COLUMN hardwareGroupId INT(11) DEFAULT NULL;
// ");
// Factory::getAgentFactory()->getDB()->query("ALTER TABLE `Agent` ADD CONSTRAINT FOREIGN KEY (`hardwareGroupId`) REFERENCES `HardwareGroup` (`hardwareGroupId`);");


// if (!Util::databaseTableExists("Benchmark")) {
// Factory::getAgentFactory()->getDB()->query("CREATE TABLE `Benchmark` (
// `benchmarkId` INT(11) NOT NULL,
// `benchmarkValue` VARCHAR(256) NOT NULL,
// `hardwareGroupId` INT(11) NOT NULL,
// `crackerBinaryId` INT(11) NOT NULL,
// `attackParameters` VARCHAR(512) NOT NULL,
// `ttl` INT(11) NULL,
// `hashMode` INT(11) NULL,
// `benchmarkType` VARCHAR(10) NULL
// ) ENGINE=InnoDB;"
// );

// Factory::getAgentFactory()->getDB()->query("ALTER TABLE `Benchmark` MODIFY `benchmarkId` int(11) NOT NULL AUTO_INCREMENT;");

// Factory::getAgentFactory()->getDB()->query("
// ALTER TABLE `Benchmark`
// ADD PRIMARY KEY (`benchmarkId`);");
// // ADD KEY `hardwareGroupId` (`hardwareGroupId`);");

// Factory::getAgentFactory()->getDB()->query("ALTER TABLE `Benchmark`
// ADD CONSTRAINT `Benchmark_ibfk_1` FOREIGN KEY (`hardwareGroupId`) REFERENCES `HardwareGroup` (`hardwareGroupId`);");
// }

// // Factory::getAgentFactory()->getDB()->query("ALTER TABLE `Agent` ADD CONSTRAINT `Agent_ibfk_2`
// // FOREIGN KEY (`hardwareGroupId`) REFERENCES `HardwareGroup` (`hardwareGroupId`);");
// Factory::getAgentFactory()->getDB()->query("ALTER TABLE `Benchmark` ADD CONSTRAINT `Benchmark_ibfk_1`
// FOREIGN KEY (`hardwareGroupId`) REFERENCES `HardwareGroup` (`hardwareGroupId`);");
Factory::getAgentFactory()->getDB()->query("ALTER TABLE `Benchmark` ADD CONSTRAINT `Benchmark_ibfk_1`
FOREIGN KEY (`hardwareGroupId`) REFERENCES `HardwareGroup` (`hardwareGroupId`);");

?>