-
Notifications
You must be signed in to change notification settings - Fork 68
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
Convert date for cloud resource specifications to correct timezone from UTC #1391
Merged
eiffel777
merged 7 commits into
ubccr:xdmod9.0
from
eiffel777:cloud-convert-hypervisor-facts-local-tz
Jul 21, 2020
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
0d36f71
adding staging table to convert resource specification date to local …
eiffel777 3ee878d
Merge branch 'xdmod9.0' of https://github.com/ubccr/xdmod into cloud-…
eiffel777 461b195
Merge branch 'xdmod9.0' into cloud-convert-hypervisor-facts-local-tz
eiffel777 57b1db2
documentation updates
eiffel777 d9ff93c
Merge branch 'cloud-convert-hypervisor-facts-local-tz' of https://git…
eiffel777 a304b31
documentation updates
eiffel777 7de2c52
updating configuration.md with note about cloud resources and timezones
eiffel777 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
configuration/etl/etl_action_defs.d/cloud_common/staging_resource_specifications.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"#": "@@session.time_zone is used instead of using the time zone listed in resources.json to keep consistency", | ||
"#": "with how time zone conversion works for other places in the cloud realm", | ||
"table_definition": { | ||
"$ref": "${table_definition_dir}/cloud_common/staging_resource_specifications.json#/table_definition" | ||
}, | ||
"source_query": { | ||
"records": { | ||
"resource_id": "raw.resource_id", | ||
"hostname": "raw.hostname", | ||
"vcpus": "raw.vcpus", | ||
"memory_mb": "raw.memory_mb", | ||
"fact_date": "DATE(CONVERT_TZ(raw.fact_date, '+00:00', @@session.time_zone))" | ||
}, | ||
"joins": [{ | ||
"name": "raw_resource_specs", | ||
"schema": "${SOURCE_SCHEMA}", | ||
"alias": "raw" | ||
}] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ | |
}, | ||
{ | ||
"name": "fact_date", | ||
"type": "date", | ||
"type": "datetime", | ||
"nullable": false | ||
} | ||
], | ||
|
53 changes: 53 additions & 0 deletions
53
configuration/etl/etl_tables.d/cloud_common/staging_resource_specifications.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"#": "Record types are global to all cloud resources", | ||
|
||
"table_definition": { | ||
"name": "staging_resource_specifications", | ||
"engine": "MyISAM", | ||
"comment": "Record type: accounting, administrative, derived, etc.", | ||
"columns": [ | ||
{ | ||
"name": "hostname", | ||
"type": "varchar(225)", | ||
"nullable": false | ||
}, | ||
{ | ||
"name": "resource_id", | ||
"type": "int(11)", | ||
"nullable": false, | ||
"comment": "Unknown = -1 for global dimensions" | ||
}, | ||
{ | ||
"name": "memory_mb", | ||
"type": "int(11)", | ||
"nullable": false, | ||
"comment": "Amount of memory available on the associated node." | ||
}, | ||
{ | ||
"name": "vcpus", | ||
"type": "int(5)", | ||
"nullable": false, | ||
"default": null, | ||
"comment": "Number of vcpus available on the associated node." | ||
}, | ||
{ | ||
"name": "fact_date", | ||
"type": "date", | ||
"nullable": false | ||
} | ||
], | ||
"indexes": [ | ||
{ | ||
"name": "PRIMARY", | ||
"columns": [ | ||
"resource_id", | ||
"hostname", | ||
"memory_mb", | ||
"vcpus", | ||
"fact_date" | ||
], | ||
"is_unique": true | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to use the time zone specified in
resources.json
? Does this handle resources in a different time zone than the database server?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jtpalmer Anywhere else in the cloud realm where we need to convert timezones it does it this way so I'd like to keep it consistent with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the documentation to note that cloud resources ignore the timezone configuration option (https://github.com/ubccr/xdmod/blame/xdmod9.0/docs/configuration.md#L424).