summaryrefslogtreecommitdiffstats
path: root/flags
diff options
context:
space:
mode:
Diffstat (limited to 'flags')
-rw-r--r--flags/pom.xml5
-rw-r--r--flags/src/main/java/com/yahoo/vespa/flags/Flags.java195
-rw-r--r--flags/src/main/java/com/yahoo/vespa/flags/PermanentFlags.java119
-rw-r--r--flags/src/main/java/com/yahoo/vespa/flags/custom/SharedHost.java4
-rw-r--r--flags/src/test/java/com/yahoo/vespa/flags/FlagsTest.java14
-rw-r--r--flags/src/test/java/com/yahoo/vespa/flags/PermanentFlagsTest.java25
6 files changed, 188 insertions, 174 deletions
diff --git a/flags/pom.xml b/flags/pom.xml
index ba0e4a94692..4f1bdcb61e3 100644
--- a/flags/pom.xml
+++ b/flags/pom.xml
@@ -88,6 +88,11 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<plugins>
diff --git a/flags/src/main/java/com/yahoo/vespa/flags/Flags.java b/flags/src/main/java/com/yahoo/vespa/flags/Flags.java
index 5bb98f772cc..4f794302ca1 100644
--- a/flags/src/main/java/com/yahoo/vespa/flags/Flags.java
+++ b/flags/src/main/java/com/yahoo/vespa/flags/Flags.java
@@ -3,8 +3,6 @@ package com.yahoo.vespa.flags;
import com.yahoo.component.Vtag;
import com.yahoo.vespa.defaults.Defaults;
-import com.yahoo.vespa.flags.custom.ClusterCapacity;
-import com.yahoo.vespa.flags.custom.SharedHost;
import java.time.Instant;
import java.time.LocalDate;
@@ -15,10 +13,8 @@ import java.util.Optional;
import java.util.TreeMap;
import static com.yahoo.vespa.flags.FetchVector.Dimension.APPLICATION_ID;
-import static com.yahoo.vespa.flags.FetchVector.Dimension.CONSOLE_USER_EMAIL;
import static com.yahoo.vespa.flags.FetchVector.Dimension.HOSTNAME;
import static com.yahoo.vespa.flags.FetchVector.Dimension.NODE_TYPE;
-import static com.yahoo.vespa.flags.FetchVector.Dimension.TENANT_ID;
import static com.yahoo.vespa.flags.FetchVector.Dimension.VESPA_VERSION;
import static com.yahoo.vespa.flags.FetchVector.Dimension.ZONE_ID;
@@ -46,214 +42,133 @@ import static com.yahoo.vespa.flags.FetchVector.Dimension.ZONE_ID;
public class Flags {
private static volatile TreeMap<FlagId, FlagDefinition> flags = new TreeMap<>();
- public static final UnboundBooleanFlag FLEET_CANARY = defineFeatureFlag(
- "fleet-canary", false,
- List.of("nobody"), "2020-12-02", "2021-02-01",
- "Whether the host is a fleet canary.",
- "Takes effect on next host admin tick.",
- HOSTNAME);
-
- public static final UnboundListFlag<String> DISABLED_HOST_ADMIN_TASKS = defineListFlag(
- "disabled-host-admin-tasks", List.of(), String.class,
- List.of("nobody"), "2020-12-02", "2021-02-01",
- "List of host-admin task names (as they appear in the log, e.g. root>main>UpgradeTask), or some node-agent " +
- "functionality (see NodeAgentTask), that should be skipped",
- "Takes effect on next host admin tick",
- HOSTNAME, NODE_TYPE);
-
- public static final UnboundStringFlag DOCKER_VERSION = defineStringFlag(
- "docker-version", "1.13.1-102.git7f2769b",
- List.of("nobody"), "2020-12-02", "2021-02-01",
- "The version of the docker to use of the format VERSION-REL: The YUM package to be installed will be " +
- "2:docker-VERSION-REL.el7.centos.x86_64 in AWS (and without '.centos' otherwise). " +
- "If docker-version is not of this format, it must be parseable by YumPackageName::fromString.",
- "Takes effect on next tick.",
- HOSTNAME);
-
- public static final UnboundDoubleFlag CONTAINER_CPU_CAP = defineDoubleFlag(
- "container-cpu-cap", 0,
- List.of("nobody"), "2020-12-02", "2021-02-01",
- "Hard limit on how many CPUs a container may use. This value is multiplied by CPU allocated to node, so " +
- "to cap CPU at 200%, set this to 2, etc.",
- "Takes effect on next node agent tick. Change is orchestrated, but does NOT require container restart",
- HOSTNAME, APPLICATION_ID);
-
- public static final UnboundIntFlag REBOOT_INTERVAL_IN_DAYS = defineIntFlag(
- "reboot-interval-in-days", 30,
- List.of("nobody"), "2020-12-02", "2021-02-01",
- "No reboots are scheduled 0x-1x reboot intervals after the previous reboot, while reboot is " +
- "scheduled evenly distributed in the 1x-2x range (and naturally guaranteed at the 2x boundary).",
- "Takes effect on next run of NodeRebooter");
-
public static final UnboundBooleanFlag RETIRE_WITH_PERMANENTLY_DOWN = defineFeatureFlag(
"retire-with-permanently-down", false,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("hakonhall"), "2020-12-02", "2021-02-01",
"If enabled, retirement will end with setting the host status to PERMANENTLY_DOWN, " +
"instead of ALLOWED_TO_BE_DOWN (old behavior).",
"Takes effect on the next run of RetiredExpirer.",
HOSTNAME);
- public static final UnboundListFlag<ClusterCapacity> PREPROVISION_CAPACITY = defineListFlag(
- "preprovision-capacity", List.of(), ClusterCapacity.class,
- List.of("nobody"), "2020-12-02", "2021-02-01",
- "Specifies the resources that ought to be immediately available for additional cluster " +
- "allocations. If the resources are not available, additional hosts will be provisioned. " +
- "Only applies to dynamically provisioned zones.",
- "Takes effect on next iteration of DynamicProvisioningMaintainer.");
-
- public static final UnboundBooleanFlag COMPACT_PREPROVISION_CAPACITY = defineFeatureFlag(
- "compact-preprovision-capacity", true,
- List.of("nobody"), "2020-12-02", "2021-02-01",
- "Whether preprovision capacity can be satisfied with available capacity on hosts with " +
- "existing allocations. Historically preprovision-capacity referred to empty hosts.",
- "Takes effect on next iteration of DynamicProvisioningMaintainer.");
-
- public static final UnboundJacksonFlag<SharedHost> SHARED_HOST = defineJacksonFlag(
- "shared-host", SharedHost.createDisabled(), SharedHost.class,
- List.of("nobody"), "2020-12-02", "2021-02-01",
- "Specifies whether shared hosts can be provisioned, and if so, the advertised " +
- "node resources of the host, the maximum number of containers, etc.",
- "Takes effect on next iteration of DynamicProvisioningMaintainer.");
-
- public static final UnboundListFlag<String> INACTIVE_MAINTENANCE_JOBS = defineListFlag(
- "inactive-maintenance-jobs", List.of(), String.class,
- List.of("nobody"), "2020-12-02", "2021-02-01",
- "The list of maintenance jobs that are inactive.",
- "Takes effect immediately, but any currently running jobs will run until completion.");
-
public static final UnboundDoubleFlag DEFAULT_TERM_WISE_LIMIT = defineDoubleFlag(
"default-term-wise-limit", 1.0,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("baldersheim"), "2020-12-02", "2021-02-01",
"Default limit for when to apply termwise query evaluation",
"Takes effect at redeployment",
ZONE_ID, APPLICATION_ID);
- public static final UnboundStringFlag JVM_GC_OPTIONS = defineStringFlag(
- "jvm-gc-options", "",
- List.of("nobody"), "2020-12-02", "2021-02-01",
- "Sets deafult jvm gc options",
- "Takes effect at redeployment",
- ZONE_ID, APPLICATION_ID);
-
public static final UnboundStringFlag FEED_SEQUENCER_TYPE = defineStringFlag(
"feed-sequencer-type", "LATENCY",
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("baldersheim"), "2020-12-02", "2021-02-01",
"Selects type of sequenced executor used for feeding, valid values are LATENCY, ADAPTIVE, THROUGHPUT",
"Takes effect at redeployment",
ZONE_ID, APPLICATION_ID);
public static final UnboundStringFlag RESPONSE_SEQUENCER_TYPE = defineStringFlag(
"response-sequencer-type", "ADAPTIVE",
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("baldersheim"), "2020-12-02", "2021-02-01",
"Selects type of sequenced executor used for mbus responses, valid values are LATENCY, ADAPTIVE, THROUGHPUT",
"Takes effect at redeployment",
ZONE_ID, APPLICATION_ID);
public static final UnboundIntFlag RESPONSE_NUM_THREADS = defineIntFlag(
"response-num-threads", 2,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("baldersheim"), "2020-12-02", "2021-02-01",
"Number of threads used for mbus responses, default is 2, negative number = numcores/4",
"Takes effect at redeployment",
ZONE_ID, APPLICATION_ID);
public static final UnboundBooleanFlag SKIP_COMMUNICATIONMANAGER_THREAD = defineFeatureFlag(
"skip-communicatiomanager-thread", false,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("baldersheim"), "2020-12-02", "2021-02-01",
"Should we skip the communicationmanager thread",
"Takes effect at redeployment",
ZONE_ID, APPLICATION_ID);
public static final UnboundBooleanFlag SKIP_MBUS_REQUEST_THREAD = defineFeatureFlag(
"skip-mbus-request-thread", false,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("baldersheim"), "2020-12-02", "2021-02-01",
"Should we skip the mbus request thread",
"Takes effect at redeployment",
ZONE_ID, APPLICATION_ID);
public static final UnboundBooleanFlag SKIP_MBUS_REPLY_THREAD = defineFeatureFlag(
"skip-mbus-reply-thread", false,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("baldersheim"), "2020-12-02", "2021-02-01",
"Should we skip the mbus reply thread",
"Takes effect at redeployment",
ZONE_ID, APPLICATION_ID);
public static final UnboundBooleanFlag USE_THREE_PHASE_UPDATES = defineFeatureFlag(
"use-three-phase-updates", false,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("vekterli"), "2020-12-02", "2021-02-01",
"Whether to enable the use of three-phase updates when bucket replicas are out of sync.",
"Takes effect at redeployment",
ZONE_ID, APPLICATION_ID);
public static final UnboundBooleanFlag USE_DIRECT_STORAGE_API_RPC = defineFeatureFlag(
"use-direct-storage-api-rpc", false,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("geirst"), "2020-12-02", "2021-02-01",
"Whether to use direct RPC for Storage API communication between content cluster nodes.",
"Takes effect at restart of distributor and content node process",
ZONE_ID, APPLICATION_ID);
public static final UnboundBooleanFlag USE_FAST_VALUE_TENSOR_IMPLEMENTATION = defineFeatureFlag(
"use-fast-value-tensor-implementation", false,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("geirst"), "2020-12-02", "2021-02-01",
"Whether to use FastValueBuilderFactory as the tensor implementation on all content nodes.",
"Takes effect at restart of content node process",
ZONE_ID, APPLICATION_ID);
public static final UnboundBooleanFlag HOST_HARDENING = defineFeatureFlag(
"host-hardening", false,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("hakonhall"), "2020-12-02", "2021-02-01",
"Whether to enable host hardening Linux baseline.",
"Takes effect on next tick or on host-admin restart (may vary where used).",
HOSTNAME);
public static final UnboundBooleanFlag TCP_ABORT_ON_OVERFLOW = defineFeatureFlag(
"tcp-abort-on-overflow", false,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("andreer"), "2020-12-02", "2021-02-01",
"Whether to set /proc/sys/net/ipv4/tcp_abort_on_overflow to 0 (false) or 1 (true)",
"Takes effect on next host-admin tick.",
HOSTNAME);
- public static final UnboundStringFlag ZOOKEEPER_SERVER_VERSION = defineStringFlag(
- "zookeeper-server-version", "3.5.6",
- List.of("nobody"), "2020-12-02", "2021-02-01",
- "ZooKeeper server version, a jar file zookeeper-server-<ZOOKEEPER_SERVER_VERSION>-jar-with-dependencies.jar must exist",
- "Takes effect on restart of Docker container",
- NODE_TYPE, APPLICATION_ID, HOSTNAME);
-
public static final UnboundStringFlag TLS_FOR_ZOOKEEPER_CLIENT_SERVER_COMMUNICATION = defineStringFlag(
"tls-for-zookeeper-client-server-communication", "OFF",
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("hmusum"), "2020-12-02", "2021-02-01",
"How to setup TLS for ZooKeeper client/server communication. Valid values are OFF, PORT_UNIFICATION, TLS_WITH_PORT_UNIFICATION, TLS_ONLY",
"Takes effect on restart of config server",
NODE_TYPE, HOSTNAME);
public static final UnboundBooleanFlag USE_TLS_FOR_ZOOKEEPER_CLIENT = defineFeatureFlag(
"use-tls-for-zookeeper-client", false,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("hmusum"), "2020-12-02", "2021-02-01",
"Whether to use TLS for ZooKeeper clients",
"Takes effect on restart of process",
NODE_TYPE, HOSTNAME);
public static final UnboundBooleanFlag VALIDATE_ENDPOINT_CERTIFICATES = defineFeatureFlag(
"validate-endpoint-certificates", false,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("andreer"), "2020-12-02", "2021-02-01",
"Whether endpoint certificates should be validated before use",
"Takes effect on the next deployment of the application");
public static final UnboundStringFlag DELETE_UNUSED_ENDPOINT_CERTIFICATES = defineStringFlag(
"delete-unused-endpoint-certificates", "disable",
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("andreer"), "2020-12-02", "2021-02-01",
"Whether the endpoint certificate maintainer should delete unused certificates in cameo/zk",
"Takes effect on next scheduled run of maintainer - set to \"disable\", \"dryrun\" or \"enable\"");
public static final UnboundBooleanFlag USE_ALTERNATIVE_ENDPOINT_CERTIFICATE_PROVIDER = defineFeatureFlag(
"use-alternative-endpoint-certificate-provider", false,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("andreer"), "2020-12-02", "2021-02-01",
"Whether to use an alternative CA when provisioning new certificates",
"Takes effect only on initial application deployment - not on later certificate refreshes!");
public static final UnboundStringFlag DOCKER_IMAGE_REPO = defineStringFlag(
"docker-image-repo", "",
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("valerijf"), "2020-12-02", "2021-02-01",
"Override default docker image repo. Docker image version will be Vespa version.",
"Takes effect on next deployment from controller",
ZONE_ID, APPLICATION_ID);
@@ -266,35 +181,27 @@ public class Flags {
public static final UnboundBooleanFlag ENDPOINT_CERT_IN_SHARED_ROUTING = defineFeatureFlag(
"endpoint-cert-in-shared-routing", false,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("andreer"), "2020-12-02", "2021-02-01",
"Whether to provision and use endpoint certs for apps in shared routing zones",
"Takes effect on next deployment of the application", APPLICATION_ID);
public static final UnboundBooleanFlag PROVISION_APPLICATION_ROLES = defineFeatureFlag(
"provision-application-roles", false,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("tokle"), "2020-12-02", "2021-02-01",
"Whether application roles should be provisioned",
"Takes effect on next deployment (controller)",
ZONE_ID);
public static final UnboundBooleanFlag APPLICATION_IAM_ROLE = defineFeatureFlag(
"application-iam-roles", false,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("tokle"), "2020-12-02", "2021-02-01",
"Allow separate iam roles when provisioning/assigning hosts",
"Takes effect immediately on new hosts, on next redeploy for applications",
APPLICATION_ID);
- public static final UnboundBooleanFlag ENABLE_PUBLIC_SIGNUP_FLOW = defineFeatureFlag(
- "enable-public-signup-flow", false,
- List.of("nobody"), "2020-12-02", "2021-02-01",
- "Show the public signup flow for a user in the console",
- "takes effect on browser reload of api/user/v1/user",
- CONSOLE_USER_EMAIL
- );
-
public static final UnboundBooleanFlag CONTROLLER_PROVISION_LB = defineFeatureFlag(
"controller-provision-lb", false,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("mpolden"), "2020-12-02", "2021-02-01",
"Provision load balancer for controller cluster",
"Takes effect when controller application is redeployed",
ZONE_ID
@@ -302,105 +209,79 @@ public class Flags {
public static final UnboundIntFlag TENANT_NODE_QUOTA = defineIntFlag(
"tenant-node-quota", 5,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("andreer"), "2020-12-02", "2021-02-01",
"The number of nodes a tenant is allowed to request per cluster",
"Only takes effect on next deployment, if set to a value other than the default for flag!",
APPLICATION_ID
);
- public static final UnboundIntFlag TENANT_BUDGET_QUOTA = defineIntFlag(
- "tenant-budget-quota", -1,
- List.of("nobody"), "2020-12-02", "2021-02-01",
- "The budget in cents/hr a tenant is allowed spend per instance, as calculated by NodeResources",
- "Only takes effect on next deployment, if set to a value other than the default for flag!",
- TENANT_ID
- );
-
public static final UnboundBooleanFlag ONLY_PUBLIC_ACCESS = defineFeatureFlag(
"enable-public-only", false,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("ogronnesby"), "2020-12-02", "2021-02-01",
"Only access public hosts from container",
"Takes effect on next tick"
);
- public static final UnboundListFlag<String> OUTBOUND_BLOCKED_IPV4 = defineListFlag(
- "container-outbound-blocked-ipv4", List.of(), String.class,
- List.of("nobody"), "2020-12-02", "2021-02-01",
- "List of IPs or CIDRs that are blocked for outbound connections",
- "Takes effect on next tick"
- );
-
- public static final UnboundListFlag<String> OUTBOUND_BLOCKED_IPV6 = defineListFlag(
- "container-outbound-blocked-ipv6", List.of(), String.class,
- List.of("nobody"), "2020-12-02", "2021-02-01",
- "List of IPs or CIDRs that are blocked for outbound connections",
- "Takes effect on next tick"
- );
-
public static final UnboundBooleanFlag HIDE_SHARED_ROUTING_ENDPOINT = defineFeatureFlag(
"hide-shared-routing-endpoint", false,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("tokle"), "2020-12-02", "2021-02-01",
"Whether the controller should hide shared routing layer endpoint",
"Takes effect immediately",
APPLICATION_ID
);
- public static final UnboundBooleanFlag SKIP_MAINTENANCE_DEPLOYMENT = defineFeatureFlag(
- "node-repository-skip-maintenance-deployment", false,
- List.of("nobody"), "2020-12-02", "2021-02-01",
- "Whether PeriodicApplicationMaintainer should skip deployment for an application",
- "Takes effect at next run of maintainer",
- APPLICATION_ID);
-
public static final UnboundBooleanFlag USE_ACCESS_CONTROL_CLIENT_AUTHENTICATION = defineFeatureFlag(
"use-access-control-client-authentication", false,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("tokle"), "2020-12-02", "2021-02-01",
"Whether application container should set up client authentication on default port based on access control element",
"Takes effect on next internal redeployment",
APPLICATION_ID);
public static final UnboundBooleanFlag USE_ASYNC_MESSAGE_HANDLING_ON_SCHEDULE = defineFeatureFlag(
"async-message-handling-on-schedule", false,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("baldersheim"), "2020-12-02", "2021-02-01",
"Optionally deliver async messages in own thread",
"Takes effect at redeployment",
ZONE_ID, APPLICATION_ID);
+
public static final UnboundIntFlag CONTENT_NODE_BUCKET_DB_STRIPE_BITS = defineIntFlag(
"content-node-bucket-db-stripe-bits", 0,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("baldersheim"), "2020-12-02", "2021-02-01",
"Number of bits used for striping the bucket DB in service layer",
"Takes effect at redeployment",
ZONE_ID, APPLICATION_ID);
+
public static final UnboundIntFlag MERGE_CHUNK_SIZE = defineIntFlag(
"merge-chunk-size", 0x400000,
- List.of("nobody"), "2020-12-02", "2021-02-01",
- "Size of merge buffer in service layer",
+ List.of("baldersheim"), "2020-12-02", "2021-02-01",
+ "Size of baldersheim buffer in service layer",
"Takes effect at redeployment",
ZONE_ID, APPLICATION_ID);
+
public static final UnboundDoubleFlag FEED_CONCURRENCY = defineDoubleFlag(
"feed-concurrency", 0.5,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("baldersheim"), "2020-12-02", "2021-02-01",
"How much concurrency should be allowed for feed",
"Takes effect at redeployment",
ZONE_ID, APPLICATION_ID);
public static final UnboundBooleanFlag ENABLE_AUTOMATIC_REINDEXING = defineFeatureFlag(
"enable-automatic-reindexing", false,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("bjorncs", "jonmv"), "2020-12-02", "2021-02-01",
"Whether to automatically trigger reindexing from config change",
"Takes effect on next internal redeployment",
APPLICATION_ID);
public static final UnboundBooleanFlag USE_POWER_OF_TWO_CHOICES_LOAD_BALANCING = defineFeatureFlag(
"use-power-of-two-choices-load-balancing", false,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("tokle"), "2020-12-02", "2021-02-01",
"Whether to use Power of two load balancing algorithm for application",
"Takes effect on next internal redeployment",
APPLICATION_ID);
public static final UnboundBooleanFlag DYNAMIC_RECONFIGURATION_OF_ZOOKEEPER_CLUSTER = defineFeatureFlag(
"dynamic-reconfiguration-of-zookeeper-cluster", false,
- List.of("nobody"), "2020-12-02", "2021-02-01",
+ List.of("hmusum"), "2020-12-02", "2021-02-01",
"Whether to allow dynamic reconfiguration of zookeeper cluster",
"Takes effect on next deployment",
APPLICATION_ID);
diff --git a/flags/src/main/java/com/yahoo/vespa/flags/PermanentFlags.java b/flags/src/main/java/com/yahoo/vespa/flags/PermanentFlags.java
index c1f0f269f73..a3e2a11a79c 100644
--- a/flags/src/main/java/com/yahoo/vespa/flags/PermanentFlags.java
+++ b/flags/src/main/java/com/yahoo/vespa/flags/PermanentFlags.java
@@ -1,10 +1,22 @@
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.flags;
+import com.yahoo.vespa.flags.custom.ClusterCapacity;
+import com.yahoo.vespa.flags.custom.SharedHost;
+
import java.time.Instant;
+import java.time.ZoneOffset;
+import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
+import static com.yahoo.vespa.flags.FetchVector.Dimension.APPLICATION_ID;
+import static com.yahoo.vespa.flags.FetchVector.Dimension.CONSOLE_USER_EMAIL;
+import static com.yahoo.vespa.flags.FetchVector.Dimension.HOSTNAME;
+import static com.yahoo.vespa.flags.FetchVector.Dimension.NODE_TYPE;
+import static com.yahoo.vespa.flags.FetchVector.Dimension.TENANT_ID;
+import static com.yahoo.vespa.flags.FetchVector.Dimension.ZONE_ID;
+
/**
* Definition for permanent feature flags
*
@@ -14,7 +26,110 @@ public class PermanentFlags {
static final List<String> OWNERS = List.of();
static final Instant CREATED_AT = Instant.EPOCH;
- static final Instant EXPIRES_AT = Instant.MAX;
+ static final Instant EXPIRES_AT = ZonedDateTime.of(2100, 1, 1, 0, 0, 0, 0, ZoneOffset.UTC).toInstant();
+
+ public static final UnboundBooleanFlag USE_ALTERNATIVE_ENDPOINT_CERTIFICATE_PROVIDER = defineFeatureFlag(
+ "use-alternative-endpoint-certificate-provider", false,
+ "Whether to use an alternative CA when provisioning new certificates",
+ "Takes effect only on initial application deployment - not on later certificate refreshes!");
+
+ public static final UnboundStringFlag JVM_GC_OPTIONS = defineStringFlag(
+ "jvm-gc-options", "",
+ "Sets deafult jvm gc options",
+ "Takes effect at redeployment",
+ ZONE_ID, APPLICATION_ID);
+
+ public static final UnboundStringFlag DOCKER_VERSION = defineStringFlag(
+ "docker-version", "1.13.1-102.git7f2769b",
+ "The version of the docker to use of the format VERSION-REL: The YUM package to be installed will be " +
+ "2:docker-VERSION-REL.el7.centos.x86_64 in AWS (and without '.centos' otherwise). " +
+ "If docker-version is not of this format, it must be parseable by YumPackageName::fromString.",
+ "Takes effect on next tick.",
+ HOSTNAME);
+
+ public static final UnboundBooleanFlag FLEET_CANARY = defineFeatureFlag(
+ "fleet-canary", false,
+ "Whether the host is a fleet canary.",
+ "Takes effect on next host admin tick.",
+ HOSTNAME);
+
+ public static final UnboundListFlag<ClusterCapacity> PREPROVISION_CAPACITY = defineListFlag(
+ "preprovision-capacity", List.of(), ClusterCapacity.class,
+ "Specifies the resources that ought to be immediately available for additional cluster " +
+ "allocations. If the resources are not available, additional hosts will be provisioned. " +
+ "Only applies to dynamically provisioned zones.",
+ "Takes effect on next iteration of DynamicProvisioningMaintainer.");
+
+ public static final UnboundIntFlag REBOOT_INTERVAL_IN_DAYS = defineIntFlag(
+ "reboot-interval-in-days", 30,
+ "No reboots are scheduled 0x-1x reboot intervals after the previous reboot, while reboot is " +
+ "scheduled evenly distributed in the 1x-2x range (and naturally guaranteed at the 2x boundary).",
+ "Takes effect on next run of NodeRebooter");
+
+ public static final UnboundJacksonFlag<SharedHost> SHARED_HOST = defineJacksonFlag(
+ "shared-host", SharedHost.createDisabled(), SharedHost.class,
+ "Specifies whether shared hosts can be provisioned, and if so, the advertised " +
+ "node resources of the host, the maximum number of containers, etc.",
+ "Takes effect on next iteration of DynamicProvisioningMaintainer.");
+
+ public static final UnboundBooleanFlag SKIP_MAINTENANCE_DEPLOYMENT = defineFeatureFlag(
+ "node-repository-skip-maintenance-deployment", false,
+ "Whether PeriodicApplicationMaintainer should skip deployment for an application",
+ "Takes effect at next run of maintainer",
+ APPLICATION_ID);
+
+ public static final UnboundListFlag<String> INACTIVE_MAINTENANCE_JOBS = defineListFlag(
+ "inactive-maintenance-jobs", List.of(), String.class,
+ "The list of maintenance jobs that are inactive.",
+ "Takes effect immediately, but any currently running jobs will run until completion.");
+
+ public static final UnboundListFlag<String> OUTBOUND_BLOCKED_IPV4 = defineListFlag(
+ "container-outbound-blocked-ipv4", List.of(), String.class,
+ "List of IPs or CIDRs that are blocked for outbound connections",
+ "Takes effect on next tick");
+
+ public static final UnboundListFlag<String> OUTBOUND_BLOCKED_IPV6 = defineListFlag(
+ "container-outbound-blocked-ipv6", List.of(), String.class,
+ "List of IPs or CIDRs that are blocked for outbound connections",
+ "Takes effect on next tick");
+
+ public static final UnboundIntFlag TENANT_BUDGET_QUOTA = defineIntFlag(
+ "tenant-budget-quota", -1,
+ "The budget in cents/hr a tenant is allowed spend per instance, as calculated by NodeResources",
+ "Only takes effect on next deployment, if set to a value other than the default for flag!",
+ TENANT_ID);
+
+ public static final UnboundDoubleFlag CONTAINER_CPU_CAP = defineDoubleFlag(
+ "container-cpu-cap", 0,
+ "Hard limit on how many CPUs a container may use. This value is multiplied by CPU allocated to node, so " +
+ "to cap CPU at 200%, set this to 2, etc.",
+ "Takes effect on next node agent tick. Change is orchestrated, but does NOT require container restart",
+ HOSTNAME, APPLICATION_ID);
+
+ public static final UnboundListFlag<String> DISABLED_HOST_ADMIN_TASKS = defineListFlag(
+ "disabled-host-admin-tasks", List.of(), String.class,
+ "List of host-admin task names (as they appear in the log, e.g. root>main>UpgradeTask), or some node-agent " +
+ "functionality (see NodeAgentTask), that should be skipped",
+ "Takes effect on next host admin tick",
+ HOSTNAME, NODE_TYPE);
+
+ public static final UnboundStringFlag DOCKER_IMAGE_REPO = defineStringFlag(
+ "docker-image-repo", "",
+ "Override default docker image repo. Docker image version will be Vespa version.",
+ "Takes effect on next deployment from controller",
+ ZONE_ID, APPLICATION_ID);
+
+ public static final UnboundStringFlag ZOOKEEPER_SERVER_VERSION = defineStringFlag(
+ "zookeeper-server-version", "3.5.6",
+ "ZooKeeper server version, a jar file zookeeper-server-<ZOOKEEPER_SERVER_VERSION>-jar-with-dependencies.jar must exist",
+ "Takes effect on restart of Docker container",
+ NODE_TYPE, APPLICATION_ID, HOSTNAME);
+
+ public static final UnboundBooleanFlag ENABLE_PUBLIC_SIGNUP_FLOW = defineFeatureFlag(
+ "enable-public-signup-flow", false,
+ "Show the public signup flow for a user in the console",
+ "takes effect on browser reload of api/user/v1/user",
+ CONSOLE_USER_EMAIL);
private PermanentFlags() {}
@@ -53,5 +168,5 @@ public class PermanentFlags {
return Flags.defineListFlag(flagId, defaultValue, elementClass, OWNERS, toString(CREATED_AT), toString(EXPIRES_AT), description, modificationEffect, dimensions);
}
- private static String toString(Instant instant) { return DateTimeFormatter.ISO_DATE.format(instant); }
+ private static String toString(Instant instant) { return DateTimeFormatter.ISO_DATE.withZone(ZoneOffset.UTC).format(instant); }
}
diff --git a/flags/src/main/java/com/yahoo/vespa/flags/custom/SharedHost.java b/flags/src/main/java/com/yahoo/vespa/flags/custom/SharedHost.java
index ab9127ebfe4..c952161cf72 100644
--- a/flags/src/main/java/com/yahoo/vespa/flags/custom/SharedHost.java
+++ b/flags/src/main/java/com/yahoo/vespa/flags/custom/SharedHost.java
@@ -7,13 +7,13 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
-import com.yahoo.vespa.flags.Flags;
+import com.yahoo.vespa.flags.PermanentFlags;
import java.util.List;
import java.util.Objects;
/**
- * Defines properties related to shared hosts, see {@link Flags#SHARED_HOST}.
+ * Defines properties related to shared hosts, see {@link PermanentFlags#SHARED_HOST}.
*
* @author hakon
*/
diff --git a/flags/src/test/java/com/yahoo/vespa/flags/FlagsTest.java b/flags/src/test/java/com/yahoo/vespa/flags/FlagsTest.java
index 8882a15e526..48ed318af41 100644
--- a/flags/src/test/java/com/yahoo/vespa/flags/FlagsTest.java
+++ b/flags/src/test/java/com/yahoo/vespa/flags/FlagsTest.java
@@ -4,8 +4,6 @@ package com.yahoo.vespa.flags;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.node.BooleanNode;
-import com.yahoo.vespa.flags.custom.HostResources;
-import com.yahoo.vespa.flags.custom.SharedHost;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
@@ -109,17 +107,7 @@ public class FlagsTest {
List.of(instance));
}
- @Test
- public void testSharedHostFlag() {
- SharedHost sharedHost = new SharedHost(List.of(new HostResources(
- 4.0, 16.0, 50.0, 0.3,
- "fast", "local",
- 10)),
- null);
- testGeneric(Flags.SHARED_HOST, sharedHost);
- }
-
- private <T> void testGeneric(UnboundFlag<T, ?, ?> unboundFlag, T value) {
+ static <T> void testGeneric(UnboundFlag<T, ?, ?> unboundFlag, T value) {
FlagSource source = mock(FlagSource.class);
Flag<T, ?> flag = unboundFlag.bindTo(source);
diff --git a/flags/src/test/java/com/yahoo/vespa/flags/PermanentFlagsTest.java b/flags/src/test/java/com/yahoo/vespa/flags/PermanentFlagsTest.java
new file mode 100644
index 00000000000..3f43682cfb9
--- /dev/null
+++ b/flags/src/test/java/com/yahoo/vespa/flags/PermanentFlagsTest.java
@@ -0,0 +1,25 @@
+package com.yahoo.vespa.flags;// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+import com.yahoo.vespa.flags.custom.HostResources;
+import com.yahoo.vespa.flags.custom.SharedHost;
+import org.junit.jupiter.api.Test;
+
+import java.util.List;
+
+import static com.yahoo.vespa.flags.FlagsTest.testGeneric;
+
+/**
+ * @author bjorncs
+ */
+class PermanentFlagsTest {
+ @Test
+ public void testSharedHostFlag() {
+ SharedHost sharedHost = new SharedHost(List.of(new HostResources(
+ 4.0, 16.0, 50.0, 0.3,
+ "fast", "local",
+ 10)),
+ null);
+ testGeneric(PermanentFlags.SHARED_HOST, sharedHost);
+ }
+
+} \ No newline at end of file