Skip to content

Commit

Permalink
fix: memory usage when building an installer
Browse files Browse the repository at this point in the history
Pulls in https://ci.dev.talos-systems.io/link/siderolabs/talos/tree/refs/pull/8109/head

Fixes #77

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
  • Loading branch information
smira committed Dec 22, 2023
1 parent a1421e0 commit 0ca3869
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
15 changes: 15 additions & 0 deletions cmd/image-factory/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"log"
"os/signal"

"github.com/siderolabs/go-debug"
"go.uber.org/zap"
"golang.org/x/sys/unix"

Expand All @@ -23,10 +24,24 @@ func main() {
}
}

func runDebugServer(ctx context.Context) {
const debugAddr = ":9981"

debugLogFunc := func(msg string) {
log.Print(msg)
}

if err := debug.ListenAndServe(ctx, debugAddr, debugLogFunc); err != nil {
log.Fatalf("failed to start debug server: %s", err)
}
}

func run() error {
ctx, cancel := signal.NotifyContext(context.Background(), unix.SIGINT, unix.SIGTERM)
defer cancel()

go runDebugServer(ctx)

return runWithContext(ctx)
}

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ require (
github.com/opencontainers/go-digest v1.0.0
github.com/prometheus/client_golang v1.17.0
github.com/siderolabs/gen v0.4.7
github.com/siderolabs/go-debug v0.2.3
github.com/siderolabs/go-pointer v1.0.0
github.com/siderolabs/talos v1.6.0-alpha.2.0.20231222130905-8db3c5b3c63a
github.com/siderolabs/talos v1.6.0-alpha.2.0.20231222150746-265f21be09d6
github.com/siderolabs/talos/pkg/machinery v1.6.0
github.com/sigstore/cosign/v2 v2.2.1
github.com/sigstore/sigstore v1.7.5
Expand Down Expand Up @@ -233,7 +234,6 @@ require (
github.com/siderolabs/go-blockdevice v0.4.7 // indirect
github.com/siderolabs/go-circular v0.1.0 // indirect
github.com/siderolabs/go-cmd v0.1.1 // indirect
github.com/siderolabs/go-debug v0.2.3 // indirect
github.com/siderolabs/go-procfs v0.1.2 // indirect
github.com/siderolabs/go-retry v0.3.3 // indirect
github.com/siderolabs/go-smbios v0.3.2 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -833,8 +833,8 @@ github.com/siderolabs/net v0.4.0 h1:1bOgVay/ijPkJz4qct98nHsiB/ysLQU0KLoBC4qLm7I=
github.com/siderolabs/net v0.4.0/go.mod h1:/ibG+Hm9HU27agp5r9Q3eZicEfjquzNzQNux5uEk0kM=
github.com/siderolabs/protoenc v0.2.1 h1:BqxEmeWQeMpNP3R6WrPqDatX8sM/r4t97OP8mFmg6GA=
github.com/siderolabs/protoenc v0.2.1/go.mod h1:StTHxjet1g11GpNAWiATgc8K0HMKiFSEVVFOa/H0otc=
github.com/siderolabs/talos v1.6.0-alpha.2.0.20231222130905-8db3c5b3c63a h1:t4aZMkv2cfD/UnbAx/zKys48VQmWFO2N5iUqDi3iiRk=
github.com/siderolabs/talos v1.6.0-alpha.2.0.20231222130905-8db3c5b3c63a/go.mod h1:wtusHdO1lESlQkoKsE3mEtuhN3Q2p2xUx7HwjVZgMO8=
github.com/siderolabs/talos v1.6.0-alpha.2.0.20231222150746-265f21be09d6 h1:M/Ml7/EZzL1vja9vt3M0CHdcPNicTQffLoqRnLIJPdQ=
github.com/siderolabs/talos v1.6.0-alpha.2.0.20231222150746-265f21be09d6/go.mod h1:wtusHdO1lESlQkoKsE3mEtuhN3Q2p2xUx7HwjVZgMO8=
github.com/siderolabs/talos/pkg/machinery v1.6.0 h1:wWtiUMyokCQMH2xkHyNsQj2vfGhRUnjBZ9eRI5kXSi4=
github.com/siderolabs/talos/pkg/machinery v1.6.0/go.mod h1:WZ/yDqQLHDfol/gf2qcD2u47+CDX819kEB+RQpAKWAU=
github.com/sigstore/cosign/v2 v2.2.1 h1:HauwPOMYYaVdQsnvUbF0P+ZsVPrkTB0G7Eq65+z1bQc=
Expand Down

0 comments on commit 0ca3869

Please sign in to comment.