Skip to content

Commit 4b8dbcf

Browse files
Merge pull request #407 from thoughtspot/sdlc_revamp_1
Revamp of Development and Deployment to match new best practices
2 parents 74d74f8 + 9034fc9 commit 4b8dbcf

15 files changed

Lines changed: 564 additions & 287 deletions

modules/ROOT/pages/common/nav.adoc

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,16 +236,18 @@ include::generated/typedoc/CustomSideNav.adoc[]
236236
* link:{{navprefix}}/development-and-deployment[Deployment and integration]
237237
** link:{{navprefix}}/development-and-deployment[Development and deployment]
238238
*** link:{{navprefix}}/thoughtspot-objects[ThoughtSpot objects overview]
239-
*** link:{{navprefix}}/variables[Custom variables]
240-
*** link:{{navprefix}}/git-integration[Deploy with Git]
241-
**** link:{{navprefix}}/git-configuration[Configure Git integration]
242-
**** link:{{navprefix}}/git-api[Version Control REST APIs]
243-
**** link:{{navprefix}}/guid-mapping[GUID mapping]
239+
*** link:{{navprefix}}/variables[Variables]
240+
*** link:{{navprefix}}/parameterze-metdata[Parameterize metadata]
244241
*** link:{{navprefix}}/deploy-with-tml-apis[Deploy with TML APIs]
242+
**** link:{{navprefix}}/git-provider-integration[Git provider integration]
245243
**** link:{{navprefix}}/modify-tml[TML modification]
246244
*** link:{{navprefix}}/publish-data-overview[Publish content to Orgs]
247-
**** link:{{navprefix}}/parameterze-metdata[Parameterize metadata]
248245
**** link:{{navprefix}}/publish-to-orgs[Publish objects to Orgs]
246+
*** link:{{navprefix}}/git-integration[Deploy with GitHub APIs (legacy)]
247+
**** link:{{navprefix}}/git-configuration[Configure GitHub integration]
248+
**** link:{{navprefix}}/git-api[GitHub REST APIs]
249+
**** link:{{navprefix}}/guid-mapping[GUID mapping]
250+
249251
250252
** link:{{navprefix}}/multi-tenancy[Multi-tenancy]
251253
*** link:{{navprefix}}/orgs[Multi-tenancy with Orgs]

modules/ROOT/pages/deploy-with-tml-apis.adoc

Lines changed: 221 additions & 213 deletions
Large diffs are not rendered by default.

modules/ROOT/pages/development-and-deployment.adoc

Lines changed: 87 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,99 @@ ThoughtSpot instances act as a constantly running service, so xref:development-a
1212

1313
ThoughtSpot provides numerous tools for building a structured deployment process, built around the link:https://docs.thoughtspot.com/cloud/latest/tml[ThoughtSpot Modeling Language (TML), window=_blank] format for representing the xref:intro-thoughtspot-objects.adoc[objects within ThoughtSpot].
1414

15-
== Best practices
16-
The primary tool for structured development and deployment in ThoughtSpot is called xref:orgs.adoc[Orgs].
15+
== Overview
16+
ThoughtSpot may provision your organization one or more separate *instances*, each with an individual URL.
1717

18-
Each Org in ThoughtSpot can be xref:version_control.adoc[paired] to a link:https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches[branch, target=_blank] in a link:https://docs.github.com/en/repositories/creating-and-managing-repositories/about-repositories[Git repository, target=_blank] as a single *environment*.
18+
Within a ThoughtSpot instance, the administrator of the Primary Org can create any number of logical tenants called xref:orgs.adoc[Orgs].
1919

2020
xref:orgs.adoc[Orgs] are fully separated tenants on a single ThoughtSpot instance. For TSE customers and others who need a structured development and deployment process, Orgs should always be enabled.
2121

22-
Once your environments are configured, you can xref:version_control.adoc#moving-tml-changes-between-environments[move data models and content] from the initial "dev environment" to any other environment using the xref:git-rest-api-guide.adoc[Git integration REST APIs].
22+
image::./images/instances_and_orgs.png[Instances and Orgs]
23+
24+
By setting the `xref:intro-thoughtspot-objects.adoc#object-identifiers[obj_id]` property of objects, objects in various Orgs that are related copies of one another will have the same `obj_id`, allowing for tracking related objects and updating them without concern for each object's unique GUID.
2325

