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
repos: | |
- repo: https://github.com/avilaton/add-msg-issue-prefix-hook | |
rev: v0.0.11 | |
hooks: | |
- id: add-msg-issue-prefix | |
- repo: https://github.com/astral-sh/ruff-pre-commit | |
rev: v0.2.2 | |
hooks: | |
- id: ruff | |
args: [--fix, --output-format=full, --show-fixes, --select, I001, --select, F401] |
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
def update_lambda(function_name): | |
response = lambda_client.update_function_code( | |
FunctionName=function_name, | |
ZipFile=open(f'{function_name}.zip', 'rb').read() | |
) |
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
def lambda_function_exist(function_name): | |
try: | |
lambda_client.get_function(FunctionName=function_name) | |
return True | |
except lambda_client.exceptions.ResourceNotFoundException: | |
return False |
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
def create_zip(function_name): | |
with zipfile.ZipFile(f'{function_name}.zip', 'w') as zf: | |
zf.write(f'{function_name}.py') |
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
lambda_client = boto3.client('lambda') |
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
parser = argparse.ArgumentParser() | |
parser.add_argument('--function_name', type=str, required=True) | |
parser.add_argument('--handler_name', type=str, required=True) | |
parser.add_argument('--role', type=str, required=True) | |
args = parser.parse_args() | |
function_name = args.function_name | |
handler_name = args.handler_name | |
role = args.role |
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 loguru import logger | |
import boto3 | |
import zipfile | |
import argparse |
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
def response(event, context): | |
response = { | |
"statusCode": 200, | |
"body": None | |
} | |
if event["message"] == "ping": | |
response["body"] = "pong" | |
else: | |
response["body"] = "Unknown message" | |
return response |
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
def response(event, context): | |
response = { | |
"statusCode": 200, | |
"body": None | |
} | |
if event["message"] == "ping": | |
response["body"] = "pong" | |
else: | |
response["body"] = "Unknown message" | |
return response |
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
sudo bash NVIDIA-Linux-x86_64-465.31.run | |
sudo dpkg -i libcudnn8_8.2.0.53-1+cuda11.3_amd64.deb | |
sudo dpkg -i libcudnn8-dev_8.2.0.53-1+cuda11.3_amd64.deb | |
sudo dpkg -i libcudnn8-samples_8.2.0.53-1+cuda11.3_amd64.deb |
NewerOlder