forked from kahing/goofys
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from mathis-marcotte/remove-multipart-and-fatal
Chore: Bump repo to latest forked commit
- Loading branch information
Showing
74 changed files
with
2,444 additions
and
293 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Google Cloud Storage (GCS) | ||
|
||
|
||
## Prerequisite | ||
|
||
Service Account credentials or user authentication. Ensure that either the service account or user has the proper permissions to the Bucket / Object under GCS. | ||
|
||
To have a successful mount, we require users to have object listing (`storage.objects.list`) permission to the bucket. | ||
|
||
### Service Account credentials | ||
|
||
Create a service account credentials (https://cloud.google.com/iam/docs/creating-managing-service-accounts) and generate the JSON credentials file. | ||
|
||
### User Authentication and `gcloud` Default Authentication | ||
User can authenticate to gcloud's default environment by first installing cloud sdk (https://cloud.google.com/sdk/) and running `gcloud auth application-default login` command. | ||
|
||
|
||
## Using Goofys for GCS | ||
|
||
### With service account credentials file | ||
``` | ||
GOOGLE_APPLICATION_CREDENTIALS="/path/to/creds.json" goofys gs://[BUCKET] /path/to/mount | ||
``` | ||
|
||
### With user authentication (`gcloud auth application-default login`) | ||
|
||
``` | ||
goofys gs://[BUCKET] [MOUNT DIRECTORY] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package common | ||
|
||
import ( | ||
"context" | ||
"golang.org/x/oauth2/google" | ||
) | ||
|
||
type GCSConfig struct { | ||
Credentials *google.Credentials | ||
ChunkSize int // determine the size of chunks when uploading a file to GCS | ||
} | ||
|
||
const ( | ||
defaultGCSChunkSize int = 64 * 1024 * 1024 | ||
) | ||
|
||
// NewGCSConfig returns a GCS Config. | ||
func NewGCSConfig() *GCSConfig { | ||
// Credentials will be checked when initializing GCS bucket to create an authenticated / unauthenticated client | ||
// We allow nil credentials for unauthenticated client. | ||
credentials, err := google.FindDefaultCredentials(context.Background()) | ||
if err == nil { | ||
// authenticated config | ||
return &GCSConfig{ | ||
ChunkSize: defaultGCSChunkSize, | ||
Credentials: credentials, | ||
} | ||
} else { | ||
log.Debugf("Initializing an unauthenticated config: %v", err) | ||
// unauthenticated config | ||
return &GCSConfig{ | ||
ChunkSize: defaultGCSChunkSize, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
FROM golang:1.14 AS goofys-builder | ||
|
||
# install goofys | ||
WORKDIR $GOPATH/src/github.com/kahing/goofys | ||
|
||
COPY . . | ||
|
||
RUN git init | ||
RUN git submodule update --init --recursive | ||
RUN go build | ||
|
||
# install gcsfuse, the binary is added to /go/bin/gcsfuse | ||
RUN go get -u github.com/googlecloudplatform/gcsfuse | ||
|
||
FROM ubuntu:18.04 | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update && \ | ||
apt-get -y install --no-install-recommends \ | ||
# gcsfuse dependencies \ | ||
fuse \ | ||
# for running goofys benchmark \ | ||
curl python-setuptools python-pip gnuplot-nox imagemagick awscli \ | ||
# finally, clean up to make image smaller \ | ||
&& apt-get clean | ||
|
||
# install catfs, required to run goofys with cache | ||
RUN curl -L -O https://github.com/kahing/catfs/releases/download/v0.8.0/catfs && \ | ||
mv catfs /usr/bin && chmod 0755 /usr/bin/catfs | ||
|
||
# goofys graph generation | ||
RUN pip install numpy | ||
|
||
ENV PATH=$PATH:/root/go/bin | ||
|
||
# copy go binaries | ||
COPY --from=goofys-builder /go/src/github.com/kahing/goofys/goofys /root/go/bin/goofys | ||
COPY --from=goofys-builder /go/bin/gcsfuse /root/go/bin/gcsfuse | ||
|
||
WORKDIR /root/go/src/github.com/kahing/goofys | ||
|
||
# copy bench scripts | ||
COPY bench bench | ||
|
||
ENTRYPOINT ["/root/go/src/github.com/kahing/goofys/bench/run_bench.sh"] |
Oops, something went wrong.