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

Run feature tests in dynamic Jenkins workers #611

Conversation

Sunnatillo
Copy link
Member

This PR makes feature tests run directly in dynamic workers instead of using worker as a jumphost

@metal3-io-bot metal3-io-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Dec 21, 2023
@Sunnatillo Sunnatillo force-pushed the move-feature-tests-to-dynamic-workers/sunnat branch from 1c47dae to 0f47108 Compare December 21, 2023 20:26
@Sunnatillo Sunnatillo force-pushed the move-feature-tests-to-dynamic-workers/sunnat branch from 0f47108 to 0eb3077 Compare December 30, 2023 22:15
@Sunnatillo
Copy link
Member Author

/test-ubuntu-e2e-feature-main

@Sunnatillo Sunnatillo force-pushed the move-feature-tests-to-dynamic-workers/sunnat branch from 0eb3077 to fb4da27 Compare December 30, 2023 22:52
@Sunnatillo
Copy link
Member Author

/test-ubuntu-e2e-feature-main

@Sunnatillo
Copy link
Member Author

/test-centos-e2e-feature-main

@Sunnatillo
Copy link
Member Author

/test-centos-e2e-feature-main
/test-centos-e2e-feature-release-1-5

@Sunnatillo
Copy link
Member Author

/test-centos-e2e-feature-main

@Sunnatillo
Copy link
Member Author

/test-ubuntu-e2e-feature-release-1-3

@Sunnatillo
Copy link
Member Author

/test-ubuntu-e2e-feature-release-1-5

1 similar comment
@Sunnatillo
Copy link
Member Author

/test-ubuntu-e2e-feature-release-1-5

@Sunnatillo
Copy link
Member Author

/test-centos-e2e-feature-release-1-5

@Sunnatillo Sunnatillo changed the title WIP: Move running feature tests to dynamic Jenkins workers Move running feature tests to dynamic Jenkins workers Jan 2, 2024
@metal3-io-bot metal3-io-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 2, 2024
@Sunnatillo
Copy link
Member Author

/test-ubuntu-integration-main
/test-centos-e2e-feature-release-1-5

@Sunnatillo
Copy link
Member Author

/test-ubuntu-e2e-feature-release-1-5

@Sunnatillo Sunnatillo changed the title Move running feature tests to dynamic Jenkins workers Run feature tests in dynamic Jenkins workers Jan 2, 2024
@Sunnatillo Sunnatillo force-pushed the move-feature-tests-to-dynamic-workers/sunnat branch from fb4da27 to 6bc6412 Compare January 2, 2024 21:08
@Sunnatillo
Copy link
Member Author

/test-centos-e2e-feature-main
/test-ubuntu-e2e-feature-main

2 similar comments
@Sunnatillo
Copy link
Member Author

/test-centos-e2e-feature-main
/test-ubuntu-e2e-feature-main

@Sunnatillo
Copy link
Member Author

/test-centos-e2e-feature-main
/test-ubuntu-e2e-feature-main

@Rozzii
Copy link
Member

Rozzii commented Jan 5, 2024

/test-ubuntu-integration-main

fi

# Fetch k8s logs form target cluster
target_config=$(sudo find /tmp/ -type f -name "kubeconfig*")
Copy link
Member

Choose a reason for hiding this comment

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

Is this file cleaned up between runs? Otherwise we could end up with multiple kubeconfigs!

Copy link
Member Author

Choose a reason for hiding this comment

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

We are using dynamic vm only for one test, then it is deleted.

Copy link
Member

Choose a reason for hiding this comment

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

Ok good!

# Fetch k8s logs form target cluster
target_config=$(sudo find /tmp/ -type f -name "kubeconfig*")
if [[ -n "${target_config}" ]]; then
#fetch target cluster k8s logs
Copy link
Member

Choose a reason for hiding this comment

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

nit

Suggested change
#fetch target cluster k8s logs
# fetch target cluster k8s logs

Copy link
Member

@lentzi90 lentzi90 left a comment

Choose a reason for hiding this comment

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

/approve

@metal3-io-bot metal3-io-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 8, 2024
Copy link
Member

@tuminoid tuminoid left a comment

Choose a reason for hiding this comment

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

Small things to fix and some nits.

fi
cd ../