2426
[NOTE]
2527
====
26-
ThoughtSpot does not recommend TML export and import across different versions of ThoughtSpot application because the TML syntax, supported features, and object schemas can vary between releases and can sometimes lead to compatibility issues and validation errors.
28+
ThoughtSpot does not recommend TML export and import from a *newer version* of ThoughtSpot to an instance on a *previous version*, because the TML syntax, supported features, and object schemas can vary between releases and can sometimes lead to compatibility issues and validation errors.
2729
====
2830

31+
== Version Control
32+
*Version control* is the process of tracking changes that occur to objects in ThoughtSpot.
33+
34+
A single branch in Git can be used for version control of a single Org in ThoughtSpot.
35+
36+
ThoughtSpot provides a GitHub-based link:https://docs.thoughtspot.com/cloud/10.15.0.cl/git-version-control[automated version control in the UI] for Liveboards and answers or a customized process can be built using the TML Export API to any Git provider.
37+
38+
It is best to use separate branches or even repositories for the UI automated version control and direct REST API processes.
39+
40+
When using the TML REST APIs and a Git provider, you can also implement version control branches, but they should be separate from the "deploy branches":
41+
42+
image::./images/version-control-branches.png[version control branches diagram]
43+
44+
It is important to have a version control branch for any "prod" Orgs with end user created content, which otherwise will not be archived in any way.
45+
46+
== Deployment
47+
*Deployment* is the process of *making copies of objects* from one Org to another Org.
48+
49+
Deployment is used in the process of building a *release* from a *dev Org* and then deploying copies of the release objects via TML to *test*, *uat*, and eventual *prod* Orgs.
50+
51+
The TML Export and Import APIs allow customizable release and deployment processes to integrate with any Git provider.
52+
53+
The standard deployment pattern for a xref:multi-tenancy-intro.adoc[multi-tenanted prod database] is shown below. RLS rules will filter the shared data models on the "prod" Org so that standard LBs and Answers only show the right data for each end customer, who are all only added as users to the "prod" Org.
54+
55+
image::./images/multi_tenant_deployment.png[Multi-tenant Database Deployment SDLC Pattern]
56+
57+
In a scenario where xref:single-tenant-data-models.adoc[end customer databases are single-tenanted], an Org can be created programmatically matching with the level of tenant separation, so that there is an Org representing each separate logical database.
58+
59+
There are two techniques for managing Orgs for single-tenanted databases:
60+
61+
* Publishing [beta betaBackground]^Beta^
62+
* Deploy to each Org using TML Import
63+
64+
== Publishing
65+
66+
*xref:publishing-overview.adoc[Publishing]* makes objects available in other Orgs without making copies.
67+
68+
Variables can be set at the Org level to override the Connection and Table object details for Publishing objects when they are accessed in a specific Org. Variables for connections and tables work with both Publishing and TML Import.
69+
70+
image::./images/publishing_diagram.png[Publishing and Variables]
71+
72+
With single-tenanted prod Orgs, the *Publishing* feature allows the final deployment step to import TML into the *publisher* Org, updating the *Published* objects, which instantly updates the objects in every Org the objects are published to.
73+
74+
image::./images/single_tenant_publishing.png[Publishing to Single-Tenants]
75+
76+
If there are structural differences within the various databases that make Publishing unviable, the TML Import process can be used to deploy unique copies of the release TML into each Org. This process may also include modifying the release TML to introduce variation into the objects that are deployed.
77+
78+
image::./images/single_tenant_deployment.png[Individual Deployment to Single-Tenants]
79+
80+
81+
82+
83+
////
84+
Each Org in ThoughtSpot can be xref:version_control.adoc[paired] to a link:https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches[branch, target=_blank] in a link:https://docs.github.com/en/repositories/creating-and-managing-repositories/about-repositories[Git repository, target=_blank] as a single *environment*.
85+
////
86+
87+
////
88+
Once your environments are configured, you can xref:version_control.adoc#moving-tml-changes-between-environments[move data models and content] from the initial "dev environment" to any other environment using the xref:git-rest-api-guide.adoc[Git integration REST APIs].
89+
////
90+
91+
92+
2993
////
3094
If you have used ThoughtSpot for a long time and are enabling Orgs for the first time, please see xref:moving-to-orgs.adoc[moving to Orgs from single-tenant ThoughtSpot instance].
3195
////
32-
== Standard structure of Orgs
96+
////
97+
== Typical Orgs pattern for SDLC
3398
When Orgs are enabled, the *Primary Org* (`org_id: 0`) should be treated as the "root" or "super-admin" Org, and all "real content" should exist on Orgs other than the Primary.
3499
100+
Additionally, the *Primary Org* is the only Org where *Published* objects can originate, so *Primary* serves as the *Publisher* Org within SDLC flows that involve Publishing.
101+
35102
The most basic standard configuration for separated development and deployment, with a xref:multi-tenancy-best-practices.adoc[multi-tenanted "prod" environment], has the following environments:
36103
37104
- *Primary*: only used for administration of instance and Orgs themselves
38-
- *Dev*: ThoughtSpot customer internal development team builds data models and standard Liveboards and Answers
39-
- *Prod*: Data models and standard content are published to this environment by service account. All end customers get READ-ONLY access to data models, standard Liveboards, and Answers.
105+
- *dev*: ThoughtSpot customer internal development team builds data models and standard Liveboards and Answers
106+
- *test*:
107+
- *prod*: Data models and standard content are published to this environment by service account. All end customers get READ-ONLY access to data models, standard Liveboards, and Answers.
40108
41109
image::./images/multi-tenanted_prod_deployment.png[Multi-tenanted prod deployment model]
42110
@@ -47,20 +115,25 @@ RLS filters the shared data models on the "prod" Org so that standard LBs and An
47115
If the production end customer data models are xref:single-tenant-data-models.adoc[single-tenanted (logical separation for each end customer)], such that a different connection is necessary), then the standard deployment involves a "release"/"pre-prod" Org and then one prod Org per end customer.
48116
49117
image::./images/single-tenant_prod_per_customer.png[Single-tenant final deployment model]
50-
118+
////
119+
////
51120
=== Additional "typical" Orgs
52121
53122
- *Test*, *UAT*: Additional steps in the publishing process between Dev and Prod, for verification before changes are deployed into Prod
54123
- *Internal Org(s)*: Org(s) for ThoughtSpot customer's own business work, never to be shared with end customers
55124
- Separate *'dev' instance*: Some people want a fully separated environment for dev, especially if doing MAJOR changes, even to cluster config. Recommend there be a 'Test Org' on the 'Prod Instance' to push to first, before pushing to 'Prod'
56125
- Separate *regional instances*: prod per customer Orgs may extend to multiple ThoughtSpot instances in different regional cloud data centers
126+
////
57127

