hilimd
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
12 additions and
4 deletions
-
docker/Dockerfile.go_build
-
docker/Dockerfile.go_build_large
-
weed/filesys/wfs_write.go
-
weed/server/filer_server_handlers_write.go
|
@ -2,7 +2,9 @@ FROM frolvlad/alpine-glibc as builder |
|
|
RUN apk add git go g++ |
|
|
RUN apk add git go g++ |
|
|
RUN mkdir -p /go/src/github.com/chrislusf/ |
|
|
RUN mkdir -p /go/src/github.com/chrislusf/ |
|
|
RUN git clone https://github.com/chrislusf/seaweedfs /go/src/github.com/chrislusf/seaweedfs |
|
|
RUN git clone https://github.com/chrislusf/seaweedfs /go/src/github.com/chrislusf/seaweedfs |
|
|
RUN cd /go/src/github.com/chrislusf/seaweedfs/weed && go install |
|
|
|
|
|
|
|
|
RUN cd /go/src/github.com/chrislusf/seaweedfs/weed \ |
|
|
|
|
|
&& export LDFLAGS="-X github.com/chrislusf/seaweedfs/weed/util.COMMIT=$(git rev-parse --short HEAD)" \ |
|
|
|
|
|
&& go install -ldflags "${LDFLAGS}" |
|
|
|
|
|
|
|
|
FROM alpine AS final |
|
|
FROM alpine AS final |
|
|
LABEL author="Chris Lu" |
|
|
LABEL author="Chris Lu" |
|
|
|
@ -2,7 +2,9 @@ FROM frolvlad/alpine-glibc as builder |
|
|
RUN apk add git go g++ |
|
|
RUN apk add git go g++ |
|
|
RUN mkdir -p /go/src/github.com/chrislusf/ |
|
|
RUN mkdir -p /go/src/github.com/chrislusf/ |
|
|
RUN git clone https://github.com/chrislusf/seaweedfs /go/src/github.com/chrislusf/seaweedfs |
|
|
RUN git clone https://github.com/chrislusf/seaweedfs /go/src/github.com/chrislusf/seaweedfs |
|
|
RUN cd /go/src/github.com/chrislusf/seaweedfs/weed && go install -tags 5BytesOffset |
|
|
|
|
|
|
|
|
RUN cd /go/src/github.com/chrislusf/seaweedfs/weed \ |
|
|
|
|
|
&& export LDFLAGS="-X github.com/chrislusf/seaweedfs/weed/util.COMMIT=$(git rev-parse --short HEAD)" \ |
|
|
|
|
|
&& go install -tags 5BytesOffset -ldflags "${LDFLAGS}" |
|
|
|
|
|
|
|
|
FROM alpine AS final |
|
|
FROM alpine AS final |
|
|
LABEL author="Chris Lu" |
|
|
LABEL author="Chris Lu" |
|
|
|
@ -65,6 +65,6 @@ func (wfs *WFS) saveDataAsChunk(dir string) filer.SaveDataAsChunkFunctionType { |
|
|
wfs.chunkCache.SetChunk(fileId, data) |
|
|
wfs.chunkCache.SetChunk(fileId, data) |
|
|
|
|
|
|
|
|
chunk = uploadResult.ToPbFileChunk(fileId, offset) |
|
|
chunk = uploadResult.ToPbFileChunk(fileId, offset) |
|
|
return chunk, "", "", nil |
|
|
|
|
|
|
|
|
return chunk, collection, replication, nil |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -139,6 +139,7 @@ func (fs *FilerServer) detectCollection(requestURI, qCollection, qReplication st |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// required by buckets folder
|
|
|
// required by buckets folder
|
|
|
|
|
|
bucketDefaultReplication := "" |
|
|
if strings.HasPrefix(requestURI, fs.filer.DirBucketsPath+"/") { |
|
|
if strings.HasPrefix(requestURI, fs.filer.DirBucketsPath+"/") { |
|
|
bucketAndObjectKey := requestURI[len(fs.filer.DirBucketsPath)+1:] |
|
|
bucketAndObjectKey := requestURI[len(fs.filer.DirBucketsPath)+1:] |
|
|
t := strings.Index(bucketAndObjectKey, "/") |
|
|
t := strings.Index(bucketAndObjectKey, "/") |
|
@ -148,7 +149,10 @@ func (fs *FilerServer) detectCollection(requestURI, qCollection, qReplication st |
|
|
if t > 0 { |
|
|
if t > 0 { |
|
|
collection = bucketAndObjectKey[:t] |
|
|
collection = bucketAndObjectKey[:t] |
|
|
} |
|
|
} |
|
|
replication, fsync = fs.filer.ReadBucketOption(collection) |
|
|
|
|
|
|
|
|
bucketDefaultReplication, fsync = fs.filer.ReadBucketOption(collection) |
|
|
|
|
|
} |
|
|
|
|
|
if replication == "" { |
|
|
|
|
|
replication = bucketDefaultReplication |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return |
|
|
return |
|
|