if [[ ( "${REPO_NAME}" == "metal3-dev-env") ||
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if [[ ( "${REPO_NAME}" == "metal3-dev-env") ||
if [[ "${REPO_NAME}" == "metal3-dev-env" ]] || [[ "${REPO_NAME}" == "cluster-api-provider-metal3") ]]; then

One condition per [[ .. ]] and no parethesis please.

fetch_k8s_logs "management_cluster" "/home/metal3ci/.kube/config"

# Fetch Ironic containers logs before pivoting to the target cluster, if they exist
if [ -d /tmp/"${CONTAINER_RUNTIME}" ] && [ "$(ls /tmp/"${CONTAINER_RUNTIME}"/)" ]; then
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if [ -d /tmp/"${CONTAINER_RUNTIME}" ] && [ "$(ls /tmp/"${CONTAINER_RUNTIME}"/)" ]; then
if [[ -d /tmp/"${CONTAINER_RUNTIME}" ]] && [[ -n "$(ls /tmp/"${CONTAINER_RUNTIME}"/)" ]]; then

Not exactly sure what the latter condition is expected to do, but assuming you're trying to check if its empty?

mkdir -p "${LOGS_DIR}/e2e_artifacts"
# only if we triggered the e2e from the capm3 repo it will be cloned under tested_repo
# else it is under metal3
if [[ -d "/home/metal3ci/tested_repo/_artifacts" ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

Quite a bit of repetition for the home dir / tested_repo dir, could we use ${HOME} or other variable to avoid repetition?

mkdir -p "${LOGS_DIR}/${dir_name}"
for NAMESPACE in ${NAMESPACES}; do
mkdir -p "${LOGS_DIR}/${dir_name}/${NAMESPACE}"
PODS="$(kubectl --kubeconfig="${kconfig}" get pods -n "${NAMESPACE}" -o jsonpath='{.items[*].metadata.name}' 2> /dev/null)"
Copy link
Member

Choose a reason for hiding this comment

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

Same here, a lot of kubectl --kubeconfig="${kconfig}" repetition. Maybe put that in a var to make this more readable?

jenkins/scripts/dynamic_worker_workflow/run_clean.sh Outdated Show resolved Hide resolved
Copy link
Member

@Rozzii Rozzii left a comment

Choose a reason for hiding this comment

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

/hold
Hold until the nits are fixed.

@metal3-io-bot metal3-io-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 8, 2024
@Sunnatillo Sunnatillo force-pushed the move-feature-tests-to-dynamic-workers/sunnat branch 2 times, most recently from cb3d5df to 501ccc9 Compare January 9, 2024 08:25
@Sunnatillo
Copy link
Member Author

@tuminoid @Rozzii I have addressed most of the comments. Regarding implementing a function and other improvements, we need to open new PR and fix them here and in other integration tests(static worker workflow) as well.

WDYT?

@Sunnatillo
Copy link
Member Author

/test-centos-e2e-feature-main
/test-ubuntu-e2e-feature-main

Copy link
Member

@tuminoid tuminoid left a comment

Choose a reason for hiding this comment

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

/lgtm

I'm cool with this. Please follow up with the clean up, so we keep it maintainable.

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 9, 2024
@Sunnatillo
Copy link
Member Author

/test-centos-e2e-feature-main
/test-ubuntu-e2e-feature-main

@Sunnatillo
Copy link
Member Author

/test-ubuntu-integration-main

@tuminoid
Copy link
Member

/unhold
Nits are fixed. @Rozzii please change your review to approving.

@metal3-io-bot metal3-io-bot added needs-rebase Indicates that a PR cannot be merged because it has merge conflicts with HEAD. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Jan 10, 2024
This PR makes feature tests run directly in dynamic workers instead
of using worker as a jumphost

Signed-off-by: Sunnatillo <[email protected]>
@Sunnatillo Sunnatillo force-pushed the move-feature-tests-to-dynamic-workers/sunnat branch from 501ccc9 to c20ac15 Compare January 10, 2024 11:18
@metal3-io-bot metal3-io-bot removed lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates that a PR cannot be merged because it has merge conflicts with HEAD. labels Jan 10, 2024
@Sunnatillo
Copy link
Member Author

/test-centos-e2e-feature-main
/test-ubuntu-e2e-feature-main
/test-ubuntu-integration-main

Copy link
Member

@tuminoid tuminoid left a comment

Choose a reason for hiding this comment

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

/lgtm

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 10, 2024
@Sunnatillo
Copy link
Member Author

/test-ubuntu-e2e-feature-main
/test-ubuntu-e2e-feature-release-1-5

@Sunnatillo
Copy link
Member Author

/test-ubuntu-e2e-feature-main

2 similar comments
@Sunnatillo
Copy link
Member Author

/test-ubuntu-e2e-feature-main

@lentzi90
Copy link
Member

/test-ubuntu-e2e-feature-main

@Rozzii Rozzii self-requested a review January 11, 2024 06:47
@metal3-io-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lentzi90, Rozzii

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@metal3-io-bot metal3-io-bot merged commit babfbfb into metal3-io:main Jan 11, 2024
8 checks passed
@Sunnatillo Sunnatillo deleted the move-feature-tests-to-dynamic-workers/sunnat branch January 11, 2024 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants