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

Deploy models via zbchaos #240

Merged
merged 2 commits into from
Nov 18, 2022
Merged

Deploy models via zbchaos #240

merged 2 commits into from
Nov 18, 2022

Conversation

ChrisKujawa
Copy link
Member

@ChrisKujawa ChrisKujawa commented Nov 17, 2022

Details

Add new sub command deploy process to deploy process models, either specified by the user
via --processModelPath or if not given it will deploy multiple versions of default models (BPMN and DMN).

The user is able to specify the count of versions which should be deployed for each.
This allows experimenting with deployment distribution.

Replacement of:

  • deploy-different-versions.sh
  • deploy-model.sh
  • deploy-specific-model.sh

closes #226
closes #160

Example Usage:

$ ./zbchaos deploy process --verbose         
Connecting to zell-chaos
Successfully created port forwarding tunnel
Deploy 10 versions of different type of models.
Deployed [2/10] versions.
Deployed [4/10] versions.
Deployed [6/10] versions.
Deployed [8/10] versions.
Deployed [10/10] versions.
Deployed different process models of different types and versions to zeebe!

bpmn
dmn

@ChrisKujawa
Copy link
Member Author

I also tried to improve our test coverage related to these functionality, I wanted to verify for example that X deployments are send or deployment X is created. Unfortunately I'm not able to fake/mock the Zeebe client because of certain issues, see camunda/camunda#11044 (camunda/camunda#11045)

Copy link
Member

@npepinpe npepinpe left a comment

Choose a reason for hiding this comment

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

Regarding testing the Zeebe client, I don't understand why gomock wouldn't work 🤔

Anyway, one way to circumvent this is to have your code not use a ZeebeClient but instead use an interface type you describe which specifies how to deploy, e.g. MyDeployer. Since Go uses structural typing, any type which implements the function will automatically implement the type, so it will work with the Zeebe client and your own mock. You have to keep the interface in sync or adapter for the Zeebe client though, but yeah. I guess it's do-able 🤷 Hope I'm clear 😅

Add new sub command to deploy process models, either specified by the user
via processModelPath or if not given it default process models BPMN and DMN
are be deployed.

The user is able to specify the count of versions which should be deployed for each.
This allows to experiment with deployment distribution.
@ChrisKujawa
Copy link
Member Author

Hey @npepinpe thanks for the review 🙇

Haven't tried yet gomock, was also a bit reluctant to use something where I have to generate something (or use a tool).

I also thought to change my functions to only use parts which might be better intercepted. You input gave also a good trigger regarding the own interface which I tried out, but without success. You can take a look at this here d4cfdc4

What we can see is that sure I can create such an interface, but still i have an issue that the ZeebeCLient returns a struct which is not what I want to use or return in that case (since I can't intercept the call or control anything then) Maybe I'm just too stupid for this 🙈

extract

I feel a bit lost here. 🥲

@npepinpe
Copy link
Member

I think you'd have to workaround this by essentially creating interfaces for everything you need, and ensuring either the Zeebe types match those (not just the client, but the returned structs for the complete execution path), or writing adapters yourself. I don't have time to check it out today, and to be honest I think a fake client is good idea anyway for us, but if you'd like we can take a look next week.

@ChrisKujawa
Copy link
Member Author

I think you'd have to workaround this by essentially creating interfaces for everything you need, and ensuring either the Zeebe types match those (not just the client, but the returned structs for the complete execution path), or writing adapters yourself. I don't have time to check it out today, and to be honest I think a fake client is good idea anyway for us, but if you'd like we can take a look next week.

I thought this as well and thought but why I use then anyway this client at all 😅 than I can also create a complete new client 😆

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.

I can deploy models via Zbchaos Improve Deployment Distribution experiment
2 participants