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

TRANSFORMER_PHASE_ENVIRONMENT_CONNECTED #2914

Merged
merged 4 commits into from
Sep 19, 2023

Conversation

kamalca
Copy link
Collaborator

@kamalca kamalca commented Aug 21, 2023

Adds a transformer phase that runs every time a VM is deployed.

@kamalca
Copy link
Collaborator Author

kamalca commented Aug 21, 2023

@squirrelsc Previous transformers are passed a node connection in the runbook. However, for transformers in this phase I want to access the node that was just deployed. Do you have thoughts on the best way to implement that?

@squirrelsc
Copy link
Member

@squirrelsc Previous transformers are passed a node connection in the runbook. However, for transformers in this phase I want to access the node that was just deployed. Do you have thoughts on the best way to implement that?

Deployed phase is different than other phases. You can create a new base class for deployed phase transformers, which can accept an environment argument on __init__. This argument can be optional, so if a transformer doesn't support this argument, it still can be used at deployed phase. Versus, a deployed transformer shouldn't raise an exception, if it can be used by other phases.

@kamalca kamalca force-pushed the kameroncarr/transformer-on-deploy branch 6 times, most recently from c279b66 to 71f6a15 Compare August 21, 2023 23:18
lisa/util/subclasses.py Outdated Show resolved Hide resolved
@kamalca kamalca force-pushed the kameroncarr/transformer-on-deploy branch 2 times, most recently from 47ef18e to a907b03 Compare August 24, 2023 22:18
@kamalca kamalca marked this pull request as ready for review September 5, 2023 17:31
@kamalca kamalca force-pushed the kameroncarr/transformer-on-deploy branch 3 times, most recently from 013dbad to 40e4f42 Compare September 5, 2023 22:33
@kamalca kamalca changed the title TRANSFORMER_PHASE_DEPLOYED TRANSFORMER_PHASE_ENVIRONMENT_CONNECTED Sep 6, 2023
lisa/schema.py Outdated Show resolved Hide resolved
lisa/transformer.py Outdated Show resolved Hide resolved
lisa/transformer.py Outdated Show resolved Hide resolved
@kamalca kamalca force-pushed the kameroncarr/transformer-on-deploy branch 3 times, most recently from 6dcaae4 to 87c52a8 Compare September 12, 2023 19:23
rename from DEPLOYED to ENVIRONEMENT_CONNECTED for clarity.
@kamalca kamalca force-pushed the kameroncarr/transformer-on-deploy branch from 87c52a8 to 23add61 Compare September 13, 2023 23:09
@pupacha
Copy link
Collaborator

pupacha commented Sep 19, 2023

This was much needed. Thanks @kamalca for adding this feature.

@kamalca kamalca merged commit 2e2a570 into main Sep 19, 2023
45 checks passed
@kamalca kamalca deleted the kameroncarr/transformer-on-deploy branch September 19, 2023 18:22
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.

3 participants