-
Notifications
You must be signed in to change notification settings - Fork 28
Support creation of CDP DW Database Catalog and Virtual Warehouses #27
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
Closed
Closed
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
3d54286
Support CDW VW changes
raju-saravanan a113082
Revert unnecessary changes
raju-saravanan d386477
Add labels for the loops
raju-saravanan 8d08f52
Remove use_default_dbc flag
raju-saravanan b74ef0a
Change the vw and dbc module names and other minor refactor
raju-saravanan 41c6383
Minor refactor
raju-saravanan 84576b9
Address review comments
raju-saravanan bf69eed
Refactor cdw teardown logic
raju-saravanan ababc1e
Add support for CDW partial teardown
raju-saravanan a85ea21
Remove logs from code
raju-saravanan 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,10 +40,10 @@ | |
| - name: Execute CDP DW cluster setup | ||
| cloudera.cloud.dw_cluster: | ||
| env: "{{ run__env_name }}" | ||
| overlay: no | ||
| # TODO - Allow direct assignment (will need to coordinate with infra role) | ||
| overlay: "{{ run__dw_overlay_network }}" | ||
| private_load_balancer: "{{ run__dw_private_load_balancer }}" | ||
| aws_public_subnets: "{{ run__datahub_public_subnet_ids }}" | ||
| aws_private_subnets: "{{ run__datahub_private_subnet_ids }}" | ||
| aws_private_subnets: "{{ run__datahub_private_subnet_ids if run__dw_private_worker_nodes else [] }}" | ||
| state: present | ||
| wait: yes | ||
| async: 3600 # 1 hour timeout | ||
|
|
@@ -60,4 +60,95 @@ | |
| register: __dw_builds_async | ||
| until: __dw_builds_async.finished | ||
| retries: 120 | ||
| delay: 30 | ||
| delay: 30 | ||
|
|
||
| - name: Retrieve CDP DW experiences | ||
Chaffelson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| cloudera.cloud.dw_cluster_info: | ||
| env: "{{ run__env_name }}" | ||
| register: run__dw_list | ||
|
|
||
| - name: Fetch all the Database Catalogs under the cluster | ||
| cloudera.cloud.dw_database_catalog_info: | ||
| cluster_id: "{{ run__dw_list.clusters[0].id }}" | ||
| register: __dbc_list | ||
|
|
||
| - name: Set default Database catalog id for the cluster | ||
| when: __dw_dbc.name | regex_search('.*'+run__dw_default_dbc_suffix+'$') | ||
| ansible.builtin.set_fact: | ||
| __default_dbc_id: "{{ __dw_dbc.id }}" | ||
| loop: "{{ __dbc_list.database_catalogs }}" | ||
| loop_control: | ||
| loop_var: __dw_dbc | ||
|
|
||
| - name: Create CDP DW Database catalogs | ||
| when: not __dw_dbc_config.use_default_dbc | ||
| cloudera.cloud.dw_database_catalog: | ||
| cluster_id : "{{ run__dw_list.clusters[0].id }}" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps pull out into a separate task that can ensure the cluster 0 exists, etc. -- the |
||
| name: "{{ __dw_dbc_config.name }}" | ||
| load_demo_data: "{{ __dw_dbc_config.load_demo_data }}" | ||
| state: present | ||
| wait: yes | ||
| async: 3600 # 1 hour timeout | ||
| poll: 0 | ||
| loop: "{{ run__dw_dbc_configs }}" | ||
| loop_control: | ||
| loop_var: __dw_dbc_config | ||
| label: "{{ __dw_dbc_config.name }}" | ||
| register: __dw_dbc_builds | ||
|
|
||
| - name: Wait for CDP DW Database catalogs setup to complete | ||
| when: __dw_dbc_build.ansible_job_id is defined | ||
| ansible.builtin.async_status: | ||
| jid: "{{ __dw_dbc_build.ansible_job_id }}" | ||
| register: __dw_dbc_builds_async | ||
| until: __dw_dbc_builds_async.finished | ||
| retries: 120 | ||
| delay: 30 | ||
| loop: "{{ __dw_dbc_builds.results }}" | ||
| loop_control: | ||
| loop_var: __dw_dbc_build | ||
| label: "{{ __dw_dbc_build.__dw_dbc_config.name }}" | ||
|
|
||
| - name: Set CDP DW Database catalog name to id map | ||
| when: __dw_dbc_build_async.database_catalog is defined | ||
| ansible.builtin.set_fact: | ||
| run__dw_dbc_ids: "{{ run__dw_dbc_ids | default({}) | combine({ __dw_dbc_build_async.database_catalog.name : __dw_dbc_build_async.database_catalog.id}) }}" | ||
| loop: "{{ __dw_dbc_builds_async.results }}" | ||
| loop_control: | ||
| loop_var: __dw_dbc_build_async | ||
|
|
||
| - name: Create CDP DW Virtual warehouse | ||
| cloudera.cloud.dw_virtual_warehouse: | ||
| cluster_id: "{{ run__dw_list.clusters[0].id }}" | ||
| dbc_id: "{{ __dw_vw_config.use_default_dbc | ternary(__default_dbc_id, run__dw_dbc_ids[__dw_vw_config.dbc_name]) }}" | ||
| type: "{{ __dw_vw_config.type }}" | ||
| name: "{{ __dw_vw_config.name }}" | ||
| template: "{{ __dw_vw_config.template }}" | ||
| autoscaling_min_nodes: "{{ __dw_vw_config.autoscaling_min_nodes }}" | ||
| autoscaling_max_nodes: "{{ __dw_vw_config.autoscaling_max_nodes }}" | ||
| common_configs: "{{ __dw_vw_config.common_configs }}" | ||
| application_configs: "{{ __dw_vw_config.application_configs }}" | ||
| ldap_groups: "{{ __dw_vw_config.ldap_groups }}" | ||
| enable_sso: "{{ __dw_vw_config.enable_sso | bool }}" | ||
| tags: "{{ __dw_vw_config.tags }}" | ||
| wait: yes | ||
| async: 3600 # 1 hour timeout | ||
| poll: 0 | ||
| register: __dw_vw_builds | ||
| loop: "{{ run__dw_vw_configs }}" | ||
| loop_control: | ||
| loop_var: __dw_vw_config | ||
| label: "{{ __dw_vw_config.name }}" | ||
|
|
||
| - name: Wait for CDP DW Virtual warehouse setup to complete | ||
| when: __dw_vw_build.ansible_job_id is defined | ||
| ansible.builtin.async_status: | ||
| jid: "{{ __dw_vw_build.ansible_job_id }}" | ||
| register: __dw_vw_builds_async | ||
| until: __dw_vw_builds_async.finished | ||
| retries: 120 | ||
| delay: 30 | ||
| loop: "{{ __dw_vw_builds.results }}" | ||
| loop_control: | ||
| loop_var: __dw_vw_build | ||
| label: "{{ __dw_vw_build.__dw_vw_config.name }}" | ||
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.
Uh oh!
There was an error while loading. Please reload this page.