merge things needed for infra
This commit is contained in:
parent
fbae355056
commit
2c302a259c
7 changed files with 76 additions and 113 deletions
|
|
@ -31,7 +31,8 @@
|
||||||
"jgclark.vscode-todo-highlight",
|
"jgclark.vscode-todo-highlight",
|
||||||
"corentinartaud.pdfpreview",
|
"corentinartaud.pdfpreview",
|
||||||
"github.vscode-github-actions",
|
"github.vscode-github-actions",
|
||||||
"anthropic.claude-code"
|
"anthropic.claude-code",
|
||||||
|
"jakobhoeg.vscode-pokemon"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
19
.github/workflows/test-autoscaling.yml
vendored
19
.github/workflows/test-autoscaling.yml
vendored
|
|
@ -6,11 +6,22 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
load-test:
|
load-test:
|
||||||
runs-on: mealcraft-runners
|
runs-on: mealcraft-runners
|
||||||
container: ubuntu:22.04
|
# container: ubuntu:22.04
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
job_id: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]
|
job_id: [
|
||||||
fail-fast: false
|
1,2,3,4,5,6,7,8,9,10,
|
||||||
|
11,12,13,14,15,16,17,18,19,20,
|
||||||
|
21,22,23,24,25,26,27,28,29,30,
|
||||||
|
31,32,33,34,35,36,37,38,39,40,
|
||||||
|
41,42,43,44,45,46,47,48,49,50,
|
||||||
|
51,52,53,54,55,56,57,58,59,60,
|
||||||
|
61,62,63,64,65,66,67,68,69,70,
|
||||||
|
71,72,73,74,75,76,77,78,79,80,
|
||||||
|
81,82,83,84,85,86,87,88,89,90,
|
||||||
|
91,92,93,94,95,96,97,98,99,100
|
||||||
|
]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
|
|
@ -20,7 +31,7 @@ jobs:
|
||||||
run: pwd
|
run: pwd
|
||||||
|
|
||||||
- name: List files
|
- name: List files
|
||||||
run: ls -al
|
run: ls -la
|
||||||
|
|
||||||
- name: Print job info
|
- name: Print job info
|
||||||
run: echo "Running job ${{ matrix.job_id }}"
|
run: echo "Running job ${{ matrix.job_id }}"
|
||||||
|
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
||||||
apiVersion: actions.github.com/v1alpha1
|
|
||||||
kind: AutoscalingRunnerSet
|
|
||||||
metadata:
|
|
||||||
name: mealcraft-runners
|
|
||||||
namespace: arc-systems
|
|
||||||
annotations:
|
|
||||||
actions.github.com/cleanup-github-secret-name: mealcraft-runners-gha-rs-github-secret
|
|
||||||
actions.github.com/cleanup-manager-role-binding: mealcraft-runners-gha-rs-manager
|
|
||||||
actions.github.com/cleanup-manager-role-name: mealcraft-runners-gha-rs-manager
|
|
||||||
actions.github.com/cleanup-no-permission-service-account-name: mealcraft-runners-gha-rs-no-permission
|
|
||||||
actions.github.com/runner-group-name: Default
|
|
||||||
actions.github.com/runner-scale-set-name: mealcraft-runners
|
|
||||||
meta.helm.sh/release-name: mealcraft-runners
|
|
||||||
meta.helm.sh/release-namespace: arc-systems
|
|
||||||
labels:
|
|
||||||
actions.github.com/organization: MealCraft
|
|
||||||
actions.github.com/scale-set-name: mealcraft-runners
|
|
||||||
actions.github.com/scale-set-namespace: arc-systems
|
|
||||||
app.kubernetes.io/component: autoscaling-runner-set
|
|
||||||
app.kubernetes.io/instance: mealcraft-runners
|
|
||||||
app.kubernetes.io/managed-by: Helm
|
|
||||||
app.kubernetes.io/name: mealcraft-runners
|
|
||||||
app.kubernetes.io/part-of: gha-rs
|
|
||||||
app.kubernetes.io/version: 0.13.0
|
|
||||||
helm.sh/chart: gha-rs-0.13.0
|
|
||||||
|
|
||||||
spec:
|
|
||||||
githubConfigSecret: mealcraft-runners-gha-rs-github-secret
|
|
||||||
githubConfigUrl: https://github.com/MealCraft
|
|
||||||
runnerScaleSetName: mealcraft-runners
|
|
||||||
|
|
||||||
template:
|
|
||||||
spec:
|
|
||||||
restartPolicy: Never
|
|
||||||
serviceAccountName: mealcraft-runners-gha-rs-no-permission
|
|
||||||
|
|
||||||
# 👇 HOST STORAGE ACCESS
|
|
||||||
volumes:
|
|
||||||
- name: k8s-storage
|
|
||||||
hostPath:
|
|
||||||
path: /home/kimjunte/k8s_storage
|
|
||||||
type: Directory
|
|
||||||
|
|
||||||
containers:
|
|
||||||
- name: runner
|
|
||||||
image: ghcr.io/actions/actions-runner:latest
|
|
||||||
command:
|
|
||||||
- /home/runner/run.sh
|
|
||||||
|
|
||||||
# 👇 AWS CREDS FROM K8S SECRET
|
|
||||||
env:
|
|
||||||
- name: RUNNER_LABELS
|
|
||||||
value: mealcraft-runners,self-hosted
|
|
||||||
|
|
||||||
envFrom:
|
|
||||||
- secretRef:
|
|
||||||
name: aws-secrets
|
|
||||||
- secretRef:
|
|
||||||
name: postgres-secret
|
|
||||||
|
|
||||||
# 👇 MOUNT PV STORAGE READ-ONLY
|
|
||||||
volumeMounts:
|
|
||||||
- name: k8s-storage
|
|
||||||
mountPath: /k8s_storage
|
|
||||||
readOnly: true
|
|
||||||
|
|
||||||
1
mist_infra/arc/controller-values.yaml
Normal file
1
mist_infra/arc/controller-values.yaml
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
replicaCount: 1
|
||||||
|
|
@ -3,45 +3,53 @@ set -euo pipefail
|
||||||
|
|
||||||
# ==========================================================
|
# ==========================================================
|
||||||
# Update / Install GitHub Actions Runner Controller (ARC)
|
# Update / Install GitHub Actions Runner Controller (ARC)
|
||||||
#
|
# + Update Runner Scale Set (gha-runner-scale-set)
|
||||||
# - Safe to run multiple times
|
|
||||||
# - Applies changes from arc/values.yaml
|
|
||||||
# - Does NOT assume fresh cluster
|
|
||||||
#
|
|
||||||
# ==========================================================
|
# ==========================================================
|
||||||
|
|
||||||
NAMESPACE="actions-runner-system"
|
# --- Controller settings ---
|
||||||
RELEASE_NAME="actions-runner-controller"
|
CONTROLLER_NAMESPACE="actions-runner-system"
|
||||||
CHART="actions-runner-controller/actions-runner-controller"
|
CONTROLLER_RELEASE="actions-runner-controller"
|
||||||
VALUES_FILE="$(dirname "$0")/values.yaml"
|
CONTROLLER_CHART="actions-runner-controller/actions-runner-controller"
|
||||||
|
CONTROLLER_VALUES_FILE="$(dirname "$0")/controller-values.yaml"
|
||||||
|
|
||||||
echo "=== Updating ARC (GitHub Actions Runner Controller) ==="
|
# --- Runner scale set settings ---
|
||||||
|
RUNNER_NAMESPACE="arc-systems"
|
||||||
|
RUNNER_RELEASE="mealcraft-runners"
|
||||||
|
RUNNER_CHART="oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set"
|
||||||
|
RUNNER_VERSION="0.13.0"
|
||||||
|
RUNNER_VALUES_FILE="$(dirname "$0")/values.yaml"
|
||||||
|
|
||||||
echo "→ Ensuring namespace exists: $NAMESPACE"
|
echo "=== Updating ARC Controller ==="
|
||||||
kubectl create namespace "$NAMESPACE" \
|
|
||||||
|
kubectl create namespace "$CONTROLLER_NAMESPACE" \
|
||||||
--dry-run=client -o yaml | kubectl apply -f -
|
--dry-run=client -o yaml | kubectl apply -f -
|
||||||
|
|
||||||
echo "→ Adding Helm repo (if missing)"
|
|
||||||
helm repo add actions-runner-controller \
|
helm repo add actions-runner-controller \
|
||||||
https://actions-runner-controller.github.io/actions-runner-controller \
|
https://actions-runner-controller.github.io/actions-runner-controller \
|
||||||
>/dev/null 2>&1 || true
|
>/dev/null 2>&1 || true
|
||||||
|
|
||||||
helm repo update
|
helm repo update
|
||||||
|
|
||||||
echo "→ Applying Helm upgrade"
|
|
||||||
helm upgrade --install \
|
helm upgrade --install \
|
||||||
"$RELEASE_NAME" \
|
"$CONTROLLER_RELEASE" \
|
||||||
"$CHART" \
|
"$CONTROLLER_CHART" \
|
||||||
-n "$NAMESPACE" \
|
-n "$CONTROLLER_NAMESPACE" \
|
||||||
-f "$VALUES_FILE"
|
-f "$CONTROLLER_VALUES_FILE"
|
||||||
|
|
||||||
|
echo "=== Updating Runner Scale Set ==="
|
||||||
|
|
||||||
|
export HELM_EXPERIMENTAL_OCI=1
|
||||||
|
|
||||||
|
helm upgrade --install \
|
||||||
|
"$RUNNER_RELEASE" \
|
||||||
|
"$RUNNER_CHART" \
|
||||||
|
--version "$RUNNER_VERSION" \
|
||||||
|
-n "$RUNNER_NAMESPACE" \
|
||||||
|
-f "$RUNNER_VALUES_FILE"
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "✅ ARC update complete"
|
echo "✅ ARC + Runner update complete"
|
||||||
echo
|
echo
|
||||||
echo "Next steps:"
|
echo "Next steps:"
|
||||||
echo "- kubectl get pods -n $NAMESPACE"
|
echo "- kubectl get pods -n $RUNNER_NAMESPACE"
|
||||||
echo "- kubectl get runners"
|
echo "- Re-run autoscaling workflow"
|
||||||
|
|
||||||
kubectl get secret aws-secrets -n default -o yaml \
|
|
||||||
| sed 's/namespace: default/namespace: arc-systems/' \
|
|
||||||
| kubectl apply -f -
|
|
||||||
|
|
@ -1,19 +1,25 @@
|
||||||
runner:
|
githubConfigUrl: https://github.com/MealCraft
|
||||||
labels:
|
|
||||||
- mist
|
githubConfigSecret:
|
||||||
|
github_token: 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
|
||||||
|
|
||||||
|
runnerScaleSetName: mealcraft-runners
|
||||||
|
|
||||||
|
containerMode:
|
||||||
|
type: dind # 👈 THIS is the key change
|
||||||
|
|
||||||
|
runnerLabels:
|
||||||
|
- mealcraft-runners
|
||||||
- self-hosted
|
- self-hosted
|
||||||
|
|
||||||
envFrom:
|
envFrom:
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: aws-secrets
|
name: aws-secrets
|
||||||
|
- secretRef:
|
||||||
|
name: postgres-secret
|
||||||
|
|
||||||
volumeMounts:
|
# 👇 Explicit DIND configuration
|
||||||
- name: k8s-storage
|
docker:
|
||||||
mountPath: /k8s_storage
|
enabled: true
|
||||||
readOnly: true
|
privileged: true
|
||||||
|
networkMTU: 1450
|
||||||
volumes:
|
|
||||||
- name: k8s-storage
|
|
||||||
hostPath:
|
|
||||||
path: /home/kimjunte/k8s_storage
|
|
||||||
type: Directory
|
|
||||||
2
stripe_to_invoice/stripe_webhook_payment.sh
Normal file
2
stripe_to_invoice/stripe_webhook_payment.sh
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
echo "note you need to do 'stripe login' to make the below command work"
|
||||||
|
stripe listen --forward-to http://localhost:3000/api/billing/webhook
|
||||||
Loading…
Add table
Reference in a new issue