-
Notifications
You must be signed in to change notification settings - Fork 38
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
Issue 489: Added support for custom storage option in long term storage #585
Conversation
Signed-off-by: anishakj <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #585 +/- ##
==========================================
+ Coverage 74.17% 74.35% +0.17%
==========================================
Files 16 16
Lines 4229 4258 +29
==========================================
+ Hits 3137 3166 +29
Misses 962 962
Partials 130 130
Continue to review full report at Codecov.
|
Signed-off-by: anishakj <[email protected]>
pkg/apis/pravega/v1beta1/pravega.go
Outdated
@@ -511,3 +514,8 @@ type HDFSSpec struct { | |||
// +optional | |||
ReplicationFactor int32 `json:"replicationFactor"` | |||
} | |||
|
|||
type CustomSpec struct { | |||
Options map[string]string `json:"options"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Options map[string]string `json:"options"` | |
Options map[string]string `json:"options,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anishakj @nishant-yt Is there a use case when only one of options
,env
blocks would have to be supplied?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, if custom option is mentioned both params needs to be provided
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anishakj looking at pravega_segmentstore.go
code, the Options
map here *can` be optional. Please, take the change suggested by @nishant-yt here and make it not required on the CRD.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
|
||
type CustomSpec struct { | ||
Options map[string]string `json:"options"` | ||
Env map[string]string `json:"env"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Env map[string]string `json:"env"` | |
Env map[string]string `json:"env,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This spec is actually needed to override the TIER2_STORAGE
env variable (though it would be better to have a separate required parameter for exactly this value).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requested changes
@anishakj Could you add some (commented out) example on how this issue might be used to the helm chart (https://github.com/pravega/pravega-operator/blob/master/charts/pravega/values.yaml#L107), please? |
have to create separate PR for that in Pravega/charts repo. Charts repo here is deprecated |
Would you at least add it to the PR description? |
Values need to be used in helm chart are added in PR description. |
@anishakj would you please amend the PR description to elaborate on the use of Apparently, the existing code would set |
@@ -362,6 +367,13 @@ func getTier2StorageOptions(pravegaSpec *api.PravegaSpec) map[string]string { | |||
} | |||
} | |||
|
|||
if pravegaSpec.LongTermStorage.Custom != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be an indentation issue within getTier2StorageOptions()
function.
if pravegaSpec.LongTermStorage.Custom != nil
has a different indentation as compared to the above three if
blocks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@@ -284,6 +284,12 @@ func MakeSegmentstoreConfigMap(p *api.PravegaCluster) *corev1.ConfigMap { | |||
javaOpts = append(javaOpts, fmt.Sprintf("-D%v=%v", name, value)) | |||
} | |||
|
|||
if p.Spec.Pravega.LongTermStorage.Custom != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... There is nothing saying that the storage options cannot be included by the customer into p.Spec.Pravega.Options
(the current practice is to include both controller and segment store java options there, and if needed only in the segment store, the option is ignored by the controller).
So p.Spec.Pravega.LongTermStorage.Custom.Options
can be optional.
pkg/apis/pravega/v1beta1/pravega.go
Outdated
@@ -511,3 +514,8 @@ type HDFSSpec struct { | |||
// +optional | |||
ReplicationFactor int32 `json:"replicationFactor"` | |||
} | |||
|
|||
type CustomSpec struct { | |||
Options map[string]string `json:"options"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anishakj looking at pravega_segmentstore.go
code, the Options
map here *can` be optional. Please, take the change suggested by @nishant-yt here and make it not required on the CRD.
|
||
type CustomSpec struct { | ||
Options map[string]string `json:"options"` | ||
Env map[string]string `json:"env"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This spec is actually needed to override the TIER2_STORAGE
env variable (though it would be better to have a separate required parameter for exactly this value).
type: object | ||
required: | ||
- env | ||
- options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, remove the options
block from the list of required parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Signed-off-by: anishakj <[email protected]>
Signed-off-by: anishakj <[email protected]>
Signed-off-by: anishakj <[email protected]>
Signed-off-by: anishakj <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -238,3 +238,34 @@ spec: | |||
root: /example | |||
replicationFactor: 3 | |||
``` | |||
|
|||
### Use Custom Storage as LongTermStorage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add the heading of this section to the contents in the beginning of the doc too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -362,6 +367,13 @@ func getTier2StorageOptions(pravegaSpec *api.PravegaSpec) map[string]string { | |||
} | |||
} | |||
|
|||
if pravegaSpec.LongTermStorage.Custom != nil { | |||
if pravegaSpec.LongTermStorage.Custom.Env != nil { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can we remove the extra line here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Signed-off-by: anishakj <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: anishakj [email protected]
Change log description
Adding a new field for custom storage in longtermstoragespec
Purpose of the change
Fixes #489
What the code does
Currently, operator supports HDFS, ECS and filesystem as longtermstorage options, added support for custom storage so that users can provide required options and env variables based on the storage type selected.
We can also pass env varaibles via
segmentStoreEnvVars
. But in case,if we do not setlongtermstorage
type, it can cause conflictsHow to verify it
Example of helm charts with
s3
as custom storageVerified that able to install pravega with
S3
as custom storage, also ran system tests