Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip - Bump helm chart version test #5071

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e3be254
Adding allowance for default configMap/secrets to pull env froms
neilisaur Feb 27, 2024
dcd1024
Merge branch 'master' into add-k8s-env-froms
neilisaur Feb 27, 2024
e018a10
Updating Helm charts
neilisaur Feb 27, 2024
7418d49
Fixing typos
neilisaur Feb 27, 2024
13560f7
More typo
neilisaur Feb 29, 2024
63eeb38
Merge remote-tracking branch 'origin/master' into add-k8s-env-froms
neilisaur Feb 29, 2024
a2701f1
Ran 'make helm'
neilisaur Feb 29, 2024
8667a20
Merge remote-tracking branch 'origin/master' into add-k8s-env-froms
neilisaur Mar 8, 2024
000b137
Updating docs from `make helm`
neilisaur Mar 8, 2024
d4915a9
Merge remote-tracking branch 'origin/master' into add-k8s-env-froms
neilisaur Mar 11, 2024
5cf75b4
`make helm` results
neilisaur Mar 11, 2024
7709167
Merge remote-tracking branch 'origin/master' into add-k8s-env-froms
neilisaur Mar 13, 2024
2be920c
Fixing issues with env vs envFrom
neilisaur Mar 14, 2024
928d943
Fixing merge issue
neilisaur Mar 14, 2024
46059b3
Better naming for variable
neilisaur Mar 14, 2024
e454188
Renaming to be more accurate
neilisaur Mar 14, 2024
0841046
Fixing typo
neilisaur Mar 14, 2024
b621f2e
Forgot one change
neilisaur Mar 14, 2024
ce4d32e
Merge remote-tracking branch 'origin/master' into add-k8s-env-froms
neilisaur Mar 15, 2024
43e20b6
Fixing linting error
neilisaur Mar 15, 2024
bc6b254
Updating Helm charts
neilisaur Mar 15, 2024
92bb983
Bump chart version
eapolinario Mar 18, 2024
cf594f6
Lint error - space before comment
eapolinario Mar 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions charts/flyte/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ apiVersion: v2
name: flyte
description: A Helm chart for Flyte Sandbox
type: application
version: v0.1.10 # VERSION
version: v0.1.11 # VERSION
dependencies:
- name: flyte-core
alias: flyte
version: v0.1.10 # VERSION
repository: file://../flyte-core # REPOSITORY
version: v0.1.10 # VERSION
repository: file://../flyte-core # REPOSITORY
- name: contour
version: 7.10.1
repository: https://charts.bitnami.com/bitnami
Expand Down
8 changes: 4 additions & 4 deletions charts/flyte/README.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions charts/flyte/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
--- # ---------------------------------------------------------------------

Check failure on line 1 in charts/flyte/values.yaml

View workflow job for this annotation

GitHub Actions / lint-and-test-charts

1:5 [comments] too few spaces before comment
# ---------------------------------------------------------------------
# Core System settings
# This section consists of Core components of Flyte and their deployment
Expand All @@ -14,9 +14,9 @@
replicaCount: 1
image:
# -- Docker image for Flyteadmin deployment
repository: cr.flyte.org/flyteorg/flyteadmin # FLYTEADMIN_IMAGE

Check failure on line 17 in charts/flyte/values.yaml

View workflow job for this annotation

GitHub Actions / lint-and-test-charts

17:52 [comments] too few spaces before comment
# -- Docker image tag
tag: v1.11.0 # FLYTEADMIN_TAG

Check failure on line 19 in charts/flyte/values.yaml

View workflow job for this annotation

GitHub Actions / lint-and-test-charts

19:20 [comments] too few spaces before comment
# -- Docker image pull policy
pullPolicy: IfNotPresent
# -- Additional flyteadmin container environment variables
Expand Down Expand Up @@ -82,9 +82,9 @@
flytescheduler:
image:
# -- Docker image for Flytescheduler deployment
repository: cr.flyte.org/flyteorg/flytescheduler # FLYTESCHEDULER_IMAGE

Check failure on line 85 in charts/flyte/values.yaml

