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

[PFS-241] make storageURL required only when deploy target is not local. #9981

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions etc/helm/examples/aws-gp2-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ etcd:

pachd:
storage:
storageURL: s3://blah
amazon:
bucket: blah
region: some-region
Expand Down
1 change: 1 addition & 0 deletions etc/helm/examples/aws-gp3-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ etcd:

pachd:
storage:
storageURL: s3://blah
amazon:
bucket: blah
region: some-region
Expand Down
2 changes: 2 additions & 0 deletions etc/helm/examples/enterprise-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ pachd:
enterpriseLicenseKey: ""
oauthClientID: "enterprise-pach"
oauthRedirectURI: "http://localhost:31657/authorization-code/callback"
storage:
storageURL: s3://blah
1 change: 1 addition & 0 deletions etc/helm/examples/enterprise-member-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pachd:
oauthClientSecret: "oauth-secret"

storage:
storageURL: s3://pachyderm-test
backend: MINIO
minio:
bucket: "pachyderm-test"
Expand Down
1 change: 1 addition & 0 deletions etc/helm/examples/gcp-tls-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ingress:

pachd:
storage:
storageURL: gs://fake-bucket
google:
bucket: "fake-bucket"
cred: ""
Expand Down
1 change: 1 addition & 0 deletions etc/helm/examples/gcp-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ deployTarget: GOOGLE

pachd:
storage:
storageURL: gs://fake-bucket
google:
bucket: "fake-bucket"
# You can also pass the creds on the command line using helm install --set-file storage.google.cred=creds.json
Expand Down
1 change: 1 addition & 0 deletions etc/helm/examples/hub-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ pachd:
apiGRPCPort: 31400
s3GatewayPort: 30600
storage:
storageURL: "gs://test-bucket"
google:
# bucket is configured per workspace.
bucket: "test-bucket"
Expand Down
3 changes: 1 addition & 2 deletions etc/helm/examples/int-test-values-with-det.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ pachd:
rootToken: "pizza"
enterpriseLicenseKey: ""
storage:
storageURL: "s3://pachyderm-test?endpoint=minio.default.svc.cluster.local:9000&disableSSL=true&region=dummy-region"
backend: AMAZON
amazon:
gocdkEnabled: "true"
storageURL: "s3://pachyderm-test?endpoint=minio.default.svc.cluster.local:9000&disableSSL=true&region=dummy-region"
id: "minioadmin"
secret: "minioadmin"

Expand Down
3 changes: 1 addition & 2 deletions etc/helm/examples/local-dev-values-with-det.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ pachd:
enterpriseLicenseKey: ""
oauthRedirectURI: "http://localhost:8283/authorization-code/callback"
storage:
storageURL: "s3://pachyderm-test?endpoint=minio.default.svc.cluster.local:9000&disableSSL=true&region=dummy-region"
backend: AMAZON
amazon:
gocdkEnabled: "true"
storageURL: "s3://pachyderm-test?endpoint=minio.default.svc.cluster.local:9000&disableSSL=true&region=dummy-region"
id: "minioadmin"
secret: "minioadmin"

Expand Down
1 change: 1 addition & 0 deletions etc/helm/examples/microsoft-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ deployTarget: MICROSOFT

pachd:
storage:
storageURL: az://pachyderm-test
microsoft:
container: "foo"
id: "bar"
Expand Down
1 change: 1 addition & 0 deletions etc/helm/examples/minio-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ deployTarget: CUSTOM

