-
Notifications
You must be signed in to change notification settings - Fork 0
174 enable postgres timeseries storage #187
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
Open
MarkTNO
wants to merge
10
commits into
main
Choose a base branch
from
174-enable-postgres-timeseries-storage
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8cb0579
use postgres for time series storage
MarkTNO da3e913
timeseries in postgres enabled
MarkTNO c5c7757
update optimizer worker env vars
MarkTNO ee07b28
merge main
MarkTNO 644c0d6
small fixes
MarkTNO 1f499ea
fix optimizer tests
MarkTNO d7dc2ae
to optimzer-worker 2.1.15 and orchestrator 1.2.9
MarkTNO 4bf746d
add mapeditor network to postgres
MarkTNO 6f5f0fa
give proper permissions for new pg dbs
MarkTNO 18c5df0
Specify the target postgres database for storing generated profile da…
cwang39403 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,8 +1,54 @@ | ||
| CREATE USER :PG_USERNAME WITH PASSWORD :'PG_PASSWORD'; | ||
| ALTER USER :PG_USERNAME WITH PASSWORD :'PG_PASSWORD'; | ||
| GRANT ALL PRIVILEGES ON DATABASE :PG_DB TO :PG_USERNAME; | ||
| GRANT ALL PRIVILEGES ON SCHEMA public TO :PG_USERNAME; | ||
| GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO :PG_USERNAME; | ||
| GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO :PG_USERNAME; | ||
| ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO :PG_USERNAME; | ||
| ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO :PG_USERNAME; | ||
| -- create databases | ||
| CREATE DATABASE :PG_DB_JOBS; | ||
| CREATE DATABASE :PG_DB_TIMESERIES; | ||
|
|
||
| -- create roles | ||
| CREATE ROLE :JOBS_RW_USER_NAME LOGIN PASSWORD :'JOBS_RW_USER_PASSWORD'; | ||
| CREATE ROLE :TIMESERIES_RW_USER_NAME LOGIN PASSWORD :'TIMESERIES_RW_USER_PASSWORD'; | ||
| CREATE ROLE :TIMESERIES_RO_USER_NAME LOGIN PASSWORD :'TIMESERIES_RO_USER_PASSWORD'; | ||
|
|
||
| -- DB1 | ||
| \connect :PG_DB_JOBS | ||
|
|
||
| -- Make RW user owner | ||
| ALTER DATABASE :PG_DB_JOBS OWNER TO :JOBS_RW_USER_NAME; | ||
| ALTER SCHEMA public OWNER TO :JOBS_RW_USER_NAME; | ||
|
|
||
| -- Ensure RW can create objects | ||
| GRANT ALL ON SCHEMA public TO :JOBS_RW_USER_NAME; | ||
|
|
||
| -- Existing objects | ||
| GRANT ALL ON ALL TABLES IN SCHEMA public TO :JOBS_RW_USER_NAME; | ||
| GRANT ALL ON ALL SEQUENCES IN SCHEMA public TO :JOBS_RW_USER_NAME; | ||
| GRANT ALL ON ALL FUNCTIONS IN SCHEMA public TO :JOBS_RW_USER_NAME; | ||
|
|
||
| -- Default privileges | ||
| ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO :JOBS_RW_USER_NAME; | ||
| ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO :JOBS_RW_USER_NAME; | ||
| ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON FUNCTIONS TO :JOBS_RW_USER_NAME; | ||
|
|
||
| -- DB2 | ||
| \connect :PG_DB_TIMESERIES | ||
|
|
||
| -- Make RW owner | ||
| ALTER DATABASE :PG_DB_TIMESERIES OWNER TO :TIMESERIES_RW_USER_NAME; | ||
| ALTER SCHEMA public OWNER TO :TIMESERIES_RW_USER_NAME; | ||
|
|
||
| -- Schema privileges | ||
| GRANT CONNECT ON DATABASE :PG_DB_TIMESERIES TO :TIMESERIES_RO_USER_NAME; | ||
| GRANT ALL ON SCHEMA public TO :TIMESERIES_RW_USER_NAME; | ||
| GRANT USAGE ON SCHEMA public TO :TIMESERIES_RO_USER_NAME; | ||
|
|
||
| -- Existing objects | ||
| GRANT ALL ON ALL TABLES IN SCHEMA public TO :TIMESERIES_RW_USER_NAME; | ||
| GRANT ALL ON ALL SEQUENCES IN SCHEMA public TO :TIMESERIES_RW_USER_NAME; | ||
| GRANT SELECT ON ALL TABLES IN SCHEMA public TO :TIMESERIES_RO_USER_NAME; | ||
|
|
||
| -- Default privileges for public schema objects created by RW user | ||
| ALTER DEFAULT PRIVILEGES FOR ROLE :TIMESERIES_RW_USER_NAME IN SCHEMA public GRANT ALL ON TABLES TO :TIMESERIES_RW_USER_NAME; | ||
| ALTER DEFAULT PRIVILEGES FOR ROLE :TIMESERIES_RW_USER_NAME IN SCHEMA public GRANT ALL ON SEQUENCES TO :TIMESERIES_RW_USER_NAME; | ||
| ALTER DEFAULT PRIVILEGES FOR ROLE :TIMESERIES_RW_USER_NAME IN SCHEMA public GRANT SELECT ON TABLES TO :TIMESERIES_RO_USER_NAME; | ||
|
|
||
| -- Default privileges for new schemas created by RW user (one schema per optimization run) | ||
| ALTER DEFAULT PRIVILEGES FOR ROLE :TIMESERIES_RW_USER_NAME GRANT USAGE ON SCHEMAS TO :TIMESERIES_RO_USER_NAME; | ||
| ALTER DEFAULT PRIVILEGES FOR ROLE :TIMESERIES_RW_USER_NAME GRANT SELECT ON TABLES TO :TIMESERIES_RO_USER_NAME; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #!/bin/bash | ||
| . scripts/_select_docker_compose.sh | ||
|
|
||
| $DOCKER_COMPOSE --profile=manual_dev down | ||
| $DOCKER_COMPOSE down |
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
Who is still using PowerShell scripts (Deltares, TPG)? Do we need to keep maintaining them?
If so, the current role and privilege assignments that are defined in
postgres/postgres-init.sqlare not fully reflected here yet?