---
# System prepended metadata

title: TS Processing Production Progress

---

# TS Processing Production Progress

## Tasks

- [x] 0. Permission Requests
    - [x] 0.1. Set permission for `
AWSTSECSExecutionRole` **BY QIYUE** to prod keyspace [Ref 1]
    - [x] 0.2. Set permission `logs:CreateLogGroup` **BY QIYUE**
    - [x] 0.3. Update permission for Egia's Backend Production Apps to access `Task 1` **BY QIYUE** (Require Tasks 1)
    - [x] 0.4. Issuing main db access
- [x] 1. DB & Storage Creation
    - [x] 1.1. Create AWS Keyspace table schema
    - [x] 1.2. Create ElasticCache **BY QIYUE**
- [x] 2. Data Sync Service
    - [x] 2.1. ECS Service
    - [x] 2.2. ECS Task Definition (**Require Tasks 0.3. and 0.1**)
    - [x] 2.3. Repository
- [x] 3. Data Retrieval Service
    - [x] 3.1. ECS Service
    - [x] 3.2. ECS Task Definition (**Require Tasks 0.3. and 0.1**)
    - [x] 3.3. Repository
- [x] 4. Data Processing Service
    - [x] 4.1. ECS Service
    - [x] 4.2. ECS Task Definition (**Require Tasks 0.3. and 0.1**)
    - [x] 4.3. Repository
- [x] 5. Helping other boss
    - [x] 5.1. Deploy TS Dashboard BE
        - [x] 5.1.1. Deploy it
        - [x] 5.1.2. Setup DNS **BY QIYUE**
        - [x] 5.1.3. Permission issue fetching SMS parameters **BY QIYUE**
        - [x] 5.1.4. Troubleshoot issues
    - [x] 5.2. Deploy TS Dashboard FE
        - [x] 5.2.1. Deploy it
        - [x] 5.2.2. Permission issue on updating cloudfront **BY QIYUE**
- [x] 6. Check is running well (Require Tasks 1, 2, 3, 4, 5)
- [ ] 6. **Optional** (NO NEED TO ASK THE PROGRESS PLEASE, will do on weekdays)
    - [ ] 6.1. Optimize cost for Database with provisioned planning
    - [ ] 6.2. Refactor unit & zone 5 mins data from retrieval to processing
    - [ ] 6.3. Migrate raw data from dev
    - [ ] 6.4. Archiving procedure

## References

### Database Permission (AWSTSECSExecutionRole)

```
{
   "Version":"2012-10-17",
   "Statement":[
      {
         "Effect":"Allow",
         "Action":[
            "cassandra:Select",
         ],
         "Resource":[
            "arn:aws:cassandra:ap-southeast-1:987837270205:/keyspace/system*"
         ]
      }
   ]
}        
{
   "Version":"2012-10-17",
   "Statement":[
      {
         "Effect":"Allow",
         "Action":[
            "cassandra:Select",
            "cassandra:Modify"
         ],
         "Resource":[
            "arn:aws:cassandra:ap-southeast-1:987837270205:/keyspace/prospace_ts_data_prod/*",
         ]
      }
   ]
}
```

### TS FE Deployment


```
npm install
npm run build-prod

aws s3 sync build/ s3://prospace-thermalsense --exclude ".git/*" --exclude ".gitignore" --exclude "deploy_*.sh"  --exclude ".idea" --exclude ".DS_Store"
aws cloudfront create-invalidation --distribution-id E1UW1FOMN1VBEZ --paths / /service-worker.js
```


### VMS FE Deployment (DEV)

```
npm install
npm run build-dev

aws s3 sync build/ s3://prospace-vms-registration-portal-dev --exclude ".git/*" --exclude ".gitignore" --exclude "deploy_*.sh"  --exclude ".idea" --exclude ".DS_Store"


aws cloudfront create-invalidation --distribution-id E2U2LQSBJGTGSE --paths / /service-worker.js
```














 public | thermalsense_cms_activity_events                 | table | song  | 80 kB      | 
 public | thermalsense_dashboard_activity_events           | table | song  | 80 kB      | 
 public | thermalsense_device_sensor_data_control          | table | song  | 8192 bytes | 
 public | thermalsense_device_unit_relations               | table | song  | 40 kB      | 
 public | thermalsense_devices                             | table | song  | 48 kB      | 
 public | thermalsense_profiles                            | table | song  | 8192 bytes | 
 public | thermalsense_site_configurations                 | table | song  | 16 kB      | 
 public | thermalsense_units                               | table | song  | 16 kB      | 
 public | thermalsense_zone_unit_relations                 | table | song  | 40 kB      | 
 public | thermalsense_zones                               | table | song  | 48 kB      | 
