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
############ layer ############## | |
OrderLayer: | |
Type: AWS::Serverless::LayerVersion | |
Properties: | |
LayerName: inventory-layer | |
ContentUri: ./layer/package.zip | |
CompatibleRuntimes: | |
- python3.8 | |
OrderLayerPermission: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import gzip, json | |
inputDict = {'helloa':'world'} | |
gzip.compress(json.dumps(inputDict).encode()) |
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
from s3bz.s3bz import S3, ExtraArgs | |
bucket = 'pybz-test' | |
key = 'test.dict' | |
fields = {**ExtraArgs.jpeg} | |
S3.presignUpload(bucket, key, fields=fields) |
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
onlineDf.to_json(path ,orient='split',compression='gzip') |
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
from s3bz.s3bz import S3, ExtraArgs | |
S3.saveFile(key=key,path=path,bucket=bucket, | |
ExtraArgs = {**ExtraArgs.jpeg, **ExtraArgs.publicRead }) |
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
# list all folders | |
layerList=$(find -name 'layer') | |
curDir=$(pwd) | |
echo executing $layerList | |
echo curdir is $curDir | |
# loop though each path | |
for path in $layerList | |
do |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import requests, time, random | |
import asyncio | |
from asgiref.sync import sync_to_async | |
from datetime import datetime | |
async def post(url, body): | |
t0 = datetime.now() | |
r = await sync_to_async(requests.post)(url,json=body) | |
return r.json() | |
async def main(): |
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
body: A JSON string of the request payload. | |
headers: '{String containing incoming request headers}' | |
httpMethod: Incoming request's method name | |
isBase64Encoded: A boolean flag to indicate if the applicable request payload is Base64-encoded | |
multiValueHeaders: '{List of strings containing incoming request headers}' | |
multiValueQueryStringParameters: '{List of query string parameters}' | |
path: Path parameter | |
pathParameters: '{path parameters}' | |
queryStringParameters: '{query string parameters }' | |
requestContext: '{Request context, including authorizer-returned key-value pairs}' |