Skip to content
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
2 changes: 1 addition & 1 deletion RELEASE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Generated by `make release` command.
# DO NOT EDIT.
tag: v0.52.1
tag: v0.52.2

releaseNoteGenerator:
showCommitter: false
Expand Down
4 changes: 2 additions & 2 deletions cmd/launcher/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions cmd/launcher/Dockerfile-okd
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions cmd/piped/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions cmd/piped/Dockerfile-okd
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
34 changes: 21 additions & 13 deletions pkg/app/piped/executor/analysis/metrics_analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,12 @@
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)
}

Check warning on line 139 in pkg/app/piped/executor/analysis/metrics_analyzer.go

View check run for this annotation

Codecov / codecov/patch

pkg/app/piped/executor/analysis/metrics_analyzer.go#L138-L139

Added lines #L138 - L139 were not covered by tests
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)
}
Expand All @@ -154,7 +158,7 @@
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
}

Expand All @@ -171,13 +175,17 @@
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)

Check warning on line 183 in pkg/app/piped/executor/analysis/metrics_analyzer.go

View check run for this annotation

Codecov / codecov/patch

pkg/app/piped/executor/analysis/metrics_analyzer.go#L178-L183

Added lines #L178 - L183 were not covered by tests
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)

Check warning on line 185 in pkg/app/piped/executor/analysis/metrics_analyzer.go

View check run for this annotation

Codecov / codecov/patch

pkg/app/piped/executor/analysis/metrics_analyzer.go#L185

Added line #L185 was not covered by tests
}
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)

Check warning on line 188 in pkg/app/piped/executor/analysis/metrics_analyzer.go

View check run for this annotation

Codecov / codecov/patch

pkg/app/piped/executor/analysis/metrics_analyzer.go#L188

Added line #L188 was not covered by tests
values := make([]float64, 0, pointsCount)
for i := range points {
values = append(values, points[i].Value)
Expand All @@ -199,28 +207,28 @@
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)

Check warning on line 211 in pkg/app/piped/executor/analysis/metrics_analyzer.go

View check run for this annotation

Codecov / codecov/patch

pkg/app/piped/executor/analysis/metrics_analyzer.go#L210-L211

Added lines #L210 - L211 were not covered by tests
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)

Check warning on line 213 in pkg/app/piped/executor/analysis/metrics_analyzer.go

View check run for this annotation

Codecov / codecov/patch

pkg/app/piped/executor/analysis/metrics_analyzer.go#L213

Added line #L213 was not covered by tests
}
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)

Check warning on line 216 in pkg/app/piped/executor/analysis/metrics_analyzer.go

View check run for this annotation

Codecov / codecov/patch

pkg/app/piped/executor/analysis/metrics_analyzer.go#L216

Added line #L216 was not covered by tests
prevValues := make([]float64, 0, prevPointsCount)
for i := range prevPoints {
prevValues = append(prevValues, prevPoints[i].Value)
}
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)

Check warning on line 224 in pkg/app/piped/executor/analysis/metrics_analyzer.go

View check run for this annotation

Codecov / codecov/patch

pkg/app/piped/executor/analysis/metrics_analyzer.go#L224

Added line #L224 was not covered by tests
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)

Check warning on line 231 in pkg/app/piped/executor/analysis/metrics_analyzer.go

View check run for this annotation

Codecov / codecov/patch

pkg/app/piped/executor/analysis/metrics_analyzer.go#L231

Added line #L231 was not covered by tests
a.logPersister.Infof("[%s] Current data points acquired:", a.id)
for i := range points {
a.logPersister.Infof("[%s] %s", a.id, &points[i])
Expand Down
10 changes: 5 additions & 5 deletions tool/piped-base-okd/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.
Expand Down