Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

SUBMARINE-1002. Submarine model management database and database sdk #731

Closed
wants to merge 19 commits into from

Conversation

KUAN-HSUN-LI
Copy link
Member

What is this PR for?

  1. Create submarine model management database including registered_models, registered_model_tags, model_versions and model_version_tags tables.
  2. Move the params and metrics tables from submarine.sql to submarine-model.sql

What type of PR is it?

[Feature]

Todos

What is the Jira issue?

https://issues.apache.org/jira/browse/SUBMARINE-1002

How should this be tested?

run the sdk unit tests pytest --cov=submarine -vs -m "not e2e"
TestModelVersion and TestRegisteredModel are two relevant unit tests

Screenshots (if appropriate)

Questions:

  • Do the license files need updating? No
  • Are there breaking changes for older versions? No
  • Does this need new documentation? No

@KUAN-HSUN-LI
Copy link
Member Author

@jeff-901 help me review this PR. Thanks.

Comment on lines 57 to 79
DROP TABLE IF EXISTS `metrics`;
CREATE TABLE `metrics` (
`id` varchar(64) NOT NULL COMMENT 'Id of the Experiment',
`key` varchar(190) NOT NULL COMMENT 'Metric key: `String` (limit 190 characters). Part of *Primary Key* for ``metrics`` table.',
`value` float NOT NULL COMMENT 'Metric value: `Float`. Defined as *Non-null* in schema.',
`worker_index` varchar(32) NOT NULL COMMENT 'Metric worker_index: `String` (limit 32 characters). Part of *Primary Key* for\r\n ``metrics`` table.',
`timestamp` bigint(20) NOT NULL COMMENT 'Timestamp recorded for this metric entry: `BigInteger`. Part of *Primary Key* for ``metrics`` table.',
`step` bigint(11) NOT NULL COMMENT 'Step recorded for this metric entry: `BigInteger`.',
`is_nan` BOOLEAN NOT NULL COMMENT 'True if the value is in fact NaN.',
PRIMARY KEY (`id`, `key`, `timestamp`, `worker_index`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `params`;
CREATE TABLE `params` (
`id` varchar(64) NOT NULL COMMENT 'Id of the Experiment',
`key` varchar(190) NOT NULL COMMENT '`String` (limit 190 characters). Part of *Primary Key* for ``params`` table.',
`value` varchar(32) NOT NULL COMMENT '`String` (limit 190 characters). Defined as *Non-null* in schema.',
`worker_index` varchar(32) NOT NULL COMMENT '`String` (limit 32 characters). Part of *Primary Key* for\r\n ``metrics`` table.',
PRIMARY KEY (`id`, `key`, `worker_index`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do metrics and params id need to be foreign key.

Copy link
Member Author

Choose a reason for hiding this comment

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

It sounds great to add the foreign key constraint. I will add it. Thanks

@KUAN-HSUN-LI KUAN-HSUN-LI force-pushed the SUBMARINE-1002 branch 2 times, most recently from 2490be6 to 2c1febe Compare September 1, 2021 08:47
@KUAN-HSUN-LI
Copy link
Member Author

@jeff-901 I have added the foreign key to both metrics and params. Help me review the following code, thanks.
By the way, database operation will be done in another PR.

Copy link
Contributor

@jeff-901 jeff-901 left a comment

Choose a reason for hiding this comment

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

LGTM

dev-support/database/submarine-model.sql Outdated Show resolved Hide resolved
dev-support/database/submarine-model.sql Outdated Show resolved Hide resolved
dev-support/database/submarine-model.sql Outdated Show resolved Hide resolved
@KUAN-HSUN-LI
Copy link
Member Author

@lowc1012 @pingsutw I have applied the singular table name and DATETIME type. Could you help me review the code?

@KUAN-HSUN-LI KUAN-HSUN-LI force-pushed the SUBMARINE-1002 branch 2 times, most recently from 4dae603 to d84b7da Compare September 9, 2021 03:57
Copy link
Member

@pingsutw pingsutw left a comment

Choose a reason for hiding this comment

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

@KUAN-HSUN-LI, Thanks.
LGTM. will merge it if more comments.

@asfgit asfgit closed this in c132986 Sep 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants