Commit Graph

103 Commits

Author SHA1 Message Date
Vedant Shrotria 5049a2ecdf
Update release.yml 2025-06-03 18:02:05 +05:30
Vedant Shrotria b8555fccfc
Update release.yml 2025-06-03 17:48:00 +05:30
Vedant Shrotria cdbcbfcdc3
Merge pull request #198 from SkySingh04/refactor_to_3.0
Refactor CI-Lib Implementation to Support Litmus 3.0
2025-06-03 14:07:39 +05:30
Sky Singh aebe03508b
chore(golangci): Add initial configuration file for GolangCI-Lint
- Introduced a new `.golangci.yml` file to configure GolangCI-Lint for the project.
- Set the version to 2 and disabled test file analysis to streamline linting processes.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-06-03 10:12:28 +05:30
Sky Singh a7fd941815
chore(dependencies): Upgrade Ginkgo to v2 and update indirect dependencies
- Updated Ginkgo from v1.16.5 to v2.19.0 for improved features and compatibility.
- Added new indirect dependencies including `github.com/go-logr/logr`, `github.com/go-task/slim-sprig/v3`, and `github.com/google/pprof`.
- Ensured consistency in dependency management within go.mod and go.sum files.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-06-03 10:05:06 +05:30
Sky Singh e9aa601056
chore(workflow): Add dependency download step in CI workflow
- Introduced a step to download and verify Go module dependencies in the CI workflow, ensuring all required packages are available for the build process.
- This enhancement improves the reliability of the build environment by ensuring dependencies are properly managed.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-06-03 09:59:55 +05:30
Sky Singh c289bb18fa
refactor(logging): Improve log formatting and error handling
- Updated log formatting in the Kubectl function for better readability.
- Replaced deprecated string replacement method with `strings.ReplaceAll` in EditFile and EditKeyValue functions for improved performance.
- Enhanced error handling by wrapping deferred close calls in anonymous functions to ensure proper error logging in DownloadFile, createInfrastructureViaRegisterInfra, applyInfrastructureManifest, and checkInfrastructureStatusViaGraphQL functions.
- Simplified condition check in PodStatusCheck for better clarity.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-06-03 09:58:13 +05:30
Sky Singh 6d3bdbde9d
chore(go.mod): Update sigs.k8s.io/yaml dependency to indirect
- Removed direct requirement for sigs.k8s.io/yaml v1.4.0 and added it as an indirect dependency to streamline module management.
- This change helps maintain cleaner dependency tracking in the go.mod file.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-06-03 09:44:31 +05:30
Sky Singh 5d1912ba35
chore(workflow): Upgrade Go version in CI workflows
- Updated the Go version from 1.14 to 1.24 in the build, push, and release workflows to ensure compatibility with the latest features and improvements.
- This change enhances the development environment and aligns with current best practices.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-06-03 09:44:02 +05:30
Sky Singh a4e22b27b6
chore(workflow): Modify release workflow trigger and clean up experiment test code
- Changed the release workflow trigger from `create` to `push` for tags matching the pattern `v*`, ensuring proper versioning during releases.
- Removed unused code and debug log functions from the container-kill experiment test file to enhance clarity and maintainability.
- Updated default application namespace and label in the experiment configuration for better alignment with standard practices.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 23:38:17 +05:30
Sky Singh f5406b0be1
chore(tests): Standardize comments and formatting in experiment test files
- Added spaces after comment slashes for better readability in various experiment test files, including container-kill, disk-fill, node-cpu-hog, and others.
- Ensured consistent formatting across all test files to enhance code clarity and maintainability.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 23:30:09 +05:30
Sky Singh fc7b0b96ce
chore(workflow): Update Litmus credentials for local testing and modify probe name
- Replaced GitHub secrets for `LITMUS_ENDPOINT`, `LITMUS_USERNAME`, `LITMUS_PASSWORD`, and `LITMUS_PROJECT_ID` with hardcoded values to facilitate local development and testing.
- Updated the `LITMUS_PROBE_NAME` from "ci-http-probe-78-container-kill" to "ci-http-probe-container-kill" for consistency in chaos experiment configurations.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 23:19:10 +05:30
Sky Singh 5211760d35
chore(workflow): Update Litmus probe name for chaos experiments
- Changed the `LITMUS_PROBE_NAME` from "ci-http-probe-88-container-kill" to "ci-http-probe-78-container-kill" in the GitHub Actions workflow to maintain alignment with the updated naming convention.
- This update ensures consistency in probe identification for chaos experiments.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 23:10:48 +05:30
Sky Singh 98f949ac97
chore(workflow): Enhance container configuration for chaos experiments
- Added configuration for `configMaps`, `secrets`, and `hostFileVolumes` to the workflow, allowing for better management of resources during chaos experiments.
- Updated `securityContext` to enable privileged access and additional capabilities, enhancing the flexibility and control over the execution environment.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 23:03:06 +05:30
Sky Singh 3636a92265
chore(workflow): Update Litmus probe name for chaos experiments
- Changed the `LITMUS_PROBE_NAME` from "ci-http-probe-99-container-kill" to "ci-http-probe-88-container-kill" in the GitHub Actions workflow to align with the new naming convention.
- This update ensures consistency in probe identification for chaos experiments.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 22:53:14 +05:30
Sky Singh 60a325e80d
chore(workflow): Secure Litmus credentials and update probe name in GitHub Actions
- Replaced hardcoded values for `LITMUS_ENDPOINT`, `LITMUS_USERNAME`, `LITMUS_PASSWORD`, and `LITMUS_PROJECT_ID` with GitHub secrets to enhance security.
- Updated the `LITMUS_PROBE_NAME` from "ci-http-probe-9-container-kill" to "ci-http-probe-99-container-kill" for consistency in chaos experiment configurations.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 22:47:58 +05:30
Sky Singh 7c068e00f9
chore(workflow): Update Litmus probe name for chaos experiments
- Changed the `LITMUS_PROBE_NAME` from "ci-http-probe-container-kill" to "ci-http-probe-9-container-kill" in the GitHub Actions workflow to align with the new naming convention.
- This update ensures consistency in probe identification for chaos experiments.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 22:32:34 +05:30
Sky Singh 04ae1618c8
chore(workflow): Update Litmus credentials and probe name for local testing
- Replaced GitHub secrets for `LITMUS_ENDPOINT`, `LITMUS_USERNAME`, `LITMUS_PASSWORD`, and `LITMUS_PROJECT_ID` with hardcoded values to facilitate local development and testing.
- Updated the `LITMUS_PROBE_NAME` from "ci-http-probe-99-container-kill" to "ci-http-probe-container-kill" for consistency in chaos experiment configurations.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 21:33:26 +05:30
Sky Singh 2670394247
chore(workflow): Update Litmus probe name for chaos experiments
- Changed the `LITMUS_PROBE_NAME` variable from "ci-http-probe-container-kill" to "ci-http-probe-99-container-kill" in the GitHub Actions workflow to reflect the new naming convention.
- This update ensures consistency in probe identification for chaos experiments.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 21:23:52 +05:30
Sky Singh beac7fda8c
chore(workflow): Secure Litmus credentials in GitHub Actions workflow
- Replaced hardcoded values for `LITMUS_ENDPOINT`, `LITMUS_USERNAME`, `LITMUS_PASSWORD`, and `LITMUS_PROJECT_ID` with GitHub secrets to enhance security and protect sensitive information.
- This change improves the security posture of the workflow by ensuring that sensitive credentials are not exposed in the codebase.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 21:20:41 +05:30
Sky Singh e8d5ebef99
chore(workflow): Add container runtime configuration for chaos experiments
- Introduced new environment variables `SOCKET_PATH` and `CONTAINER_RUNTIME` in the GitHub Actions workflow to support containerd as the runtime for chaos experiments.
- Updated the `GetDefaultExperimentConfig` function to retrieve these values from the environment, ensuring flexibility in configuration.
- Adjusted experiment manifests to utilize the new variables for socket path and container runtime, enhancing the adaptability of chaos experiments.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 21:12:18 +05:30
Sky Singh ded229682c
chore(workflow): Change INFRA_SCOPE from namespace to cluster in GitHub Actions workflow
- Updated the `INFRA_SCOPE` environment variable from "namespace" to "cluster" across multiple jobs to reflect the new infrastructure configuration for chaos experiments.
- This change ensures that the chaos experiments are executed at the cluster level, enhancing the scope of testing.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 20:57:59 +05:30
Sky Singh a5b70e4931
chore(workflow): Update Litmus configuration for local testing in GitHub Actions workflow
- Replaced GitHub secrets with hardcoded values for `LITMUS_ENDPOINT`, `LITMUS_USERNAME`, `LITMUS_PASSWORD`, and `LITMUS_PROJECT_ID` across multiple jobs to facilitate local development and testing.
- Adjusted `LITMUS_PROBE_NAME` variables to remove version suffixes for clarity and consistency in chaos experiment configurations.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 20:43:06 +05:30
Sky Singh cb06f092f0
chore(workflow): Update Litmus probe names to version 4 in GitHub Actions workflow
- Renamed multiple `LITMUS_PROBE_NAME` variables from "ci-http-probe-3" to "ci-http-probe-4" across various jobs to reflect the new versioning scheme.
- This change ensures unique identification of probes and maintains consistency in chaos experiment configurations.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 20:31:08 +05:30
Sky Singh cd7dbe9dae
chore(workflow): Remove uninstall step for Litmus in chaos experiment jobs
- Eliminated the redundant uninstall step for Litmus across various chaos experiment jobs in the GitHub Actions workflow to streamline the process.
- This change enhances the efficiency of the workflow by reducing unnecessary commands during execution.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 20:25:42 +05:30
Sky Singh 821be89c77
chore(workflow): Update Litmus probe names to version 3 in GitHub Actions workflow
- Renamed multiple `LITMUS_PROBE_NAME` variables from "ci-http-probe-2" to "ci-http-probe-3" across various jobs to reflect the new versioning scheme.
- This change ensures unique identification of probes and maintains consistency in chaos experiment configurations.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 20:15:43 +05:30
Sky Singh 9496e6be7b
chore(workflow): Add APP_LABEL environment variable for chaos experiments
- Introduced new `APP_LABEL` environment variable in the GitHub Actions workflow for various chaos experiments to enhance identification and management.
- Updated the `GetDefaultExperimentConfig` function to retrieve `APP_LABEL` from environment variables, ensuring flexibility and consistency across deployments.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 20:14:45 +05:30
Sky Singh 05ffa3ab0c
chore(workflow): Clean up environment variable definitions in GitHub Actions workflow
- Removed an incomplete line for `APP_LABEL` in the workflow configuration.
- Ensured proper formatting and consistency in the environment variable definitions for the Litmus deployment.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 20:03:17 +05:30
Sky Singh ea61f9ff82
chore(workflow): Update Litmus probe names in GitHub Actions workflow
- Renamed multiple `LITMUS_PROBE_NAME` variables to include a version suffix "2" for consistency across chaos experiment jobs.
- This change ensures unique identification of probes and aligns with recent updates in the deployment configurations.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 20:02:41 +05:30
Sky Singh 8ee59ce527
chore(workflow): Update Litmus deployment configurations in GitHub Actions workflow
- Changed the application namespace to "litmus" for all jobs to ensure consistency.
- Updated deployment names and service configurations for chaos experiments to ensure uniqueness, including modifications to probe names and URLs.
- Enhanced the deployment process by downloading and modifying the nginx deployment YAML for each chaos experiment, ensuring proper application to the litmus namespace.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 19:48:01 +05:30
Sky Singh 77a23756c0
chore(workflow): Update Litmus configuration and deployment in GitHub Actions workflow
- Replaced hardcoded Litmus configuration values with GitHub secrets for enhanced security across multiple jobs.
- Updated the application namespace to "litmus" and modified deployment names and service configurations for chaos experiments to ensure uniqueness.
- Adjusted probe names and URLs to reflect the new deployment configurations for improved clarity and maintainability.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 19:32:05 +05:30
Sky Singh 512278e0af
chore(workflow): Update Litmus configuration in GitHub Actions workflow
- Replaced GitHub secrets with hardcoded values for Litmus configuration across multiple jobs in the workflow, setting `LITMUS_ENDPOINT`, `LITMUS_USERNAME`, `LITMUS_PASSWORD`, and `LITMUS_PROJECT_ID` to specific local values for testing purposes.
- This change is intended for local development and testing scenarios.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 19:17:45 +05:30
Sky Singh 36748e3ae0
chore(workflow): Update Litmus probe name in GitHub Actions workflow
- Changed the environment variable `LITMUS_PROBE_NAME` from "ci-http-probe" to "ci-http-probe-2" across multiple jobs in the workflow to ensure consistency in probe naming.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 19:08:09 +05:30
Sky Singh de6131aa98
feat(workflow): Update default AppNamespace and use secrets for Litmus configuration
- Changed the default AppNamespace from "litmus" to "default" in the experiment configuration for consistency.
- Replaced hardcoded Litmus configuration values with GitHub secrets across multiple jobs in the workflow to enhance security and maintainability.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 18:53:55 +05:30
Sky Singh 0bf11ab07c
feat(workflow): Update GitHub Actions to use secrets for Litmus configuration and switch to KinD cluster setup
- Replaced hardcoded Litmus configuration values with GitHub secrets for enhanced security.
- Updated the workflow to install and configure a KinD cluster instead of Minikube for running end-to-end tests, improving compatibility and performance.
- Removed Minikube installation steps and streamlined the cluster setup process.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 18:35:11 +05:30
Sky Singh 45323e3bff
feat(workflow): Replace KinD cluster setup with Minikube for end-to-end tests
- Updated the GitHub Actions workflow to install and configure a Minikube cluster instead of a KinD cluster for running end-to-end tests.
- Added steps to download and install Minikube, and configured it to start with specified resources for improved testing performance.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 18:13:28 +05:30
Sky Singh a98c455e4a
fix(tests): Refactor log retrieval in container-kill experiment for improved error handling
- Moved the `getSubscriberPodLogs` function call to ensure logs are retrieved consistently during polling for experiment run status and when the experiment is stuck in the queued state.
- This change enhances the visibility of logs during error scenarios, aiding in debugging efforts.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 15:49:19 +05:30
Sky Singh 626d066593
refactor(workflow): Update namespace and app label in experiment configuration
- Changed the default AppNamespace and experiment manifest namespace from "litmus-2" to "litmus" for consistency across configurations.
- This update ensures that the experiment configurations align with the current namespace structure, improving clarity and maintainability.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 15:26:49 +05:30
Sky Singh 3fa52b404b
fix(tests): Add log retrieval in container-kill experiment for error handling
- Integrated the `getSubscriberPodLogs` function to fetch and log subscriber pod logs when an error occurs while fetching the experiment run status.
- This enhancement improves error visibility and aids in debugging during the container-kill experiment.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 15:18:54 +05:30
Sky Singh b94bfc4dcd
feat(tests): Add helper function for enhanced debugging in container-kill experiment
- Introduced a new helper function `getSubscriberPodLogs` to retrieve and log the status of various components in the Litmus namespace, including subscriber pod logs, workflow controller logs, chaos operator logs, and the status of pods and workflows.
- Improved debugging capabilities by providing detailed logs for better visibility during the container-kill experiment.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 15:12:44 +05:30
Sky Singh fd9b53ca2b
feat(tests): Enhance logging and retry mechanism in container-kill experiment tests
- Improved logging for experiment creation and polling for experiment runs, providing detailed information about the experiment ID, infrastructure ID, and project ID.
- Increased the maximum number of polling retries from 10 to 20 and adjusted the polling interval from 3 seconds to 5 seconds for better reliability.
- Added detailed logging of experiment run attempts, including specific run details for improved debugging and visibility.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 14:05:08 +05:30
Sky Singh 377ba52af8
feat(workflow): Update Litmus probe configuration and experiment names in GitHub Actions
- Added the environment variable `LITMUS_USE_EXISTING_PROBE` set to "false" across multiple jobs to ensure a fresh probe is created for chaos experiments.
- Renamed the experiment steps from "pod-network-corruption" to "pod-network-latency" and "pod-network-loss" to better reflect their functionality.
- Enhanced clarity and consistency in the workflow for improved chaos experiment execution.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 13:49:45 +05:30
Sky Singh 3a0a40cedc
feat(infrastructure): Integrate HTTP probe configuration for chaos experiments
- Added new environment variables for HTTP probe configuration in the GitHub Actions workflow, enhancing the monitoring capabilities during chaos experiments.
- Implemented a service exposure for the NGINX deployment to facilitate probe connectivity, ensuring that the HTTP probe can effectively monitor the service.
- Updated the `ExperimentDetails` struct to store the manifest returned by the `registerInfra` mutation, improving infrastructure management during activation.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 13:37:19 +05:30
Sky Singh 95600b03ca
feat(infrastructure): Enhance infrastructure activation process with namespace and CRD management
- Added functions to ensure the existence of the specified namespace and to apply Litmus CRDs as part of the infrastructure activation process.
- Updated the `ActivateInfrastructure` function to include steps for namespace verification and CRD application before retrieving and applying the infrastructure manifest.
- Improved logging for each step to provide better visibility during the activation process.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 13:05:20 +05:30
Sky Singh 3b910b9d33
feat(infrastructure): Implement GraphQL fallback for infrastructure manifest retrieval
- Updated the `getInfrastructureManifestViaGraphQL` function to first attempt fetching the infrastructure manifest using the `getInfraManifest` query.
- Added a new helper function `getExistingInfrastructureManifest` to handle the GraphQL query and response parsing.
- Implemented comprehensive logging for both successful and failed attempts to retrieve the manifest.
- Enhanced the `applyInfrastructureManifest` function to check and replace incorrect infrastructure IDs in the manifest content.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 13:00:56 +05:30
Sky Singh 2cd81e89b9
feat(infrastructure): Enhance infrastructure status check with GraphQL support
- Replaced the SDK method for checking infrastructure status with a direct GraphQL query to improve reliability.
- Implemented a new function `checkInfrastructureStatusViaGraphQL` to handle GraphQL requests and responses.
- Added comprehensive logging for both GraphQL and SDK methods, including error handling and fallback mechanisms.
- Improved the overall robustness of the infrastructure status verification process during activation.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 12:41:58 +05:30
Sky Singh d53fe2a78c
feat(infrastructure): Implement infrastructure status check during activation
- Added a new function `checkInfrastructureStatus` to verify the active status of infrastructure using the SDK.
- Updated the `waitForInfrastructureActivation` function to utilize the new status check, providing informative logs for both active and inactive states.
- Enhanced error handling for infrastructure status retrieval, improving robustness during activation processes.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 12:11:06 +05:30
Sky Singh 7b73ae2482
feat(infrastructure): Add infrastructure activation feature
- Introduced new environment variables `ACTIVATE_INFRA` and `INFRA_ACTIVATION_TIMEOUT` to control infrastructure activation during chaos experiments.
- Updated the `SetupInfrastructure` function to include infrastructure activation by deploying manifests.
- Implemented the `ActivateInfrastructure` function to handle the activation process, including manifest retrieval and application.
- Enhanced `ExperimentDetails` struct to accommodate new fields for activation control.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 11:58:57 +05:30
Sky Singh 9bf696fec7
chore(workflow): Enhance GitHub Actions for Litmus Chaos experiments
- Updated environment variables for multiple jobs to enable installation and configuration of Litmus ChaosCenter.
- Added steps to install Litmus ChaosCenter locally, including Helm repository setup, namespace creation, and service configuration.
- Implemented port forwarding for local access to ChaosCenter, ensuring readiness checks for frontend and backend services.
- Streamlined chaos experiment deployment processes across various infrastructure setups.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 11:16:16 +05:30
Sky Singh a15dc58c51
chore(workflow): Update environment variables for chaos experiments
- Added environment variables INSTALL_CHAOS_CENTER, CONNECT_INFRA, and INSTALL_INFRA with default values set to "false" across multiple jobs in the GitHub Actions workflow.
- Removed the installation step for Litmus in each job to streamline the workflow process.

Signed-off-by: Sky Singh <akashsingh2210670@gmail.com>
2025-05-30 10:55:54 +05:30