...
This approach will
Take configuration in the form of JSON object
Based on the jobs specified in configuration, jobs will be loaded with appropriate and required config params
Once the loader is completed with onboarding configuration, all the jobs are executed by executor
Uploading to BLOB will be based on configuration across multiple providers
Allows to extend / add custom jobs, so that additional automation are handled automatically based on configuration
Impact
Code reuse:
By externalising a module, adopters can easily reuse the functionality in their projects, saving time and effort
Maintenance:
Externalising a module can make it easier to maintain the code, as it can be updated and tested independently of the main project
Modularity:
Externalising a module can improve the overall design of the project by making it more modular, which can make it easier to understand, test, and maintain
Collaboration:
Externalising a module allows developers (adopters) to collaborate more easily, as they can work on different parts of the codebase simultaneously without interfering with one another
Scenario 1
Configuration
Code Block | ||
---|---|---|
| ||
[ { "tenant": "Tenant 1", "container": "tenant_1", "jobs": [ { "name": "resourceBundles", "isEnabled": true, "cloudServiceProvider": "azure", "folders": [ { "name": "consumption", "path": "/resourcebundles/data/consumption/", "dest": "/resourcebundles/json/", "blobName": "label", "uploadPath": "tenant_1/labels/consumption" }, { "name": "creation',", "path": "/resourcebundles/data/creation/", "dest": "/resourcebundles/json/", "blobName": "label", "uploadPath": "tenant_1/labels/creation" } ] }, { "name": "assets", "isEnabled": true, "cloudServiceProvider": "aws", "folders": [ { "name": "logos", "path": "/logos", "blobName": "images", "uploadPath": "tenant_1/images" } ] } ] }, { "tenant": "Tenant 2", "container": "tenant_2", "jobs": [ { "name": "resourceBundles", "isEnabled": true, "cloudServiceProvider": "azure", "folders": [ { "name": "consumption", "path": "/resourcebundles/data/consumption/", "dest": "/resourcebundles/json/", "blobName": "label", "uploadPath": "tenant_2/labels/consumption" }, { "name": "creation',", "path": "/resourcebundles/data/creation/", "dest": "/resourcebundles/json/", "blobName": "label", "uploadPath": "tenant_2/labels/creation" } ] }, { "name": "assets", "isEnabled": true, "cloudServiceProvider": "aws", "folders": [ { "name": "logos", "path": "/logos", "blobName": "images", "uploadPath": "tenant_2/images" } ] } ] } ] |
...
Folder Structure
Code Block |
---|
. ├── ekstep │ ├── assets │ │ ├── contact.png │ │ └── logo.png │ └── resource-bundles │ ├── data │ │ ├── consumption │ │ │ └── en.properties │ │ └── creation │ │ └── en.properties │ └── json ├── jobs │ ├── asset-parser │ ├── blob-uploader │ └── resource-bundle-parser ── sunbird │ ├── assets │ │ ├── contact.png │ │ └── logo.png │ └── resource-bundles │ ├── data │ │ ├── consumption │ │ │ └── en.properties │ │ └── creation │ │ └── en.properties │ └── json ├── .env └── configuration.json |
...