Skip to content

Instantly share code, notes, and snippets.

View abatilo's full-sized avatar

Aaron Batilo abatilo

View GitHub Profile
@abatilo
abatilo / cmd.go
Created April 2, 2023 21:42
Build index and search index with OpenAI
View cmd.go
package gogptindex
import (
"context"
_ "embed"
"encoding/json"
"fmt"
"net/http"
"os"
"os/signal"
View imagepulljob.yaml
apiVersion: apps.kruise.io/v1alpha1
kind: ImagePullJob
metadata:
name: sudokurace
namespace: kruise-system
spec:
image: '911907402684.dkr.ecr.us-west-2.amazonaws.com/sudokurace:' # Tag set by kustomization.yaml
pullSecrets:
# Must match https://gist.github.com/abatilo/6b287265d541d06da567893c1522999f#file-imagepulljob-tf-L3
- kruise-ecr-token
View imagepulljob.tf
locals {
kruise_ecr_token_updater_service_account = "kruise-ecr-token-updater"
kruise_ecr_token_secret_name = "kruise-ecr-token"
kruise_ecr_token_updater_script = <<EOF
ECR_TOKEN=`aws ecr get-login-password --region $${AWS_REGION}`
NAMESPACE_NAME=${kubernetes_namespace.kruise_system.metadata[0].name}
kubectl delete secret --ignore-not-found $DOCKER_SECRET_NAME -n $NAMESPACE_NAME
kubectl create secret docker-registry $DOCKER_SECRET_NAME \
@abatilo
abatilo / openkruise.tf
Created March 7, 2023 00:00
Terraform for installing OpenKruise with AWS ECR credentials
View openkruise.tf
locals {
kruise_ecr_token_updater_service_account = "kruise-ecr-token-updater"
kruise_ecr_token_secret_name = "kruise-ecr-token"
kruise_ecr_token_updater_script = <<EOF
ECR_TOKEN=`aws ecr get-login-password --region $${AWS_REGION}`
NAMESPACE_NAME=${kubernetes_namespace.kruise_system.metadata[0].name}
kubectl delete secret --ignore-not-found $DOCKER_SECRET_NAME -n $NAMESPACE_NAME
kubectl create secret docker-registry $DOCKER_SECRET_NAME \
@abatilo
abatilo / ratelimit.yml
Created October 9, 2022 20:58
Example of getting app rate limits
View ratelimit.yml
name: Print rate limits
on:
push:
jobs:
rate-limit:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate_token
View test.sql
DROP TABLE IF EXISTS sent;
DROP TABLE IF EXISTS message;
DROP TABLE IF EXISTS recipient;
CREATE TABLE IF NOT EXISTS recipient (
id serial primary key
);
CREATE TABLE IF NOT EXISTS message (
id serial primary key
@abatilo
abatilo / keybase.md
Created July 17, 2021 15:26
Keybase verification
View keybase.md

Keybase proof

I hereby claim:

  • I am abatilo on github.
  • I am abatilo (https://keybase.io/abatilo) on keybase.
  • I have a public key ASBj4Bn3TezS05hHpJOC9GEht3EPE2hH8UCfVnGGI-YacQo

To claim this, I am signing this object:

@abatilo
abatilo / gist:b13fae524c2192da376643a425dadeba
Created October 13, 2020 12:11
Argo Rollouts specific rollout logs
View gist:b13fae524c2192da376643a425dadeba
time="2020-10-13T12:08:28Z" level=info msg="Started syncing rollout at (2020-10-13 12:08:28.976596472 +0000 UTC m=+0.127703923)" namespace=default rollout=nginx
time="2020-10-13T12:08:28Z" level=warning msg="Assuming 7b54fb9677 for new replicaset pod hash" namespace=default rollout=nginx
time="2020-10-13T12:08:28Z" level=info msg="Patched: {\"status\":{\"conditions\":[{\"lastTransitionTime\":\"2020-10-13T12:08:28Z\",\"lastUpdateTime\":\"2020-10-13T12:08:28Z\",\"message\":\"Rollout \\\"nginx\\\" is progressing.\",\"reason\":\"ReplicaSetUpdated\",\"status\":\"True\",\"type\":\"Progressing\"},{\"lastTransitionTime\":\"2020-10-13T12:08:28Z\",\"lastUpdateTime\":\"2020-10-13T12:08:28Z\",\"message\":\"Rollout does not have minimum availability\",\"reason\":\"AvailableReason\",\"status\":\"False\",\"type\":\"Available\"}],\"currentPodHash\":\"7b54fb9677\",\"currentStepHash\":\"8cd479c8f\",\"currentStepIndex\":0,\"observedGeneration\":\"58c975674b\",\"selector\":\"app=nginx\"}}" namespace=default rollout=nginx
time="2
View gist:a4ff10e0c07013f824594f7d84b21c4e
time="2020-10-13T12:08:28Z" level=info msg="Creating event broadcaster"
time="2020-10-13T12:08:28Z" level=info msg="Setting up event handlers"
time="2020-10-13T12:08:28Z" level=info msg="Setting up experiments event handlers"
time="2020-10-13T12:08:28Z" level=info msg="Setting up analysis event handlers"
time="2020-10-13T12:08:28Z" level=info msg="Waiting for controller's informer caches to sync"
time="2020-10-13T12:08:28Z" level=info msg="Starting Controllers"
time="2020-10-13T12:08:28Z" level=info msg="Started controller"
time="2020-10-13T12:08:28Z" level=info msg="Starting Metric Server at 0.0.0.0:8090"
time="2020-10-13T12:08:28Z" level=info msg="Starting Rollout workers"
time="2020-10-13T12:08:28Z" level=info msg="Starting Experiment workers"
View argo-rollouts-issue-repro.yml
---
apiVersion: argoproj.io/v1alpha1
kind: AnalysisTemplate
metadata:
name: integrationtests
spec:
metrics:
- name: integrationtests
failureLimit: 0
provider: