From f9d46fd8a607a928dc0382f308ad577f36b0a8b8 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Mon, 12 Aug 2024 17:08:28 +0400 Subject: [PATCH] fix: add `dns-resolve-cache` to the list of logs gathered See https://github.com/siderolabs/talos/issues/9143 Signed-off-by: Andrey Smirnov --- .github/workflows/ci.yaml | 27 +++++++++++++++++++++++- .golangci.yml | 35 ++++++++++++-------------------- Dockerfile | 25 +++++++++++------------ Makefile | 14 ++++++------- support/collectors/collectors.go | 1 + support/collectors/talos.go | 8 ++++---- 6 files changed, 63 insertions(+), 47 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index adb2901..627e316 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,6 +1,6 @@ # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2024-05-21T13:42:28Z by kres 0290180. +# Generated on 2024-08-12T12:50:05Z by kres 2ab5924. name: default concurrency: @@ -30,6 +30,31 @@ jobs: - generic if: (!startsWith(github.head_ref, 'renovate/') && !startsWith(github.head_ref, 'dependabot/')) steps: + - name: gather-system-info + id: system-info + uses: kenchan0130/actions-system-info@v1.3.0 + continue-on-error: true + - name: print-system-info + run: | + MEMORY_GB=$((${{ steps.system-info.outputs.totalmem }}/1024/1024/1024)) + + OUTPUTS=( + "CPU Core: ${{ steps.system-info.outputs.cpu-core }}" + "CPU Model: ${{ steps.system-info.outputs.cpu-model }}" + "Hostname: ${{ steps.system-info.outputs.hostname }}" + "NodeName: ${NODE_NAME}" + "Kernel release: ${{ steps.system-info.outputs.kernel-release }}" + "Kernel version: ${{ steps.system-info.outputs.kernel-version }}" + "Name: ${{ steps.system-info.outputs.name }}" + "Platform: ${{ steps.system-info.outputs.platform }}" + "Release: ${{ steps.system-info.outputs.release }}" + "Total memory: ${MEMORY_GB} GB" + ) + + for OUTPUT in "${OUTPUTS[@]}";do + echo "${OUTPUT}" + done + continue-on-error: true - name: checkout uses: actions/checkout@v4 - name: Unshallow diff --git a/.golangci.yml b/.golangci.yml index 9114bf6..07fdd0c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,6 @@ # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2024-05-21T13:42:28Z by kres 0290180. +# Generated on 2024-08-12T12:50:05Z by kres 2ab5924. # options for analysis running run: @@ -13,8 +13,8 @@ run: # output configuration options output: formats: - - format: colored-line-number - path: stdout + - format: colored-line-number + path: stdout print-issued-lines: true print-linter-name: true uniq-by-line: true @@ -94,17 +94,21 @@ linters-settings: cyclop: # the maximal code complexity to report max-complexity: 20 - # depguard: - # Main: - # deny: - # - github.com/OpenPeeDeeP/depguard # this is just an example + depguard: + rules: + prevent_unmaintained_packages: + list-mode: lax # allow unless explicitly denied + files: + - $all + deny: + - pkg: io/ioutil + desc: "replaced by io and os packages since Go 1.16: https://tip.golang.org/doc/go1.16#ioutil" linters: enable-all: true disable-all: false fast: false disable: - - exhaustivestruct - exhaustruct - err113 - forbidigo @@ -120,30 +124,17 @@ linters: - mnd - nestif - nonamedreturns - - nosnakecase - paralleltest - tagalign - tagliatelle - thelper - - typecheck - varnamelen - wrapcheck - - depguard # Disabled because starting with golangci-lint 1.53.0 it doesn't allow denylist alone anymore - testifylint # complains about our assert recorder and has a number of false positives for assert.Greater(t, thing, 1) - protogetter # complains about us using Value field on typed spec, instead of GetValue which has a different signature - perfsprint # complains about us using fmt.Sprintf in non-performance critical code, updating just kres took too long - # abandoned linters for which golangci shows the warning that the repo is archived by the owner - - deadcode - - golint - - ifshort - - interfacer - - maligned - - scopelint - - structcheck - - varcheck - # disabled as it seems to be broken - goes into imported libraries and reports issues there - - musttag - goimports # same as gci + - musttag # seems to be broken - goes into imported libraries and reports issues there issues: exclude: [ ] diff --git a/Dockerfile b/Dockerfile index d4f9404..586b683 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -# syntax = docker/dockerfile-upstream:1.7.1-labs +# syntax = docker/dockerfile-upstream:1.9.0-labs # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2024-05-21T13:42:28Z by kres 0290180. +# Generated on 2024-08-12T12:50:05Z by kres 2ab5924. ARG TOOLCHAIN @@ -10,28 +10,27 @@ ARG TOOLCHAIN FROM scratch AS generate # runs markdownlint -FROM docker.io/node:22.2.0-alpine3.19 AS lint-markdown +FROM docker.io/oven/bun:1.1.22-alpine AS lint-markdown WORKDIR /src -RUN npm i -g markdownlint-cli@0.40.0 -RUN npm i sentences-per-line@0.2.1 +RUN bun i markdownlint-cli@0.41.0 sentences-per-line@0.2.1 COPY .markdownlint.json . COPY ./README.md ./README.md -RUN markdownlint --ignore "CHANGELOG.md" --ignore "**/node_modules/**" --ignore '**/hack/chglog/**' --rules node_modules/sentences-per-line/index.js . +RUN bunx markdownlint --ignore "CHANGELOG.md" --ignore "**/node_modules/**" --ignore '**/hack/chglog/**' --rules node_modules/sentences-per-line/index.js . # base toolchain image -FROM ${TOOLCHAIN} AS toolchain +FROM --platform=${BUILDPLATFORM} ${TOOLCHAIN} AS toolchain RUN apk --update --no-cache add bash curl build-base protoc protobuf-dev # build tools FROM --platform=${BUILDPLATFORM} toolchain AS tools -ENV GO111MODULE on +ENV GO111MODULE=on ARG CGO_ENABLED -ENV CGO_ENABLED ${CGO_ENABLED} +ENV CGO_ENABLED=${CGO_ENABLED} ARG GOTOOLCHAIN -ENV GOTOOLCHAIN ${GOTOOLCHAIN} +ENV GOTOOLCHAIN=${GOTOOLCHAIN} ARG GOEXPERIMENT -ENV GOEXPERIMENT ${GOEXPERIMENT} -ENV GOPATH /go +ENV GOEXPERIMENT=${GOEXPERIMENT} +ENV GOPATH=/go ARG DEEPCOPY_VERSION RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg go install github.com/siderolabs/deep-copy@${DEEPCOPY_VERSION} \ && mv /go/bin/deep-copy /bin/deep-copy @@ -63,7 +62,7 @@ RUN FILES="$(gofumpt -l .)" && test -z "${FILES}" || (echo -e "Source code is no FROM base AS lint-golangci-lint WORKDIR /src COPY .golangci.yml . -ENV GOGC 50 +ENV GOGC=50 RUN golangci-lint config verify --config .golangci.yml RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/root/.cache/golangci-lint --mount=type=cache,target=/go/pkg golangci-lint run --config .golangci.yml diff --git a/Makefile b/Makefile index e8a8973..015c7d7 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2024-05-21T13:42:28Z by kres 0290180. +# Generated on 2024-08-12T12:50:05Z by kres 2ab5924. # common variables @@ -17,15 +17,15 @@ WITH_RACE ?= false REGISTRY ?= ghcr.io USERNAME ?= siderolabs REGISTRY_AND_USERNAME ?= $(REGISTRY)/$(USERNAME) -PROTOBUF_GO_VERSION ?= 1.34.1 -GRPC_GO_VERSION ?= 1.3.0 -GRPC_GATEWAY_VERSION ?= 2.20.0 +PROTOBUF_GO_VERSION ?= 1.34.2 +GRPC_GO_VERSION ?= 1.5.1 +GRPC_GATEWAY_VERSION ?= 2.21.0 VTPROTOBUF_VERSION ?= 0.6.0 -GOIMPORTS_VERSION ?= 0.21.0 +GOIMPORTS_VERSION ?= 0.24.0 DEEPCOPY_VERSION ?= v0.5.6 -GOLANGCILINT_VERSION ?= v1.58.2 +GOLANGCILINT_VERSION ?= v1.59.1 GOFUMPT_VERSION ?= v0.6.0 -GO_VERSION ?= 1.22.3 +GO_VERSION ?= 1.22.6 GO_BUILDFLAGS ?= GO_LDFLAGS ?= CGO_ENABLED ?= 0 diff --git a/support/collectors/collectors.go b/support/collectors/collectors.go index 38ad333..5494732 100644 --- a/support/collectors/collectors.go +++ b/support/collectors/collectors.go @@ -129,6 +129,7 @@ func GetTalosNodeCollectors(ctx context.Context, client *client.Client) ([]*Coll base := []*Collector{ NewCollector("dmesg.log", dmesg), NewCollector("controller-runtime.log", logs("controller-runtime", false)), + NewCollector("dns-resolve-cache.log", logs("dns-resolve-cache", false)), NewCollector("dependencies.dot", dependencies), NewCollector("mounts", mounts), NewCollector("devices", devices), diff --git a/support/collectors/talos.go b/support/collectors/talos.go index 814e6f2..af16494 100644 --- a/support/collectors/talos.go +++ b/support/collectors/talos.go @@ -176,11 +176,11 @@ func ioPressure(ctx context.Context, options *bundle.Options) ([]byte, error) { var buf bytes.Buffer w := tabwriter.NewWriter(&buf, 0, 0, 3, ' ', 0) - fmt.Fprintln(w, "NAME\tIO_TIME\tIO_TIME_WEIGHTED\tDISK_WRITE_SECTORS\tDISK_READ_SECTORS") + fmt.Fprintln(w, "NAME\tIO_TIME\tIO_TIME_WEIGHTED\tDISK_WRITE_SECTORS\tDISK_READ_SECTORS") //nolint:errcheck for _, msg := range resp.Messages { for _, stat := range msg.Devices { - fmt.Fprintf(w, "%s\t%d\t%d\t%d\t%d\n", + fmt.Fprintf(w, "%s\t%d\t%d\t%d\t%d\n", //nolint:errcheck stat.Name, stat.IoTimeMs, stat.IoTimeWeightedMs, @@ -208,7 +208,7 @@ func processes(ctx context.Context, options *bundle.Options) ([]byte, error) { var buf bytes.Buffer w := tabwriter.NewWriter(&buf, 0, 0, 3, ' ', 0) - fmt.Fprintln(w, "PID\tSTATE\tTHREADS\tCPU-TIME\tVIRTMEM\tRESMEM\tCOMMAND") + fmt.Fprintln(w, "PID\tSTATE\tTHREADS\tCPU-TIME\tVIRTMEM\tRESMEM\tCOMMAND") //nolint:errcheck for _, msg := range resp.Messages { procs := msg.Processes @@ -225,7 +225,7 @@ func processes(ctx context.Context, options *bundle.Options) ([]byte, error) { args = p.Args } - fmt.Fprintf(w, "%6d\t%1s\t%4d\t%8.2f\t%7s\t%7s\t%s\n", + fmt.Fprintf(w, "%6d\t%1s\t%4d\t%8.2f\t%7s\t%7s\t%s\n", //nolint:errcheck p.Pid, p.State, p.Threads, p.CpuTime, humanize.Bytes(p.VirtualMemory), humanize.Bytes(p.ResidentMemory), args) } }