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

Jobflow must allow generating multiple instances of the same type in a single execution #5796

Open
fcaffieri opened this issue Oct 2, 2024 · 2 comments

Comments

@fcaffieri
Copy link
Member

Version Revision Production/Development Component Install type
NA NA Development Jobflow NA

Description

Jobflow is required to be able to execute the allocator in such a way that it allows more than one VM to be instantiated.
For example:

version: 0.1
description: This workflow is used to test agents deployment for DDT1 PoC
variables:
  agent-os:
    - linux-ubuntu-24.04-amd64
    - linux-ubuntu-24.04-amd64
    - linux-ubuntu-24.04-amd64
  infra-provider: aws
  macos-infra-provider: vagrant
  working-dir: /tmp/dtt1-poc

tasks:
  # Unique agent allocate task
  - task: "allocate-agent-{agent}"
    description: "Allocate resources for the agent."
    do:
      this: process
      with:
        path: python3
        args:
          - modules/allocation/main.py
          - action: create
          - provider: "{infra-provider}"
          - size: small
          - composite-name: "{agent}"
          - instance-name: "{agent}-1"
          - inventory-output: "{working-dir}/agent-{agent}-1/inventory.yaml"
          - track-output: "{working-dir}/agent-{agent}-1/track.yaml"
          - label-termination-date: "1d"
          - label-team: "qa"
          - label-issue: "https://github.com/wazuh/wazuh/issues/26002"
    foreach:
      - variable: agent-os
        as: agent

Should allow 3 ubuntu24 to be raised.

Evironment

Node Vagrant/AWS Image CPU RAM (GB) Disk size (GB) Packages/Repository/Sources branch
NA NA NA NA NA NA NA

Steps to reproduce

  1. Ejecute Jobflow with this yaml:
version: 0.1
description: This workflow is used to test agents deployment for DDT1 PoC
variables:
  agent-os:
    - linux-ubuntu-24.04-amd64
    - linux-ubuntu-24.04-amd64
    - linux-ubuntu-24.04-amd64
  infra-provider: aws
  macos-infra-provider: vagrant
  working-dir: /tmp/dtt1-poc

tasks:
  # Unique agent allocate task
  - task: "allocate-agent-{agent}"
    description: "Allocate resources for the agent."
    do:
      this: process
      with:
        path: python3
        args:
          - modules/allocation/main.py
          - action: create
          - provider: "{infra-provider}"
          - size: small
          - composite-name: "{agent}"
          - instance-name: "{agent}-1"
          - inventory-output: "{working-dir}/agent-{agent}-1/inventory.yaml"
          - track-output: "{working-dir}/agent-{agent}-1/track.yaml"
          - label-termination-date: "1d"
          - label-team: "qa"
          - label-issue: "https://github.com/wazuh/wazuh/issues/26002"
    foreach:
      - variable: agent-os
        as: agent

Current result

Currently it throws the following error:

$ python3 -m jobflow modules/jobflow/examples/4.9.1/install/test_agents1.yaml --log-level DEBUG --threads 4 
[2024-10-02 18:31:15] [DEBUG] [1191430] [MainThread] [jobflow]: Validating input file: modules/jobflow/examples/4.9.1/install/test_agents1.yaml
[2024-10-02 18:31:15] [DEBUG] [1191430] [MainThread] [jobflow]: Loading schema file: /home/fcaffieri/repos/wazuh-qa/.venv/lib/python3.10/site-packages/jobflow/schemas/schema_v1.json
[2024-10-02 18:31:15] [DEBUG] [1191430] [MainThread] [jobflow]: Loading yaml file: modules/jobflow/examples/4.9.1/install/test_agents1.yaml
[2024-10-02 18:31:15] [DEBUG] [1191430] [MainThread] [jobflow]: Loading workflow file: modules/jobflow/examples/4.9.1/install/test_agents1.yaml
[2024-10-02 18:31:15] [DEBUG] [1191430] [MainThread] [jobflow]: Process workflow.
Error executing workflow: Duplicated task names: allocate-agent-linux-ubuntu-24.04-amd64
$ 

Expected result

It is expected to instantiate the 3 VMs

Attachments

NA

  • Build link: NA

  • Build parameters: python3 -m jobflow modules/jobflow/examples/4.9.1/install/test_agents1.yaml --log-level DEBUG --threads 4

  • Artifacts: .yaml

  • Logs: .txt, .log or .zip

@rauldpm
Copy link
Member

rauldpm commented Oct 3, 2024

Please open an issue to the @wazuh/devel-devops team to allow the Allocator to deploy multiple instances of the same system and version

Block this issue by that issue (third party + note)

@fcaffieri
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants