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

feat: combine event streams with activations #657

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

hsong-rh
Copy link
Contributor

@hsong-rh hsong-rh commented Feb 7, 2024

https://issues.redhat.com/browse/AAP-20144
https://issues.redhat.com/browse/AAP-20036
https://issues.redhat.com/browse/AAP-19799

This is the first attempt at getting a basic fanout working with the latest model changes. We can create event streams attach them to activations, report on the events for each one separately, get the logs for each one separately. With the basic stuff working with complete UI support we should be able to continue parallel work in QE and Dev to harden some of the internal plumbing needed to get fanout to closure. There are unit tests for most of the changes. We would start writing the first E2E tests once we get a client generated from this.

Testing this PR

To start up the test environment we need the 2 images

You can build the image from this PR or use the ones below

  • export EDA_IMAGE=quay.io/hsong_rh/eda-server:final
  • export EDA_UI_IMAGE=quay.io/lgalis/eda-ui:latest_arm
    On Linux if using amd chip use
  • export EDA_UI_IMAGE=quay.io/lgalis/eda-ui:latest_amd

Start up the server using docker_compose or minikube
Log into the EDA Server

Steps

  1. Create a Decision Environment (e.g. quay) pointing to
quay.io/ansible/ansible-rulebook:main
  1. Create a new Project with the Name set to demo and the SCM URL set to
 https://github.com/mkanoor/eda-project
  1. Create an Event Stream
    • Name
      Testing Generic
    
    • Source type
        ansible.eda.generic
    
    • Decision environment
      quay
    
    • Args:
startup_delay: 60
payload:
   - i : 1
   - i : 2
   - name: Fred
  1. Create a new Rulebook Activation pick the project demo and the rulebook single_rule.yml and attach the "Testing Generic" EventStream to it
  2. Watch for results in the Logs or in the Rule Audit, you will see 2 myrule1 which is the rule triggered when the condition matches.

@hsong-rh hsong-rh requested a review from a team as a code owner February 7, 2024 23:27
@mkanoor mkanoor changed the title Combine event streams with activations feat: combine event streams with activations Feb 7, 2024
src/aap_eda/api/serializers/activation.py Outdated Show resolved Hide resolved
src/aap_eda/api/serializers/activation.py Show resolved Hide resolved
src/aap_eda/api/serializers/activation.py Outdated Show resolved Hide resolved
src/aap_eda/api/serializers/activation.py Outdated Show resolved Hide resolved
@hsong-rh hsong-rh force-pushed the enable_fanout branch 4 times, most recently from e0e1705 to fd00c1f Compare February 8, 2024 17:20
@hsong-rh hsong-rh force-pushed the enable_fanout branch 2 times, most recently from daa3878 to 1dbc719 Compare February 8, 2024 18:18
@mkanoor
Copy link
Contributor

mkanoor commented Feb 8, 2024

UI PR ansible/ansible-ui#1571

@mkanoor
Copy link
Contributor

mkanoor commented Feb 8, 2024

Setting up Decision Environment
DecisionEnvionment

Setting up Event Stream
EventStream

Setting up Activation

Activation

Rule Audit
RuleAudit

@hsong-rh hsong-rh removed the run-e2e label Feb 12, 2024
@bzwei
Copy link
Collaborator

bzwei commented Feb 12, 2024

The code LGTM. Haven't got chance to test it. I am ok to have it merged. Will try it soon.

@mkanoor mkanoor merged commit 876a41f into ansible:main Feb 12, 2024
2 of 3 checks passed
@bzwei
Copy link
Collaborator

bzwei commented Feb 12, 2024

Tested and worked fine

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.

5 participants