Skip to content
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

fix(nms): improve sync of orc8r tenants with NMS organizations in NMS scripts #13939

Merged
merged 6 commits into from
Sep 21, 2022

Conversation

alexzurbonsen
Copy link
Contributor

@alexzurbonsen alexzurbonsen commented Sep 15, 2022

Summary

[merge after #13917 (and rebase before)]

This PR follows up on #13917 and implements corresponding changes in scripts that create or modify organizations.

These scripts are called when dev_setup.sh is run after NMS start up.

In createOrganization.ts an initial sync is introduced, which updates orc8r tenants to the state of NMS organizations.

Test Plan

locally test that

  • tenants are synced with NMS when dev_setup.sh (i.e. createOrganization.ts) is run
  • the organizations that are created or updated by dev_setup.sh are also created or updated in orc8r "tenants" table

Additional Information

  • This change is backwards-breaking

@pull-request-size pull-request-size bot added the size/L Denotes a Pull Request that changes 100-499 lines. label Sep 15, 2022
@github-actions
Copy link
Contributor

Thanks for opening a PR! 💯

A couple initial guidelines

Howto

  • Reviews. The "Reviewers" listed for this PR are the Magma maintainers who will shepherd it.
  • Checks. All required CI checks must pass before merge.
  • Merge. Once approved and passing CI checks, use the ready2merge label to indicate the maintainers can merge your PR.

More info

Please take a moment to read through the Magma project's

If this is your first Magma PR, also consider reading

@github-actions github-actions bot added component: nms NMS-related issue component: orc8r Orchestrator-related issue labels Sep 15, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Sep 15, 2022

feg-workflow

    2 files  203 suites   40s ⏱️
374 tests 374 ✔️ 0 💤 0
388 runs  388 ✔️ 0 💤 0

Results for commit a1bcde2.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 15, 2022

nms-workflow

0 tests   0 ✔️  0s ⏱️
0 suites  0 💤
0 files    0

Results for commit 39685cd.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 15, 2022

dp-workflow

0 tests   0 ✔️  0s ⏱️
0 suites  0 💤
0 files    0

Results for commit 39685cd.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 15, 2022

cloud-workflow

1 135 tests   1 135 ✔️  3m 5s ⏱️
   365 suites         0 💤
       7 files           0

Results for commit a1bcde2.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 15, 2022

agw-workflow

615 tests   611 ✔️  3m 50s ⏱️
    2 suites      4 💤
    2 files        0

Results for commit a1bcde2.

♻️ This comment has been updated with latest results.

@alexzurbonsen alexzurbonsen linked an issue Sep 15, 2022 that may be closed by this pull request
7 tasks
@alexzurbonsen alexzurbonsen force-pushed the nms-orc8r-tenants-sync-scripts branch 2 times, most recently from 20afbee to a1bcde2 Compare September 15, 2022 17:44
@alexzurbonsen alexzurbonsen marked this pull request as ready for review September 15, 2022 17:49
@alexzurbonsen alexzurbonsen requested review from a team September 15, 2022 17:49
@github-actions github-actions bot removed the component: orc8r Orchestrator-related issue label Sep 19, 2022
@voisey voisey removed the request for review from a team September 20, 2022 12:04
@@ -13,8 +13,13 @@

import Sequelize from 'sequelize';

import axios from 'axios';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <@typescript-eslint/no-unused-vars> reported by reviewdog 🐶
'axios' is defined but never used.

@@ -12,11 +12,13 @@
*/

import Sequelize from 'sequelize';
import axios from 'axios';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <@typescript-eslint/no-unused-vars> reported by reviewdog 🐶
'axios' is defined but never used.

alexzurbonsen and others added 5 commits September 20, 2022 16:31
Signed-off-by: Alexander zur Bonsen <alexander.zur.bonsen@tngtech.com>
… if organization is created or updated

Signed-off-by: Alexander zur Bonsen <alexander.zur.bonsen@tngtech.com>
…ts with NMS orgs

Signed-off-by: Alexander zur Bonsen <alexander.zur.bonsen@tngtech.com>
Signed-off-by: Alexander zur Bonsen <alexander.zur.bonsen@tngtech.com>
Signed-off-by: Sebastian Thomas <sebastian.thomas@tngtech.com>
@sebathomas sebathomas force-pushed the nms-orc8r-tenants-sync-scripts branch 3 times, most recently from 60212d2 to f398fed Compare September 20, 2022 14:54

import OrchestratorAPI from '../api/OrchestratorAPI';
import axios from 'axios';
import {Organization} from '../../shared/sequelize_models';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <@typescript-eslint/no-unused-vars> reported by reviewdog 🐶
'Organization' is defined but never used.

import axios from 'axios';
import {Organization} from '../../shared/sequelize_models';
import {OrganizationModel} from '../../shared/sequelize_models/models/organization';
import {Tenant} from '../../generated';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <@typescript-eslint/no-unused-vars> reported by reviewdog 🐶
'Tenant' is defined but never used.

import {Organization} from '../../shared/sequelize_models';
import {OrganizationModel} from '../../shared/sequelize_models/models/organization';
import {Tenant} from '../../generated';
import {isEqual, sortBy} from 'lodash';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <@typescript-eslint/no-unused-vars> reported by reviewdog 🐶
'isEqual' is defined but never used.

import {Organization} from '../../shared/sequelize_models';
import {OrganizationModel} from '../../shared/sequelize_models/models/organization';
import {Tenant} from '../../generated';
import {isEqual, sortBy} from 'lodash';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <@typescript-eslint/no-unused-vars> reported by reviewdog 🐶
'sortBy' is defined but never used.

Signed-off-by: Sebastian Thomas <sebastian.thomas@tngtech.com>
@sebathomas sebathomas merged commit c3c289e into magma:master Sep 21, 2022
mpfirrmann pushed a commit to wolfseb/magma that referenced this pull request Sep 21, 2022
… scripts (magma#13939)

* refactor tenants sync functions in util file

Signed-off-by: Alexander zur Bonsen <alexander.zur.bonsen@tngtech.com>

* adapt scripts that are run by dev_setup.sh to sync with orc8r as well if organization is created or updated

Signed-off-by: Alexander zur Bonsen <alexander.zur.bonsen@tngtech.com>

* add modified version of syncTenants to utils, which syncs orc8r tenants with NMS orgs

Signed-off-by: Alexander zur Bonsen <alexander.zur.bonsen@tngtech.com>

* add initial sync of orc8r tenants

Signed-off-by: Alexander zur Bonsen <alexander.zur.bonsen@tngtech.com>

* Minor changes and fix mock server for e2e test

Signed-off-by: Sebastian Thomas <sebastian.thomas@tngtech.com>

* Revert initial tenants-sync when creating organization

Signed-off-by: Sebastian Thomas <sebastian.thomas@tngtech.com>

Signed-off-by: Alexander zur Bonsen <alexander.zur.bonsen@tngtech.com>
Signed-off-by: Sebastian Thomas <sebastian.thomas@tngtech.com>
Co-authored-by: Sebastian Thomas <sebastian.thomas@tngtech.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: nms NMS-related issue size/L Denotes a Pull Request that changes 100-499 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NMS organizations and orc8r tenants not kept in sync consistently
2 participants