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

Update actions, update operator-sdk + go + Kube #452

Merged
merged 6 commits into from
Nov 18, 2022
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
33 changes: 12 additions & 21 deletions .github/actions/run-integ-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,40 +21,31 @@ runs:
run: |
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
- name: Set up Go 1.18
uses: actions/setup-go@v1
sudo rm -rf /opt/ghc
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-integ-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-integ-
go-version-file: 'go.mod'
cache: true
- name: Create Kind Cluster
uses: helm/kind-action@v1.3.0
uses: helm/kind-action@v1.4.0
with:
version: v0.14.0
node_image: kindest/node:v1.24.3
version: v0.17.0
node_image: kindest/node:v1.25.3
cluster_name: kind
config: tests/testdata/kind/kind_config_6_workers.yaml
- name: Install Helm
uses: azure/setup-helm@v3
with:
version: 3.10.2
id: install_helm
- name: Download cass-operator image
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: cass-operator
path: /tmp
- name: Download system-logger image
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: system-logger
path: /tmp
Expand Down
37 changes: 14 additions & 23 deletions .github/workflows/kindIntegTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-integ-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-integ-
uses: docker/setup-buildx-action@v2
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
file: Dockerfile
context: .
Expand All @@ -35,7 +28,7 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
file: logger.Dockerfile
push: false
Expand All @@ -45,12 +38,12 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Upload cass-operator image
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: cass-operator
path: /tmp/k8ssandra-cass-operator.tar
- name: Upload system-logger image
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: system-logger
path: /tmp/k8ssandra-system-logger.tar
Expand Down Expand Up @@ -111,18 +104,18 @@ jobs:
CGO_ENABLED: 0
M_INTEG_DIR: ${{ matrix.integration_test }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@v2
- uses: actions/checkout@v3
if: github.event_name != 'pull_request'
- uses: ./.github/actions/run-integ-test
with:
integration_test: ${{ matrix.integration_test }}
- name: Archive k8s logs
if: ${{ failure() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: k8s-logs-${{ matrix.integration_test }}
path: ./build/kubectl_dump
Expand All @@ -131,10 +124,8 @@ jobs:
strategy:
matrix:
version:
- "3.11.7"
- "3.11.11"
- "4.0.0"
- "4.0.3"
- "3.11.14"
- "4.0.7"
include:
- version: 3.11.7
serverImage: k8ssandra/cass-management-api:3.11.7-v0.1.24 # k8ssandra 1.1
Expand All @@ -148,18 +139,18 @@ jobs:
M_SERVER_VERSION: ${{ matrix.version }}
M_SERVER_IMAGE: ${{ matrix.serverImage }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@v2
- uses: actions/checkout@v3
if: github.event_name != 'pull_request'
- uses: ./.github/actions/run-integ-test
with:
integration_test: smoke_test_oss
- name: Archive k8s logs
if: ${{ failure() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: k8s-logs-smoke_test_oss-${{ matrix.version }}-${{ matrix.serverImage }}
path: ./build/kubectl_dump
2 changes: 1 addition & 1 deletion .github/workflows/license-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install Fossa CLI
run: |
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | bash -s -- -b .
Expand Down
51 changes: 16 additions & 35 deletions .github/workflows/operatorBuildAndDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,19 @@ jobs:
env:
CGO_ENABLED: 0
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@v2
- uses: actions/checkout@v3
if: github.event_name != 'pull_request'
- name: Set up Go 1.18
uses: actions/setup-go@v1
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version-file: 'go.mod'
cache: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
uses: docker/setup-buildx-action@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand All @@ -58,30 +46,23 @@ jobs:
if: github.ref == 'refs/heads/master'
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Set git parsed values
id: vars
run: |
echo ::set-output name=sha_short::$(git rev-parse --short=8 ${{ github.sha }})
echo ::set-output name=tag_name::${GITHUB_REF#refs/tags/}
echo ::set-output name=version::$(make version)
echo "sha_short=$(git rev-parse --short=8 ${{ github.sha }})" >> $GITHUB_OUTPUT
echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
echo "version=$(make version)" >> $GITHUB_OUTPUT
- name: Build and push
id: docker_build_cass_operator
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
file: Dockerfile
context: .
Expand All @@ -92,7 +73,7 @@ jobs:
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Build and push
id: docker_build_system_logger
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
file: logger.Dockerfile
push: ${{ github.event_name != 'pull_request' }}
Expand All @@ -105,7 +86,7 @@ jobs:
make IMG=k8ssandra/cass-operator:${{ steps.vars.outputs.version }} VERSION=${{ steps.vars.outputs.version }} CHANNEL=dev bundle
- name: Build and push cass-operator-bundle
id: docker_build_cass-operator_bundle
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
file: bundle.Dockerfile
build-args: |
Expand Down
45 changes: 20 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,13 @@ jobs:
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go 1.18
uses: actions/setup-go@v1
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version-file: 'go.mod'
cache: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
if: ${{ !env.ACT }}
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: ${{ !env.ACT }}
uses: docker/login-action@v2
Expand All @@ -45,8 +38,8 @@ jobs:
id: vars
shell: bash
run: |
echo ::set-output name=sha_short::$(git rev-parse --short=8 ${{ github.sha }})
echo ::set-output name=tag_name::${GITHUB_REF#refs/tags/}
echo "sha_short=$(git rev-parse --short=8 ${{ github.sha }})" >> $GITHUB_OUTPUT
echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
echo "TARGET_VERSION=$(echo ${GITHUB_REF#refs/tags/} | awk '{print substr($0,2)}')" >> $GITHUB_ENV
- name: Build system-logger
id: docker_build_system-logger
Expand Down Expand Up @@ -103,14 +96,15 @@ jobs:
- name: Tag and push images for Red Hat certification
shell: bash
if: ${{ !env.ACT }}
# The double docker login is a workaround for RH's odd login issues
run: |
docker tag k8ssandra/cass-operator:${{ steps.vars.outputs.tag_name}} scan.connect.redhat.com/ospid-18783bca-8f79-459c-aa0b-bda4e71c6ec3/cass-operator:${{ steps.vars.outputs.tag_name}}
docker tag k8ssandra/system-logger:${{ steps.vars.outputs.tag_name}} scan.connect.redhat.com/ospid-6138f998fb33d420b79f0af9/system-logger:${{ steps.vars.outputs.tag_name}}
docker login -u unused scan.connect.redhat.com -p ${{ secrets.CASS_OPERATOR_CONNECT_SECRET }}
docker push scan.connect.redhat.com/ospid-18783bca-8f79-459c-aa0b-bda4e71c6ec3/cass-operator:${{ steps.vars.outputs.tag_name}}
docker login -u unused scan.connect.redhat.com -p ${{ secrets.SYSTEM_LOGGER_CONNECT_SECRET }}
docker push scan.connect.redhat.com/ospid-6138f998fb33d420b79f0af9/system-logger:${{ steps.vars.outputs.tag_name}}
docker tag k8ssandra/cass-operator:${{ steps.vars.outputs.tag_name}} quay.io/redhat-isv-containers/5ebee0e40e3deaf258b160d1:${{ steps.vars.outputs.tag_name}}
docker tag k8ssandra/system-logger:${{ steps.vars.outputs.tag_name}} quay.io/redhat-isv-containers/6138f998fb33d420b79f0af9:${{ steps.vars.outputs.tag_name}}

docker login -u redhat-isv-containers+5ebee0e40e3deaf258b160d1-robot quay.io -p ${{ secrets.CASS_OPERATOR_CONNECT_SECRET }}
docker push quay.io/redhat-isv-containers/5ebee0e40e3deaf258b160d1:${{ steps.vars.outputs.tag_name}}

docker login -u redhat-isv-containers+6138f998fb33d420b79f0af9-robot quay.io -p ${{ secrets.SYSTEM_LOGGER_CONNECT_SECRET }}
docker push quay.io/redhat-isv-containers/6138f998fb33d420b79f0af9:${{ steps.vars.outputs.tag_name}}
- name: Install CLI tools from OpenShift Mirror
uses: redhat-actions/openshift-tools-installer@v1
with:
Expand All @@ -125,10 +119,11 @@ jobs:
- name: Run preflight checks and submit results
shell: bash
run: |
docker login -u unused scan.connect.redhat.com -p ${{ secrets.CASS_OPERATOR_CONNECT_SECRET }}
preflight check container scan.connect.redhat.com/ospid-18783bca-8f79-459c-aa0b-bda4e71c6ec3/cass-operator:${{ steps.vars.outputs.tag_name}} --certification-project-id=5ebee0e40e3deaf258b160d1 --pyxis-api-token=${{ secrets.PREFLIGHT_KEY }} --submit --docker-config=$HOME/.docker/config.json
docker login -u unused scan.connect.redhat.com -p ${{ secrets.SYSTEM_LOGGER_CONNECT_SECRET }}
preflight check container scan.connect.redhat.com/ospid-6138f998fb33d420b79f0af9/system-logger:${{ steps.vars.outputs.tag_name}} --certification-project-id=6138f998fb33d420b79f0af9 --pyxis-api-token=${{ secrets.PREFLIGHT_KEY }} --submit --docker-config=$HOME/.docker/config.json
docker login -u redhat-isv-containers+5ebee0e40e3deaf258b160d1-robot quay.io -p ${{ secrets.CASS_OPERATOR_CONNECT_SECRET }}
preflight check container quay.io/redhat-isv-containers/5ebee0e40e3deaf258b160d1:${{ steps.vars.outputs.tag_name}} --certification-project-id=5ebee0e40e3deaf258b160d1 --pyxis-api-token=${{ secrets.PREFLIGHT_KEY }} --submit --docker-config=$HOME/.docker/config.json

docker login -u redhat-isv-containers+6138f998fb33d420b79f0af9-robot quay.io -p ${{ secrets.SYSTEM_LOGGER_CONNECT_SECRET }}
preflight check container quay.io/redhat-isv-containers/6138f998fb33d420b79f0af9:${{ steps.vars.outputs.tag_name}} --certification-project-id=6138f998fb33d420b79f0af9 --pyxis-api-token=${{ secrets.PREFLIGHT_KEY }} --submit --docker-config=$HOME/.docker/config.json
- name: Create bundle
shell: bash
if: ${{ !env.ACT }} # Act does not have yq
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Changelog for Cass Operator, new PRs should update the `main / unreleased` secti

## unreleased

* [CHANGE] [#447](https://github.com/k8ssandra/cass-operator/issues/447) Update Github actions to remove all deprecated features (set-outputs, node v12 actions)
* [CHANGE] [#448](https://github.com/k8ssandra/cass-operator/issues/448) Update to operator-sdk 1.25.1, update to go 1.19, update to Kubernetes 1.25, remove amd64 restriction on local builds (cass-operator and system-logger will be built for aarch64 also)
* [FEATURE] [#441](https://github.com/k8ssandra/cass-operator/issues/441) Implement a CassandraTask for moving single-token nodes

## v1.13.1
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.18 as builder
FROM golang:1.19 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand All @@ -17,7 +17,7 @@ COPY pkg/ pkg/


# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go
RUN CGO_ENABLED=0 GOOS=linux go build -a -o manager main.go

# Build the UBI image
FROM redhat/ubi8-micro:latest
Expand Down
Loading