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

Add --actor-config to snactor run #627

Merged
merged 2 commits into from Jun 5, 2020

Conversation

vinzenz
Copy link
Member

@vinzenz vinzenz commented May 12, 2020

This patch introduces support for specifying a model which the actor
should consume for configuration data.
Using this feature requires to run an actor before which produces this
model and saves the output.

Jira-Task: OAMG-1092

Signed-off-by: Vinzenz Feenstra vfeenstr@redhat.com
Fixes #530

@vinzenz vinzenz added the wip label May 12, 2020
@leapp-bot
Copy link
Collaborator

Thank you for contributing to the Leapp project!

Please note that every PR needs to comply with the Leapp Guidelines, pass tests and linter checks before it can be merged.

If you want to re-run tests or request review, you can use following commands as a comment:

  • leapp-ci build to run unit tests and copr build
  • e2e tests to run unit tests, copr build and end-to-end tests (OAMG members only)
  • review please to notify leapp developers of review request

@@ -19,10 +19,18 @@
'''


def _get_model(name, repo):
try:
return {model.__name__.lower(): model}[name.lower()]
Copy link
Member

Choose a reason for hiding this comment

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

Traceback (most recent call last):
  File "/usr/bin/snactor", line 9, in <module>
    load_entry_point('leapp==0.10.0', 'console_scripts', 'snactor')()
  File "/usr/lib/python2.7/site-packages/leapp/snactor/__init__.py", line 78, in main
    cli.command.execute(version=_('snactor version {}').format(VERSION))
  File "/usr/lib/python2.7/site-packages/leapp/utils/clicmd.py", line 103, in execute
    args.func(args)
  File "/usr/lib/python2.7/site-packages/leapp/utils/clicmd.py", line 125, in called
    self.target(args)
  File "/usr/lib/python2.7/site-packages/leapp/utils/repository.py", line 20, in checker
    return f(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/leapp/snactor/context.py", line 32, in wrapper
    return f(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/leapp/snactor/commands/run.py", line 46, in cli
    config_model = _get_model(args.actor_config, repository) if args.actor_config else None
  File "/usr/lib/python2.7/site-packages/leapp/snactor/commands/run.py", line 24, in _get_model
    return {model.__name__.lower(): model}[name.lower()]
NameError: global name 'model' is not defined

@vinzenz vinzenz force-pushed the snactor-workflow-config-support branch 2 times, most recently from 94287de to 8669cac Compare May 13, 2020 12:30
@vinzenz vinzenz force-pushed the snactor-workflow-config-support branch from 8669cac to 5dfd9b0 Compare May 20, 2020 12:23
@Rezney
Copy link
Member

Rezney commented May 22, 2020

@vinzenz is this still WIP?

@vinzenz vinzenz force-pushed the snactor-workflow-config-support branch 3 times, most recently from eedc9e3 to 37575d3 Compare May 26, 2020 13:22
@Rezney
Copy link
Member

Rezney commented May 26, 2020

Tested, seems to be working fine. @pirat89 any potential comments here?

@Rezney
Copy link
Member

Rezney commented May 29, 2020

@vinzenz I originally thought the failed tests was due to some outage but:

=================================== FAILURES ===================================

_____________ [pylint] leapp/snactor/commands/messages/__init__.py _____________

W: 15, 0: Reimport 'requires_repository' (imported line 11) (reimported)

============= 1 failed, 98 passed, 179 deselected in 27.71 seconds =============

could you please take a look?

@vinzenz vinzenz force-pushed the snactor-workflow-config-support branch 2 times, most recently from c1bb512 to 3e2f175 Compare May 29, 2020 09:15
@drehak
Copy link
Contributor

drehak commented May 29, 2020

Is the option only meant to be used for IPUConfig or other models too?
What about using the option multiple times with different models? The corresponding BaseMessaging attribute, _config_models is a tuple, but if I use the option multiple times, only the latter one gets used. (In the case it's not meant to be used multiple times, shouldn't such usage throw an error instead of some of them being silently discarded?)

@Rezney
Copy link
Member

Rezney commented Jun 1, 2020

@drehak It is meant just for "IPUConfig" model as this is used differently then other models. Please note that you still have to run "IPUWorkflowConfig" actor to generate the data, same as to get the messages from other actors, which however do not require any special treatment. HTH.

@drehak
Copy link
Contributor

drehak commented Jun 1, 2020

@Rezney if it's for and only for IPUConfig, shouldn't the option just be a flag? Being able to specify any model as an argument is kinda pointless, if the argument is going to be IPUConfig anyway.

@Rezney
Copy link
Member

Rezney commented Jun 1, 2020

@drehak To give a real example. We may (or may not) want to migrate Convert2RHEL to LEAPP. In this case, there would be a new repository, with a new workflow, and a new config model C2RConfig. HTH

@vinzenz vinzenz force-pushed the snactor-workflow-config-support branch from 3e2f175 to 5f64afb Compare June 2, 2020 11:20
@drehak
Copy link
Contributor

drehak commented Jun 3, 2020

@Rezney Alright, looks good to me then.

@Rezney
Copy link
Member

Rezney commented Jun 3, 2020

@vinzenz could you please also document this?

This patch introduces support for specifying a model which the actor
should consume for configuration data.
Using this feature requires to run an actor before which produces this
model and saves the output.

Additionally to facilitate the testing needs for this PR `snactor
messages add` has been added, which allows injecting messages from the
commandline.

Jira-Task: OAMG-1092

Signed-off-by: Vinzenz Feenstra <vfeenstr@redhat.com>
@vinzenz vinzenz force-pushed the snactor-workflow-config-support branch from 5f64afb to 6f55fba Compare June 5, 2020 09:08
@vinzenz vinzenz removed the wip label Jun 5, 2020
Copy link
Member

@Rezney Rezney left a comment

Choose a reason for hiding this comment

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

Doc added. Approved...

@Rezney Rezney merged commit c464a59 into oamg:master Jun 5, 2020
MichalHe pushed a commit to MichalHe/leapp that referenced this pull request Aug 12, 2021
## Packaging
- Bump required leapp-framework capability to 1.4 (oamg#642)

## Upgrade handling
### Fixes
- Fix comparison of the newest installed and booted kernel (oamg#600)
- Fix remediation command for ipa-server removal (oamg#617)
- Fix crash due to missing network interfaces during upgrade phases (oamg#625)
- Fix error with /boot/efi existing on non-EFI systems (oamg#627)
- Fix false positive detection of issue in /etc/default/grub that led into GRUB prompt (oamg#587)
- Fix syntax error in upgrade script (oamg#619)
- Inhibit upgrade with mount options in fstab that break mounting on RHEL 8 (oamg#639)
- Inhibit upgrade on s390x machines with /boot on a separate partition (oamg#641)
- Inhibit upgrade if multiple kernel-debug pkgs are installed (oamg#599)
- Remove the initial-setup package to avoid it asking for EULA acceptance during upgrade (oamg#626)
- Remove the *leapp-resume* service after the *FirstBoot* phase to prevent kill of the leapp process on `systemctl daemon-reload` (oamg#611)

### Enhancements
- Add upgrade support for SAP HANA (own upgrade path) (oamg#503)
- Allow upgrade with SCA enabled manifest (oamg#615)
- Add actors to migrate Quagga to FRR (oamg#467)
- Add stable uniq Key id for every dialog (oamg#618)
- Respect the *kernel-rt* package (oamg#600)

## Additional changes interesting for devels
- Add a possibility to overwrite virtualenv name using `$VENVNAME` (oamg#613)
- Update product certificates for RHEL 8.3 GA and 8.4 Beta/HTB (oamg#624)

Related leapp release: https://github.com/oamg/leapp/releases/tag/v0.12.0
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.

Workflow configuration: missing snactor support
4 participants