Skip to content

Regenerate Artifacts

There might be a scenario when the artifact for objects got deleted due to some reason (data loss). The user can regenerate the artifacts in such cases using the regenerate-artifact utility.

In general, before running this command, run a simulation for the object on the platform.

This command is only available for the corridor-api component.

Available options:

$ corridor-api scripts regenerate-artifact --help

Usage: corridor-api scripts regenerate-artifact [OPTIONS] OBJECTS

  Create an artifact bundle for the provided Objects.

  Objects that this script can be run on:
  - 'all': Use all Objects
  - 'upgrade-fix': Use all objects in final state and not having an artifact bundle
  - '<object_name>': Use all items in the given object_name
                     Ex: data_element, feature, etc.
  - '<object_ref>': Use the given object_ref
                    Ex: data_element_1, feature_45, etc.

Options:
  -u, --user TEXT     User doing the bulk regenerate  [required]
  --save / --no-save  Whether to save persistently to DB or not
  --help              Show this message and exit.

Note

In future versions of corridor the way to provide a list of objects will change.

Example

To generate the artifact for a data element with id=211. Note that the --save option will add the info about the newly generated artifact in the database. Only then the new artifact would be available to download from the platform. If the artifact creation is successful and the artifact information is saved to the database, the logs would show Saving DB.

$ corridor-api scripts regenerate-artifact -u master --save data_element_211
[I 2021-07-15 14:40:08,286 corridor_api] Got 1 refs to run on
[I 2021-07-15 14:40:08,343 corridor_api] 1 of 1: data_element_211 ("Loan Issue Date"): Generating Bundle Artifact
[I 2021-07-15 14:40:08,444 corridor_api] Solving for <class 'corridor_api.tasks.artifact_execution_task_helpers.PlatformEntityExecutionHelper'>: solve=['feature_211'], require=['data_element_211', 'platform_entity_2']
[I 2021-07-15 14:40:08,527 corridor_api] Solving for <class 'corridor_api.tasks.artifact_execution_task_helpers.DataVaultExecutionHelper'>: solve=['platform_entity_2', 'data_element_211'], require=['data_column_288', 'data_column_291', 'data_table_8']
[I 2021-07-15 14:40:08,527 corridor_api] Solving for DataTables: {'solve': {'data_column_288', 'data_table_8', 'data_column_291'}, 'require': []}
[I 2021-07-15 14:40:08,569 corridor_api] Solving for <class 'corridor_api.tasks.artifact_execution_task_helpers.PlatformEntityExecutionHelper'>: solve=['feature_211'], require=['data_element_211', 'platform_entity_2']
[I 2021-07-15 14:40:08,587 corridor_api] Solving for <class 'corridor_api.tasks.artifact_execution_task_helpers.DataVaultExecutionHelper'>: solve=['platform_entity_2', 'data_element_211'], require=['data_column_288', 'data_column_291', 'data_table_8']
[I 2021-07-15 14:40:08,587 corridor_api] Solving for DataTables: {'solve': {'data_column_288', 'data_table_8', 'data_column_291'}, 'require': []}
[I 2021-07-15 14:40:08,874 corridor_api] Saving DB ...

To generate the artifact for a data element with id=211, without saving the artifact info to the database. This would not make the artifact available for download from the UI.

$ corridor-api scripts regenerate-artifact -u master data_element_211
[I 2021-07-15 14:39:18,350 corridor_api] Got 1 refs to run on
[I 2021-07-15 14:39:18,425 corridor_api] 1 of 1: data_element_211 ("Loan Issue Date"): Generating Bundle Artifact
[I 2021-07-15 14:39:18,502 corridor_api] Solving for <class 'corridor_api.tasks.artifact_execution_task_helpers.PlatformEntityExecutionHelper'>: solve=['feature_211'], require=['data_element_211', 'platform_entity_2']
[I 2021-07-15 14:39:18,582 corridor_api] Solving for <class 'corridor_api.tasks.artifact_execution_task_helpers.DataVaultExecutionHelper'>: solve=['platform_entity_2', 'data_element_211'], require=['data_column_288', 'data_column_291', 'data_table_8']
[I 2021-07-15 14:39:18,583 corridor_api] Solving for DataTables: {'solve': {'data_table_8', 'data_column_288', 'data_column_291'}, 'require': []}
[I 2021-07-15 14:39:18,626 corridor_api] Solving for <class 'corridor_api.tasks.artifact_execution_task_helpers.PlatformEntityExecutionHelper'>: solve=['feature_211'], require=['data_element_211', 'platform_entity_2']
[I 2021-07-15 14:39:18,638 corridor_api] Solving for <class 'corridor_api.tasks.artifact_execution_task_helpers.DataVaultExecutionHelper'>: solve=['platform_entity_2', 'data_element_211'], require=['data_column_288', 'data_column_291', 'data_table_8']
[I 2021-07-15 14:39:18,638 corridor_api] Solving for DataTables: {'solve': {'data_table_8', 'data_column_288', 'data_column_291'}, 'require': []}
[I 2021-07-15 14:39:19,052 corridor_api] Not saved Data to DB