pachd:
storage:
storageURL: s3://foo
backend: MINIO
minio:
bucket: "foo"
Expand Down
4 changes: 2 additions & 2 deletions etc/helm/pachyderm/templates/pachd/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ spec:
env:
- name: GOCDK_ENABLED
value: {{ .Values.pachd.storage.gocdkEnabled | default true | quote }}
{{- if .Values.pachd.storage.storageURL }}
{{- if and (ne .Values.deployTarget "LOCAL") .Values.pachd.storage.gocdkEnabled }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the deploy target is local, we only use the storageRoot as the object storage backend

- name: STORAGE_URL
value: {{ .Values.pachd.storage.storageURL }}
value: {{ required "storage URL required" .Values.pachd.storage.storageURL | quote }}
{{- end }}
- name: PACHW_IN_SIDECARS
value: {{ .Values.pachw.inSidecars | quote }}
Expand Down
4 changes: 2 additions & 2 deletions etc/helm/pachyderm/templates/pachw/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ spec:
value: "true"
- name: GOCDK_ENABLED
value: {{ .Values.pachd.storage.gocdkEnabled | default true | quote }}
{{- if .Values.pachd.storage.storageURL }}
{{- if and (ne .Values.deployTarget "LOCAL") .Values.pachd.storage.gocdkEnabled }}
- name: STORAGE_URL
value: {{ .Values.pachd.storage.storageURL }}
value: {{ required "storage URL required" .Values.pachd.storage.storageURL | quote }}
{{- end }}
- name: POSTGRES_HOST
value: {{ required "postgresql host required" .Values.global.postgresql.postgresqlHost | quote }}
Expand Down
1 change: 1 addition & 0 deletions etc/helm/test/google_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func TestGoogle(t *testing.T) {
"deployTarget": expectedStorageBackend,
`pachd.serviceAccount.additionalAnnotations.iam\.gke\.io/gcp-service-account`: expectedServiceAccount,
`pachd.worker.serviceAccount.additionalAnnotations.iam\.gke\.io/gcp-service-account`: expectedServiceAccount,
"pachd.storage.storageURL": "gs://fake-bucket",
}
for _, tc := range testCases {
helmValues[tc.helmKey] = tc.value
Expand Down
10 changes: 10 additions & 0 deletions etc/helm/test/pachyderm_helm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func TestConsoleImageAndConfigTag(t *testing.T) {
"oidc.issuerURI": expectedIssuerURI,
"console.config.oauthRedirectURI": expectedOauthRedirectURI,
"deployTarget": "GOOGLE",
"pachd.storage.storageURL": "gs://bucuket",
"pachd.storage.google.bucket": "bucket",
"global.image.registry": globalImageRegistry,
},
Expand Down Expand Up @@ -81,6 +82,7 @@ func TestEtcdImageTag(t *testing.T) {
SetValues: map[string]string{
"etcd.image.tag": "blah",
"deployTarget": "GOOGLE",
"pachd.storage.storageURL": "gs://bucket",
"pachd.storage.google.bucket": "bucket",
"global.image.registry": globalImageRegistry,
},
Expand All @@ -105,6 +107,7 @@ func TestPachdImageTag(t *testing.T) {
SetValues: map[string]string{
"pachd.image.tag": "blah1234",
"deployTarget": "GOOGLE",
"pachd.storage.storageURL": "gs://bucket",
"pachd.storage.google.bucket": "bucket",
"global.image.registry": globalImageRegistry,
},
Expand All @@ -130,6 +133,7 @@ func TestPachdImageTagDeploymentEnv(t *testing.T) {
SetValues: map[string]string{
"pachd.image.tag": expectedTag,
"deployTarget": "GOOGLE",
"pachd.storage.storageURL": "gs://bucket",
"pachd.storage.google.bucket": "bucket",
"global.image.registry": globalImageRegistry,
},
Expand Down Expand Up @@ -187,6 +191,7 @@ func TestSetNamespaceWorkerRoleBinding(t *testing.T) {
options := &helm.Options{
SetValues: map[string]string{
"deployTarget": "GOOGLE",
"pachd.storage.storageURL": "gs://bucket",
"pachd.storage.google.bucket": "bucket",
},
KubectlOptions: k8s.NewKubectlOptions("", "", expectedNamespace),
Expand All @@ -213,6 +218,7 @@ func TestSetNamespaceServiceAccount(t *testing.T) {
options := &helm.Options{
SetValues: map[string]string{
"deployTarget": "GOOGLE",
"pachd.storage.storageURL": "gs://bucket",
"pachd.storage.google.bucket": "bucket",
},
KubectlOptions: k8s.NewKubectlOptions("", "", expectedNamespace),
Expand All @@ -239,6 +245,7 @@ func TestSetNamespaceWorkerServiceAccount(t *testing.T) {
options := &helm.Options{
SetValues: map[string]string{
"deployTarget": "GOOGLE",
"pachd.storage.storageURL": "gs://bucket",
"pachd.storage.google.bucket": "bucket",
},
KubectlOptions: k8s.NewKubectlOptions("", "", expectedNamespace),
Expand All @@ -265,6 +272,7 @@ func TestSetNamespaceRoleBinding(t *testing.T) {
options := &helm.Options{
SetValues: map[string]string{
"deployTarget": "GOOGLE",
"pachd.storage.storageURL": "gs://bucket",
"pachd.storage.google.bucket": "bucket",
},
KubectlOptions: k8s.NewKubectlOptions("", "", expectedNamespace),
Expand Down Expand Up @@ -311,6 +319,7 @@ func TestServicePorts(t *testing.T) {
&helm.Options{
SetStrValues: map[string]string{
"deployTarget": "LOCAL",
"pachd.storage.storageURL": "gs://bucket",
"pachd.storage.local.hostPath": hostPath,
}},
"../pachyderm/", "release-name", nil))
Expand Down Expand Up @@ -438,6 +447,7 @@ func TestGOMAXPROCS(t *testing.T) {
&helm.Options{
SetStrValues: map[string]string{
"deployTarget": "LOCAL",
"pachd.storage.storageURL": "gs://bucket",
"pachd.storage.local.hostPath": hostPath,
}},
"../pachyderm/", "release-name", nil))
Expand Down