diff --git a/.github/workflows/build-tools.yml b/.github/workflows/build-tools.yml deleted file mode 100644 index 9d019c2f826..00000000000 --- a/.github/workflows/build-tools.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: build-tools-CI -on: - push: - branches: - - main - - v1 - paths: - - 'tools/**' - - 'Makefile' - -jobs: - validate: - name: Validate - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v3 - with: - fetch-depth: 1 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - # Username used to log in to a Docker registry. If not set then no login will occur - username: ${{ github.repository_owner }} - # Password or personal access token used to log in to a Docker registry. If not set then no login will occur - password: ${{ secrets.GHCR_AUTH_PAT }} - # Server address of Docker registry. If not set then will default to Docker Hub - registry: ghcr.io - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build and publish Tools image - run: make publish-build-tools diff --git a/.github/workflows/main-build.yml b/.github/workflows/main-build.yml index 29fe33df865..12140e4cc18 100644 --- a/.github/workflows/main-build.yml +++ b/.github/workflows/main-build.yml @@ -12,8 +12,8 @@ jobs: packages: write id-token: write # needed for signing the images with GitHub OIDC Token **not production ready** - # build-tools is built from ../../tools/build-tools.Dockerfile - container: ghcr.io/kedacore/build-tools:1.20.5 + # keda-tools is built from github.com/test-tools/tools/Dockerfile + container: ghcr.io/kedacore/keda-tools:1.20.5 steps: - name: Check out code uses: actions/checkout@v3 diff --git a/.github/workflows/pr-e2e.yml b/.github/workflows/pr-e2e.yml index 101dbd1c7c0..44efa75dcb4 100644 --- a/.github/workflows/pr-e2e.yml +++ b/.github/workflows/pr-e2e.yml @@ -67,7 +67,7 @@ jobs: needs: triage runs-on: ubuntu-latest name: Build images - container: ghcr.io/kedacore/build-tools:1.20.5 + container: ghcr.io/kedacore/keda-tools:1.20.5 if: needs.triage.outputs.run-e2e == 'true' steps: - name: Set status in-progress @@ -110,7 +110,7 @@ jobs: needs: [triage, build-test-images] runs-on: e2e name: Execute e2e tests - container: ghcr.io/kedacore/build-tools:1.20.5 + container: ghcr.io/kedacore/keda-tools:1.20.5 if: needs.triage.outputs.run-e2e == 'true' steps: - name: Set status in-progress diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index a5300dbdf8d..579185c0fa1 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -5,7 +5,7 @@ jobs: validate: name: validate - ${{ matrix.name }} runs-on: ${{ matrix.runner }} - container: ghcr.io/kedacore/build-tools:1.20.5 + container: ghcr.io/kedacore/keda-tools:1.20.5 strategy: matrix: include: @@ -68,7 +68,7 @@ jobs: validate-dockerfiles: name: validate-dockerfiles - ${{ matrix.name }} runs-on: ${{ matrix.runner }} - container: ghcr.io/kedacore/build-tools:1.20.5 + container: ghcr.io/kedacore/keda-tools:1.20.5 strategy: matrix: include: @@ -96,47 +96,10 @@ jobs: if: steps.filter.outputs.dockerfiles == 'true' run: make docker-build - validate-build-tools: - name: Validate build-tools - ${{ matrix.name }} - runs-on: ${{ matrix.runner }} - container: ghcr.io/kedacore/build-tools:1.20.5 - strategy: - matrix: - include: - - runner: ARM64 - name: arm64 - - runner: ubuntu-latest - name: amd64 - steps: - - uses: actions/checkout@v3 - - - name: Register workspace path - run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - - - uses: dorny/paths-filter@v2 - id: filter - with: - filters: | - tools: - - 'tools/**' - - 'Makefile' - - - name: Set up QEMU - if: steps.filter.outputs.tools == 'true' - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - if: steps.filter.outputs.tools == 'true' - uses: docker/setup-buildx-action@v2 - - - name: Build tools - if: steps.filter.outputs.tools == 'true' - run: make docker-build-tools - validate-dev-container: name: Validate dev-container - ${{ matrix.name }} runs-on: ${{ matrix.runner }} - container: ghcr.io/kedacore/build-tools:1.20.5 + container: ghcr.io/kedacore/keda-tools:1.20.5 strategy: matrix: include: diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index a6d545235f8..3dd52d48afe 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -12,8 +12,8 @@ jobs: packages: write id-token: write # needed for signing the images with GitHub OIDC Token **not production ready** - # build-tools is built from ../../tools/build-tools.Dockerfile - container: ghcr.io/kedacore/build-tools:1.20.5 + # keda-tools is built from github.com/test-tools/tools/Dockerfile + container: ghcr.io/kedacore/keda-tools:1.20.5 steps: - name: Check out code uses: actions/checkout@v3 diff --git a/.github/workflows/static-analysis-codeql.yml b/.github/workflows/static-analysis-codeql.yml index d7c3fd3ac40..9371ebad3ae 100644 --- a/.github/workflows/static-analysis-codeql.yml +++ b/.github/workflows/static-analysis-codeql.yml @@ -9,7 +9,7 @@ jobs: codeQl: name: Analyze CodeQL Go runs-on: ubuntu-latest - container: ghcr.io/kedacore/build-tools:1.20.5 + container: ghcr.io/kedacore/keda-tools:1.20.5 if: (github.actor != 'dependabot[bot]') steps: - name: Checkout repository diff --git a/.github/workflows/template-main-e2e-test.yml b/.github/workflows/template-main-e2e-test.yml index 2d8471e33d7..7655d159e2c 100644 --- a/.github/workflows/template-main-e2e-test.yml +++ b/.github/workflows/template-main-e2e-test.yml @@ -7,8 +7,8 @@ jobs: e2e-tests: name: Run e2e test runs-on: ARM64 - # build-tools is built from ../../tools/build-tools.Dockerfile - container: ghcr.io/kedacore/build-tools:1.20.5 + # keda-tools is built from github.com/test-tools/tools/Dockerfile + container: ghcr.io/kedacore/keda-tools:1.20.5 concurrency: e2e-tests steps: - name: Check out code diff --git a/.github/workflows/v1-build.yml b/.github/workflows/v1-build.yml index 2a563d88e8a..df7b8f67a51 100644 --- a/.github/workflows/v1-build.yml +++ b/.github/workflows/v1-build.yml @@ -7,7 +7,6 @@ jobs: validate: name: Validate runs-on: ubuntu-latest - # build-tools is built from ../../tools/build-tools.Dockerfile container: kedacore/build-tools:v1 steps: - name: Check out code diff --git a/BUILD.md b/BUILD.md index 28f798891d8..7ed2de27272 100644 --- a/BUILD.md +++ b/BUILD.md @@ -57,7 +57,7 @@ make build This project is using [Operator SDK framework](https://github.com/operator-framework/operator-sdk), make sure you have installed the right version. To check the current version used for KEDA check the `RELEASE_VERSION` in file -[tools/build-tools.Dockerfile](https://github.com/kedacore/keda/blob/main/tools/build-tools.Dockerfile). +[github.com/test-tools/tools/Dockerfile](https://github.com/kedacore/test-tools/blob/main/tools/Dockerfile). ```bash git clone git@github.com:kedacore/keda.git diff --git a/Dockerfile b/Dockerfile index 63225873c6f..bb46da4fd7a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM --platform=$BUILDPLATFORM ghcr.io/kedacore/build-tools:1.20.5 AS builder +FROM --platform=$BUILDPLATFORM ghcr.io/kedacore/keda-tools:1.20.5 AS builder ARG BUILD_VERSION=main ARG GIT_COMMIT=HEAD diff --git a/Dockerfile.adapter b/Dockerfile.adapter index 0b8e6ecc87a..9f0a91216e8 100644 --- a/Dockerfile.adapter +++ b/Dockerfile.adapter @@ -1,5 +1,5 @@ # Build the adapter binary -FROM --platform=$BUILDPLATFORM ghcr.io/kedacore/build-tools:1.20.5 AS builder +FROM --platform=$BUILDPLATFORM ghcr.io/kedacore/keda-tools:1.20.5 AS builder ARG BUILD_VERSION=main ARG GIT_COMMIT=HEAD diff --git a/Dockerfile.webhooks b/Dockerfile.webhooks index 022afd67e48..e5d44264ac5 100644 --- a/Dockerfile.webhooks +++ b/Dockerfile.webhooks @@ -1,5 +1,5 @@ # Build the manager binary -FROM --platform=$BUILDPLATFORM ghcr.io/kedacore/build-tools:1.20.5 AS builder +FROM --platform=$BUILDPLATFORM ghcr.io/kedacore/keda-tools:1.20.5 AS builder ARG BUILD_VERSION=main ARG GIT_COMMIT=HEAD diff --git a/Makefile b/Makefile index f6bfed85c9d..061320f541a 100644 --- a/Makefile +++ b/Makefile @@ -22,9 +22,6 @@ IMAGE_CONTROLLER = $(IMAGE_REGISTRY)/$(IMAGE_REPO)/keda$(SUFFIX):$(VERSION) IMAGE_ADAPTER = $(IMAGE_REGISTRY)/$(IMAGE_REPO)/keda-metrics-apiserver$(SUFFIX):$(VERSION) IMAGE_WEBHOOKS = $(IMAGE_REGISTRY)/$(IMAGE_REPO)/keda-admission-webhooks$(SUFFIX):$(VERSION) -BUILD_TOOLS_GO_VERSION = 1.20.5 -IMAGE_BUILD_TOOLS = $(IMAGE_REGISTRY)/$(IMAGE_REPO)/build-tools:$(BUILD_TOOLS_GO_VERSION) - ARCH ?=amd64 CGO ?=0 TARGET_OS ?=linux @@ -362,14 +359,6 @@ $(PROTOCGEN_GRPC): $(LOCALBIN) help: ## Display this help. @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) -.PHONY: docker-build-tools -docker-build-tools: ## Build build-tools image - docker build -f tools/build-tools.Dockerfile -t $(IMAGE_BUILD_TOOLS) --build-arg GO_VERSION=$(BUILD_TOOLS_GO_VERSION) . - -.PHONY: publish-build-tools -publish-build-tools: ## Build and push multi-arch Docker image for build-tools. - docker buildx build --push --platform=${BUILD_PLATFORMS} -f tools/build-tools.Dockerfile -t ${IMAGE_BUILD_TOOLS} --build-arg GO_VERSION=$(BUILD_TOOLS_GO_VERSION) . - .PHONY: docker-build-dev-containers docker-build-dev-containers: ## Build dev-containers image docker build -f .devcontainer/Dockerfile . diff --git a/tools/build-tools.Dockerfile b/tools/build-tools.Dockerfile deleted file mode 100644 index a9e6f478ee8..00000000000 --- a/tools/build-tools.Dockerfile +++ /dev/null @@ -1,67 +0,0 @@ -FROM ubuntu:20.04 - -# Install prerequisite -RUN apt update && \ - apt-get install software-properties-common -y -RUN apt-add-repository ppa:git-core/ppa && \ - apt update && \ - apt install -y wget curl build-essential git git-lfs unzip - -# Use Bash instead of Dash -RUN ln -sf bash /bin/sh - -# Install python3 -RUN apt install -y python3 python3-pip - -# Install azure-cli -RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash - -# Install docker -RUN apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common lsb-release && \ - curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | apt-key add - 2>/dev/null && \ - add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" && \ - apt-get update &&\ - apt-get install -y docker-ce-cli - -# Install golang -ARG GO_VERSION -RUN curl -LO https://golang.org/dl/go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz && \ - tar -C /usr/local -xvzf go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz && \ - rm -rf go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz - -# Install kubectl -RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/$(dpkg --print-architecture)/kubectl" && \ - curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/$(dpkg --print-architecture)/kubectl.sha256" && \ - echo "$(cat kubectl.sha256) kubectl" | sha256sum --check && \ - chmod +x ./kubectl && mv ./kubectl /usr/bin/kubectl && \ - rm kubectl.sha256 - -# Install operator-sdk -RUN RELEASE_VERSION=v1.0.1 && \ - curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu && \ - curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu.asc && \ - gpg --keyserver keyserver.ubuntu.com --recv-key 0CF50BEE7E4DF6445E08C0EA9AFDE59E90D2B445 && \ - gpg --verify operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu.asc && \ - chmod +x operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu && \ - mkdir -p /usr/local/bin/ && \ - cp operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu /usr/local/bin/operator-sdk && \ - rm operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu - -ENV PATH=${PATH}:/usr/local/go/bin -ENV GOROOT=/usr/local/go -ENV GOPATH=/go -ENV PATH=${PATH}:${GOPATH}/bin - -# Install gh -RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg && \ - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null && \ - apt update && \ - apt install -y gh - - # Protocol Buffer Compiler -RUN PROTOC_VERSION=21.9 \ - && if [ $(dpkg --print-architecture) = "amd64" ]; then PROTOC_ARCH="x86_64"; else PROTOC_ARCH="aarch_64" ; fi \ - && curl -LO "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-$PROTOC_ARCH.zip" \ - && unzip "protoc-${PROTOC_VERSION}-linux-$PROTOC_ARCH.zip" -d $HOME/.local \ - && mv $HOME/.local/bin/protoc /usr/local/bin/protoc \ - && mv $HOME/.local/include/ /usr/local/bin/include/