-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: pass correct env vars to read/write containers in megapod. Org…
…anize runtime env var code. (#13790)
- Loading branch information
Showing
13 changed files
with
731 additions
and
368 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
189 changes: 79 additions & 110 deletions
189
airbyte-workload-launcher/src/main/kotlin/config/EnvVarConfigBeanFactory.kt
Large diffs are not rendered by default.
Oops, something went wrong.
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
55 changes: 55 additions & 0 deletions
55
airbyte-workload-launcher/src/main/kotlin/constants/EnvVarConstants.kt
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package io.airbyte.workload.launcher.constants | ||
|
||
import io.airbyte.workers.workload.WorkloadConstants | ||
|
||
/** | ||
* Env var names and other string constants used to set env vars for the containers we launch. | ||
* | ||
* Over time, we should try to collect the env vars here. Moving this to a shared library is also likely. | ||
*/ | ||
object EnvVarConstants { | ||
const val METRIC_CLIENT_ENV_VAR = "METRIC_CLIENT" | ||
const val DD_AGENT_HOST_ENV_VAR = "DD_AGENT_HOST" | ||
const val DD_DOGSTATSD_PORT_ENV_VAR = "DD_DOGSTATSD_PORT" | ||
const val DD_ENV_ENV_VAR = "DD_ENV" | ||
const val DD_SERVICE_ENV_VAR = "DD_SERVICE" | ||
const val DD_VERSION_ENV_VAR = "DD_VERSION" | ||
const val JAVA_OPTS_ENV_VAR = "JAVA_OPTS" | ||
const val PUBLISH_METRICS_ENV_VAR = "PUBLISH_METRICS" | ||
const val CONTROL_PLANE_AUTH_ENDPOINT_ENV_VAR = "CONTROL_PLANE_AUTH_ENDPOINT" | ||
const val DATA_PLANE_SERVICE_ACCOUNT_CREDENTIALS_PATH_ENV_VAR = "DATA_PLANE_SERVICE_ACCOUNT_CREDENTIALS_PATH" | ||
const val DATA_PLANE_SERVICE_ACCOUNT_EMAIL_ENV_VAR = "DATA_PLANE_SERVICE_ACCOUNT_EMAIL" | ||
const val AIRBYTE_API_AUTH_HEADER_NAME_ENV_VAR = "AIRBYTE_API_AUTH_HEADER_NAME" | ||
const val AIRBYTE_API_AUTH_HEADER_VALUE_ENV_VAR = "AIRBYTE_API_AUTH_HEADER_VALUE" | ||
const val KEYCLOAK_CLIENT_ID_ENV_VAR = "KEYCLOAK_CLIENT_ID" | ||
const val KEYCLOAK_INTERNAL_REALM_ISSUER_ENV_VAR = "KEYCLOAK_INTERNAL_REALM_ISSUER" | ||
const val INTERNAL_API_HOST_ENV_VAR = "INTERNAL_API_HOST" | ||
const val ACCEPTANCE_TEST_ENABLED_VAR = "ACCEPTANCE_TEST_ENABLED" | ||
const val DD_INTEGRATION_ENV_VAR_FORMAT = "DD_INTEGRATION_%s_ENABLED" | ||
const val WORKER_V2_MICRONAUT_ENV = WorkloadConstants.WORKER_V2_MICRONAUT_ENV | ||
const val WORKLOAD_API_HOST_ENV_VAR = "WORKLOAD_API_HOST" | ||
const val WORKLOAD_API_CONNECT_TIMEOUT_SECONDS_ENV_VAR = "WORKLOAD_API_CONNECT_TIMEOUT_SECONDS" | ||
const val WORKLOAD_API_READ_TIMEOUT_SECONDS_ENV_VAR = "WORKLOAD_API_READ_TIMEOUT_SECONDS" | ||
const val WORKLOAD_API_RETRY_DELAY_SECONDS_ENV_VAR = "WORKLOAD_API_RETRY_DELAY_SECONDS" | ||
const val WORKLOAD_API_MAX_RETRIES_ENV_VAR = "WORKLOAD_API_MAX_RETRIES" | ||
const val SECRET_PERSISTENCE = "SECRET_PERSISTENCE" | ||
const val SECRET_STORE_GCP_PROJECT_ID = "SECRET_STORE_GCP_PROJECT_ID" | ||
const val AWS_SECRET_MANAGER_REGION = "AWS_SECRET_MANAGER_REGION" | ||
const val AWS_KMS_KEY_ARN = "AWS_KMS_KEY_ARN" | ||
const val AWS_SECRET_MANAGER_SECRET_TAGS = "AWS_SECRET_MANAGER_SECRET_TAGS" | ||
const val VAULT_ADDRESS = "VAULT_ADDRESS" | ||
const val VAULT_PREFIX = "VAULT_PREFIX" | ||
const val CONCURRENT_SOURCE_STREAM_READ_ENV_VAR = "CONCURRENT_SOURCE_STREAM_READ" | ||
const val USE_STREAM_CAPABLE_STATE_ENV_VAR = "USE_STREAM_CAPABLE_STATE" | ||
const val OTEL_COLLECTOR_ENDPOINT_ENV_VAR = "OTEL_COLLECTOR_ENDPOINT" | ||
|
||
// secrets | ||
const val AWS_ASSUME_ROLE_ACCESS_KEY_ID_ENV_VAR = "AWS_ASSUME_ROLE_ACCESS_KEY_ID" | ||
const val AWS_ASSUME_ROLE_SECRET_ACCESS_KEY_ENV_VAR = "AWS_ASSUME_ROLE_SECRET_ACCESS_KEY" | ||
const val WORKLOAD_API_BEARER_TOKEN_ENV_VAR = "WORKLOAD_API_BEARER_TOKEN" | ||
const val KEYCLOAK_CLIENT_SECRET_ENV_VAR = "KEYCLOAK_CLIENT_SECRET" | ||
const val SECRET_STORE_GCP_CREDENTIALS = "SECRET_STORE_GCP_CREDENTIALS" | ||
const val AWS_SECRET_MANAGER_ACCESS_KEY_ID = "AWS_SECRET_MANAGER_ACCESS_KEY_ID" | ||
const val AWS_SECRET_MANAGER_SECRET_ACCESS_KEY = "AWS_SECRET_MANAGER_SECRET_ACCESS_KEY" | ||
const val VAULT_AUTH_TOKEN = "VAULT_AUTH_TOKEN" | ||
} |
18 changes: 18 additions & 0 deletions
18
airbyte-workload-launcher/src/main/kotlin/model/MapEnvVarExtensions.kt
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.airbyte.workload.launcher.model | ||
|
||
import io.fabric8.kubernetes.api.model.EnvVar | ||
import io.fabric8.kubernetes.api.model.EnvVarSource | ||
|
||
/** | ||
* For EnvVar that directly contain their values. | ||
*/ | ||
private fun Map.Entry<String, String>.toEnvVar() = EnvVar(this.key, this.value, null) | ||
|
||
/** | ||
* For EnvVar that contain a reference to their values (EnvVarSource). Usually secrets. | ||
*/ | ||
private fun Map.Entry<String, EnvVarSource>.toRefEnvVar() = EnvVar(this.key, null, this.value) | ||
|
||
fun Map<String, String>.toEnvVarList() = this.map { it.toEnvVar() }.toList() | ||
|
||
fun Map<String, EnvVarSource>.toRefEnvVarList() = this.map { it.toRefEnvVar() }.toList() |
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
Oops, something went wrong.