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

Jindo fuse recover support and upgrade jindofs version #1385

Merged
merged 6 commits into from
Jan 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions charts/fluid/fluid/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ runtime:
portRange: 18000-19999
enabled: false
smartdata:
image: registry.cn-shanghai.aliyuncs.com/jindofs/smartdata:3.7.3
image: registry.cn-shanghai.aliyuncs.com/jindofs/smartdata:3.8.0
fuse:
image: registry.cn-shanghai.aliyuncs.com/jindofs/jindo-fuse:3.7.3
image: registry.cn-shanghai.aliyuncs.com/jindofs/jindo-fuse:3.8.0
controller:
image: fluidcloudnative/jindoruntime-controller:v0.7.0-3ce62a9
init:
Expand Down
4 changes: 2 additions & 2 deletions charts/fluid/v0.6.0/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ runtime:
portRange: 18000-19999
enabled: false
smartdata:
image: registry.cn-shanghai.aliyuncs.com/jindofs/smartdata:3.7.3
image: registry.cn-shanghai.aliyuncs.com/jindofs/smartdata:3.8.0
fuse:
image: registry.cn-shanghai.aliyuncs.com/jindofs/jindo-fuse:3.7.3
image: registry.cn-shanghai.aliyuncs.com/jindofs/jindo-fuse:3.8.0
controller:
image: fluidcloudnative/jindoruntime-controller:v0.6.0-48de610
goosefs:
Expand Down
12 changes: 9 additions & 3 deletions charts/jindofs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
0.7.0
Support logConfig
Support fuse lazy start
Support fuse critical pod

Support logConfig <br/>
Support fuse lazy start <br/>
Support fuse critical pod <br/>

0.8.0

Expand All @@ -22,5 +23,10 @@ Add owner Reference
0.8.4

Support more Posix

0.8.5

Add mountPropagation for registrar <br/>
Add auto fuse recovery


2 changes: 1 addition & 1 deletion charts/jindofs/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
appVersion: 3.7.3
appVersion: 3.8.0
version: 0.8.3
description: FileSystem on the cloud based on Aliyun Object Storage aimed for data
acceleration.
Expand Down
2 changes: 2 additions & 0 deletions charts/jindofs/templates/fuse/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ spec:
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: FLUID_FUSE_MOUNTPOINT
value: {{ .Values.fuse.mountPath }}
securityContext:
privileged: true
capabilities:
Expand Down
4 changes: 2 additions & 2 deletions charts/jindofs/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


image: registry-vpc.__ACK_REGION_ID__.aliyuncs.com/jindo/smartdata
imageTag: "3.7.3"
imageTag: "3.8.0"
imagePullPolicy: Always

initPortCheck:
Expand All @@ -15,7 +15,7 @@ initPortCheck:
portsToCheck: ""

fuseImage: registry-vpc.__ACK_REGION_ID__.aliyuncs.com/jindo/jindo-fuse
fuseImageTag: "3.7.3"
fuseImageTag: "3.8.0"

