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

fix releases #161

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
6807102
go: upgraded golang.org/x/net v0.32.0 => v0.33.0
dmolik Dec 19, 2024
3456c42
build(deps): bump github.com/onsi/ginkgo/v2 from 2.22.0 to 2.22.1
dependabot[bot] Dec 20, 2024
217a4be
build(deps): bump github.com/onsi/gomega from 1.36.1 to 1.36.2
dependabot[bot] Dec 24, 2024
f61ef27
build(deps): bump github.com/valkey-io/valkey-go from 1.0.51 to 1.0.52
dependabot[bot] Dec 25, 2024
6e1d2f2
feat: Modify CRD to support pre-setting service-password
dmolik Dec 27, 2024
49afaf1
build(deps): bump github.com/onsi/ginkgo/v2 from 2.22.1 to 2.22.2
dependabot[bot] Dec 31, 2024
0f6b673
feat: Github Attestation for image and image.yaml
dmolik Dec 31, 2024
8fd40e5
update action permissions
dmolik Dec 31, 2024
8c5dbe0
chore: update testing rig versions
dmolik Jan 7, 2025
1ecf120
build(deps): bump sigs.k8s.io/controller-runtime from 0.19.3 to 0.19.4
dependabot[bot] Jan 8, 2025
75408dd
build(deps): bump docker/build-push-action from 6.10.0 to 6.11.0
dependabot[bot] Jan 8, 2025
c70b6c2
Build out sidecar infrastructure (#125)
dmolik Jan 8, 2025
6bc0983
build(deps): bump alpine from 3.21.1 to 3.21.2 (#155)
dependabot[bot] Jan 10, 2025
13c8044
build(deps): bump github.com/oliver006/redis_exporter (#156)
dependabot[bot] Jan 10, 2025
d7d1272
build(deps): bump docker/metadata-action from 5.5.1 to 5.6.1 (#158)
dependabot[bot] Jan 10, 2025
e0f9e45
build(deps): bump docker/build-push-action from 6.9.0 to 6.11.0 (#157)
dependabot[bot] Jan 10, 2025
ebdf34d
fix(controller): Fix add-slots-range algorithm in initCluster (#159)
dmolik Jan 10, 2025
165b728
work on building containers in PR-Branches (#160)
dmolik Jan 10, 2025
48e7bf0
prep for v0.0.48
dmolik Jan 10, 2025
2410f54
fix job ids
dmolik Jan 10, 2025
46404be
missing tag in image singing
dmolik Jan 10, 2025
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
50 changes: 39 additions & 11 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,47 @@
name: Go Build
name: Build

on:
pull_request:

env:
REGISTRY: ghcr.io

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: 1.23
# You can test your matrix by printing the current Go version
- name: Display Go version
run: go version
- name: Build it
run: make V=1
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: 1.23
# You can test your matrix by printing the current Go version
- name: Display Go version
run: go version
- name: Build it
run: make V=1
build-operator-container:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: 1.23
- name: Build it
run: make V=1
- name: Extract metadata (Operator tags, labels) for Docker
id: meta_operator
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96
with:
images: ${{ env.REGISTRY }}/hyperspike/valkey-operator:${{ github.sha }}
- name: Build Operator image
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc
id: docker_build_operator
with:
file: Dockerfile.controller
context: .
push: false
visibility: public
tags: ${{ steps.meta_operator.outputs.images }}
labels: ${{ steps.meta_operator.outputs.labels }}
84 changes: 73 additions & 11 deletions .github/workflows/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ on:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
VALKEY_VERSION: 8.0.2
RELEASE_VERSION: ${{ github.ref_name }}

jobs:
build-and-push-image:
Expand All @@ -22,6 +24,7 @@ jobs:
packages: write
id-token: write
security-events: write
attestations: write

steps:
- name: Checkout repository
Expand All @@ -34,16 +37,26 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
- name: Extract metadata (Controller tags, labels) for Docker
id: meta_controller
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}${{ env.RELEASE_VERSION }}
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }}
- name: Extract metadata (Sidecar tags, labels) for Docker
id: meta_sidecar
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96
with:
images: ${{ env.REGISTRY }}/hyperspike/valkey-sidecar:${{ env.RELEASE_VERSION }}
- name: Extract metadata (Valkey tags, labels) for Docker
id: meta_valkey
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96
with:
images: ${{ env.REGISTRY }}/hyperspike/valkey:${{ env.VALKEY_VERSION }}

- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: 1.22
go-version: 1.23
# You can test your matrix by printing the current Go version
- name: Display Go version
run: go version
Expand All @@ -52,26 +65,75 @@ jobs:
run: make V=1

- name: Build and push Docker image
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355
id: docker_build
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc
id: docker_build_controller
with:
file: Dockerfile.controller
context: .
push: true
visibility: public
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }}
labels: ${{ steps.meta_manager.outputs.labels }}
- name: Build and push Sidecar image
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc
id: docker_build_sidecar
with:
file: Dockerfile.sidecar
context: .
push: true
visibility: public
tags: ${{ env.REGISTRY }}/hyperspike/valkey-sidecar:${{ env.RELEASE_VERSION }}
labels: ${{ steps.meta_sidecar.outputs.labels }}
- name: Build and push Valkey image
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc
id: docker_build_valkey
with:
file: Dockerfile.valkey
context: .
push: true
visibility: public
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ env.REGISTRY }}/hyperspike/valkey:${{ env.VALKEY_VERSION }}
labels: ${{ steps.meta_valkey.outputs.labels }}

- name: Set up Cosign
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0