128+
////
58129
[#deploy-between-environments]
59130
== Deploying content between environments
60-
////
131+
61132
The workflow for a very simple "dev" to "prod" flow on the same environment shown here, is the same pattern for any source-to-destination environment flow:
62133
63134
image::./images/development-deployment-process.png[Development and deployment workflow]
135+
////
136+
64137
////
65138
=== Git deployment
66139
The xref:version_control.adoc[Git REST APIs] are designed for the best practice pattern of building on a Dev Org and then deploying to any number of Orgs through Prod(s).
@@ -74,9 +147,12 @@ You will need a xref:guid-mapping.adoc[GUID Mapping file] that records the `orig
74147
75148
== Multi-tenancy and data security
76149
The exact deployment pattern chosen will depend on the design of your data warehouse. Please see the xref:multi-tenancy-intro.adoc[full documentation on multi-tenancy within ThoughtSpot] to determine which deployment pattern best fits your needs.
150+
////
77151

152+
////
78153
== Publishing content to Orgs within a ThoughtSpot instance
79154
80155
Starting with the 10.10.0.cl release, ThoughtSpot provides the ability to parameterize object properties using variables for each Org and publish objects directly from the Primary Org to other Orgs on a multi-tenant instance. The publishing feature [beta betaBackground]^Beta^ enables administrators to create a single main object in the Primary Org and distribute it to other Orgs within the instance.
81156
82-
For more information, see xref:publishing-overview.adoc[Publishing content to Orgs].
157+
For more information, see xref:publishing-overview.adoc[Publishing content to Orgs].
158+
////

modules/ROOT/pages/git-configuration.adoc

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
= Configure Git integration
1+
= Configure GitHub integration
22
:toc: true
33
:toclevels: 2
44

5-
:page-title: Configure Git integration
5+
:page-title: Configure GitHub integration
66
:page-pageid: git-configuration
7-
:page-description: Configuring the Git integration for a ThoughtSpot instance
7+
:page-description: Configuring the GitHub integration for a ThoughtSpot instance
88

9-
Git integration requires configuration within both ThoughtSpot, accomplished via the V2.0 REST APIs, and your Git provider (GitHub currently).
9+
[NOTE]
10+
====
11+
The legacy GitHub REST APIs referenced here are tied to GitHub exclusively. The newer xref:git-provider-integration.adoc[Git provider integration pattern] provides more flexibility and control and should be utilized if you are starting out or having issues with the GitHub APIs.
12+
====
13+
14+
GitHub integration requires configuration within both ThoughtSpot, accomplished via the V2.0 REST APIs, and your Git provider (GitHub currently).
1015

1116
== Configure Git repository
1217

@@ -44,7 +49,7 @@ tscli git-integration enable
4449
////
4550

4651
== Confirm permissions within ThoughtSpot Orgs
47-
* To commit objects from Thoughtspot to a Git repository, your ThoughtSpot user account requires at least view permission for all objects that will be committed as part of the operation.
52+
* To commit objects from ThoughtSpot to a Git repository, your ThoughtSpot user account requires at least view permission for all objects that will be committed as part of the operation.
4853
* To deploy or revert objects from a Git repository to ThoughtSpot, you require edit access to all objects that will be updated as part of the deployment. If the deployment contains Models, Views, or Tables, users require **Can manage data** (`DATAMANAGEMENT`) privilege for deploy, commit, and revert operations.
4954

5055
[#guid-map-and-config-files]
@@ -80,17 +85,16 @@ For more advanced Git development patterns, list multiple `branch_names` in the
8085
|===
8186
|Parameter|Description
8287
|`repository_url`|__String__. The HTTPS URL of the Git repository; for example, `\https://github.com/user/repo.git`.
83-
|`username`
84-
|__String__. Username to authenticate to the Git repository.
88+
|`username`|__String__. Username to authenticate to the Git repository.
8589
|`access_token`|__String__. Access token to authenticate to the Git repository.
8690
|`org_identifier`|__String__. ID of the Org. Define this parameter only if the Orgs feature is enabled on your ThoughtSpot cluster and separate Orgs are configured for development and production environments.
8791
|`branch_names`|__Array of strings__. List of Git branches to configure.
88-
|`commit_branch_name` |__String__. Name of the remote branch where objects committed from this Thoughtspot instance will be versioned. Replaces `default_branch_name`, which is deprecated in 9.10.5.cl.
92+
|`commit_branch_name` |__String__. Name of the remote branch where objects committed from this ThoughtSpot instance will be versioned. Replaces `default_branch_name`, which is deprecated in 9.10.5.cl.
8993
|`default_branch_name` +
9094
__Optional__|__String__. Deprecated in 9.10.5.cl. In earlier versions, this parameter was used to configure the name of the default Git branch to use for all operations on the cluster.
9195
|`enable_guid_mapping` |__Boolean__. Enables GUID mapping and generates a GUID mapping file. Starting from 9.7.0.cl, this attribute is set to `true` by default.
9296
To know more about GUID mapping, see xref:version_control.adoc#_guid_mapping_and_configuration_files[GUID mapping].
93-
|`configuration_branch_name` a|__String__. Name of the branch where the configuration files related to operations between Thoughtspot and the version control repository should be maintained. Replaces `guid_mapping_branch_name`, which is deprecated in 9.10.5.cl.
97+
|`configuration_branch_name` a|__String__. Name of the branch where the configuration files related to operations between ThoughtSpot and the version control repository should be maintained. Replaces `guid_mapping_branch_name`, which is deprecated in 9.10.5.cl.
9498

9599
[NOTE]
96100
====
@@ -109,14 +113,14 @@ The following example shows the API request format for connecting ThoughtSpot to
109113
----
110114
curl -X POST \
111115
--url 'https://{ThoughtSpot-Host-Dev}/api/rest/2.0/vcs/git/config/create' \
112-
-H 'Authorization: Bearer {Bearer_token} \
116+
-H 'Authorization: Bearer {Bearer_token}' \
113117
-H 'Accept: application/json'\
114118
-H 'Content-Type: application/json' \
115119
--data-raw '{
116120
"repository_url": "https://github.com/user/repo.git",
117121
"username": "ts-git-user",
118122
"access_token": "{ACCESS_TOKEN}",
119-
"org_identifier": "dev"
123+
"org_identifier": "dev",
120124
"branch_names": [
121125
"dev",
122126
"main"
@@ -128,7 +132,7 @@ curl -X POST \
128132

129133
If the API request is successful, the ThoughtSpot instance will be connected to the Git repository.
130134

131-
Go into each Org an issue the `config/create` call to link the appropriate branch to establish all environments.
135+
Go into each Org and issue the `config/create` call to link the appropriate branch to establish all environments.
132136

133137
The following example shows the API request parameters to connect a ThoughtSpot `Prod` Org to the Git repo. Note that GUID mapping is enabled in the API request.
134138

@@ -138,15 +142,15 @@ The `Bearer_token` value must be requested for the desired Org, specified throug
138142
----
139143
curl -X POST \
140144
--url 'https://{ThoughtSpot-Host-Prod}/api/rest/2.0/vcs/git/config/create' \
141-
-H 'Authorization: Bearer {Bearer_token} \
145+
-H 'Authorization: Bearer {Bearer_token}' \
142146
-H 'Accept: application/json'\
143147
-H 'Content-Type: application/json' \
144148
--data-raw '{
145149
"repository_url": "https://github.com/user/repo.git",
146150
"username": "ts-git-user",
147151
"access_token": "{ACCESS_TOKEN}",
148152
"enable_guid_mapping": true,
149-
"org_identifier": "prod"
153+
"org_identifier": "prod",
150154
"branch_names": [
151155
"prod"
152156
],
@@ -162,9 +166,9 @@ Version control and xref:guid-mapping.adoc[GUID mapping] utilize files stored in
162166

163167
You can initialize these files by immediately using the xref:git-rest-api-guide.adoc#deploy-commits[deploy commits REST API] after configuring the Org for Git.
164168

165-
See the link:https://github.com/thoughtspot/thoughtspot_rest_api_v1_python/blob/main/examples_v2/create_orgs_with_linked_git_branch.py[create_orgs_with_linked_git_branch.py script] for an example of deploying a full Orgs or branches setup for structured development and deployment.
169+
See the link:https://github.com/thoughtspot/thoughtspot_rest_api_v1_python/blob/main/examples_v2/create_orgs_with_linked_git_branch.py[create_orgs_with_linked_git_branch.py script, window=_blank] for an example of deploying a full Orgs or branches setup for structured development and deployment.
166170

167-
After the Orgs are set up, you can link:https://github.com/thoughtspot/thoughtspot_rest_api_v1_python/blob/main/examples_v2/create_connection_on_orgs.py[create connections across the orgs] and xref:guid-mapping.adoc#using-mapping-for-table-tml-properties[add any necessary entries to the GUID mapping files].
171+
After the Orgs are set up, you can link:https://github.com/thoughtspot/thoughtspot_rest_api_v1_python/blob/main/examples_v2/create_connection_on_orgs.py[create connections across Orgs, window=_blank] and xref:guid-mapping.adoc#using-mapping-for-table-tml-properties[add any necessary entries to the GUID mapping files].
168172

169173

170174
[#update-git-config]

0 commit comments

Comments
 (0)