Skip to content

Commit d1bd475

Browse files
committed
fix: make docs-generate
fix: error GOMEMLIMIT in doc-generate fix: docs-generate protobuf fix: GOMEMLIMIT error log
1 parent 5fb6724 commit d1bd475

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

docs/helpers/configenvextractor.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"os/exec"
88
"path"
99
"path/filepath"
10+
"runtime"
1011
"strings"
1112
"text/template"
1213
)
@@ -71,6 +72,12 @@ func runIntermediateCode(intermediateCodePath string) {
7172
defaultDataPath := "/var/lib/ocis"
7273
os.Setenv("OCIS_BASE_DATA_PATH", defaultDataPath)
7374
os.Setenv("OCIS_CONFIG_DIR", defaultConfigPath)
75+
76+
// Set AUTOMEMLIMIT_EXPERIMENT=system on non-Linux systems to avoid cgroups errors
77+
if runtime.GOOS != "linux" {
78+
os.Setenv("AUTOMEMLIMIT_EXPERIMENT", "system")
79+
}
80+
7481
out, err := exec.Command("go", "run", intermediateCodePath).CombinedOutput()
7582
if err != nil {
7683
log.Fatal(string(out), err)

docs/helpers/extended_vars.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,14 @@ variables:
144144
description: The default directory location for config files. See the General Info
145145
section in the documentation for more details on defaults.
146146
do_ignore: false
147+
- rawname: OCIS_INSECURE
148+
path: ocis-pkg/service/grpc/client.go:77
149+
foundincode: true
150+
name: OCIS_INSECURE
151+
type: ""
152+
default_value: "false"
153+
description: "Insecure TLS mode is only allowed in development environments with OCIS_INSECURE=true"
154+
do_ignore: false
147155
- rawname: RUN_CMD_TEST
148156
path: internal/testenv/test.go:32
149157
foundincode: true

ocis-pkg/shared/memlimit.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@ package shared
22

33
import (
44
"log/slog"
5+
"os"
6+
"runtime"
57

68
"github.com/KimMachineGun/automemlimit/memlimit"
79
)
810

911
// we init the memlimit here to include it for ocis als well as individual service binaries
1012
func init() {
1113
slog.SetLogLoggerLevel(slog.LevelError)
14+
15+
// Enable system memory provider on non-Linux systems to avoid cgroups errors
16+
if runtime.GOOS != "linux" {
17+
os.Setenv("AUTOMEMLIMIT_EXPERIMENT", "system")
18+
}
19+
1220
_, _ = memlimit.SetGoMemLimitWithOpts(
1321
memlimit.WithLogger(slog.Default()),
1422
)

0 commit comments

Comments
 (0)