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

Some improvement and fixes #12

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

axeltorchy
Copy link

This pull request is made of 4 commits, each addressing a specific additional feature or bug fix.

1. Added possibility to skip tasks that require privilege escalation (become) [8c322e1]
We might want to run the Ansible playbook without executing any of the tasks that require privilege escalation. For example, if we don't need to deploy any component and only want to push the new tests pipeline into the scheduler and TestAPI.

This change adds a new boolean variable become_tasks which defaults to true. It is used as a condition for all tasks that required privilege escalation. For tasks where privilege escalation depended on a condition (e.g. become: "{{ ansible_connection is defined }}"), the skipping condition in when includes the "or" and negation of this condition so that the task is not skipped when privilege escalation was not needed. In that example, the condition will be become_tasks or ansible_connection is not defined.

2. Added possibility to change Jenkins agent's name (w/o K8s) [d81816f]
This is necessary if we want to use the Ansible role to deploy multiple Jenkins agents on the same machine. It was not possible because the container name was hardcoded and always the same: "jenkins-agent".
A new variable is added: jenkins_agent_auto_container_name, which defaults to jenkins-agent. It is used in the "Starting Jenkins agent" task, when kubernetes_deploy is false.

3. Added disjoint URLs for TestAPI deploy and test execution vars [641edf3]
The same variable testapi_url was used in two different contexts:

  • when registering the pod/project/testcases in TestAPI (job deployment phase)
  • by the test container following test execution to push test results to TestAPI (passed as environment variables)

A new variable is added: testapi_deploy_url, whch defaults to the value of testapi_url.

It is now possible to use a different endpoint for these two actions, which is useful because if the runner is not located on the machine where the playbook is executed then it may not be able to reach TestAPI via the same URL.

4. Fixed wrong TestAPI pod name registration [90283c0]
There was a discrepancy between the pod name registration and the pod_name used by the container when trying to push results to TestAPI (see https://github.com/opnfv/functest-xtesting/blob/861f79d46397d8bbc5b55b95bc4ca2ac0fb1f247/xtesting/core/testcase.py#L222)

The registration tasks used the value of the project variable from the Ansible playbook, whereas the test container used the NODE_NAME environment variable (defined in run.yaml.j2, either equal to the slave name or to node_name if use_slave is false).

The change proposes to register the pods based on the values of the slave variables in the Docker tags if defined (or node_name if not defined). It adds a loop in the task and makes it possible to register multiple pods.

@collivier collivier force-pushed the master branch 9 times, most recently from 57c6020 to 36be5a4 Compare January 18, 2023 12:59
@collivier collivier force-pushed the master branch 6 times, most recently from f14385a to 89d9cf0 Compare February 2, 2023 11:41
@collivier collivier force-pushed the master branch 11 times, most recently from efd6b5f to abb042b Compare February 9, 2023 16:29
@collivier collivier force-pushed the master branch 2 times, most recently from 4143be6 to b2d7540 Compare February 11, 2023 15:11
@axeltorchy
Copy link
Author

Hello @collivier, have you had the chance to consider the proposed changes? What is your opinion about them?

@collivier collivier force-pushed the master branch 2 times, most recently from 8318ca0 to 18dad06 Compare June 2, 2023 09:50
@collivier collivier force-pushed the master branch 11 times, most recently from 3c39260 to 95535a2 Compare July 3, 2023 17:07
@collivier collivier force-pushed the master branch 3 times, most recently from 9bdf09a to 1e7c33f Compare July 4, 2023 12:58
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.

1 participant