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

add feature with JindoRuntime dataloader #764

Merged
merged 30 commits into from
May 11, 2021

Conversation

frankleaf
Copy link
Member

Ⅰ. Describe what this PR does

Ⅱ. Does this pull request fix one issue?

Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@codecov-commenter
Copy link

codecov-commenter commented May 6, 2021

Codecov Report

Merging #764 (bbbfccc) into master (76e4509) will decrease coverage by 0.12%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #764      +/-   ##
==========================================
- Coverage   12.65%   12.52%   -0.13%     
==========================================
  Files          93       93              
  Lines        4236     4279      +43     
==========================================
  Hits          536      536              
- Misses       3640     3683      +43     
  Partials       60       60              
Impacted Files Coverage Δ
pkg/ddc/jindo/cache.go 0.00% <ø> (ø)
pkg/ddc/jindo/master_internal.go 0.00% <0.00%> (ø)
pkg/ddc/jindo/runtime_info.go 0.00% <ø> (ø)
pkg/ddc/jindo/shutdown.go 0.00% <0.00%> (ø)
pkg/ddc/jindo/transform.go 0.00% <0.00%> (ø)
pkg/ddc/jindo/utils.go 0.00% <0.00%> (ø)
pkg/utils/docker/image.go 14.54% <0.00%> (-1.79%) ⬇️
pkg/utils/runtimes.go 29.62% <0.00%> (-10.38%) ⬇️
pkg/ddc/alluxio/master.go 0.00% <0.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 76e4509...bbbfccc. Read the comment docs.

fileUtils := alluxioOperations.NewAlluxioFileUtils(podName, containerName, targetDataset.Namespace, ctx.Log)
ready = fileUtils.Ready()
case common.JINDO_RUNTIME:
podName := fmt.Sprintf("%s-jindofs-master-0", targetDataset.Name)
Copy link
Contributor

Choose a reason for hiding this comment

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

suggest put %s-jindofs-master-0 in a unified place

Copy link
Member Author

Choose a reason for hiding this comment

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

thx,same situation as alluxio , will resolve next pr