View workflow job for this annotation

GitHub Actions / lint-and-test-charts

85:56 [comments] too few spaces before comment
# -- Docker image tag
tag: v1.11.0 # FLYTESCHEDULER_TAG

Check failure on line 87 in charts/flyte/values.yaml

View workflow job for this annotation

GitHub Actions / lint-and-test-charts

87:20 [comments] too few spaces before comment
# -- Docker image pull policy
pullPolicy: IfNotPresent
# -- Default resources requests and limits for Flytescheduler deployment
Expand Down Expand Up @@ -127,9 +127,9 @@
replicaCount: 1
image:
# -- Docker image for Datacatalog deployment
repository: cr.flyte.org/flyteorg/datacatalog # DATACATALOG_IMAGE

Check failure on line 130 in charts/flyte/values.yaml

View workflow job for this annotation

GitHub Actions / lint-and-test-charts

130:53 [comments] too few spaces before comment
# -- Docker image tag
tag: v1.11.0 # DATACATALOG_TAG

Check failure on line 132 in charts/flyte/values.yaml

View workflow job for this annotation

GitHub Actions / lint-and-test-charts

132:20 [comments] too few spaces before comment
# -- Docker image pull policy
pullPolicy: IfNotPresent
# -- Default resources requests and limits for Datacatalog deployment
Expand Down Expand Up @@ -176,9 +176,9 @@
manager: false
image:
# -- Docker image for Flytepropeller deployment
repository: cr.flyte.org/flyteorg/flytepropeller # FLYTEPROPELLER_IMAGE

Check failure on line 179 in charts/flyte/values.yaml

View workflow job for this annotation

GitHub Actions / lint-and-test-charts

179:56 [comments] too few spaces before comment
# -- Docker image tag
tag: v1.11.0 # FLYTEPROPELLER_TAG

Check failure on line 181 in charts/flyte/values.yaml

View workflow job for this annotation

GitHub Actions / lint-and-test-charts

181:20 [comments] too few spaces before comment
# -- Docker image pull policy
pullPolicy: IfNotPresent
# -- Default resources requests and limits for Flytepropeller deployment
Expand Down Expand Up @@ -221,7 +221,7 @@
replicaCount: 1
image:
# -- Docker image for Flyteconsole deployment
repository: cr.flyte.org/flyteorg/flyteconsole # FLYTECONSOLE_IMAGE

Check failure on line 224 in charts/flyte/values.yaml

View workflow job for this annotation

GitHub Actions / lint-and-test-charts

224:54 [comments] too few spaces before comment
# -- Docker image tag
tag: v1.10.3 # FLYTECONSOLE_TAG
# -- Docker image pull policy
Expand Down Expand Up @@ -547,6 +547,8 @@
- FLYTE_AWS_ACCESS_KEY_ID: minio
- FLYTE_AWS_SECRET_ACCESS_KEY: miniostorage
default-memory: 200Mi
default-env-from-configmaps: []
default-env-from-secrets: []

