This repository constitutes the backbone of IoT Hub and related services for the Callisto initiative
Order of tiers:
- Sandbox (0)
- Develop (1)
- Test (2)
- Staging (3)
- Prod (4)
- All new changes should be merged into Sandbox (0) first
- N.B. only "principal" branches (
sandbox
,develop
,test
,staging
,master
) are eligible deployment targets. Any other branch will fail branch policies and deployment of infrastructure will be skipped. Useful for running a build, useless when trying to get a fix out.
- N.B. only "principal" branches (
- Changes will be brought up through the tiers by PR:
- e.g. to get new work into
Test
we must begin with:- PR
feature
branch to |-->Sandbox
- (only one approval required, can be creator of PR)
- We can also merge directly into
sandbox
should only one developer be maintaining this repo. PR is a formality at this stage but not condusive to POC work. Begin PR with going intodevelop
.- Recommend a
squash
merge intodevelop
! Otherwise all the commits will clutter the branch during testing.
- Recommend a
- PR
Sandbox
to |-->Develop
- (two approvals required, creator plus another is sufficient)
- PR
Develop
to |-->Test
- (two approvals required)
- PR
- Example deployment to
Develop
branch to all associated environments : )
- e.g. to get new work into
To reduce overhead and cost of resources there is a system of shared resources consisting of Azure Data Explorer, Azure Container Registry, and Azure Device Provisioning Services.
Simply put, each datacenter (e.g. USA) will have single instances of Non-Prod and Prod resources consisting of the above resources, as demonstrated in the following images:
- Merge your code into the desired branch (assuming Sandbox as the first environment, but depends on your need).
- Shared Resources should roll out without a hitch (sometimes ADX will hang and time out, but this is rare - just rerun pipeline to remedy).
- If this is the first time a deployment takes place in a brand-new environment where the resource groups have not been created, it is expected that the pipeline will fail due to "resource group not found." This is due to a poor dependency chain of Terraform attempting to deploy into a resource group that is not yet ready and is out of our control. After pipeline fails, wait a few minutes, and try again. If same error appears, rinse and repeat until pipeline succeeds. This will not happen after the first time the resource groups are created.'
- Perform the next two steps before running the pipeline again.
- Next issue is when Data Connections on ADX are being established. Since the ADX database and Data Connections roll out together, the first time this process takes place the deployment will fail.
- Currently the process of establishing the ADX schemas is manual. Now is the time to apply those from the empower-data-explorer repository.
- N.B. the above may be remedied at a later time.
- The Device Provision function app and Message Enrichment function app are also in separate repositories. Run both of these repositories with the appropriate branches to deploy to the desired environment.
- Next issue is when Data Connections on ADX are being established. Since the ADX database and Data Connections roll out together, the first time this process takes place the deployment will fail.
- Now run the same pipeline as you did in step 1. "Run New" (rerun failed jobs -> does not work because TF will detect .tfplan is not latest and will end process preemptively)
- Assuming everything above has been done you should have created a brand new and fully functional Callisto Platform environment!