Skip to content

Commit

Permalink
Merge branch 'main' into automate-olm-releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
fmuyassarov authored Dec 24, 2024
2 parents b17a911 + f09cb0e commit ab1a763
Show file tree
Hide file tree
Showing 12 changed files with 154 additions and 13 deletions.
11 changes: 8 additions & 3 deletions .github/ISSUE_TEMPLATE/new-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,21 @@ future releases.
- [ ] Push the tag with `git push $VERSION`.
- [ ] Check that new container images are published for the tag.
- ```
for i in nri-resource-policy-topology-aware nri-resource-policy-balloons nri-resource-policy-template nri-config-manager nri-memory-qos nri-memtierd; do \
skopeo inspect --format "$i: {{.Digest}}" docker://ghcr.io/containers/nri-plugins/$i:$VERSION;
done
# You can do this with the in-repo artifact verification script:
./scripts/release/check-artifacts.sh --images $VERSION
```
- [ ] Finalize the new *draft* release created by CI
- [ ] Check that all artefacts (Helm charts) were uploaded
- [ ] Write the change log to the release.
- [ ] Get the change log OK'd by other maintainers.
- [ ] Publish the draft as a release.
- [ ] Verify that the Helm repo was updated
- ```
# You can do this with the in-repo artifact verification script:
./scripts/release/check-artifacts.sh --charts $VERSION
# Or to do a final verification of both images and charts:
./scripts/release/check-artifacts.sh $VERSION
```
- [ ] Add a link to the tagged release in this issue.
- [ ] Generate the operator bundle by running make bundle within `deployment/operator` directory and submit the generated content to the [community-operators](https://github.com/k8s-operatorhub/community-operators).
- [ ] Create and push unannotated development tag `X.Y.0-devel` for next release cycle.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ GO_LINT := golint -set_exit_status
GO_FMT := gofmt
GO_VET := $(GO_CMD) vet
GO_DEPS := $(GO_CMD) list -f '{{ join .Deps "\n" }}'
GO_VERSION ?= 1.22.10
GO_VERSION ?= 1.23.4

GO_MODULES := $(shell $(GO_CMD) list ./...)
GO_SUBPKGS := $(shell find ./pkg -name go.mod | sed 's:/go.mod::g' | grep -v testdata | \
Expand Down
2 changes: 1 addition & 1 deletion cmd/config-manager/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build Stage
ARG GO_VERSION=1.22
ARG GO_VERSION=1.23

FROM golang:${GO_VERSION}-bullseye AS build
WORKDIR /go/builder
Expand Down
2 changes: 1 addition & 1 deletion cmd/plugins/balloons/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_VERSION=1.22
ARG GO_VERSION=1.23

FROM golang:${GO_VERSION}-bullseye AS builder

Expand Down
2 changes: 1 addition & 1 deletion cmd/plugins/memory-qos/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_VERSION=1.22
ARG GO_VERSION=1.23

FROM golang:${GO_VERSION}-bullseye AS builder

Expand Down
2 changes: 1 addition & 1 deletion cmd/plugins/memtierd/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_VERSION=1.22
ARG GO_VERSION=1.23

FROM golang:${GO_VERSION}-bullseye AS builder

Expand Down
2 changes: 1 addition & 1 deletion cmd/plugins/sgx-epc/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_VERSION=1.22
ARG GO_VERSION=1.23

FROM golang:${GO_VERSION}-bullseye AS builder

Expand Down
2 changes: 1 addition & 1 deletion cmd/plugins/template/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_VERSION=1.22
ARG GO_VERSION=1.23

FROM golang:${GO_VERSION}-bullseye AS builder

Expand Down
2 changes: 1 addition & 1 deletion cmd/plugins/topology-aware/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_VERSION=1.22
ARG GO_VERSION=1.23

FROM golang:${GO_VERSION}-bullseye AS builder

Expand Down
2 changes: 1 addition & 1 deletion docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM sphinxdoc/sphinx:7.4.7

ARG GO_VERSION=1.22
ARG GO_VERSION=1.23

RUN apt-get update && apt-get install -y wget git

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/containers/nri-plugins

go 1.22.10
go 1.23.4

require (
github.com/containerd/nri v0.6.0
Expand Down
136 changes: 136 additions & 0 deletions scripts/release/check-artifacts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
#!/bin/bash

set -e -o pipefail

CHECK_IMAGES="\
nri-resource-policy-balloons \
nri-resource-policy-template \
nri-resource-policy-topology-aware \
nri-config-manager \
nri-memory-qos \
nri-memtierd \
nri-sgx-epc \
"

CHECK_CHARTS="\
nri-resource-policy-balloons \
nri-resource-policy-template \
nri-resource-policy-topology-aware \
nri-memory-qos \
nri-memtierd \
nri-sgx-epc \
"

CHECKS="all"

IMAGE_URL="ghcr.io/containers/nri-plugins"
INDEX_URL="https://containers.github.io/nri-plugins/index.yaml"

info() {
echo "$*"
}

error() {
echo "ERROR: $*" >&2
}

check-images() {
local status=0 pkg img

info "Checking images for version $VERSION..."
for pkg in $CHECK_IMAGES; do \
img="$IMAGE_URL/$pkg"
info " $img..."
if ! result=$(skopeo inspect --format "$pkg: {{.Digest}}" "docker://$img:$VERSION"); then
info " FAIL: $img:$VERSION NOT FOUND"
status=1
else
info " OK: $result"
fi
done

return $status
}

check-helm-charts() {
local status=0 pkg

rm -f helm-index
info "Downloading Helm index..."
if ! wget -q $INDEX_URL -Ohelm-index; then
error "Failed to download Helm index"
return 1
fi

info "Checking Helm charts for version $VERSION..."
for pkg in $CHECK_CHARTS; do
info " $pkg:$VERSION..."
if [ $(cat helm-index | yq ".entries.$pkg[] | select(.version == \"$VERSION\") | length > 0") != "true" ]; then
info " FAIL: Helm chart $pkg:$VERSION NOT FOUND"
status=1
else
info " OK: $pkg"
fi
done
rm -f helm-index

return $status
}

while [ $# -gt 0 ]; do
case $1 in
-h|--help)
echo "Usage: $0 [--images] [--charts] <version-tag>"
exit 0
;;
--images|-i)
CHECKS="images"
;;
--charts|--helm|-c)
CHECKS="charts"
;;
*)
if [ -n "$VERSION" ]; then
error "Needs a single version but multiple given ($VERSION, $1)"
exit 1
fi
VERSION="$1"
;;
esac
shift
done

if [ -z "$VERSION" ]; then
error "Usage: $0 <version>"
exit 1
fi

status=0

if [ "$CHECKS" = "all" ] || [ "$CHECKS" = "images" ]; then
if ! check-images; then
status=1
else
info "All expected images found."
fi
else
info "Skipping image checks."
fi

if [ "$CHECKS" = "all" ] || [ "$CHECKS" = "charts" ]; then
if ! check-helm-charts; then
status=1
else
info "All expected Helm charts found."
fi
else
info "Skipping Helm chart checks."
fi

if [ $status -eq 0 ]; then
info "SUCCESS: All expected artifacts for $VERSION found."
else
error "FAILED: Some artifacts for release $VERSION not found."
fi

exit $status

0 comments on commit ab1a763

Please sign in to comment.