- name: Sign image with GitHub OIDC Token
- name: Sign Controller image with GitHub OIDC Token
run: |
cosign sign --yes ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }}@${{ steps.docker_build_controller.outputs.digest }}
- name: Sign Sidecar image with GitHub OIDC Token
run: |
cosign sign --yes ${{ env.REGISTRY }}/hyperspike/valkey-sidecar:${{ env.RELEASE_VERSION }}@${{ steps.docker_build_sidecar.outputs.digest }}
- name: Sign Valkey image with GitHub OIDC Token
run: |
cosign sign --yes ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}${{ env.RELEASE_VERSION }}@${{ steps.docker_build.outputs.digest }}
cosign sign --yes ${{ env.REGISTRY }}/hyperspike/valkey:${{ env.VALKEY_VERSION }}@${{ steps.docker_build_valkey.outputs.digest }}

- name: Attest the Controller image
uses: actions/attest-build-provenance@v2
id: attest_controller
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
subject-digest: ${{ steps.docker_build_controller.outputs.digest }}
push-to-registry: true
- name: Attest the Sidecar image
uses: actions/attest-build-provenance@v2
id: attest_sidecar
with:
subject-name: ${{ env.REGISTRY }}/hyperspike/valkey-sidecar
subject-digest: ${{ steps.docker_build_sidecar.outputs.digest }}
push-to-registry: true
- name: Attest the Valkey image
uses: actions/attest-build-provenance@v2
id: attest_valkey
with:
subject-name: ${{ env.REGISTRY }}/hyperspike/valkey
subject-digest: ${{ steps.docker_build_valkey.outputs.digest }}
push-to-registry: true

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}${{ env.RELEASE_VERSION }}'
image-ref: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }}'
format: 'sarif'
output: 'trivy-results.sarif'

Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ jobs:
runs-on: ubuntu-latest
needs: publish
name: Upload release assets
permissions:
contents: write
packages: write
id-token: write
attestations: write
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -38,6 +43,12 @@ jobs:
check-latest: true
- name: Build Installer
run: make build-installer IMG=ghcr.io/hyperspike/valkey-operator:${{ github.ref_name }}
- name: Attest
uses: actions/attest-build-provenance@v2
id: attest
with:
subject-path: |
dist/install.yaml
- name: Upload dist/install.yaml to release
uses: svenstaro/upload-release-action@v2
with:
Expand Down
35 changes: 34 additions & 1 deletion .github/workflows/scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
- main
pull_request:

env:
REGISTRY: ghcr.io

permissions:
contents: read
security-events: write
Expand All @@ -20,7 +23,13 @@ jobs:
- uses: actions/checkout@v4
- uses: hadolint/[email protected]
with:
dockerfile: Dockerfile
dockerfile: Dockerfile.valkey
- uses: hadolint/[email protected]
with:
dockerfile: Dockerfile.controller
- uses: hadolint/[email protected]
with:
dockerfile: Dockerfile.sidecar
gosec:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -68,3 +77,27 @@ jobs:

# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
# skip-build-cache: true
trivy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build the Valkey image
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc
id: docker_build_valkey
with:
file: Dockerfile.valkey
context: .
push: false
tags: ${{ env.REGISTRY }}/hyperspike/valkey:${{ github.SHA }}
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: ${{ env.REGISTRY }}/hyperspike/valkey:${{ github.SHA }}
format: 'sarif'
output: 'trivy-results.sarif'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: trivy-results.sarif
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ go.work
.ingress.yaml
blank.yaml
cilium/
manager
/manager
/sidecar
valkey-operator/
valkey-operator-*-chart.tgz
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ linters:
- unconvert
- unparam
- unused
linters-settings:
lll:
line-length: 256
33 changes: 0 additions & 33 deletions Dockerfile

This file was deleted.

5 changes: 5 additions & 0 deletions Dockerfile.controller
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM gcr.io/distroless/static:nonroot
COPY manager /manager
USER 65532:65532

ENTRYPOINT ["/manager"]
6 changes: 6 additions & 0 deletions Dockerfile.sidecar
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM gcr.io/distroless/static:nonroot

COPY sidecar /sidecar
USER 65532:65532

ENTRYPOINT ["/sidecar"]
35 changes: 35 additions & 0 deletions Dockerfile.valkey
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM alpine:3.21.2 AS builder

ARG VALKEY_VERSION=8.0.1

WORKDIR /home/valkey

RUN apk add --no-cache --virtual .build-deps \
git=2.47.1-r0 \
coreutils=9.5-r2 \
linux-headers=6.6-r1 \
musl-dev=1.2.5-r8 \
openssl-dev=3.3.2-r4 \
gcc=14.2.0-r4 \
curl=8.11.1-r0 \
make=4.4.1-r2 \
&& curl -L https://github.com/valkey-io/valkey/archive/refs/tags/${VALKEY_VERSION}.tar.gz -o valkey.tar.gz \
&& tar -xzf valkey.tar.gz --strip-components=1 \
&& make PREFIX=/usr BUILD_TLS=yes \
&& make install BUILD_TLS=yes PREFIX=/home/valkey/build

FROM alpine:3.21.2 AS valkey

RUN apk add --no-cache \
openssl=3.3.2-r4 \
ca-certificates=20241121-r1 \
&& addgroup -S valkey -g 1009 \
&& adduser -S -G valkey valkey -u 1009 \
&& mkdir /etc/valkey \
&& chown valkey:valkey /etc/valkey \
&& mkdir /var/lib/valkey \
&& chown valkey:valkey /var/lib/valkey

COPY --from=builder /home/valkey/build/ /usr/

USER valkey
Loading
Loading