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

Consolidate the ci/ and hack/ directories #10589

Merged
merged 12 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ runs:
CLUSTER_NODE_VERSION: ${{ matrix.kube-version.node }}
IMAGE_VARIANT: ${{ matrix.image-variant }}
CONFORMANCE: "true"
run: ./ci/kind/setup-kind.sh
run: ./hack/kind/setup-kind.sh
- name: Install kgateway via helm
shell: bash
run: |
Expand Down
11 changes: 0 additions & 11 deletions .github/actions/kubernetes-e2e-tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,9 @@ runs:
ISTIO_VERSION: ${{ inputs.istio-version }}
shell: bash
run: make go-test
- name: Summarize tests
# Print out a summary of ALL tests run under this action. In the future we can use this tool
# with the --json flag to export the results for centralized processing.
shell: bash
run: go run ./ci/github-actions/go-test-summary
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added some context in the git commit message -- from my perspective, I think we can remove this and re-introduce over time if there's some pain points that this type of approach solves.

- name: Archive bug report directory on failure
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: bug-report-${{ inputs.cluster-name }}-${{ inputs.matrix-label }}-attempt-${{ github.run_attempt }}
path: ./_test/bug_report/${{ inputs.cluster-name }}
- name: Archive test results
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this removed?

if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: go-test-summary-${{ inputs.cluster-name }}-${{ inputs.matrix-label }}-attempt-${{ github.run_attempt }}
path: ./_test/test_log/go-test-summary
24 changes: 0 additions & 24 deletions .github/actions/process-skip-directives/action.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/actions/regression-tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ runs:
CLUSTER_NAME: 'kind'
CLUSTER_NODE_VERSION: ${{ matrix.kube-version.node }}
IMAGE_VARIANT: ${{ matrix.image-variant }}
run: ./ci/kind/setup-kind.sh
run: ./hack/kind/setup-kind.sh
- name: Testing - kube e2e regression tests
env:
KUBE2E_TESTS: ${{ matrix.kube-e2e-test-type }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-kind-cluster/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ runs:
CLUSTER_NODE_VERSION: ${{ inputs.kind-node-version }}
ISTIO_VERSION: ${{ inputs.istio-version }}
CONFORMANCE_VERSION: ${{ inputs.kgateway-api-version }}
run: ./ci/kind/setup-kind.sh
run: ./hack/kind/setup-kind.sh
21 changes: 0 additions & 21 deletions .github/workflows/pr-kubernetes-tests.yaml_noop
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# name: Prepare Environment
# runs-on: ubuntu-22.04
# timeout-minutes: 5
# outputs:
# should-auto-succeed-kube-tests: ${{ steps.run-strategy.outputs.auto_succeed }}
# steps:
# - name: Cancel Previous Actions
# uses: styfle/[email protected]
Expand All @@ -25,17 +23,6 @@
# # We require gathering the branch and tag history since we rely on a `git diff`
# # which compares the state of two branches
# fetch-depth: 0
# - id: process-skip-directives
Copy link
Contributor

Choose a reason for hiding this comment

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

related to above comment - are we sure we want to remove this now?

Copy link
Member Author

Choose a reason for hiding this comment

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

My preference would be to remove it -- even if we adopt the current changelog process from the solo-io organization, I'd rather decouple release notes from controlling CI. Happy to do that in a follow-up if it's easiest.

# uses: ./.github/actions/process-skip-directives
# with:
# base-ref: ${{ github.base_ref }}
# - id: run-strategy
# name: Determine Test Run Strategy
# run: |
# skip_kube_tests=${{ steps.process-skip-directives.outputs.skip-kube-tests }}
# if [[ ! -z $skip_kube_tests && $skip_kube_tests = true ]] ; then
# echo "auto_succeed=true" >> $GITHUB_OUTPUT
# fi

# end_to_end_tests:
# name: End-to-End (${{ matrix.test.cluster-name }})
Expand Down Expand Up @@ -95,26 +82,19 @@
# version-files:
# - file: './.github/workflows/.env/pr-tests/versions.env'
# steps:
# - id: auto-succeed-tests
# if: needs.prepare_env.outputs.should-auto-succeed-kube-tests == 'true'
# run: |
# echo "Regression tests auto-succeeded"
# - uses: actions/checkout@v4
# - name: Prep Go Runner
# uses: ./.github/actions/prep-go-runner
# if: needs.prepare_env.outputs.should-auto-succeed-kube-tests != 'true'
# # The dotenv action is used to load key-value pairs from files.
# # In this case, the file is specified in the matrix and will contain the versions of the tools to use
# - name: Dotenv Action
# uses: falti/[email protected]
# if: needs.prepare_env.outputs.should-auto-succeed-kube-tests != 'true'
# id: dotenv
# with:
# path: ${{ matrix.version-files.file }}
# log-variables: true
# - id: setup-kind-cluster
# name: Setup KinD Cluster
# if: needs.prepare_env.outputs.should-auto-succeed-kube-tests != 'true'
# uses: ./.github/actions/setup-kind-cluster
# with:
# cluster-name: ${{ matrix.test.cluster-name }}
Expand All @@ -124,7 +104,6 @@
# helm-version: ${{ steps.dotenv.outputs.helm_version }}
# istio-version: ${{ steps.dotenv.outputs.istio_version }}
# - id: run-tests
# if: needs.prepare_env.outputs.should-auto-succeed-kube-tests != 'true'
# uses: ./.github/actions/kubernetes-e2e-tests
# with:
# cluster-name: ${{ matrix.test.cluster-name }}
Expand Down
23 changes: 0 additions & 23 deletions .github/workflows/regression-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ jobs:
name: Prepare Environment
runs-on: ubuntu-22.04
timeout-minutes: 5
outputs:
should-auto-succeed-regression-tests: ${{ steps.run-strategy.outputs.auto_succeed }}
steps:
- name: Cancel Previous Actions
uses: styfle/[email protected]
Expand All @@ -27,17 +25,6 @@ jobs:
# We require gathering the branch and tag history since we rely on a `git diff`
# which compares the state of two branches
fetch-depth: 0
- id: process-skip-directives
uses: ./.github/actions/process-skip-directives
with:
base-ref: ${{ github.base_ref }}
- id: run-strategy
name: Determine Test Run Strategy
run: |
skip_kube_tests=${{ steps.process-skip-directives.outputs.skip-kube-tests }}
if [[ ! -z $skip_kube_tests && $skip_kube_tests = true ]] ; then
echo "auto_succeed=true" >> $GITHUB_OUTPUT
fi

# regression_tests:
# name: k8s regression tests (${{matrix.kube-e2e-test-type}})
Expand All @@ -63,12 +50,7 @@ jobs:
# steps:
# - uses: actions/checkout@v4
# - id: run-tests
# if: needs.prepare_env.outputs.should-auto-succeed-regression-tests != 'true'
# uses: ./.github/actions/regression-tests
# - id: auto-succeed-tests
# if: needs.prepare_env.outputs.should-auto-succeed-regression-tests == 'true'
# run: |
# echo "Regression tests auto-succeeded"

kube_gateway_api_conformance_tests:
name: kubernetes gateway api conformance tests (${{matrix.image-variant}})
Expand All @@ -86,10 +68,5 @@ jobs:
- standard
steps:
- uses: actions/checkout@v4
- id: auto-succeed-tests
if: needs.prepare_env.outputs.should-auto-succeed-regression-tests == 'true'
run: |
echo "Kubernetes Gateway API conformance tests auto-succeeded"
- id: run-tests
if: needs.prepare_env.outputs.should-auto-succeed-regression-tests != 'true'
uses: ./.github/actions/kube-gateway-api-conformance-tests
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ jobs:
run: make mod-download

- name: Setup kind cluster
run: ./ci/kind/setup-kind.sh
run: ./hack/kind/setup-kind.sh
env:
VERSION: ${{ needs.setup.outputs.version }}
SKIP_DOCKER: "true"
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ jobs:
- name: Prep Go Runner
uses: ./.github/actions/prep-go-runner
- name: Generate Code
run: |
./ci/check-generated-code.sh
run: make verify

static-analysis:
name: Lint Checks
Expand Down
22 changes: 9 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ fmt-changed:

# must be a separate target so that make waits for it to complete before moving on
.PHONY: mod-download
mod-download: check-go-version
mod-download:
Copy link
Contributor

Choose a reason for hiding this comment

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

is check-go-version not useful anymore?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think it's strictly needed anymore with Go 1.21+ being out for a while.

go mod download all

.PHONY: check-format
Expand Down Expand Up @@ -280,6 +280,10 @@ clean-test-logs:
# Generated Code and Docs
#----------------------------------------------------------------------------------

.PHONY: verify
verify: generate-all ## Verify that generated code is up to date
git diff -U3 --exit-code

.PHONY: generate-all
generate-all: generated-code

Expand All @@ -293,7 +297,6 @@ generate-all-debug: generate-all

# Generates all required code, cleaning and formatting as well; this target is executed in CI
.PHONY: generated-code
generated-code: check-go-version
generated-code: go-generate-all getter-check mod-tidy
generated-code: update-licenses
# generated-code: generate-crd-reference-docs
Expand All @@ -317,11 +320,6 @@ getter-check:
mod-tidy:
go mod tidy

# Validates that local Go version matches go.mod
.PHONY: check-go-version
check-go-version:
./ci/check-go-version.sh

#----------------------------------------------------------------------------------
# Generate CRD Reference Documentation
#
Expand Down Expand Up @@ -503,21 +501,19 @@ docker-push-%:
docker push $(IMAGE_REGISTRY)/$*:$(VERSION)

.PHONY: docker-standard
docker-standard: check-go-version ## Build docker images (standard only)
docker-standard: kgateway-docker
docker-standard: kgateway-docker ## Build docker images (standard only)
docker-standard: envoy-wrapper-docker
docker-standard: sds-docker

.PHONY: docker-distroless
docker-distroless: check-go-version ## Build docker images (distroless only)
docker-distroless: kgateway-distroless-docker
docker-distroless: kgateway-distroless-docker ## Build docker images (distroless only)
docker-distroless: envoy-wrapper-distroless-docker
docker-distroless: sds-distroless-docker

IMAGE_VARIANT ?= all
# Build docker images using the defined IMAGE_REGISTRY, VERSION
.PHONY: docker
docker: check-go-version ## Build all docker images (standard and distroless)
docker: ## Build all docker images (standard and distroless)
docker: # Standard images
ifeq ($(IMAGE_VARIANT),$(filter $(IMAGE_VARIANT),all standard))
docker: docker-standard
Expand Down Expand Up @@ -578,7 +574,7 @@ CLUSTER_NAME ?= kind
INSTALL_NAMESPACE ?= kgateway-system

kind-setup:
VERSION=${VERSION} CLUSTER_NAME=${CLUSTER_NAME} ./ci/kind/setup-kind.sh
VERSION=${VERSION} CLUSTER_NAME=${CLUSTER_NAME} ./hack/kind/setup-kind.sh

kind-load-%-distroless:
kind load docker-image $(IMAGE_REGISTRY)/$*:$(VERSION)-distroless --name $(CLUSTER_NAME)
Expand Down
2 changes: 1 addition & 1 deletion Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def validate_registry() :
def install_metallb():
if not settings["metal_lb"]:
return
local("./ci/kind/setup-metalllb-on-kind.sh")
local("./hack/kind/setup-metalllb-on-kind.sh")

validate_registry()
install_gloo()
Expand Down
19 changes: 0 additions & 19 deletions ci/README.md

This file was deleted.

16 changes: 0 additions & 16 deletions ci/check-generated-code.sh

This file was deleted.

15 changes: 0 additions & 15 deletions ci/check-go-version.sh

This file was deleted.

19 changes: 0 additions & 19 deletions ci/github-actions/go-test-summary/go_test_summary.go

This file was deleted.

Loading