Skip to content

Commit

Permalink
[HOPSWORKS-2356] add tables (logicalclocks#612)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErmiasG authored May 17, 2021
1 parent 64c9b01 commit 1802833
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 2 deletions.
47 changes: 47 additions & 0 deletions files/default/sql/ddl/2.3.0__initial_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1972,3 +1972,50 @@ CREATE TABLE IF NOT EXISTS `feature_store_expectation_rule` (
CONSTRAINT `fk_fs_expectation_rule_id` FOREIGN KEY (`feature_store_expectation_id`) REFERENCES `feature_store_expectation` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION,
CONSTRAINT `fk_validation_rule_id` FOREIGN KEY (`validation_rule_id`) REFERENCES `validation_rule` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;

CREATE TABLE IF NOT EXISTS `alert_manager_config` (
`id` int NOT NULL AUTO_INCREMENT,
`content` mediumblob NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;

CREATE TABLE `job_alert` (
`id` int NOT NULL AUTO_INCREMENT,
`job_id` int NOT NULL,
`status` varchar(45) NOT NULL,
`type` varchar(45) NOT NULL,
`severity` varchar(45) NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_job_alert` (`job_id`,`status`),
KEY `fk_job_alert_2_idx` (`job_id`),
CONSTRAINT `fk_job_alert_2` FOREIGN KEY (`job_id`) REFERENCES `jobs` (`id`) ON DELETE CASCADE
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;

CREATE TABLE `feature_group_alert` (
`id` int NOT NULL AUTO_INCREMENT,
`feature_group_id` int NOT NULL,
`status` varchar(45) COLLATE latin1_general_cs NOT NULL,
`type` varchar(45) COLLATE latin1_general_cs NOT NULL,
`severity` varchar(45) COLLATE latin1_general_cs NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_feature_group_alert` (`feature_group_id`,`status`),
KEY `fk_feature_group_alert_2_idx` (`feature_group_id`),
CONSTRAINT `fk_feature_group_alert_2` FOREIGN KEY (`feature_group_id`) REFERENCES `feature_group` (`id`) ON DELETE CASCADE
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;

CREATE TABLE `project_service_alert` (
`id` int NOT NULL AUTO_INCREMENT,
`project_id` int NOT NULL,
`service` VARCHAR(32) COLLATE latin1_general_cs NOT NULL,
`status` varchar(45) COLLATE latin1_general_cs NOT NULL,
`type` varchar(45) COLLATE latin1_general_cs NOT NULL,
`severity` varchar(45) COLLATE latin1_general_cs NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_project_service_alert` (`project_id`,`status`),
KEY `fk_project_service_2_idx` (`project_id`),
CONSTRAINT `fk_project_service_alert_2` FOREIGN KEY (`project_id`) REFERENCES `project` (`id`) ON DELETE CASCADE
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
49 changes: 48 additions & 1 deletion files/default/sql/ddl/updates/2.3.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,51 @@ CREATE TABLE IF NOT EXISTS `default_job_configuration` (
CONSTRAINT `FK_JOBCONFIG_PROJECT` FOREIGN KEY (`project_id`) REFERENCES `project` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;

ALTER TABLE `hopsworks`.`validation_rule` ADD COLUMN `feature_type` VARCHAR(45) COLLATE latin1_general_cs DEFAULT NULL AFTER `accepted_type`;
ALTER TABLE `hopsworks`.`validation_rule` ADD COLUMN `feature_type` VARCHAR(45) COLLATE latin1_general_cs DEFAULT NULL AFTER `accepted_type`;

CREATE TABLE IF NOT EXISTS `alert_manager_config` (
`id` int NOT NULL AUTO_INCREMENT,
`content` mediumblob NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;

CREATE TABLE IF NOT EXISTS `job_alert` (
`id` int NOT NULL AUTO_INCREMENT,
`job_id` int NOT NULL,
`status` varchar(45) NOT NULL,
`type` varchar(45) NOT NULL,
`severity` varchar(45) NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_job_alert` (`job_id`,`status`),
KEY `fk_job_alert_2_idx` (`job_id`),
CONSTRAINT `fk_job_alert_2` FOREIGN KEY (`job_id`) REFERENCES `jobs` (`id`) ON DELETE CASCADE
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;

CREATE TABLE `feature_group_alert` (
`id` int NOT NULL AUTO_INCREMENT,
`feature_group_id` int NOT NULL,
`status` varchar(45) COLLATE latin1_general_cs NOT NULL,
`type` varchar(45) COLLATE latin1_general_cs NOT NULL,
`severity` varchar(45) COLLATE latin1_general_cs NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_feature_group_alert` (`feature_group_id`,`status`),
KEY `fk_feature_group_alert_2_idx` (`feature_group_id`),
CONSTRAINT `fk_feature_group_alert_2` FOREIGN KEY (`feature_group_id`) REFERENCES `feature_group` (`id`) ON DELETE CASCADE
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;

CREATE TABLE `project_service_alert` (
`id` int NOT NULL AUTO_INCREMENT,
`project_id` int NOT NULL,
`service` VARCHAR(32) COLLATE latin1_general_cs NOT NULL,
`status` varchar(45) COLLATE latin1_general_cs NOT NULL,
`type` varchar(45) COLLATE latin1_general_cs NOT NULL,
`severity` varchar(45) COLLATE latin1_general_cs NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_project_service_alert` (`project_id`,`status`),
KEY `fk_project_service_2_idx` (`project_id`),
CONSTRAINT `fk_project_service_alert_2` FOREIGN KEY (`project_id`) REFERENCES `project` (`id`) ON DELETE CASCADE
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
7 changes: 6 additions & 1 deletion files/default/sql/ddl/updates/undo/2.3.0__undo.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
DROP TABLE IF EXISTS `default_job_configuration`;
ALTER TABLE `hopsworks`.`validation_rule` DROP COLUMN `feature_type`;
ALTER TABLE `hopsworks`.`validation_rule` DROP COLUMN `feature_type`;

DROP TABLE IF EXISTS `alert_manager_config`;
DROP TABLE IF EXISTS `job_alert`;
DROP TABLE IF EXISTS `feature_group_alert`;
DROP TABLE IF EXISTS `project_service_alert`;
7 changes: 7 additions & 0 deletions recipes/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@
not_if { node['install']['external_users'].casecmp("true") == 0 }
end

group node['hopsmonitor']['group'] do
action :modify
members ["#{node['hopsworks']['user']}"]
append true
not_if { node['install']['external_users'].casecmp("true") == 0 }
end

#update permissions of base_dir to 770
directory node['jupyter']['base_dir'] do
owner node['hops']['yarnapp']['user']
Expand Down

0 comments on commit 1802833

Please sign in to comment.