App that is zipping up files from an S3 bucket and uploads the zip file back into the bucket.
9.8K
UPP Golang App to download files from S3, zip them and upload the newly created zip file back to S3
Download the source code, dependencies and test dependencies:
go get -u github.com/Financial-Times/zipper-s3
cd $GOPATH/src/github.com/Financial-Times/zipper-s3
go build .
Run the tests and install the binary:
go test ./... -v -race
go install
Run the binary (using the help flag to see the available optional arguments):
Environment variables:
IS_ENABLED flag which if it is true, the app will run the zip creation process, otherwise will stop immediately after start.MAX_NO_OF_GOROUTINES the maximum number of goroutines which is used to zip filesYEAR_TO_START the app will create yearly zips starting from provided year. Defaults to 1995, when the first FT article has been published.AWS_ACCESS_KEY_ID S3 access keyAWS_SECRET_ACCESS_KEY S3 secret keyBUCKET_NAME bucket name of contentS3_DOMAIN S3 domain of contentS3_CONTENT_FOLDER name of the folder that json files with the content are stored inS3_CONCEPT_FOLDER name of the folder that json files with the concept are stored inLOG_DEBUG flag which if it is set to true, the app will also output debug logsThis service is executed as a daily Kubernetes cronjob in the UPP Publishing clusters. It takes around 2 hours to complete its execution. If you don't want to wait until the next cron execution time to check the logs and the files in S3, you can manually trigger an execution using the following command (wait 2 hours to see if all archives are uploaded successfully):
kubectl create job --from=cronjob/zipper-s3 zipper-s3-manual
Content type
Image
Digest
sha256:a70d539a9…
Size
11.6 MB
Last updated
about 21 hours ago
docker pull coco/zipper-s3