mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2025-12-24 14:50:39 -05:00
Compare commits
4 Commits
v3.7.0
...
readtimeou
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2883a6245d | ||
|
|
936a84096e | ||
|
|
6e0bb09aff | ||
|
|
59eb411024 |
@@ -1481,7 +1481,7 @@ def multiServiceE2ePipeline(ctx, watch_fs_enabled = False):
|
||||
}
|
||||
|
||||
if watch_fs_enabled:
|
||||
extra_server_environment["STORAGE_USES_POSIX_WATCH_FS"] = True
|
||||
extra_server_environment["STORAGE_USERS_POSIX_WATCH_FS"] = True
|
||||
|
||||
storage_users_environment = {
|
||||
"OC_CORS_ALLOW_ORIGINS": "%s,https://%s:9201" % (OC_URL, OC_SERVER_NAME),
|
||||
@@ -2073,6 +2073,7 @@ def opencloudServer(storage = "decomposed", accounts_hash_difficulty = 4, depend
|
||||
"WEB_DEBUG_ADDR": "0.0.0.0:9104",
|
||||
"WEBDAV_DEBUG_ADDR": "0.0.0.0:9119",
|
||||
"WEBFINGER_DEBUG_ADDR": "0.0.0.0:9279",
|
||||
"STORAGE_USERS_POSIX_SCAN_DEBOUNCE_DELAY": 0,
|
||||
}
|
||||
|
||||
if storage == "posix":
|
||||
@@ -2110,7 +2111,7 @@ def opencloudServer(storage = "decomposed", accounts_hash_difficulty = 4, depend
|
||||
environment["SEARCH_EXTRACTOR_CS3SOURCE_INSECURE"] = True
|
||||
|
||||
if watch_fs_enabled:
|
||||
environment["STORAGE_USES_POSIX_WATCH_FS"] = True
|
||||
environment["STORAGE_USERS_POSIX_WATCH_FS"] = True
|
||||
|
||||
# Pass in "default" accounts_hash_difficulty to not set this environment variable.
|
||||
# That will allow OpenCloud to use whatever its built-in default is.
|
||||
|
||||
3
go.mod
3
go.mod
@@ -60,7 +60,7 @@ require (
|
||||
github.com/oklog/run v1.2.0
|
||||
github.com/olekukonko/tablewriter v1.1.0
|
||||
github.com/onsi/ginkgo v1.16.5
|
||||
github.com/onsi/ginkgo/v2 v2.27.1
|
||||
github.com/onsi/ginkgo/v2 v2.27.2
|
||||
github.com/onsi/gomega v1.38.2
|
||||
github.com/open-policy-agent/opa v1.9.0
|
||||
github.com/opencloud-eu/icap-client v0.0.0-20250930132611-28a2afe62d89
|
||||
@@ -371,7 +371,6 @@ require (
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.38.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.38.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v1.7.1 // indirect
|
||||
go.uber.org/automaxprocs v1.6.0 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
go.uber.org/zap v1.27.0 // indirect
|
||||
go.yaml.in/yaml/v2 v2.4.2 // indirect
|
||||
|
||||
8
go.sum
8
go.sum
@@ -933,8 +933,8 @@ github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W
|
||||
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
|
||||
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
|
||||
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
|
||||
github.com/onsi/ginkgo/v2 v2.27.1 h1:0LJC8MpUSQnfnp4n/3W3GdlmJP3ENGF0ZPzjQGLPP7s=
|
||||
github.com/onsi/ginkgo/v2 v2.27.1/go.mod h1:wmy3vCqiBjirARfVhAqFpYt8uvX0yaFe+GudAqqcCqA=
|
||||
github.com/onsi/ginkgo/v2 v2.27.2 h1:LzwLj0b89qtIy6SSASkzlNvX6WktqurSHwkk2ipF/Ns=
|
||||
github.com/onsi/ginkgo/v2 v2.27.2/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo=
|
||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
|
||||
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
|
||||
@@ -1001,8 +1001,6 @@ github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:Om
|
||||
github.com/pquerna/cachecontrol v0.2.0 h1:vBXSNuE5MYP9IJ5kjsdo8uq+w41jSPgvba2DEnkRx9k=
|
||||
github.com/pquerna/cachecontrol v0.2.0/go.mod h1:NrUG3Z7Rdu85UNR3vm7SOsl1nFIeSiQnrHV5K9mBcUI=
|
||||
github.com/pquerna/otp v1.3.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg=
|
||||
github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
|
||||
github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U=
|
||||
github.com/prometheus/alertmanager v0.28.1 h1:BK5pCoAtaKg01BYRUJhEDV1tqJMEtYBGzPw8QdvnnvA=
|
||||
github.com/prometheus/alertmanager v0.28.1/go.mod h1:0StpPUDDHi1VXeM7p2yYfeZgLVi/PPlt39vo9LQUHxM=
|
||||
github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||
@@ -1308,8 +1306,6 @@ go.opentelemetry.io/proto/otlp v1.7.1/go.mod h1:b2rVh6rfI/s2pHWNlB7ILJcRALpcNDzK
|
||||
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
||||
go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs=
|
||||
go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8=
|
||||
go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
|
||||
@@ -62,13 +62,14 @@ type Runtime struct {
|
||||
type Config struct {
|
||||
*shared.Commons `yaml:"shared"`
|
||||
|
||||
Tracing *shared.Tracing `yaml:"tracing"`
|
||||
Log *shared.Log `yaml:"log"`
|
||||
Cache *shared.Cache `yaml:"cache"`
|
||||
GRPCClientTLS *shared.GRPCClientTLS `yaml:"grpc_client_tls"`
|
||||
GRPCServiceTLS *shared.GRPCServiceTLS `yaml:"grpc_service_tls"`
|
||||
HTTPServiceTLS shared.HTTPServiceTLS `yaml:"http_service_tls"`
|
||||
Reva *shared.Reva `yaml:"reva"`
|
||||
Tracing *shared.Tracing `yaml:"tracing"`
|
||||
Log *shared.Log `yaml:"log"`
|
||||
Cache *shared.Cache `yaml:"cache"`
|
||||
GRPCClientTLS *shared.GRPCClientTLS `yaml:"grpc_client_tls"`
|
||||
GRPCServiceTLS *shared.GRPCServiceTLS `yaml:"grpc_service_tls"`
|
||||
HTTPServiceTLS shared.HTTPServiceTLS `yaml:"http_service_tls"`
|
||||
HTTPServiceTimeout shared.HTTPServiceTimeout `yaml:"http_service_timeout"`
|
||||
Reva *shared.Reva `yaml:"reva"`
|
||||
|
||||
Mode Mode // DEPRECATED
|
||||
File string
|
||||
|
||||
@@ -2,6 +2,7 @@ package parser
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/opencloud-eu/opencloud/pkg/config"
|
||||
"github.com/opencloud-eu/opencloud/pkg/config/envdecode"
|
||||
@@ -61,6 +62,8 @@ func EnsureDefaults(cfg *config.Config) {
|
||||
if cfg.Reva == nil {
|
||||
cfg.Reva = &shared.Reva{}
|
||||
}
|
||||
|
||||
cfg.HTTPServiceTimeout.Read = 60 * time.Second
|
||||
}
|
||||
|
||||
// EnsureCommons copies applicable parts of the OpenCloud config into the commons part
|
||||
@@ -83,6 +86,7 @@ func EnsureCommons(cfg *config.Config) {
|
||||
}
|
||||
|
||||
cfg.Commons.HTTPServiceTLS = cfg.HTTPServiceTLS
|
||||
cfg.Commons.HTTPServiceTimeout = cfg.HTTPServiceTimeout
|
||||
|
||||
cfg.Commons.TokenManager = structs.CopyOrZeroValue(cfg.TokenManager)
|
||||
|
||||
|
||||
@@ -4,10 +4,11 @@ import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"github.com/opencloud-eu/opencloud/pkg/log"
|
||||
"github.com/opencloud-eu/opencloud/pkg/shared"
|
||||
"github.com/urfave/cli/v2"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
|
||||
"github.com/opencloud-eu/opencloud/pkg/log"
|
||||
"github.com/opencloud-eu/opencloud/pkg/shared"
|
||||
)
|
||||
|
||||
// Option defines a single option function.
|
||||
@@ -17,6 +18,7 @@ type Option func(o *Options)
|
||||
type Options struct {
|
||||
Logger log.Logger
|
||||
TLSConfig shared.HTTPServiceTLS
|
||||
TimeoutConfig shared.HTTPServiceTimeout
|
||||
Namespace string
|
||||
Name string
|
||||
Version string
|
||||
@@ -96,6 +98,13 @@ func TLSConfig(config shared.HTTPServiceTLS) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// TimeoutConfig provides a function to set the TimeOutConfig option.
|
||||
func TimeoutConfig(config shared.HTTPServiceTimeout) Option {
|
||||
return func(o *Options) {
|
||||
o.TimeoutConfig = config
|
||||
}
|
||||
}
|
||||
|
||||
// TraceProvider provides a function to set the TraceProvider option.
|
||||
func TraceProvider(tp trace.TracerProvider) Option {
|
||||
return func(o *Options) {
|
||||
|
||||
@@ -3,16 +3,18 @@ package http
|
||||
import (
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"net"
|
||||
"strings"
|
||||
|
||||
"github.com/opencloud-eu/opencloud/pkg/broker"
|
||||
"github.com/opencloud-eu/opencloud/pkg/registry"
|
||||
netx "github.com/opencloud-eu/opencloud/pkg/x/net"
|
||||
|
||||
mhttps "github.com/go-micro/plugins/v4/server/http"
|
||||
mtracer "github.com/go-micro/plugins/v4/wrapper/trace/opentelemetry"
|
||||
occrypto "github.com/opencloud-eu/opencloud/pkg/crypto"
|
||||
"go-micro.dev/v4"
|
||||
"go-micro.dev/v4/server"
|
||||
|
||||
occrypto "github.com/opencloud-eu/opencloud/pkg/crypto"
|
||||
)
|
||||
|
||||
// Service simply wraps the go-micro web service.
|
||||
@@ -24,7 +26,9 @@ type Service struct {
|
||||
func NewService(opts ...Option) (Service, error) {
|
||||
noopBroker := broker.NoOp{}
|
||||
sopts := newOptions(opts...)
|
||||
var mServer server.Server
|
||||
|
||||
var listener net.Listener
|
||||
var err error
|
||||
if sopts.TLSConfig.Enabled {
|
||||
var cert tls.Certificate
|
||||
var err error
|
||||
@@ -50,11 +54,27 @@ func NewService(opts ...Option) (Service, error) {
|
||||
tlsConfig := &tls.Config{
|
||||
Certificates: []tls.Certificate{cert},
|
||||
}
|
||||
mServer = mhttps.NewServer(server.TLSConfig(tlsConfig))
|
||||
// Create TLS listener
|
||||
listener, err = tls.Listen("tcp", sopts.Address, tlsConfig)
|
||||
if err != nil {
|
||||
return Service{}, fmt.Errorf("error starting TLS listener: %w", err)
|
||||
}
|
||||
} else {
|
||||
mServer = mhttps.NewServer()
|
||||
// Create Non-TLS listener
|
||||
listener, err = net.Listen("tcp", sopts.Address)
|
||||
if err != nil {
|
||||
return Service{}, fmt.Errorf("error starting TCP listener: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
mServer := mhttps.NewServer(
|
||||
// Wrap listener with timeoutListener to set a read timeout
|
||||
mhttps.Listener(netx.TimeoutListener{
|
||||
Listener: listener,
|
||||
ReadTimeout: sopts.TimeoutConfig.Read,
|
||||
}),
|
||||
)
|
||||
|
||||
wopts := []micro.Option{
|
||||
micro.Server(mServer),
|
||||
micro.Broker(noopBroker),
|
||||
|
||||
@@ -55,6 +55,10 @@ type HTTPServiceTLS struct {
|
||||
Key string `yaml:"key" env:"OC_HTTP_TLS_KEY" desc:"Path/File name for the TLS certificate key (in PEM format) for the server certificate to use for the http services." introductionVersion:"1.0.0"`
|
||||
}
|
||||
|
||||
type HTTPServiceTimeout struct {
|
||||
Read time.Duration `yaml:"duration" env:"OC_HTTP_TIMEOUT_READ" desc:"The duration after which a read operation will time out." introductionVersion:"%%NEXT%%"`
|
||||
}
|
||||
|
||||
type Cache struct {
|
||||
Store string `yaml:"store" env:"OC_CACHE_STORE" desc:"The type of the cache store. Supported values are: 'memory', 'redis-sentinel', 'nats-js-kv', 'noop'. See the text description for details." introductionVersion:"1.0.0"`
|
||||
Nodes []string `yaml:"nodes" env:"OC_CACHE_STORE_NODES" desc:"A comma separated list of nodes to access the configured store. This has no effect when 'memory' store is configured. Note that the behaviour how nodes are used is dependent on the library of the configured store." introductionVersion:"1.0.0"`
|
||||
@@ -69,21 +73,22 @@ type Cache struct {
|
||||
// Commons holds configuration that are common to all extensions. Each extension can then decide whether
|
||||
// to overwrite its values.
|
||||
type Commons struct {
|
||||
Log *Log `yaml:"log"`
|
||||
Tracing *Tracing `yaml:"tracing"`
|
||||
Cache *Cache `yaml:"cache"`
|
||||
GRPCClientTLS *GRPCClientTLS `yaml:"grpc_client_tls"`
|
||||
GRPCServiceTLS *GRPCServiceTLS `yaml:"grpc_service_tls"`
|
||||
HTTPServiceTLS HTTPServiceTLS `yaml:"http_service_tls"`
|
||||
OpenCloudURL string `yaml:"opencloud_url" env:"OC_URL" desc:"URL, where OpenCloud is reachable for users." introductionVersion:"1.0.0"`
|
||||
TokenManager *TokenManager `mask:"struct" yaml:"token_manager"`
|
||||
Reva *Reva `yaml:"reva"`
|
||||
MachineAuthAPIKey string `mask:"password" yaml:"machine_auth_api_key" env:"OC_MACHINE_AUTH_API_KEY" desc:"Machine auth API key used to validate internal requests necessary for the access to resources from other services." introductionVersion:"1.0.0"`
|
||||
TransferSecret string `mask:"password" yaml:"transfer_secret,omitempty" env:"REVA_TRANSFER_SECRET" desc:"The secret used for signing the requests towards the data gateway for up- and downloads." introductionVersion:"1.0.0"`
|
||||
SystemUserID string `yaml:"system_user_id" env:"OC_SYSTEM_USER_ID" desc:"ID of the OpenCloud storage-system system user. Admins need to set the ID for the storage-system system user in this config option which is then used to reference the user. Any reasonable long string is possible, preferably this would be an UUIDv4 format." introductionVersion:"1.0.0"`
|
||||
SystemUserAPIKey string `mask:"password" yaml:"system_user_api_key" env:"SYSTEM_USER_API_KEY" desc:"API key for all system users." introductionVersion:"1.0.0"`
|
||||
AdminUserID string `yaml:"admin_user_id" env:"OC_ADMIN_USER_ID" desc:"ID of a user, that should receive admin privileges. Consider that the UUID can be encoded in some LDAP deployment configurations like in .ldif files. These need to be decoded beforehand." introductionVersion:"1.0.0"`
|
||||
MultiTenantEnabled bool `yaml:"multi_tenant_enabled" env:"OC_MULTI_TENANT_ENABLED" desc:"Set this to true to enable multi-tenant support." introductionVersion:"%%NEXT%%"`
|
||||
Log *Log `yaml:"log"`
|
||||
Tracing *Tracing `yaml:"tracing"`
|
||||
Cache *Cache `yaml:"cache"`
|
||||
GRPCClientTLS *GRPCClientTLS `yaml:"grpc_client_tls"`
|
||||
GRPCServiceTLS *GRPCServiceTLS `yaml:"grpc_service_tls"`
|
||||
HTTPServiceTLS HTTPServiceTLS `yaml:"http_service_tls"`
|
||||
HTTPServiceTimeout HTTPServiceTimeout `yaml:"http_service_timeout"`
|
||||
OpenCloudURL string `yaml:"opencloud_url" env:"OC_URL" desc:"URL, where OpenCloud is reachable for users." introductionVersion:"1.0.0"`
|
||||
TokenManager *TokenManager `mask:"struct" yaml:"token_manager"`
|
||||
Reva *Reva `yaml:"reva"`
|
||||
MachineAuthAPIKey string `mask:"password" yaml:"machine_auth_api_key" env:"OC_MACHINE_AUTH_API_KEY" desc:"Machine auth API key used to validate internal requests necessary for the access to resources from other services." introductionVersion:"1.0.0"`
|
||||
TransferSecret string `mask:"password" yaml:"transfer_secret,omitempty" env:"REVA_TRANSFER_SECRET" desc:"The secret used for signing the requests towards the data gateway for up- and downloads." introductionVersion:"1.0.0"`
|
||||
SystemUserID string `yaml:"system_user_id" env:"OC_SYSTEM_USER_ID" desc:"ID of the OpenCloud storage-system system user. Admins need to set the ID for the storage-system system user in this config option which is then used to reference the user. Any reasonable long string is possible, preferably this would be an UUIDv4 format." introductionVersion:"1.0.0"`
|
||||
SystemUserAPIKey string `mask:"password" yaml:"system_user_api_key" env:"SYSTEM_USER_API_KEY" desc:"API key for all system users." introductionVersion:"1.0.0"`
|
||||
AdminUserID string `yaml:"admin_user_id" env:"OC_ADMIN_USER_ID" desc:"ID of a user, that should receive admin privileges. Consider that the UUID can be encoded in some LDAP deployment configurations like in .ldif files. These need to be decoded beforehand." introductionVersion:"1.0.0"`
|
||||
MultiTenantEnabled bool `yaml:"multi_tenant_enabled" env:"OC_MULTI_TENANT_ENABLED" desc:"Set this to true to enable multi-tenant support." introductionVersion:"%%NEXT%%"`
|
||||
|
||||
// NOTE: you will not fing GRPCMaxReceivedMessageSize size being used in the code. The envvar is actually extracted in revas `pool` package: https://github.com/cs3org/reva/blob/edge/pkg/rgrpc/todo/pool/connection.go
|
||||
// It is mentioned here again so it is documented
|
||||
|
||||
47
pkg/x/net/listener.go
Normal file
47
pkg/x/net/listener.go
Normal file
@@ -0,0 +1,47 @@
|
||||
package net
|
||||
|
||||
import (
|
||||
"io"
|
||||
gonet "net"
|
||||
"time"
|
||||
)
|
||||
|
||||
type TimeoutListener struct {
|
||||
gonet.Listener
|
||||
ReadTimeout time.Duration
|
||||
}
|
||||
|
||||
func (l TimeoutListener) Accept() (gonet.Conn, error) {
|
||||
c, err := l.Listener.Accept()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &TimeoutConn{Conn: c, readTimeout: l.ReadTimeout}, nil
|
||||
}
|
||||
|
||||
type TimeoutConn struct {
|
||||
gonet.Conn
|
||||
readTimeout time.Duration
|
||||
bodyDone bool
|
||||
}
|
||||
|
||||
// Read implements a read with a sliding timeout window.
|
||||
func (c *TimeoutConn) Read(b []byte) (int, error) {
|
||||
if c.readTimeout > 0 && !c.bodyDone {
|
||||
if err := c.SetReadDeadline(time.Now().Add(c.readTimeout)); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
}
|
||||
|
||||
n, err := c.Conn.Read(b)
|
||||
if n > 0 && c.readTimeout > 0 && !c.bodyDone {
|
||||
// reset deadline after every successful read
|
||||
_ = c.SetReadDeadline(time.Now().Add(c.readTimeout))
|
||||
}
|
||||
|
||||
if err == io.EOF {
|
||||
c.bodyDone = true
|
||||
}
|
||||
return n, err
|
||||
}
|
||||
@@ -4,11 +4,12 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go-micro.dev/v4"
|
||||
|
||||
pkgcrypto "github.com/opencloud-eu/opencloud/pkg/crypto"
|
||||
"github.com/opencloud-eu/opencloud/pkg/service/http"
|
||||
"github.com/opencloud-eu/opencloud/pkg/shared"
|
||||
"github.com/opencloud-eu/opencloud/pkg/version"
|
||||
"go-micro.dev/v4"
|
||||
)
|
||||
|
||||
// Server initializes the http service and server.
|
||||
@@ -40,6 +41,7 @@ func Server(opts ...Option) (http.Service, error) {
|
||||
Cert: options.Config.HTTP.TLSCert,
|
||||
Key: options.Config.HTTP.TLSKey,
|
||||
}),
|
||||
http.TimeoutConfig(options.Config.Commons.HTTPServiceTimeout),
|
||||
http.Logger(options.Logger),
|
||||
http.Address(options.Config.HTTP.Addr),
|
||||
http.Namespace(options.Config.HTTP.Namespace),
|
||||
|
||||
@@ -743,6 +743,10 @@ class CliContext implements Context {
|
||||
* @return void
|
||||
*/
|
||||
public function theAdministratorRenamesFile(string $user, string $file, string $newName): void {
|
||||
// this downloads the file using WebDAV and by that checks if it's still in
|
||||
// postprocessing. So its effectively a check for finished postprocessing
|
||||
$this->featureContext->userDownloadsFileUsingTheAPI($user, $file);
|
||||
|
||||
$userUuid = $this->featureContext->getAttributeOfCreatedUser($user, 'id');
|
||||
$storagePath = $this->getUsersStoragePath();
|
||||
|
||||
@@ -767,6 +771,10 @@ class CliContext implements Context {
|
||||
* @return void
|
||||
*/
|
||||
public function theAdministratorMovesFileToFolder(string $user, string $file, string $folder): void {
|
||||
// this downloads the file using WebDAV and by that checks if it's still in
|
||||
// postprocessing. So its effectively a check for finished postprocessing
|
||||
$this->featureContext->userDownloadsFileUsingTheAPI($user, $file);
|
||||
|
||||
$userUuid = $this->featureContext->getAttributeOfCreatedUser($user, 'id');
|
||||
$storagePath = $this->getUsersStoragePath();
|
||||
|
||||
|
||||
9
vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md
generated
vendored
9
vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md
generated
vendored
@@ -1,3 +1,12 @@
|
||||
## 2.27.2
|
||||
|
||||
### Fixes
|
||||
- inline automaxprocs to simplify dependencies; this will be removed when Go 1.26 comes out [a69113a]
|
||||
|
||||
### Maintenance
|
||||
- Fix syntax errors and typo [a99c6e0]
|
||||
- Fix paragraph position error [f993df5]
|
||||
|
||||
## 2.27.1
|
||||
|
||||
### Fixes
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
_ "go.uber.org/automaxprocs"
|
||||
_ "github.com/onsi/ginkgo/v2/ginkgo/automaxprocs"
|
||||
)
|
||||
3
vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/README.md
generated
vendored
Normal file
3
vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/README.md
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
This entire directory is a lightly modified clone of https://github.com/uber-go/automaxprocs
|
||||
|
||||
It will be removed when Go 1.26 ships and we no longer need to support Go 1.24 (which does not correctly autodetect maxprocs in containers).
|
||||
71
vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/automaxprocs.go
generated
vendored
Normal file
71
vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/automaxprocs.go
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
// Copyright (c) 2017 Uber Technologies, Inc.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
// Package maxprocs lets Go programs easily configure runtime.GOMAXPROCS to
|
||||
// match the configured Linux CPU quota. Unlike the top-level automaxprocs
|
||||
// package, it lets the caller configure logging and handle errors.
|
||||
package automaxprocs
|
||||
|
||||
import (
|
||||
"os"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
func init() {
|
||||
Set()
|
||||
}
|
||||
|
||||
const _maxProcsKey = "GOMAXPROCS"
|
||||
|
||||
type config struct {
|
||||
procs func(int, func(v float64) int) (int, CPUQuotaStatus, error)
|
||||
minGOMAXPROCS int
|
||||
roundQuotaFunc func(v float64) int
|
||||
}
|
||||
|
||||
// Set GOMAXPROCS to match the Linux container CPU quota (if any), returning
|
||||
// any error encountered and an undo function.
|
||||
//
|
||||
// Set is a no-op on non-Linux systems and in Linux environments without a
|
||||
// configured CPU quota.
|
||||
func Set() error {
|
||||
cfg := &config{
|
||||
procs: CPUQuotaToGOMAXPROCS,
|
||||
roundQuotaFunc: DefaultRoundFunc,
|
||||
minGOMAXPROCS: 1,
|
||||
}
|
||||
|
||||
// Honor the GOMAXPROCS environment variable if present. Otherwise, amend
|
||||
// `runtime.GOMAXPROCS()` with the current process' CPU quota if the OS is
|
||||
// Linux, and guarantee a minimum value of 1. The minimum guaranteed value
|
||||
// can be overridden using `maxprocs.Min()`.
|
||||
if _, exists := os.LookupEnv(_maxProcsKey); exists {
|
||||
return nil
|
||||
}
|
||||
maxProcs, status, err := cfg.procs(cfg.minGOMAXPROCS, cfg.roundQuotaFunc)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if status == CPUQuotaUndefined {
|
||||
return nil
|
||||
}
|
||||
runtime.GOMAXPROCS(maxProcs)
|
||||
return nil
|
||||
}
|
||||
@@ -21,7 +21,7 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
|
||||
package cgroups
|
||||
package automaxprocs
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
@@ -21,7 +21,7 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
|
||||
package cgroups
|
||||
package automaxprocs
|
||||
|
||||
const (
|
||||
// _cgroupFSType is the Linux CGroup file system type used in
|
||||
@@ -21,7 +21,7 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
|
||||
package cgroups
|
||||
package automaxprocs
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
@@ -21,12 +21,10 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
|
||||
package runtime
|
||||
package automaxprocs
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
cg "go.uber.org/automaxprocs/internal/cgroups"
|
||||
)
|
||||
|
||||
// CPUQuotaToGOMAXPROCS converts the CPU quota applied to the calling process
|
||||
@@ -58,8 +56,8 @@ type queryer interface {
|
||||
}
|
||||
|
||||
var (
|
||||
_newCgroups2 = cg.NewCGroups2ForCurrentProcess
|
||||
_newCgroups = cg.NewCGroupsForCurrentProcess
|
||||
_newCgroups2 = NewCGroups2ForCurrentProcess
|
||||
_newCgroups = NewCGroupsForCurrentProcess
|
||||
_newQueryer = newQueryer
|
||||
)
|
||||
|
||||
@@ -68,7 +66,7 @@ func newQueryer() (queryer, error) {
|
||||
if err == nil {
|
||||
return cgroups, nil
|
||||
}
|
||||
if errors.Is(err, cg.ErrNotV2) {
|
||||
if errors.Is(err, ErrNotV2) {
|
||||
return _newCgroups()
|
||||
}
|
||||
return nil, err
|
||||
@@ -21,7 +21,7 @@
|
||||
//go:build !linux
|
||||
// +build !linux
|
||||
|
||||
package runtime
|
||||
package automaxprocs
|
||||
|
||||
// CPUQuotaToGOMAXPROCS converts the CPU quota applied to the calling process
|
||||
// to a valid GOMAXPROCS value. This is Linux-specific and not supported in the
|
||||
@@ -21,7 +21,7 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
|
||||
package cgroups
|
||||
package automaxprocs
|
||||
|
||||
import "fmt"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
|
||||
package cgroups
|
||||
package automaxprocs
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
@@ -18,7 +18,7 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
package runtime
|
||||
package automaxprocs
|
||||
|
||||
import "math"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
|
||||
package cgroups
|
||||
package automaxprocs
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
2
vendor/github.com/onsi/ginkgo/v2/types/version.go
generated
vendored
2
vendor/github.com/onsi/ginkgo/v2/types/version.go
generated
vendored
@@ -1,3 +1,3 @@
|
||||
package types
|
||||
|
||||
const VERSION = "2.27.1"
|
||||
const VERSION = "2.27.2"
|
||||
|
||||
14
vendor/go.uber.org/automaxprocs/.codecov.yml
generated
vendored
14
vendor/go.uber.org/automaxprocs/.codecov.yml
generated
vendored
@@ -1,14 +0,0 @@
|
||||
coverage:
|
||||
range: 80..100
|
||||
round: down
|
||||
precision: 2
|
||||
|
||||
status:
|
||||
project: # measuring the overall project coverage
|
||||
default: # context, you can create multiple ones with custom titles
|
||||
enabled: yes # must be yes|true to enable this status
|
||||
target: 90% # specify the target coverage for each commit status
|
||||
# option: "auto" (must increase from parent commit or pull request base)
|
||||
# option: "X%" a static target percentage to hit
|
||||
if_not_found: success # if parent is not found report status as success, error, or failure
|
||||
if_ci_failed: error # if ci fails report status as success, error, or failure
|
||||
33
vendor/go.uber.org/automaxprocs/.gitignore
generated
vendored
33
vendor/go.uber.org/automaxprocs/.gitignore
generated
vendored
@@ -1,33 +0,0 @@
|
||||
# Compiled Object files, Static and Dynamic libs (Shared Objects)
|
||||
*.o
|
||||
*.a
|
||||
*.so
|
||||
|
||||
# Folders
|
||||
_obj
|
||||
_test
|
||||
vendor
|
||||
|
||||
# Architecture specific extensions/prefixes
|
||||
*.[568vq]
|
||||
[568vq].out
|
||||
|
||||
*.cgo1.go
|
||||
*.cgo2.c
|
||||
_cgo_defun.c
|
||||
_cgo_gotypes.go
|
||||
_cgo_export.*
|
||||
|
||||
_testmain.go
|
||||
|
||||
*.exe
|
||||
*.test
|
||||
*.prof
|
||||
*.pprof
|
||||
*.out
|
||||
*.log
|
||||
coverage.txt
|
||||
|
||||
/bin
|
||||
cover.out
|
||||
cover.html
|
||||
52
vendor/go.uber.org/automaxprocs/CHANGELOG.md
generated
vendored
52
vendor/go.uber.org/automaxprocs/CHANGELOG.md
generated
vendored
@@ -1,52 +0,0 @@
|
||||
# Changelog
|
||||
|
||||
## v1.6.0 (2024-07-24)
|
||||
|
||||
- Add RoundQuotaFunc option that allows configuration of rounding
|
||||
behavior for floating point CPU quota.
|
||||
|
||||
## v1.5.3 (2023-07-19)
|
||||
|
||||
- Fix mountinfo parsing when super options have fields with spaces.
|
||||
- Fix division by zero while parsing cgroups.
|
||||
|
||||
## v1.5.2 (2023-03-16)
|
||||
|
||||
- Support child control cgroups
|
||||
- Fix file descriptor leak
|
||||
- Update dependencies
|
||||
|
||||
## v1.5.1 (2022-04-06)
|
||||
|
||||
- Fix cgroups v2 mountpoint detection.
|
||||
|
||||
## v1.5.0 (2022-04-05)
|
||||
|
||||
- Add support for cgroups v2.
|
||||
|
||||
Thanks to @emadolsky for their contribution to this release.
|
||||
|
||||
## v1.4.0 (2021-02-01)
|
||||
|
||||
- Support colons in cgroup names.
|
||||
- Remove linters from runtime dependencies.
|
||||
|
||||
## v1.3.0 (2020-01-23)
|
||||
|
||||
- Migrate to Go modules.
|
||||
|
||||
## v1.2.0 (2018-02-22)
|
||||
|
||||
- Fixed quota clamping to always round down rather than up; Rather than
|
||||
guaranteeing constant throttling at saturation, instead assume that the
|
||||
fractional CPU was added as a hedge for factors outside of Go's scheduler.
|
||||
|
||||
## v1.1.0 (2017-11-10)
|
||||
|
||||
- Log the new value of `GOMAXPROCS` rather than the current value.
|
||||
- Make logs more explicit about whether `GOMAXPROCS` was modified or not.
|
||||
- Allow customization of the minimum `GOMAXPROCS`, and modify default from 2 to 1.
|
||||
|
||||
## v1.0.0 (2017-08-09)
|
||||
|
||||
- Initial release.
|
||||
75
vendor/go.uber.org/automaxprocs/CODE_OF_CONDUCT.md
generated
vendored
75
vendor/go.uber.org/automaxprocs/CODE_OF_CONDUCT.md
generated
vendored
@@ -1,75 +0,0 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age,
|
||||
body size, disability, ethnicity, gender identity and expression, level of
|
||||
experience, nationality, personal appearance, race, religion, or sexual
|
||||
identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an
|
||||
appointed representative at an online or offline event. Representation of a
|
||||
project may be further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at oss-conduct@uber.com. The project
|
||||
team will review and investigate all complaints, and will respond in a way
|
||||
that it deems appropriate to the circumstances. The project team is obligated
|
||||
to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 1.4, available at
|
||||
[http://contributor-covenant.org/version/1/4][version].
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
81
vendor/go.uber.org/automaxprocs/CONTRIBUTING.md
generated
vendored
81
vendor/go.uber.org/automaxprocs/CONTRIBUTING.md
generated
vendored
@@ -1,81 +0,0 @@
|
||||
# Contributing
|
||||
|
||||
We'd love your help improving this package!
|
||||
|
||||
If you'd like to add new exported APIs, please [open an issue][open-issue]
|
||||
describing your proposal — discussing API changes ahead of time makes
|
||||
pull request review much smoother. In your issue, pull request, and any other
|
||||
communications, please remember to treat your fellow contributors with
|
||||
respect! We take our [code of conduct](CODE_OF_CONDUCT.md) seriously.
|
||||
|
||||
Note that you'll need to sign [Uber's Contributor License Agreement][cla]
|
||||
before we can accept any of your contributions. If necessary, a bot will remind
|
||||
you to accept the CLA when you open your pull request.
|
||||
|
||||
## Setup
|
||||
|
||||
[Fork][fork], then clone the repository:
|
||||
|
||||
```
|
||||
mkdir -p $GOPATH/src/go.uber.org
|
||||
cd $GOPATH/src/go.uber.org
|
||||
git clone git@github.com:your_github_username/automaxprocs.git
|
||||
cd automaxprocs
|
||||
git remote add upstream https://github.com/uber-go/automaxprocs.git
|
||||
git fetch upstream
|
||||
```
|
||||
|
||||
Install the test dependencies:
|
||||
|
||||
```
|
||||
make dependencies
|
||||
```
|
||||
|
||||
Make sure that the tests and the linters pass:
|
||||
|
||||
```
|
||||
make test
|
||||
make lint
|
||||
```
|
||||
|
||||
If you're not using the minor version of Go specified in the Makefile's
|
||||
`LINTABLE_MINOR_VERSIONS` variable, `make lint` doesn't do anything. This is
|
||||
fine, but it means that you'll only discover lint failures after you open your
|
||||
pull request.
|
||||
|
||||
## Making Changes
|
||||
|
||||
Start by creating a new branch for your changes:
|
||||
|
||||
```
|
||||
cd $GOPATH/src/go.uber.org/automaxprocs
|
||||
git checkout master
|
||||
git fetch upstream
|
||||
git rebase upstream/master
|
||||
git checkout -b cool_new_feature
|
||||
```
|
||||
|
||||
Make your changes, then ensure that `make lint` and `make test` still pass. If
|
||||
you're satisfied with your changes, push them to your fork.
|
||||
|
||||
```
|
||||
git push origin cool_new_feature
|
||||
```
|
||||
|
||||
Then use the GitHub UI to open a pull request.
|
||||
|
||||
At this point, you're waiting on us to review your changes. We *try* to respond
|
||||
to issues and pull requests within a few business days, and we may suggest some
|
||||
improvements or alternatives. Once your changes are approved, one of the
|
||||
project maintainers will merge them.
|
||||
|
||||
We're much more likely to approve your changes if you:
|
||||
|
||||
* Add tests for new functionality.
|
||||
* Write a [good commit message][commit-message].
|
||||
* Maintain backward compatibility.
|
||||
|
||||
[fork]: https://github.com/uber-go/automaxprocs/fork
|
||||
[open-issue]: https://github.com/uber-go/automaxprocs/issues/new
|
||||
[cla]: https://cla-assistant.io/uber-go/automaxprocs
|
||||
[commit-message]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
||||
19
vendor/go.uber.org/automaxprocs/LICENSE
generated
vendored
19
vendor/go.uber.org/automaxprocs/LICENSE
generated
vendored
@@ -1,19 +0,0 @@
|
||||
Copyright (c) 2017 Uber Technologies, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
46
vendor/go.uber.org/automaxprocs/Makefile
generated
vendored
46
vendor/go.uber.org/automaxprocs/Makefile
generated
vendored
@@ -1,46 +0,0 @@
|
||||
export GOBIN ?= $(shell pwd)/bin
|
||||
|
||||
GO_FILES := $(shell \
|
||||
find . '(' -path '*/.*' -o -path './vendor' ')' -prune \
|
||||
-o -name '*.go' -print | cut -b3-)
|
||||
|
||||
GOLINT = $(GOBIN)/golint
|
||||
STATICCHECK = $(GOBIN)/staticcheck
|
||||
|
||||
.PHONY: build
|
||||
build:
|
||||
go build ./...
|
||||
|
||||
.PHONY: install
|
||||
install:
|
||||
go mod download
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
go test -race ./...
|
||||
|
||||
.PHONY: cover
|
||||
cover:
|
||||
go test -coverprofile=cover.out -covermode=atomic -coverpkg=./... ./...
|
||||
go tool cover -html=cover.out -o cover.html
|
||||
|
||||
$(GOLINT): tools/go.mod
|
||||
cd tools && go install golang.org/x/lint/golint
|
||||
|
||||
$(STATICCHECK): tools/go.mod
|
||||
cd tools && go install honnef.co/go/tools/cmd/staticcheck@2023.1.2
|
||||
|
||||
.PHONY: lint
|
||||
lint: $(GOLINT) $(STATICCHECK)
|
||||
@rm -rf lint.log
|
||||
@echo "Checking gofmt"
|
||||
@gofmt -d -s $(GO_FILES) 2>&1 | tee lint.log
|
||||
@echo "Checking go vet"
|
||||
@go vet ./... 2>&1 | tee -a lint.log
|
||||
@echo "Checking golint"
|
||||
@$(GOLINT) ./... | tee -a lint.log
|
||||
@echo "Checking staticcheck"
|
||||
@$(STATICCHECK) ./... 2>&1 | tee -a lint.log
|
||||
@echo "Checking for license headers..."
|
||||
@./.build/check_license.sh | tee -a lint.log
|
||||
@[ ! -s lint.log ]
|
||||
71
vendor/go.uber.org/automaxprocs/README.md
generated
vendored
71
vendor/go.uber.org/automaxprocs/README.md
generated
vendored
@@ -1,71 +0,0 @@
|
||||
# automaxprocs [![GoDoc][doc-img]][doc] [![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov]
|
||||
|
||||
Automatically set `GOMAXPROCS` to match Linux container CPU quota.
|
||||
|
||||
## Installation
|
||||
|
||||
`go get -u go.uber.org/automaxprocs`
|
||||
|
||||
## Quick Start
|
||||
|
||||
```go
|
||||
import _ "go.uber.org/automaxprocs"
|
||||
|
||||
func main() {
|
||||
// Your application logic here.
|
||||
}
|
||||
```
|
||||
|
||||
# Performance
|
||||
Data measured from Uber's internal load balancer. We ran the load balancer with 200% CPU quota (i.e., 2 cores):
|
||||
|
||||
| GOMAXPROCS | RPS | P50 (ms) | P99.9 (ms) |
|
||||
| ------------------ | --------- | -------- | ---------- |
|
||||
| 1 | 28,893.18 | 1.46 | 19.70 |
|
||||
| 2 (equal to quota) | 44,715.07 | 0.84 | 26.38 |
|
||||
| 3 | 44,212.93 | 0.66 | 30.07 |
|
||||
| 4 | 41,071.15 | 0.57 | 42.94 |
|
||||
| 8 | 33,111.69 | 0.43 | 64.32 |
|
||||
| Default (24) | 22,191.40 | 0.45 | 76.19 |
|
||||
|
||||
When `GOMAXPROCS` is increased above the CPU quota, we see P50 decrease slightly, but see significant increases to P99. We also see that the total RPS handled also decreases.
|
||||
|
||||
When `GOMAXPROCS` is higher than the CPU quota allocated, we also saw significant throttling:
|
||||
|
||||
```
|
||||
$ cat /sys/fs/cgroup/cpu,cpuacct/system.slice/[...]/cpu.stat
|
||||
nr_periods 42227334
|
||||
nr_throttled 131923
|
||||
throttled_time 88613212216618
|
||||
```
|
||||
|
||||
Once `GOMAXPROCS` was reduced to match the CPU quota, we saw no CPU throttling.
|
||||
|
||||
## Development Status: Stable
|
||||
|
||||
All APIs are finalized, and no breaking changes will be made in the 1.x series
|
||||
of releases. Users of semver-aware dependency management systems should pin
|
||||
automaxprocs to `^1`.
|
||||
|
||||
## Contributing
|
||||
|
||||
We encourage and support an active, healthy community of contributors —
|
||||
including you! Details are in the [contribution guide](CONTRIBUTING.md) and
|
||||
the [code of conduct](CODE_OF_CONDUCT.md). The automaxprocs maintainers keep
|
||||
an eye on issues and pull requests, but you can also report any negative
|
||||
conduct to oss-conduct@uber.com. That email list is a private, safe space;
|
||||
even the automaxprocs maintainers don't have access, so don't hesitate to hold
|
||||
us to a high standard.
|
||||
|
||||
<hr>
|
||||
|
||||
Released under the [MIT License](LICENSE).
|
||||
|
||||
[doc-img]: https://godoc.org/go.uber.org/automaxprocs?status.svg
|
||||
[doc]: https://godoc.org/go.uber.org/automaxprocs
|
||||
[ci-img]: https://github.com/uber-go/automaxprocs/actions/workflows/go.yml/badge.svg
|
||||
[ci]: https://github.com/uber-go/automaxprocs/actions/workflows/go.yml
|
||||
[cov-img]: https://codecov.io/gh/uber-go/automaxprocs/branch/master/graph/badge.svg
|
||||
[cov]: https://codecov.io/gh/uber-go/automaxprocs
|
||||
|
||||
|
||||
33
vendor/go.uber.org/automaxprocs/automaxprocs.go
generated
vendored
33
vendor/go.uber.org/automaxprocs/automaxprocs.go
generated
vendored
@@ -1,33 +0,0 @@
|
||||
// Copyright (c) 2017 Uber Technologies, Inc.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
// Package automaxprocs automatically sets GOMAXPROCS to match the Linux
|
||||
// container CPU quota, if any.
|
||||
package automaxprocs // import "go.uber.org/automaxprocs"
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"go.uber.org/automaxprocs/maxprocs"
|
||||
)
|
||||
|
||||
func init() {
|
||||
maxprocs.Set(maxprocs.Logger(log.Printf))
|
||||
}
|
||||
23
vendor/go.uber.org/automaxprocs/internal/cgroups/doc.go
generated
vendored
23
vendor/go.uber.org/automaxprocs/internal/cgroups/doc.go
generated
vendored
@@ -1,23 +0,0 @@
|
||||
// Copyright (c) 2017 Uber Technologies, Inc.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
// Package cgroups provides utilities to access Linux control group (CGroups)
|
||||
// parameters (CPU quota, for example) for a given process.
|
||||
package cgroups
|
||||
139
vendor/go.uber.org/automaxprocs/maxprocs/maxprocs.go
generated
vendored
139
vendor/go.uber.org/automaxprocs/maxprocs/maxprocs.go
generated
vendored
@@ -1,139 +0,0 @@
|
||||
// Copyright (c) 2017 Uber Technologies, Inc.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
// Package maxprocs lets Go programs easily configure runtime.GOMAXPROCS to
|
||||
// match the configured Linux CPU quota. Unlike the top-level automaxprocs
|
||||
// package, it lets the caller configure logging and handle errors.
|
||||
package maxprocs // import "go.uber.org/automaxprocs/maxprocs"
|
||||
|
||||
import (
|
||||
"os"
|
||||
"runtime"
|
||||
|
||||
iruntime "go.uber.org/automaxprocs/internal/runtime"
|
||||
)
|
||||
|
||||
const _maxProcsKey = "GOMAXPROCS"
|
||||
|
||||
func currentMaxProcs() int {
|
||||
return runtime.GOMAXPROCS(0)
|
||||
}
|
||||
|
||||
type config struct {
|
||||
printf func(string, ...interface{})
|
||||
procs func(int, func(v float64) int) (int, iruntime.CPUQuotaStatus, error)
|
||||
minGOMAXPROCS int
|
||||
roundQuotaFunc func(v float64) int
|
||||
}
|
||||
|
||||
func (c *config) log(fmt string, args ...interface{}) {
|
||||
if c.printf != nil {
|
||||
c.printf(fmt, args...)
|
||||
}
|
||||
}
|
||||
|
||||
// An Option alters the behavior of Set.
|
||||
type Option interface {
|
||||
apply(*config)
|
||||
}
|
||||
|
||||
// Logger uses the supplied printf implementation for log output. By default,
|
||||
// Set doesn't log anything.
|
||||
func Logger(printf func(string, ...interface{})) Option {
|
||||
return optionFunc(func(cfg *config) {
|
||||
cfg.printf = printf
|
||||
})
|
||||
}
|
||||
|
||||
// Min sets the minimum GOMAXPROCS value that will be used.
|
||||
// Any value below 1 is ignored.
|
||||
func Min(n int) Option {
|
||||
return optionFunc(func(cfg *config) {
|
||||
if n >= 1 {
|
||||
cfg.minGOMAXPROCS = n
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// RoundQuotaFunc sets the function that will be used to covert the CPU quota from float to int.
|
||||
func RoundQuotaFunc(rf func(v float64) int) Option {
|
||||
return optionFunc(func(cfg *config) {
|
||||
cfg.roundQuotaFunc = rf
|
||||
})
|
||||
}
|
||||
|
||||
type optionFunc func(*config)
|
||||
|
||||
func (of optionFunc) apply(cfg *config) { of(cfg) }
|
||||
|
||||
// Set GOMAXPROCS to match the Linux container CPU quota (if any), returning
|
||||
// any error encountered and an undo function.
|
||||
//
|
||||
// Set is a no-op on non-Linux systems and in Linux environments without a
|
||||
// configured CPU quota.
|
||||
func Set(opts ...Option) (func(), error) {
|
||||
cfg := &config{
|
||||
procs: iruntime.CPUQuotaToGOMAXPROCS,
|
||||
roundQuotaFunc: iruntime.DefaultRoundFunc,
|
||||
minGOMAXPROCS: 1,
|
||||
}
|
||||
for _, o := range opts {
|
||||
o.apply(cfg)
|
||||
}
|
||||
|
||||
undoNoop := func() {
|
||||
cfg.log("maxprocs: No GOMAXPROCS change to reset")
|
||||
}
|
||||
|
||||
// Honor the GOMAXPROCS environment variable if present. Otherwise, amend
|
||||
// `runtime.GOMAXPROCS()` with the current process' CPU quota if the OS is
|
||||
// Linux, and guarantee a minimum value of 1. The minimum guaranteed value
|
||||
// can be overridden using `maxprocs.Min()`.
|
||||
if max, exists := os.LookupEnv(_maxProcsKey); exists {
|
||||
cfg.log("maxprocs: Honoring GOMAXPROCS=%q as set in environment", max)
|
||||
return undoNoop, nil
|
||||
}
|
||||
|
||||
maxProcs, status, err := cfg.procs(cfg.minGOMAXPROCS, cfg.roundQuotaFunc)
|
||||
if err != nil {
|
||||
return undoNoop, err
|
||||
}
|
||||
|
||||
if status == iruntime.CPUQuotaUndefined {
|
||||
cfg.log("maxprocs: Leaving GOMAXPROCS=%v: CPU quota undefined", currentMaxProcs())
|
||||
return undoNoop, nil
|
||||
}
|
||||
|
||||
prev := currentMaxProcs()
|
||||
undo := func() {
|
||||
cfg.log("maxprocs: Resetting GOMAXPROCS to %v", prev)
|
||||
runtime.GOMAXPROCS(prev)
|
||||
}
|
||||
|
||||
switch status {
|
||||
case iruntime.CPUQuotaMinUsed:
|
||||
cfg.log("maxprocs: Updating GOMAXPROCS=%v: using minimum allowed GOMAXPROCS", maxProcs)
|
||||
case iruntime.CPUQuotaUsed:
|
||||
cfg.log("maxprocs: Updating GOMAXPROCS=%v: determined from CPU quota", maxProcs)
|
||||
}
|
||||
|
||||
runtime.GOMAXPROCS(maxProcs)
|
||||
return undo, nil
|
||||
}
|
||||
24
vendor/go.uber.org/automaxprocs/maxprocs/version.go
generated
vendored
24
vendor/go.uber.org/automaxprocs/maxprocs/version.go
generated
vendored
@@ -1,24 +0,0 @@
|
||||
// Copyright (c) 2017 Uber Technologies, Inc.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
package maxprocs
|
||||
|
||||
// Version is the current package version.
|
||||
const Version = "1.6.0"
|
||||
9
vendor/modules.txt
vendored
9
vendor/modules.txt
vendored
@@ -1211,12 +1211,13 @@ github.com/onsi/ginkgo/reporters/stenographer
|
||||
github.com/onsi/ginkgo/reporters/stenographer/support/go-colorable
|
||||
github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty
|
||||
github.com/onsi/ginkgo/types
|
||||
# github.com/onsi/ginkgo/v2 v2.27.1
|
||||
# github.com/onsi/ginkgo/v2 v2.27.2
|
||||
## explicit; go 1.23.0
|
||||
github.com/onsi/ginkgo/v2
|
||||
github.com/onsi/ginkgo/v2/config
|
||||
github.com/onsi/ginkgo/v2/formatter
|
||||
github.com/onsi/ginkgo/v2/ginkgo
|
||||
github.com/onsi/ginkgo/v2/ginkgo/automaxprocs
|
||||
github.com/onsi/ginkgo/v2/ginkgo/build
|
||||
github.com/onsi/ginkgo/v2/ginkgo/command
|
||||
github.com/onsi/ginkgo/v2/ginkgo/generators
|
||||
@@ -2334,12 +2335,6 @@ go.opentelemetry.io/proto/otlp/collector/trace/v1
|
||||
go.opentelemetry.io/proto/otlp/common/v1
|
||||
go.opentelemetry.io/proto/otlp/resource/v1
|
||||
go.opentelemetry.io/proto/otlp/trace/v1
|
||||
# go.uber.org/automaxprocs v1.6.0
|
||||
## explicit; go 1.20
|
||||
go.uber.org/automaxprocs
|
||||
go.uber.org/automaxprocs/internal/cgroups
|
||||
go.uber.org/automaxprocs/internal/runtime
|
||||
go.uber.org/automaxprocs/maxprocs
|
||||
# go.uber.org/multierr v1.11.0
|
||||
## explicit; go 1.19
|
||||
go.uber.org/multierr
|
||||
|
||||
Reference in New Issue
Block a user