# -- Logger configuration
logger:
Expand Down
6 changes: 4 additions & 2 deletions deployment/sandbox/flyte_helm_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,8 @@ data:
plugins:
k8s:
default-cpus: 100m
default-env-from-configmaps: []
default-env-from-secrets: []
default-env-vars:
- FLYTE_AWS_ENDPOINT: http://minio.flyte:9000
- FLYTE_AWS_ACCESS_KEY_ID: minio
Expand Down Expand Up @@ -7170,7 +7172,7 @@ spec:
template:
metadata:
annotations:
configChecksum: "ecefcb1d6df38b32a9ec77d91de63cd40da935a3239b70a5bb0396435878c80"
configChecksum: "3500386bee9f0763c6f14460f607cea4e6e24be4224a806c0673db71e13e287"
labels:
app.kubernetes.io/name: flytepropeller
app.kubernetes.io/instance: flyte
Expand Down Expand Up @@ -7244,7 +7246,7 @@ spec:
app.kubernetes.io/name: flyte-pod-webhook
app.kubernetes.io/version: v1.11.0
annotations:
configChecksum: "ecefcb1d6df38b32a9ec77d91de63cd40da935a3239b70a5bb0396435878c80"
configChecksum: "3500386bee9f0763c6f14460f607cea4e6e24be4224a806c0673db71e13e287"
spec:
securityContext:
fsGroup: 65534
Expand Down
4 changes: 2 additions & 2 deletions docker/sandbox-bundled/manifests/complete-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ type: Opaque
---
apiVersion: v1
data:
haSharedSecret: VTg5RFBvY205cXRtcEVFbw==
haSharedSecret: U0tNSVV0aUwzZzYxNVZnVQ==
proxyPassword: ""
proxyUsername: ""
kind: Secret
Expand Down Expand Up @@ -1412,7 +1412,7 @@ spec:
metadata:
annotations:
checksum/config: 8f50e768255a87f078ba8b9879a0c174c3e045ffb46ac8723d2eedbe293c8d81
checksum/secret: b8339a7b42c1e04b994b517d4ddd749074787df4a0eaef9e1aa2181988aea2d7
checksum/secret: e0d4db2f1f52d2e4d16959b463e9470d657899ab22db5d8eb2fbc605cdcda0a2
labels:
app: docker-registry
release: flyte-sandbox
Expand Down
4 changes: 2 additions & 2 deletions docker/sandbox-bundled/manifests/complete.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ type: Opaque
---
apiVersion: v1
data:
haSharedSecret: ZTNEUmhqY1VsWDBXNFowTg==
haSharedSecret: bmNtdzJkQ0l2Rm5BS3VZSg==
proxyPassword: ""
proxyUsername: ""
kind: Secret
Expand Down Expand Up @@ -1360,7 +1360,7 @@ spec:
metadata:
annotations:
checksum/config: 8f50e768255a87f078ba8b9879a0c174c3e045ffb46ac8723d2eedbe293c8d81
checksum/secret: cedf489b22e27428631c5c365e58bfd51cf8465bf04d07a74462677278017b80
checksum/secret: b1ca10c95becb2e7214c9ece8101acc322ecde650f1e70bdb1bbb37323c948f6
labels:
app: docker-registry
release: flyte-sandbox
Expand Down
4 changes: 2 additions & 2 deletions docker/sandbox-bundled/manifests/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ metadata:
---
apiVersion: v1
data:
haSharedSecret: bkV2U2JzN0o2TXNVcHJTMg==
haSharedSecret: S2hmRkxmVjdKZUpoTkR6OQ==
proxyPassword: ""
proxyUsername: ""
kind: Secret
Expand Down Expand Up @@ -934,7 +934,7 @@ spec:
metadata:
annotations:
checksum/config: 8f50e768255a87f078ba8b9879a0c174c3e045ffb46ac8723d2eedbe293c8d81
checksum/secret: 2f2e4b3f4abc8a670a75900bd0c7987fb3afa6b2a287fdf7292fbeb755c00c12
checksum/secret: 446da9acad72026ea6684e9f0cf3e47f8a458fa10d29d61ac3f8bc509afc7c11
labels:
app: docker-registry
release: flyte-sandbox
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ type K8sPluginConfig struct {
DefaultEnvVars map[string]string `json:"default-env-vars" pflag:"-,Additional environment variable that should be injected into every resource"`
// Provide additional environment variable pairs whose values resolve from the plugin's execution environment.
DefaultEnvVarsFromEnv map[string]string `json:"default-env-vars-from-env" pflag:"-,Additional environment variable that should be injected into every resource"`
// Provide additional environment variable parts from configMaps
DefaultEnvFromConfigMaps []string `json:"default-env-from-configmaps" pflag:"-,Additional environment variable sets that should be injected into each pod from these configMaps"`
// Provide additional environment variable parts from secrets
DefaultEnvFromSecrets []string `json:"default-env-from-secrets" pflag:"-,Additional environment variable sets that should be injected into each pod from these secret"`

// default cpu requests for a container
DefaultCPURequest resource.Quantity `json:"default-cpus" pflag:",Defines a default value for cpu for containers if not specified."`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ func AddFlyteCustomizationsToContainer(ctx context.Context, parameters template.
}
container.Args = modifiedArgs

container.Env = DecorateEnvVars(ctx, container.Env, parameters.TaskExecMetadata.GetEnvironmentVariables(), parameters.TaskExecMetadata.GetTaskExecutionID())
container.Env, container.EnvFrom = DecorateEnvVars(ctx, container.Env, parameters.TaskExecMetadata.GetEnvironmentVariables(), parameters.TaskExecMetadata.GetTaskExecutionID())

// retrieve platformResources and overrideResources to use when aggregating container resources
platformResources := parameters.TaskExecMetadata.GetPlatformResources()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
return envVars
}

