diff --git a/internal/storage/juicefs.go b/internal/storage/juicefs.go index ec1e09cfa..a7baceec6 100644 --- a/internal/storage/juicefs.go +++ b/internal/storage/juicefs.go @@ -4,6 +4,7 @@ import ( "fmt" "log" "os/exec" + "strconv" "time" "github.com/beam-cloud/beta9/internal/types" @@ -25,12 +26,16 @@ func NewJuiceFsStorage(config types.JuiceFSConfig) (Storage, error) { func (s *JuiceFsStorage) Mount(localPath string) error { log.Printf("JuiceFS filesystem mounting to: '%s'\n", localPath) + cacheSize := strconv.FormatInt(s.config.CacheSize, 10) + s.mountCmd = exec.Command( "juicefs", "mount", s.config.RedisURI, localPath, "-d", + "--cache-size", + cacheSize, ) // Start the mount command in the background @@ -77,6 +82,7 @@ func (s *JuiceFsStorage) Format(fsName string) error { "--bucket", s.config.AWSS3Bucket, s.config.RedisURI, fsName, + "--no-update", ) if s.config.AWSAccessKey != "" || s.config.AWSSecretKey != "" { diff --git a/internal/types/config.go b/internal/types/config.go index 64883b061..b4ffedead 100644 --- a/internal/types/config.go +++ b/internal/types/config.go @@ -119,6 +119,7 @@ type JuiceFSConfig struct { AWSS3Bucket string `key:"awsS3Bucket" json:"aws_s3_bucket"` AWSAccessKey string `key:"awsAccessKey" json:"aws_access_key"` AWSSecretKey string `key:"awsSecretKey" json:"aws_secret_key"` + CacheSize int64 `key:"cacheSize" json:"cache_size"` } type MountPointConfig struct {