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

Implemente migrate method in ModelClient; #12179

Merged
merged 2 commits into from
Oct 22, 2020

Conversation

ycliuhw
Copy link
Member

@ycliuhw ycliuhw commented Oct 22, 2020

Implemente migrate method in ModelClient to track the migrated model in target client and untrack it in source client;

We made a change for the models to be destroyed when we exit the runtime_context context 1d047af.
And the existing model migration CI tests run migrate directly using juju which does NOT untrack the migrated model from the source client. So we get not found error when the test runs juju status on the already migrated model which does not exist anymore on the source controller.

2020-10-21 08:02:24 INFO juju --show-log show-status -m nw-model-migration-amd64-lxd-b:example-model-resource --format yaml
08:02:24 INFO  juju.cmd supercommand.go:54 running juju [2.8.6 302 78e7a5a60ef88bd281835a3dfb3522277474257f gc go1.14.10]
08:02:24 INFO  juju.juju api.go:67 connecting to API addresses: [10.104.238.124:17070]
08:02:24 INFO  juju.api apiclient.go:637 connection established to "wss://10.104.238.124:17070/api"
08:02:24 INFO  juju.juju api.go:67 connecting to API addresses: [10.104.238.124:17070]
08:02:24 INFO  juju.api apiclient.go:637 connection established to "wss://10.104.238.124:17070/api"
08:02:25 INFO  juju.juju api.go:67 connecting to API addresses: [10.104.238.124:17070]
08:02:25 INFO  juju.api apiclient.go:637 connection established to "wss://10.104.238.124:17070/api"
08:02:25 INFO  juju.juju api.go:67 connecting to API addresses: [10.104.238.124:17070]
08:02:25 INFO  juju.api apiclient.go:637 connection established to "wss://10.104.238.124:17070/api"
{}
ERROR model nw-model-migration-amd64-lxd-b:admin/example-model-resource not found


2020-10-21 08:03:14 ERROR Command '('juju', '--show-log', 'show-status', '-m', 'nw-model-migration-amd64-lxd-b:example-model-resource', '--format', 'yaml')' returned non-zero exit status 1
Traceback (most recent call last):
  File "/var/lib/jenkins/workspace/nw-model-migration-amd64-lxd/acceptancetests/utility.py", line 426, in logged_exception
    yield
  File "/var/lib/jenkins/workspace/nw-model-migration-amd64-lxd/acceptancetests/deploy_stack.py", line 1040, in runtime_context
    yield
  File "/var/lib/jenkins/workspace/nw-model-migration-amd64-lxd/acceptancetests/deploy_stack.py", line 1173, in new_bootstrap
    yield machines
  File "/var/lib/jenkins/workspace/nw-model-migration-amd64-lxd/acceptancetests/deploy_stack.py", line 1152, in booted_context
    yield machines
  File "/var/lib/jenkins/workspace/nw-model-migration-amd64-lxd/acceptancetests//assess_model_migration.py", line 70, in assess_model_migration
    ensure_api_login_redirects(source_client, dest_client)
  File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
    self.gen.next()
  File "/var/lib/jenkins/workspace/nw-model-migration-amd64-lxd/acceptancetests/deploy_stack.py", line 1187, in existing_booted_context
    yield machines
  File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
    self.gen.next()
  File "/var/lib/jenkins/workspace/nw-model-migration-amd64-lxd/acceptancetests/deploy_stack.py", line 1057, in runtime_context
    m_client.show_status()
  File "/var/lib/jenkins/workspace/nw-model-migration-amd64-lxd/acceptancetests/jujupy/client.py", line 1163, in show_status
    self.juju(self._show_status, ('--format', 'yaml'))
  File "/var/lib/jenkins/workspace/nw-model-migration-amd64-lxd/acceptancetests/jujupy/client.py", line 1324, in juju
    model, check, timeout, extra_env, suppress_err=suppress_err)
  File "/var/lib/jenkins/workspace/nw-model-migration-amd64-lxd/acceptancetests/jujupy/backend.py", line 226, in juju
    rval = call_func(args, stderr=stderr)
  File "/usr/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '('juju', '--show-log', 'show-status', '-m', 'nw-model-migration-amd64-lxd-b:example-model-resource', '--format', 'yaml')' returned non-zero exit status 1

Checklist

  • Requires a pylibjuju change
  • Added integration tests for the PR
  • Added or updated doc.go related to packages changed
  • Comments answer the question of why design decisions were made

QA steps

Run nw-model-migration-amd64-*

Documentation changes

No

Bug reference

No

@ycliuhw ycliuhw requested a review from wallyworld October 22, 2020 06:46
@ycliuhw ycliuhw force-pushed the feature/juju-migrate-CI branch from c1d98e8 to 30dc828 Compare October 22, 2020 06:53
@ycliuhw
Copy link
Member Author

ycliuhw commented Oct 22, 2020

@wallyworld wallyworld merged commit 66bf72a into juju:2.8 Oct 22, 2020
@achilleasa achilleasa mentioned this pull request Oct 22, 2020
jujubot added a commit that referenced this pull request Oct 22, 2020
#12180

Forward merge of 2.8 into develop.

Brings the following changes:
- #12169
- #12171
- #12178 
- #12179
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants