fix: make docs-generate

fix: error GOMEMLIMIT in doc-generate

fix: docs-generate protobuf

fix: GOMEMLIMIT error log
This commit is contained in:
Michal Klos
2025-07-29 09:49:24 +02:00
parent 5fb672402a
commit d1bd475af0
3 changed files with 23 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ import (
"os/exec"
"path"
"path/filepath"
"runtime"
"strings"
"text/template"
)
@@ -71,6 +72,12 @@ func runIntermediateCode(intermediateCodePath string) {
defaultDataPath := "/var/lib/ocis"
os.Setenv("OCIS_BASE_DATA_PATH", defaultDataPath)
os.Setenv("OCIS_CONFIG_DIR", defaultConfigPath)
// Set AUTOMEMLIMIT_EXPERIMENT=system on non-Linux systems to avoid cgroups errors
if runtime.GOOS != "linux" {
os.Setenv("AUTOMEMLIMIT_EXPERIMENT", "system")
}
out, err := exec.Command("go", "run", intermediateCodePath).CombinedOutput()
if err != nil {
log.Fatal(string(out), err)

View File

@@ -144,6 +144,14 @@ variables:
description: The default directory location for config files. See the General Info
section in the documentation for more details on defaults.
do_ignore: false
- rawname: OCIS_INSECURE
path: ocis-pkg/service/grpc/client.go:77
foundincode: true
name: OCIS_INSECURE
type: ""
default_value: "false"
description: "Insecure TLS mode is only allowed in development environments with OCIS_INSECURE=true"
do_ignore: false
- rawname: RUN_CMD_TEST
path: internal/testenv/test.go:32
foundincode: true

View File

@@ -2,6 +2,8 @@ package shared
import (
"log/slog"
"os"
"runtime"
"github.com/KimMachineGun/automemlimit/memlimit"
)
@@ -9,6 +11,12 @@ import (
// we init the memlimit here to include it for ocis als well as individual service binaries
func init() {
slog.SetLogLoggerLevel(slog.LevelError)
// Enable system memory provider on non-Linux systems to avoid cgroups errors
if runtime.GOOS != "linux" {
os.Setenv("AUTOMEMLIMIT_EXPERIMENT", "system")
}
_, _ = memlimit.SetGoMemLimitWithOpts(
memlimit.WithLogger(slog.Default()),
)