Skip to content

Instantly share code, notes, and snippets.

View metaskills's full-sized avatar
🐙
Being Inkcellent to Each Other

Ken Collins metaskills

🐙
Being Inkcellent to Each Other
View GitHub Profile
@metaskills
metaskills / embedding_store.rb
Created June 30, 2023 17:19 — forked from peterc/embedding_store.rb
Using SQLite to store OpenAI vector embeddings from Ruby
# Example of using SQLite VSS with OpenAI's text embedding API
# from Ruby.
# Note: Install/bundle the sqlite3, sqlite_vss, and ruby-openai gems first
# OPENAI_API_KEY must also be set in the environment
# Other embeddings can be used, but this is the easiest for a quick demo
# More on the topic at
# https://observablehq.com/@asg017/introducing-sqlite-vss
# https://observablehq.com/@asg017/making-sqlite-extension-gem-installable
DisconnectWSLambda:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
CodeUri: "/var/task/src/ws/disconnect"
Runtime: nodejs16.x
Architectures:
- x86_64
MemorySize: 1152
DisconnectWSRoute:
DefaultWSLambda:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
CodeUri: "/var/task/src/ws/default"
Runtime: nodejs16.x
DefaultWSRoute:
Type: AWS::ApiGatewayV2::Route
Properties:
ApiId:
ConnectWSLambda:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
CodeUri: "/var/task/src/ws/connect"
ConnectWSRoute:
Type: AWS::ApiGatewayV2::Route
Properties:
ApiId:
Ref: WS
WS:
Type: AWS::ApiGatewayV2::Api
Properties:
Name: MyappWebsocketStaging
ProtocolType: WEBSOCKET
RouteSelectionExpression: "$request.body.message"
WebsocketDeployment:
Type: AWS::ApiGatewayV2::Deployment
DependsOn:
- ConnectWSRoute
DataTable:
Type: AWS::DynamoDB::Table
Properties:
KeySchema:
- AttributeName: scopeID
KeyType: HASH
- AttributeName: dataID
KeyType: RANGE
AttributeDefinitions:
- AttributeName: scopeID
---
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Exported by architect/package@8.4.1 on 2023-03-02T00:58:20.484Z
Resources:
Role:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'
@metaskills
metaskills / failure.txt
Created January 22, 2023 19:33
GitHub Devcontainer w/Docker-in-Docker Action: Random Failure
2023-01-22T19:18:48.0957839Z Requested labels: ubuntu-latest
2023-01-22T19:18:48.0957881Z Job defined at: customink/crypteia/.github/workflows/test.yml@refs/heads/MultiPlatform
2023-01-22T19:18:48.0957914Z Waiting for a runner to pick up this job...
2023-01-22T19:18:48.5509306Z Job is waiting for a hosted runner to come online.
2023-01-22T19:18:53.1417633Z Job is about to start running on the hosted runner: GitHub Actions 8 (hosted)
2023-01-22T19:18:55.8052163Z Current runner version: '2.300.2'
2023-01-22T19:18:55.8084326Z ##[group]Operating System
2023-01-22T19:18:55.8085007Z Ubuntu
2023-01-22T19:18:55.8085356Z 22.04.1
2023-01-22T19:18:55.8085727Z LTS
@metaskills
metaskills / failure.txt
Last active January 22, 2023 19:32
GitHub Devcontainer w/Docker-in-Docker Action: Success
2023-01-22T19:18:48.0957839Z Requested labels: ubuntu-latest
2023-01-22T19:18:48.0957881Z Job defined at: customink/crypteia/.github/workflows/test.yml@refs/heads/MultiPlatform
2023-01-22T19:18:48.0957914Z Waiting for a runner to pick up this job...
2023-01-22T19:18:48.5509306Z Job is waiting for a hosted runner to come online.
2023-01-22T19:18:53.1417633Z Job is about to start running on the hosted runner: GitHub Actions 8 (hosted)
2023-01-22T19:18:55.8052163Z Current runner version: '2.300.2'
2023-01-22T19:18:55.8084326Z ##[group]Operating System
2023-01-22T19:18:55.8085007Z Ubuntu
2023-01-22T19:18:55.8085356Z 22.04.1
2023-01-22T19:18:55.8085727Z LTS
@metaskills
metaskills / talk.md
Created November 7, 2022 16:05
Lambda Sidecar Talk Proposal

Introducing the “Lambda Sidecar” Pattern for K8s Event-Driven Architecture

Description

In this session we are going to share a top to bottom (architecture → tooling) story on how we at Custom Ink are using real cloud-native & serverless solutions for our Kubernetes workloads during our migration from AMQP to EventBridge. Like many teams, we are slowly marching to a more event-driven architecture (EDA) and we cant wait to share how Lambda, SQS, & EventBridge are a key part of our journey. In our time together, we want to explore the following topics.

  1. A product review on the current state of open-soruce solutions for containerized event handling.
  2. What does the “Lambda Sidecar” architecture pattern look like and where can it be used? Background jobs?
  3. How using Lambda’s functional command interface helps avoid costly HTTP-based software refactors.
  4. How can we use the same ECR images for our Kubernetes workloads with AWS Lambda? Secrets & Env variables?