Python relative imports in AWS Lambda fail with attempted relative import with no known parent package
In AWS Lambda if I attempt an explicit relative import like this
.
├── lambda_file.py
└── example.py
| Stable Diffusion is an AI art generation model similar to DALLE-2. | |
| Here are some prompts for generating art with Stable Diffusion. | |
| Example: | |
| - A ghostly apparition drifting through a haunted mansion's grand ballroom, illuminated by flickering candlelight. Eerie, ethereal, moody lighting. | |
| - portait of a homer simpson archer shooting arrow at forest monster, front game card, drark, marvel comics, dark, smooth | |
| - pirate, deep focus, fantasy, matte, sharp focus | |
| - red dead redemption 2, cinematic view, epic sky, detailed, low angle, high detail, warm lighting, volumetric, godrays, vivid, beautiful | |
| - a fantasy style portrait painting of rachel lane / alison brie hybrid in the style of francois boucher oil painting, rpg portrait |
| #!/usr/bin/env bash | |
| # ~/.ssh/gcp-start-iap-tunnel-ssh-proxy-magic.sh | |
| # a script to be used as SSH ProxyCommand to allow fully functional SSH access to any Google Cloud Compute Engine VMs allowing IAP access | |
| # | |
| # Author: Jaeho Shin <netj@sparcs.org> | |
| # Created: 2022-10-31 | |
| # See also: | |
| # - https://gist.github.com/netj/df4f9de1fefd254ab11979be7035b5d0/#readme | |
| # - https://cloud.google.com/iap/docs/using-tcp-forwarding | |
| # |
| import os | |
| import codecs | |
| import urllib3 | |
| import gzip | |
| from pathlib import Path | |
| # CChardet is faster and can be more accurate | |
| try: | |
| import cchardet as chardet | |
| except ImportError: |
| exports.handler = (event, context, callback) => { | |
| const response = { | |
| statusCode: 301, | |
| headers: { | |
| Location: 'https://google.com', | |
| } | |
| }; | |
| return callback(null, response); | |
| } |
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "golang.org/x/oauth2" | |
| "golang.org/x/oauth2/google" |
Cloud-Init is the defacto multi-distribution package that handles early initialization of a virtual machine instance. Using Cloud-Init, one can configure network
| # based on the "patch deployment" strategy in this comment: | |
| # https://github.com/kubernetes/kubernetes/issues/13488#issuecomment-372532659 | |
| # requires jq | |
| # $1 is a valid namespace | |
| function refresh-all-pods() { | |
| echo | |
| DEPLOYMENT_LIST=$(kubectl -n $1 get deployment -o json|jq -r .items[].metadata.name) | |
| echo "Refreshing pods in all Deployments" | |
| for deployment_name in $DEPLOYMENT_LIST ; do |
| cat <<EOF > user-data | |
| #cloud-config | |
| debug: True | |
| disable_root: False | |
| ssh_deletekeys: False | |
| ssh_pwauth: True | |
| ssh_authorized_keys: | |
| - ssh-rsa XXX | |
| # users: |