if err != nil {
log.Error(err, "failed to generate dataload chart's value file")
return utils.RequeueIfError(err)
}
chartName := utils.GetChartsDirectory() + "/" + cdataload.DATALOAD_CHART
chartName := ""
if boundedRuntimeType == "alluxio" {
Copy link
Contributor

Choose a reason for hiding this comment

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

avoid hardcode alluxio

if boundedRuntimeType == common.DataRuntimeAlluxio.String() {}

Copy link
Member Author

Choose a reason for hiding this comment

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

thx, replace by common constant

@@ -21,4 +21,6 @@ const (
DATALOAD_DEFAULT_IMAGE = "registry.cn-hangzhou.aliyuncs.com/fluid/fluid-dataloader"
DATALOAD_SUFFIX_LENGTH = 5
ENV_DATALOADER_IMG = "DATALOADER_IMG"
DATALOAD_ALLUXIO_CHART = "alluxio"
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

alluxio appear many time, can it be unified into one place ?

Copy link
Member Author

Choose a reason for hiding this comment

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

thx, removed and replaced by common constant

// Check if the Alluxio is ready by running `alluxio fsadmin report` command
func (a JindoFileUtils) Ready() (ready bool) {
var (
command = []string{"/sdk/bin/jindo", "jfs", "-report"}
Copy link
Contributor

Choose a reason for hiding this comment

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

hard code

Copy link
Member Author

Choose a reason for hiding this comment

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

thx,this is jindofs's fixed shell command, so be hard code

Copy link
Collaborator

Choose a reason for hiding this comment

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

You can define constant in common pkg.

Copy link
Member Author

Choose a reason for hiding this comment

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

just same as with other many command , will replace "/sdk/bin/jindo" by "jindo"

for _, mount := range dataset.Spec.Mounts {

jfsNamespace = jfsNamespace + mount.Name + ","
//jfsNamespace = jfsNamespace + mount.Name + ","

if !strings.HasSuffix(mount.MountPoint, "/") {
mount.MountPoint = mount.MountPoint + "/"
}
// transform mountpoint for oss or hdfs format
if strings.HasPrefix(mount.MountPoint, "hdfs://") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Which protocol can be encapsulated as a util function

@cheyang cheyang requested a review from TrafalgarZZZ May 6, 2021 06:10
LoadMemoryData bool `json:"loadMemoryData,omitempty"`

// add HdfsConfig for JindoRuntime
HdfsConfig string `json:"hdfsConfig,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should user define this HDFSConfig?

Copy link
Member Author

Choose a reason for hiding this comment

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

removed

@@ -33,8 +33,8 @@ runtime:
portRange: 18000-19999
enabled: false
smartdata:
image: registry.cn-shanghai.aliyuncs.com/jindofs/smartdata:3.5.2
image: registry.cn-shanghai.aliyuncs.com/jindofs/smartdata:3.5.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

3.5.0 is older than 3.5.2? Is it your expectation?

Copy link
Member Author

Choose a reason for hiding this comment

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

thx,The version of the mirror will be same as JindoFS version in the future,so 3.5.0 is expected

@@ -53,6 +53,12 @@ type DataLoadSpec struct {

// Target defines target paths that needs to be loaded
Target []TargetPath `json:"target,omitempty"`

// LoadMemoryData specifies if the dataload job should load memory or not
LoadMemoryData bool `json:"loadMemoryData,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does loadMemoryData mean?

Copy link
Member Author

Choose a reason for hiding this comment

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

already removed

Comment on lines +36 to +37
OssKey string `yaml:"osskey,omitempty"`
OssSecret string `yaml:"osssecret,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

I think it's better to use ossKey and ossSecret for consistency.

Copy link
Member Author

Choose a reason for hiding this comment

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

thx, Capitalization is for external reference

@@ -0,0 +1,86 @@
# fluid-dataloader
Copy link
Member

Choose a reason for hiding this comment

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

READMEs in both fluid-dataloader/alluxio and fluid-dataloader/jindo is deprecated. So I suggest we should delete them to avoid misleading info.

Copy link
Member Author

Choose a reason for hiding this comment

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

this is two different dataload type I think it's better to be separated

# Required
# Description: the dataset that this DataLoad targets
targetDataset: #imagenet

Copy link
Member

Choose a reason for hiding this comment

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

Add default values and comments for hdfsConfig and loadMemoryData

Copy link
Member Author

Choose a reason for hiding this comment

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

thx,already removed this two unnecessary parameter

@frankleaf frankleaf requested review from cheyang and TrafalgarZZZ May 6, 2021 13:30
@@ -68,10 +68,20 @@ func GetWorkerImage(client client.Client, datasetName string, runtimeType string

}
if imageName == "" {
imageName = "registry.cn-huhehaote.aliyuncs.com/alluxio/alluxio"
if runtimeType == common.ALLUXIO_RUNTIME {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I suggest to use switch here.

Copy link
Member

Choose a reason for hiding this comment

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

I and @XIAO-HOU are trying to unify get image methods.
perhaps you need to agree with us in the future.

@@ -21,6 +21,12 @@ type DataLoadInfo struct {

// Image specifies the image that the DataLoad job uses
Image string `yaml:"image,omitempty"`

// LoadMemoryData specifies if the dataload job should load memory or not
LoadMemoryData bool `yaml:"loadMemoryData,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need define this in the struct for the comon dataloadInfo Object?

Copy link
Member Author

Choose a reason for hiding this comment

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

thx, so define JindoOptions to include these two parameter, not in the common dataloadInfo

if err != nil {
log.Error(err, "failed to generate dataload chart's value file")
return utils.RequeueIfError(err)
}
chartName := utils.GetChartsDirectory() + "/" + cdataload.DATALOAD_CHART
chartName := ""
if boundedRuntimeType == common.ALLUXIO_RUNTIME {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggest to change to switch, thanks.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

image := fmt.Sprintf("%s:%s", imageName, imageTag)

runtime, err := utils.GetJindoRuntime(r.Client, boundedRuntime.Name, boundedRuntime.Namespace)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will this change break dataload logic for alluxio?

Copy link
Member Author

Choose a reason for hiding this comment

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

thx,to avoid break the logic for alluixo, make generateJindoDataLoadValueFile function to separate each other

@@ -21,6 +21,17 @@ type DataLoadInfo struct {

// Image specifies the image that the DataLoad job uses
Image string `yaml:"image,omitempty"`

// JindoOptions specifies the options that jindoruntime uses
JindoOptions JindoOptions `yaml:"jindoOptions,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think JindoOptions shouldn't be part of dataLoadInfo. Just like the carOption is not part of the vehicle.

Copy link
Member

Choose a reason for hiding this comment

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

Agreed. Perhaps better to use two different chart value structs for each ddc engine and shared properties like Image and TargetDataset can be put together in a struct.

Copy link
Member

Choose a reason for hiding this comment

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

We can build a field to pass options, which option can be effective is decided by runtime type, just like csi options.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe you can provide csi sample for reference.

@@ -68,10 +68,20 @@ func GetWorkerImage(client client.Client, datasetName string, runtimeType string

}
if imageName == "" {
imageName = "registry.cn-huhehaote.aliyuncs.com/alluxio/alluxio"
if runtimeType == common.ALLUXIO_RUNTIME {
Copy link
Member

Choose a reason for hiding this comment

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

I and @XIAO-HOU are trying to unify get image methods.
perhaps you need to agree with us in the future.

log.Error(err, "failed to generate dataload chart's value file")
return utils.RequeueIfError(err)
}
chartName = utils.GetChartsDirectory() + "/" + cdataload.DATALOAD_CHART + "/" + common.ALLUXIO_RUNTIME
Copy link
Member

Choose a reason for hiding this comment

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

how about make it a function which return chartName according to runtimeName?

Copy link
Member Author

Choose a reason for hiding this comment

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

thx, will refeactor next PR

@@ -21,6 +21,17 @@ type DataLoadInfo struct {

// Image specifies the image that the DataLoad job uses
Image string `yaml:"image,omitempty"`

// JindoOptions specifies the options that jindoruntime uses
JindoOptions JindoOptions `yaml:"jindoOptions,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

We can build a field to pass options, which option can be effective is decided by runtime type, just like csi options.

@cheyang cheyang merged commit db75dcf into fluid-cloudnative:master May 11, 2021
xieydd pushed a commit to xieydd/fluid-1 that referenced this pull request May 24, 2021
* add ns with the cache path

* fix err unused

* fix err unused

* fix directory dir

* add dataloader crd for JindoRuntime

* fix dataloader runtime

* fix constant ns to jindo

* add jindofs client conf yaml

* fix configmap yaml

* add support with s3 and global fuse

* upgrade jindo version to 3.5.0

* refine dataloader config

* change default nsname

* add core-site dataloader

* add jindo dataset status judge

* add load data to memory type

* change default ns to jindo

* fix ufs mode

* change dataload

* change dataload to alluxio and jindo

* refine dataload

* refine dataload

* refine dataload

* refine dataload

* refine dataload function

* delete readme file

* add generateJindoDataLoadValueFile to separate from alluxioRuntime

* dataload options define

* refine

Signed-off-by: xieydd <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants