forked from google/neuroglancer
-
Notifications
You must be signed in to change notification settings - Fork 10
Change s3 encoding
William Silversmith edited this page May 12, 2017
·
5 revisions
class SetEncodingTask(RegisteredTask):
def __init__(self, layer_path, prefix):
super(SetEncodingTask, self).__init__(layer_path, prefix)
self.layer_path = layer_path
self.prefix = prefix
def execute(self):
from neuroglancer.pipeline.storage import S3Interface
s3i = S3Interface(Storage.extract_path(self.layer_path))
s3i.apply_gzip_encoding(self.prefix)
If you set your amazon credentials in your ~/.boto file, you can use gsutil
instead.
gsutil -m setmeta -h 'Content-Encoding:gzip' s3://neuroglancer/DATASET/LAYER/KEY/**
https://cloud.google.com/storage/docs/gsutil/commands/setmeta