
Andrew Womeldorf
Software Engineer
In the last few months, I’ve been gifted some Onyx Coffee Earl Grey and a Hario tea pot. I have never liked bagged earl grey that I’ve had - no matter how long I steep it, it’s bitter. Yet, I absolutely love this tea, the way I’ve been brewing it in the tea pot.
So I want to try more teas of varying type and quality, and see what else I like.
Today I finally took the time to find some info that I’ve wondered about for…too long.
The Open Container Initiative governs the interfaces around containers. In particular, for today, I want to understand the specification for interacting with registries, like ECR.
Hey, guess what? The OCI specs are all in github! Here are the API endpoints for a registry.
The spec doesn’t appear to define authentication - only that it might exist.
Simply put:
pip install -r <(poetry export) -t out/ poetry export outputs a pinned version of packages in the same format as a requirements.txt.
Package as a lambda function in Gitlab CI:
# .gitlab-ci.yml stages: - package package: stage: package image: python:3.10 variables: POETRY_HOME: /usr/local before_script: - curl -sSL https://install.python-poetry.org | python3 - # install poetry - apt-get update && apt-get install -y zip # install zip script: - pip install -r <(poetry export) -t out/ - cp src/*.
I am trying to run a shell script in AWS Lambda. I packaged it in a Docker image based on Alpine. The logs show that it runs fine, but the Lambda shows an error, even though my script exited with 0.
This blog post was my key to understanding what went wrong.
The docs page I had found mentioned the Lambda Runtime API, and how the container needs to implement that API.
#!/usr/bin/env sh # # Loop a JSON list and perform some action fakelist='["foo", "bar", "baz"]' echo $fakelist | jq -rc '.[]' | while read item; do echo $item done Handy dandy.
We currently have our domestic phone plan through US Mobile. We have their unlimited plan, which includes a free 10GB of international data. Before traveling, we added a new eSim to our phone for the destination. It was so simple to setup, and worked great. Maybe worth noting that it only provided data, but what do we need calling and texting for? We can do all communication over the internet.
I was interested in exploring NHTSA Vehicle Data without worrying about the limits placed on their API. They make available a backup of their MS Sql Server database as a .bak file. However, I don’t know Sql Server, and I don’t really want to learn it too much. Also, it’s not necessarily “fun” to run Sql Server locally on Linux.
Here’s a pretty rudimentary solution I came up with. It uses Docker to run a Sql Server container.
I like to be able to build an AWS Lambda in golang and be able to test it locally.
The AWS Lambda sets some environment variables. Use those to check if you’re in the Lambda runtime.
package main import ( "context" "fmt" "os" "github.com/aws/aws-lambda-go/lambda" ) type MyEvent struct {} var isLambda bool func init() { runtime := os.Getenv("AWS_LAMBDA_RUNTIME_API") if runtime != "" { isLambda = true } } func run(ctx context.
Here’s a simple example.
The lambda function and its requirements are in lambda/.
A null_resource is responsible for triggering a rebuild. The trigger calculates a base64sha256 on each file in lambda/, and concatenates the results together into a single string. Any time files are added, removed, or modified inside lambda/, the null resource is rerun. The provisioner removes any existing build result directory out/, then installs the packages with pip, and copies source files into the build result dir.
walterwanderley/sqlc-grpc is a very interesting project that builds on the output of kyleconroy/sqlc to generate a functional REST/JSON and GRPC server. When I started toying with it, I was a little disappointed that I couldn’t easily add any application logic outside of my SQL. This could be great for scaffolding a project, but then it seemed like I might not be able to add anything like validation.
Having had some more time to explore the project, now, I see that there is some way to be able to add a layer between the communication layer and the database layer.