This document serves as an in-depth guide for understanding the CI/CD workflow associated with the cilium/cilium project. Currently, the CI/CD infrastructure leverages GitHub Actions (GHA) for managing continuous integration and continuous deployment tasks.

Overview of CI/CD in cilium/cilium

The CI infrastructure in cilium/cilium includes:

  • Smoke Tests: Quickly assess basic functionality for PRs.
  • Platform Tests: Test more extensive functionality, usually initiated by organization members.

Step-by-Step Guide to the CI/CD Workflow

Step 1: Code Contribution

Developers start by making changes to the codebase. Once changes are made, the developer should commit these changes and push them to a Git branch. A typical commit command could look like this:

$ git commit -sam "Your commit message here"

Step 2: Create a Pull Request (PR)

Based on the branch created, contributors should initiate a pull request (PR) in the cilium/cilium GitHub repository. It’s essential to ensure the PR is correctly targeting the intended base branch, typically main.

Step 3: GitHub Actions Trigger

When a PR is created or updated, the GitHub Actions workflows are automatically triggered. This will initiate the following actions:

  • Smoke Tests: These tests run automatically to verify that the fundamental aspects of the code are working as intended.
  • Platform Tests: These tests, which require additional confirmation from organization members, may also need to be triggered manually.

For initiating the required CI jobs, specific trigger phrases can be used depending on the target branch of the PR:

  • For the main branch, use:

    /test
    
  • For v1.15, use:

    /test-backport-1.15
    

Step 4: Test Outcomes

After running the tests, outcomes will be accessible in the PR interface on GitHub. If smoke tests fail, developers can inspect the logs to debug and rectify issues. Successful tests will result in a green checkmark, indicating that the PR is ready to be merged.

Step 5: Image Building and Updating

If the changes pertain to building images (such as runtime or builder), follow these commands for updating:

  1. Update Runtime Image

    make -C images update-runtime-image
    
  2. Update Builder Image

    make -C images update-builder-image
    
  3. Commit Changes Related to Images

    Use the following commands to commit updated images:

    $ git commit -sam "images: update cilium-{runtime,builder}" --amend
    

Step 6: CI Results Verification

Once the changes related to the images have been committed, ensure to run the full CI tests again. Confirm that all tests pass before proceeding to merge the PR.

Step 7: Merge the PR

If all checks are clear, the final step is to merge the PR into the main codebase. This act integrates all the proposed modifications with the primary source code of cilium/cilium.

Additional Best Practices

  • Make sure to keep the changes minimally scoped to avoid complex reviews.
  • Regularly update images as part of routine work to ensure software dependencies are up-to-date.
  • For more specific updates tied to image dependency changes, follow the guidelines outlined in the project documentation.

Conclusion

The CI/CD workflow for the cilium/cilium project provides a structured approach to managing contributions and ensuring code quality. By following the outlined steps, contributions can be seamlessly integrated into the project, ensuring that every commit and PR maintains high standards of quality and functionality.

This guide was generated using the foundational knowledge sourced from the cilium/cilium project documentation.