-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update migrations #667
update migrations #667
Conversation
|
||
|
||
def migrate(dryrun): | ||
LOGGER.info('Updating station data in Elasticsearch index') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicated below (line 60), delete.
try: | ||
res = es.search(index=es_index, | ||
query={'match_all': {}}, | ||
size=maxrecords) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whilst maxrecords
is large for the metadata do we want/need to consider paging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given this a migration, and the the state of existing installations, we are probably safe without paging.
th = record['wis2box']['topic_hierarchy'] | ||
|
||
if th not in DATA_MAPPINGS['data'].keys(): | ||
print("TH", th) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use logger?
record['wis2box']['data_mappings'] = DATA_MAPPINGS['data'][th] | ||
|
||
if dryrun: | ||
LOGGER.info('dryrun == True, writing updates to stdout') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want this logged for each record?
LOGGER.info('dryrun == True, writing updates to stdout') | ||
print(record) | ||
else: | ||
LOGGER.info('Updating index ...') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move outside of loop over records?
I tried to test the migration-script, I got the following error:
|
I've added some commits to this PR to fix various issues, and I could confirm the dataset-editor could load the datasets after migration. |
Update: given WCMP2 migrations are complex given the significant changes in wis2box-api and associated workflows, we will instruct users to delete their volumes and start fresh. Keeping station updates and WCMP2 |
No description provided.