user: 0
group: 0
Expand Down
2 changes: 1 addition & 1 deletion pkg/common/jindo.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const (

JINDO_FUSE_IMAGE_ENV = "JINDO_FUSE_IMAGE_ENV"

DEFAULT_JINDO_RUNTIME_IMAGE = "registry.cn-shanghai.aliyuncs.com/jindofs/smartdata:3.7.3"
DEFAULT_JINDO_RUNTIME_IMAGE = "registry.cn-shanghai.aliyuncs.com/jindofs/smartdata:3.8.0"

JINDO_DNS_SERVER = "JINDO_DNS_SERVER_ENV"
)
2 changes: 2 additions & 0 deletions pkg/ddc/jindo/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ const (
WOKRER_POD_ROLE = "jindo-worker"

runtimeFSType = "jindofs"

JINDO_FUSE_MONNTPATH = "/jfs/jindofs-fuse"
)
7 changes: 4 additions & 3 deletions pkg/ddc/jindo/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (e *JindoEngine) transform(runtime *datav1alpha1.JindoRuntime) (value *Jind
},
Fuse: Fuse{
Args: e.transformFuseArg(runtime, dataset),
HostPath: e.getMountPoint(),
HostPath: e.getHostMountPoint(),
},
Mounts: Mounts{
Master: e.transformMasterMountPath(metaPath),
Expand Down Expand Up @@ -148,6 +148,7 @@ func (e *JindoEngine) transform(runtime *datav1alpha1.JindoRuntime) (value *Jind
e.transformLogConfig(runtime, value)
value.Master.DnsServer = dnsServer
value.Master.NameSpace = e.namespace
value.Fuse.MountPath = JINDO_FUSE_MONNTPATH
return value, err
}

Expand Down Expand Up @@ -496,7 +497,7 @@ func (e *JindoEngine) transformFuseArg(runtime *datav1alpha1.JindoRuntime, datas
func (e *JindoEngine) getSmartDataConfigs() (image, tag, dnsServer string) {
var (
defaultImage = "registry.cn-shanghai.aliyuncs.com/jindofs/smartdata"
defaultTag = "3.7.3"
defaultTag = "3.8.0"
defaultDnsServer = "1.1.1.1"
)

Expand All @@ -520,7 +521,7 @@ func (e *JindoEngine) getSmartDataConfigs() (image, tag, dnsServer string) {
func (e *JindoEngine) parseFuseImage() (image, tag string) {
var (
defaultImage = "registry.cn-shanghai.aliyuncs.com/jindofs/jindo-fuse"
defaultTag = "3.7.3"
defaultTag = "3.8.0"
)

image = docker.GetImageRepoFromEnv(common.JINDO_FUSE_IMAGE_ENV)
Expand Down
2 changes: 1 addition & 1 deletion pkg/ddc/jindo/transform_fuse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func TestParseFuseImage(t *testing.T) {
Name: "test",
Path: "/",
}},
}}, &Jindo{}, "registry.cn-shanghai.aliyuncs.com/jindofs/jindo-fuse:3.7.3"},
}}, &Jindo{}, "registry.cn-shanghai.aliyuncs.com/jindofs/jindo-fuse:3.8.0"},
}
for _, test := range tests {
engine := &JindoEngine{Log: log.NullLogger{}}
Expand Down
2 changes: 1 addition & 1 deletion pkg/ddc/jindo/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func TestParseSmartDataImage(t *testing.T) {
Name: "test",
Path: "/",
}},
}}, &Jindo{}, "registry.cn-shanghai.aliyuncs.com/jindofs/smartdata:3.7.3"},
}}, &Jindo{}, "registry.cn-shanghai.aliyuncs.com/jindofs/smartdata:3.8.0"},
}
for _, test := range tests {
engine := &JindoEngine{Log: log.NullLogger{}}
Expand Down
1 change: 1 addition & 0 deletions pkg/ddc/jindo/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ type Fuse struct {
Labels map[string]string `yaml:"labels,omitempty"`
CriticalPod bool `yaml:"criticalPod,omitempty"`
Resources Resources `yaml:"resources,omitempty"`
MountPath string `yaml:"mountPath,omitempty"`
}

type Mounts struct {
Expand Down
6 changes: 6 additions & 0 deletions pkg/ddc/jindo/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ func (e *JindoEngine) getMountPoint() (mountPath string) {
return fmt.Sprintf("%s/%s/%s/jindofs-fuse", mountRoot, e.namespace, e.name)
}

func (j *JindoEngine) getHostMountPoint() (mountPath string) {
mountRoot := getMountRoot()
j.Log.Info("mountRoot", "path", mountRoot)
return fmt.Sprintf("%s/%s/%s", mountRoot, j.namespace, j.name)
}

// getMountRoot returns the default path, if it's not set
func getMountRoot() (path string) {
path, err := utils.GetMountRoot()
Expand Down
40 changes: 40 additions & 0 deletions pkg/ddc/jindo/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ limitations under the License.
package jindo

import (
"github.com/go-logr/logr"
"os"
"sigs.k8s.io/controller-runtime/pkg/log"
"testing"

"github.com/fluid-cloudnative/fluid/pkg/common"
Expand Down Expand Up @@ -79,3 +81,41 @@ func TestMountRootWithoutEnvSet(t *testing.T) {
}
}
}

func TestJindoFSEngine_getHostMountPoint(t *testing.T) {
type fields struct {
name string
namespace string
Log logr.Logger
MountRoot string
}
var tests = []struct {
name string
fields fields
wantMountPath string
}{
{
name: "test",
fields: fields{
name: "jindofs",
namespace: "default",
Log: log.NullLogger{},
MountRoot: "/tmp",
},
wantMountPath: "/tmp/jindo/default/jindofs",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
j := &JindoEngine{
name: tt.fields.name,
namespace: tt.fields.namespace,
Log: tt.fields.Log,
}
os.Setenv("MOUNT_ROOT", tt.fields.MountRoot)
if gotMountPath := j.getHostMountPoint(); gotMountPath != tt.wantMountPath {
t.Errorf("getHostMountPoint() = %v, want %v", gotMountPath, tt.wantMountPath)
}
})
}
}