diff --git a/RELEASE b/RELEASE index 29840a030b..35beaa0bb4 100644 --- a/RELEASE +++ b/RELEASE @@ -1,6 +1,6 @@ # Generated by `make release` command. # DO NOT EDIT. -tag: v0.52.1 +tag: v0.52.2 releaseNoteGenerator: showCommitter: false diff --git a/cmd/launcher/Dockerfile b/cmd/launcher/Dockerfile index 3a4998c8fd..cc687a8048 100644 --- a/cmd/launcher/Dockerfile +++ b/cmd/launcher/Dockerfile @@ -13,8 +13,8 @@ COPY . ./ RUN make build/go MOD=launcher BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH} -# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base/452707327?tag=v0.52.0-76-g8a7294e -FROM ghcr.io/pipe-cd/piped-base@sha256:a8f3aba027d8c14aab1b093c9ccb26d40c3b551ba9160902445d186d555a92c7 +# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base/459025001?tag=v0.52.0-97-g3e3df6d +FROM ghcr.io/pipe-cd/piped-base@sha256:fc2bde38211a80ee0df6d90ed168c817f30a7d0dbe8a0aff872a93ffb7d40a66 COPY --from=builder /app/.artifacts/launcher /usr/local/bin/launcher diff --git a/cmd/launcher/Dockerfile-okd b/cmd/launcher/Dockerfile-okd index 1c879aac61..af1addc6c0 100644 --- a/cmd/launcher/Dockerfile-okd +++ b/cmd/launcher/Dockerfile-okd @@ -13,8 +13,8 @@ COPY . ./ RUN make build/go MOD=launcher BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH} -# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base-okd/321464518?tag=v0.50.0-26-ga8527d2 -FROM ghcr.io/pipe-cd/piped-base-okd@sha256:da9bd5a1dae3aa5c2df4baba81ff836ba4a55159d85984605549ef2d1f136895 +# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base-okd/460487531?tag=v0.52.0-102-g2f29597 +FROM ghcr.io/pipe-cd/piped-base-okd@sha256:fc69a9d270e27e086381e8334885ea3d630db2e10fdd00d41759dc40d87fbafc COPY --from=builder /app/.artifacts/launcher /usr/local/bin/launcher diff --git a/cmd/piped/Dockerfile b/cmd/piped/Dockerfile index f72750c91b..0fe4542207 100644 --- a/cmd/piped/Dockerfile +++ b/cmd/piped/Dockerfile @@ -13,8 +13,8 @@ COPY . ./ RUN make build/go MOD=piped BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH} -# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base/452707327?tag=v0.52.0-76-g8a7294e -FROM ghcr.io/pipe-cd/piped-base@sha256:a8f3aba027d8c14aab1b093c9ccb26d40c3b551ba9160902445d186d555a92c7 +# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base/459025001?tag=v0.52.0-97-g3e3df6d +FROM ghcr.io/pipe-cd/piped-base@sha256:fc2bde38211a80ee0df6d90ed168c817f30a7d0dbe8a0aff872a93ffb7d40a66 COPY --from=builder /app/.artifacts/piped /usr/local/bin/piped diff --git a/cmd/piped/Dockerfile-okd b/cmd/piped/Dockerfile-okd index 099d030407..2a013b1580 100644 --- a/cmd/piped/Dockerfile-okd +++ b/cmd/piped/Dockerfile-okd @@ -13,8 +13,8 @@ COPY . ./ RUN make build/go MOD=piped BUILD_OS=${TARGETOS} BUILD_ARCH=${TARGETARCH} -# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base-okd/321464518?tag=v0.50.0-26-ga8527d2 -FROM ghcr.io/pipe-cd/piped-base-okd@sha256:da9bd5a1dae3aa5c2df4baba81ff836ba4a55159d85984605549ef2d1f136895 +# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base-okd/460487531?tag=v0.52.0-102-g2f29597 +FROM ghcr.io/pipe-cd/piped-base-okd@sha256:fc69a9d270e27e086381e8334885ea3d630db2e10fdd00d41759dc40d87fbafc COPY --from=builder /app/.artifacts/piped /usr/local/bin/piped diff --git a/docs/content/en/docs-v0.52.x/user-guide/configuration-reference.md b/docs/content/en/docs-v0.52.x/user-guide/configuration-reference.md index 8fd2a21ccb..b3949a097d 100644 --- a/docs/content/en/docs-v0.52.x/user-guide/configuration-reference.md +++ b/docs/content/en/docs-v0.52.x/user-guide/configuration-reference.md @@ -284,7 +284,7 @@ One of `yamlField` or `regex` is required. | Field | Type | Description | Required | |-|-|-|-| -| id | string | The unique ID of the stage. | No | +| id | string | The unique ID of the stage. This field is `deprecated`. | No | | name | string | One of the provided stage names. | Yes | | desc | string | The description about the stage. | No | | timeout | duration | The maximum time the stage can be taken to run. | No | diff --git a/pkg/app/piped/executor/analysis/metrics_analyzer.go b/pkg/app/piped/executor/analysis/metrics_analyzer.go index 77946c8dc5..134e69b3af 100644 --- a/pkg/app/piped/executor/analysis/metrics_analyzer.go +++ b/pkg/app/piped/executor/analysis/metrics_analyzer.go @@ -133,8 +133,12 @@ func (a *metricsAnalyzer) analyzeWithThreshold(ctx context.Context) (bool, error To: now, } - a.logPersister.Infof("[%s] Run query: %q, in range: %v", a.id, a.cfg.Query, queryRange) - points, err := a.provider.QueryPoints(ctx, a.cfg.Query, queryRange) + renderedQuery, err := a.renderQuery(a.cfg.Query, a.cfg.PrimaryArgs, primaryVariantName) + if err != nil { + return false, fmt.Errorf("failed to render query template for Threshold: %w", err) + } + a.logPersister.Infof("[%s] Run query: %q, in range: %v", a.id, renderedQuery, queryRange) + points, err := a.provider.QueryPoints(ctx, renderedQuery, queryRange) if err != nil { return false, fmt.Errorf("failed to run query: %w", err) } @@ -154,7 +158,7 @@ func (a *metricsAnalyzer) analyzeWithThreshold(ctx context.Context) (bool, error break } if !expected { - a.logPersister.Errorf("[%s] Failed because it found a data point (%s) that is outside the expected range (%s). Performed query: %q", a.id, &outiler, &a.cfg.Expected, a.cfg.Query) + a.logPersister.Errorf("[%s] Failed because it found a data point (%s) that is outside the expected range (%s). Performed query: %q", a.id, &outiler, &a.cfg.Expected, renderedQuery) return false, nil } @@ -171,13 +175,17 @@ func (a *metricsAnalyzer) analyzeWithPrevious(ctx context.Context) (expected, fi To: now, } - a.logPersister.Infof("[%s] Run query: %q, in range: %v", a.id, a.cfg.Query, queryRange) - points, err := a.provider.QueryPoints(ctx, a.cfg.Query, queryRange) + renderedQuery, err := a.renderQuery(a.cfg.Query, a.cfg.PrimaryArgs, primaryVariantName) + if err != nil { + return false, false, fmt.Errorf("failed to render query template for Previous: %w", err) + } + a.logPersister.Infof("[%s] Run query: %q, in range: %v", a.id, renderedQuery, queryRange) + points, err := a.provider.QueryPoints(ctx, renderedQuery, queryRange) if err != nil { - return false, false, fmt.Errorf("failed to run query: %w: performed query: %q", err, a.cfg.Query) + return false, false, fmt.Errorf("failed to run query: %w: performed query: %q", err, renderedQuery) } pointsCount := len(points) - a.logPersister.Infof("[%s] Got %d data points for current Primary from the query: %q", a.id, pointsCount, a.cfg.Query) + a.logPersister.Infof("[%s] Got %d data points for current Primary from the query: %q", a.id, pointsCount, renderedQuery) values := make([]float64, 0, pointsCount) for i := range points { values = append(values, points[i].Value) @@ -199,13 +207,13 @@ func (a *metricsAnalyzer) analyzeWithPrevious(ctx context.Context) (expected, fi To: prevTo, } - a.logPersister.Infof("[%s] Run query: %q, in range: %v", a.id, a.cfg.Query, prevQueryRange) - prevPoints, err := a.provider.QueryPoints(ctx, a.cfg.Query, prevQueryRange) + a.logPersister.Infof("[%s] Run query: %q, in range: %v", a.id, renderedQuery, prevQueryRange) + prevPoints, err := a.provider.QueryPoints(ctx, renderedQuery, prevQueryRange) if err != nil { - return false, false, fmt.Errorf("failed to run query to fetch metrics for the previous deployment: %w: performed query: %q", err, a.cfg.Query) + return false, false, fmt.Errorf("failed to run query to fetch metrics for the previous deployment: %w: performed query: %q", err, renderedQuery) } prevPointsCount := len(prevPoints) - a.logPersister.Infof("[%s] Got %d data points for previous Primary from the query: %q", a.id, prevPointsCount, a.cfg.Query) + a.logPersister.Infof("[%s] Got %d data points for previous Primary from the query: %q", a.id, prevPointsCount, renderedQuery) prevValues := make([]float64, 0, prevPointsCount) for i := range prevPoints { prevValues = append(prevValues, prevPoints[i].Value) @@ -213,14 +221,14 @@ func (a *metricsAnalyzer) analyzeWithPrevious(ctx context.Context) (expected, fi expected, err = a.compare(values, prevValues, a.cfg.Deviation) if err != nil { a.logPersister.Errorf("[%s] Failed to compare data points: %v", a.id, err) - a.logPersister.Infof("[%s] Performed query: %q", a.id, a.cfg.Query) + a.logPersister.Infof("[%s] Performed query: %q", a.id, renderedQuery) return false, false, err } if !expected { a.logPersister.Errorf("[%s] The difference between Current Primary and Previous one is statistically significant", a.id) a.logPersister.Infof("[%s] Performed query range for current Primary: %q", a.id, &queryRange) a.logPersister.Infof("[%s] Performed query range for previous Primary: %q", a.id, &prevQueryRange) - a.logPersister.Infof("[%s] Performed query: %q", a.id, a.cfg.Query) + a.logPersister.Infof("[%s] Performed query: %q", a.id, renderedQuery) a.logPersister.Infof("[%s] Current data points acquired:", a.id) for i := range points { a.logPersister.Infof("[%s] %s", a.id, &points[i]) diff --git a/tool/piped-base-okd/Dockerfile b/tool/piped-base-okd/Dockerfile index 5676bcbe79..e6a14e316e 100644 --- a/tool/piped-base-okd/Dockerfile +++ b/tool/piped-base-okd/Dockerfile @@ -1,6 +1,6 @@ # check=skip=SecretsUsedInArgOrEnv -# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base/103341355?tag=v0.44.0-alpha-52-ge881cac -FROM ghcr.io/pipe-cd/piped-base@sha256:18a5a6af6507c8c70c5442d19651a2000672c78fc5dd91cfd3c0af26c899c1d3 +# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base/459025001?tag=v0.52.0-97-g3e3df6d +FROM ghcr.io/pipe-cd/piped-base@sha256:fc2bde38211a80ee0df6d90ed168c817f30a7d0dbe8a0aff872a93ffb7d40a66 ARG PIPED_UID=1000 ARG ROOT_GID=0 @@ -21,14 +21,14 @@ RUN \ cmake && \ # Install glibc to be used for building nss_wrapper. wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \ - wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.33-r0/glibc-2.33-r0.apk && \ - apk add glibc-2.33-r0.apk && \ + wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r1/glibc-2.35-r1.apk && \ + apk add glibc-2.35-r1.apk && \ # Install nss_wrapper to add an random UID to "passwd" at runtime without having to directly modify /etc/passwd. /installer/install-nss-wrapper.sh && \ # Remove what were used for installation. rm -rf /installer && \ rm -f /var/cache/apk/* && \ - rm /glibc-2.33-r0.apk && \ + rm /glibc-2.35-r1.apk && \ # Create the modifiable passwd file. grep -v -e ^default /etc/passwd > $PIPED_HOME/passwd && \ # Grant access to the root group because all containers running on OKD belong to it.