func DecorateEnvVars(ctx context.Context, envVars []v1.EnvVar, taskEnvironmentVariables map[string]string, id pluginsCore.TaskExecutionID) []v1.EnvVar {
func DecorateEnvVars(ctx context.Context, envVars []v1.EnvVar, taskEnvironmentVariables map[string]string, id pluginsCore.TaskExecutionID) ([]v1.EnvVar, []v1.EnvFromSource) {
envVars = append(envVars, GetContextEnvVars(ctx)...)
envVars = append(envVars, GetExecutionEnvVars(id)...)

Expand All @@ -128,7 +128,21 @@
envVars = append(envVars, v1.EnvVar{Name: k, Value: value})
}

return envVars
envFroms := []v1.EnvFromSource{}

for _, secretName := range config.GetK8sPluginConfig().DefaultEnvFromSecrets {
optional := true
secretRef := v1.SecretEnvSource{LocalObjectReference: v1.LocalObjectReference{Name: secretName}, Optional: &optional}
envFroms = append(envFroms, v1.EnvFromSource{SecretRef: &secretRef})
}

Check warning on line 137 in flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds.go

View check run for this annotation

Codecov / codecov/patch

flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds.go#L134-L137

Added lines #L134 - L137 were not covered by tests

for _, cmName := range config.GetK8sPluginConfig().DefaultEnvFromConfigMaps {
optional := true
cmRef := v1.ConfigMapEnvSource{LocalObjectReference: v1.LocalObjectReference{Name: cmName}, Optional: &optional}
envFroms = append(envFroms, v1.EnvFromSource{ConfigMapRef: &cmRef})
}

Check warning on line 143 in flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds.go

View check run for this annotation

Codecov / codecov/patch

flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds.go#L140-L143

Added lines #L140 - L143 were not covered by tests

return envVars, envFroms
}

func GetPodTolerations(interruptible bool, resourceRequirements ...v1.ResourceRequirements) []v1.Toleration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ func TestDecorateEnvVars(t *testing.T) {
DefaultEnvVars: tt.additionEnvVar,
DefaultEnvVarsFromEnv: tt.additionEnvVarFromEnv,
}))
if got := DecorateEnvVars(ctx, tt.args.envVars, tt.executionEnvVar, tt.args.id); !reflect.DeepEqual(got, tt.want) {
if got, _ := DecorateEnvVars(ctx, tt.args.envVars, tt.executionEnvVar, tt.args.id); !reflect.DeepEqual(got, tt.want) {
t.Errorf("DecorateEnvVars() = %v, want %v", got, tt.want)
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func UpdateBatchInputForArray(_ context.Context, batchInput *batch.SubmitJobInpu

func getEnvVarsForTask(ctx context.Context, execID pluginCore.TaskExecutionID, containerEnvVars []*core.KeyValuePair,
defaultEnvVars map[string]string) []v1.EnvVar {
envVars := flytek8s.DecorateEnvVars(ctx, flytek8s.ToK8sEnvVar(containerEnvVars), nil, execID)
envVars, _ := flytek8s.DecorateEnvVars(ctx, flytek8s.ToK8sEnvVar(containerEnvVars), nil, execID)
m := make(map[string]string, len(envVars))
for _, envVar := range envVars {
m[envVar.Name] = envVar.Value
Expand Down
Loading