-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
environment names are constants (ref)
Signed-off-by: Alex Aizman <[email protected]>
- Loading branch information
1 parent
6f01677
commit 5ba9180
Showing
30 changed files
with
139 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,95 +1,62 @@ | ||
// Package env contains environment variables | ||
/* | ||
* Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved. | ||
* Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved. | ||
*/ | ||
package env | ||
|
||
// NOTE not included: | ||
// not included: | ||
// - "AIS_READ_HEADER_TIMEOUT" | ||
// - "AIS_DAEMON_ID" | ||
// - "AIS_HOST_IP", "AIS_HOST_PORT" - local playground (target only) | ||
// - "AIS_TARGET_URL" - ETL | ||
// | ||
// See also: | ||
// - "AIS_TARGET_URL" - ETL | ||
// see also: | ||
// - docs/environment-vars.md | ||
|
||
var AIS = struct { | ||
const ( | ||
// endpoint: client | primary startup | ||
Endpoint string | ||
PrimaryEP string | ||
|
||
AisEndpoint = "AIS_ENDPOINT" // the way to designate primary when cluster's starting up | ||
AisPrimaryEP = "AIS_PRIMARY_EP" | ||
|
||
// networking: two CIDR masks | ||
LocalRedirectCIDR string | ||
PubIPv4CIDR string | ||
// 1. differentiate local (same CIDR) clients for faster HTTP redirect | ||
// 2. at node startup: when present with multiple choices, select one matching local unicast IP | ||
// to use it as node's public interface | ||
AisLocalRedirectCIDR = "AIS_CLUSTER_CIDR" | ||
AisPubIPv4CIDR = "AIS_PUBLIC_IP_CIDR" | ||
|
||
// | ||
// HTTPS | ||
// for details and background, see: https://github.com/NVIDIA/aistore/blob/main/docs/environment-vars.md#https | ||
// | ||
UseHTTPS string | ||
// TLS: client side | ||
Certificate string | ||
CertKey string | ||
ClientCA string | ||
SkipVerifyCrt string | ||
// TLS: server (aistore, AuthN) side (NOTE comment below) | ||
|
||
// tests, CI | ||
NumTarget string | ||
NumProxy string | ||
|
||
// K8s | ||
K8sPod string | ||
K8sNode string | ||
K8sNamespace string | ||
K8sServiceName string | ||
K8sPublicHostname string | ||
K8sClusterDomain string | ||
K8sHostNetwork string | ||
K8sEnableExternalAccess string | ||
}{ | ||
// the way to designate primary when cluster's starting up | ||
Endpoint: "AIS_ENDPOINT", | ||
PrimaryEP: "AIS_PRIMARY_EP", | ||
|
||
// two CIDRs, respectively: | ||
// 1. differentiate local (same CIDR) clients for faster HTTP redirect | ||
// 2. at node startup: when present with multiple choices, select one matching local unicast IP | ||
// to use it as node's public interface | ||
LocalRedirectCIDR: "AIS_CLUSTER_CIDR", | ||
PubIPv4CIDR: "AIS_PUBLIC_IP_CIDR", | ||
|
||
// false: HTTP transport, with all the TLS config (below) ignored | ||
// true: HTTPS/TLS | ||
// for details and background, see: https://github.com/NVIDIA/aistore/blob/main/docs/environment-vars.md#https | ||
UseHTTPS: "AIS_USE_HTTPS", // cluster config: "net.http.use_https" | ||
AisUseHTTPS = "AIS_USE_HTTPS" | ||
|
||
// TLS: client side | ||
Certificate: "AIS_CRT", | ||
CertKey: "AIS_CRT_KEY", | ||
ClientCA: "AIS_CLIENT_CA", | ||
|
||
// TLS: server (aistore, AuthN) side | ||
// "AIS_SERVER_CRT" - TLS certificate (pathname) | ||
// "AIS_SERVER_KEY" - private key (ditto) | ||
AisClientCert = "AIS_CRT" | ||
AisClientCertKey = "AIS_CRT_KEY" | ||
AisClientCA = "AIS_CLIENT_CA" | ||
|
||
// TLS: common | ||
SkipVerifyCrt: "AIS_SKIP_VERIFY_CRT", // cluster config: "net.http.skip_verify" | ||
// client and dev deployment; see also cluster config "net.http.skip_verify" | ||
AisSkipVerifyCrt = "AIS_SKIP_VERIFY_CRT" | ||
|
||
// variables used in tests and CI | ||
NumTarget: "NUM_TARGET", | ||
NumProxy: "NUM_PROXY", | ||
// tests and CI | ||
AisNumTarget = "NUM_TARGET" | ||
AisNumProxy = "NUM_PROXY" | ||
|
||
// via ais-k8s repo | ||
// see also: | ||
// * https://github.com/NVIDIA/ais-k8s/blob/main/operator/pkg/resources/cmn/env.go | ||
// * docs/environment-vars.md | ||
K8sPod: "MY_POD", | ||
K8sNode: "MY_NODE", | ||
K8sNamespace: "K8S_NS", | ||
K8sServiceName: "MY_SERVICE", | ||
K8sPublicHostname: "AIS_PUBLIC_HOSTNAME", | ||
K8sClusterDomain: "AIS_K8S_CLUSTER_DOMAIN", | ||
K8sHostNetwork: "HOST_NETWORK", | ||
K8sEnableExternalAccess: "ENABLE_EXTERNAL_ACCESS", | ||
} | ||
AisK8sPod = "MY_POD" | ||
AisK8sNode = "MY_NODE" | ||
AisK8sNamespace = "K8S_NS" | ||
AisK8sServiceName = "MY_SERVICE" | ||
AisK8sPublicHostname = "AIS_PUBLIC_HOSTNAME" | ||
AisK8sClusterDomain = "AIS_K8S_CLUSTER_DOMAIN" | ||
AisK8sHostNetwork = "HOST_NETWORK" | ||
AisK8sEnableExternalAccess = "ENABLE_EXTERNAL_ACCESS" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,27 @@ | ||
// Package env contains environment variables | ||
/* | ||
* Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved. | ||
* Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved. | ||
*/ | ||
package env | ||
|
||
// authn environment variables | ||
// AuthN environment names | ||
// see also: docs/environment-vars.md | ||
|
||
var ( | ||
AuthN = struct { | ||
Enabled string | ||
URL string | ||
TokenFile string | ||
Token string | ||
ConfDir string | ||
LogDir string | ||
LogLevel string | ||
Port string | ||
TTL string | ||
UseHTTPS string | ||
ServerCrt string | ||
ServerKey string | ||
AdminPassword string | ||
AdminUsername string | ||
SecretKey string | ||
}{ | ||
Enabled: "AIS_AUTHN_ENABLED", | ||
URL: "AIS_AUTHN_URL", | ||
TokenFile: "AIS_AUTHN_TOKEN_FILE", // fully qualified | ||
Token: "AIS_AUTHN_TOKEN", // Only the JWT token itself (excluding the file and JSON) | ||
ConfDir: "AIS_AUTHN_CONF_DIR", // contains AuthN config and tokens DB | ||
LogDir: "AIS_AUTHN_LOG_DIR", | ||
LogLevel: "AIS_AUTHN_LOG_LEVEL", | ||
Port: "AIS_AUTHN_PORT", | ||
TTL: "AIS_AUTHN_TTL", | ||
UseHTTPS: "AIS_AUTHN_USE_HTTPS", | ||
ServerCrt: "AIS_SERVER_CRT", | ||
ServerKey: "AIS_SERVER_KEY", | ||
SecretKey: "AIS_AUTHN_SECRET_KEY", | ||
AdminUsername: "AIS_AUTHN_SU_NAME", | ||
AdminPassword: "AIS_AUTHN_SU_PASS", | ||
} | ||
//nolint:gosec // false positive G101 | ||
const ( | ||
AisAuthEnabled = "AIS_AUTHN_ENABLED" | ||
AisAuthURL = "AIS_AUTHN_URL" | ||
AisAuthTokenFile = "AIS_AUTHN_TOKEN_FILE" // fully qualified | ||
AisAuthToken = "AIS_AUTHN_TOKEN" // Only the JWT token itself (excluding the file and JSON) | ||
AisAuthConfDir = "AIS_AUTHN_CONF_DIR" // contains AuthN config and tokens DB | ||
AisAuthLogDir = "AIS_AUTHN_LOG_DIR" | ||
AisAuthLogLevel = "AIS_AUTHN_LOG_LEVEL" | ||
AisAuthPort = "AIS_AUTHN_PORT" | ||
AisAuthTTL = "AIS_AUTHN_TTL" | ||
AisAuthUseHTTPS = "AIS_AUTHN_USE_HTTPS" | ||
AisAuthServerCrt = "AIS_SERVER_CRT" | ||
AisAuthServerKey = "AIS_SERVER_KEY" | ||
AisAuthSecretKey = "AIS_AUTHN_SECRET_KEY" | ||
AisAuthAdminUsername = "AIS_AUTHN_SU_NAME" | ||
AisAuthAdminPassword = "AIS_AUTHN_SU_PASS" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.