From 5218aee5864ba6070aadf637d40be84b438b55ae Mon Sep 17 00:00:00 2001 From: Chris Farhood Date: Thu, 16 Apr 2026 21:15:51 -0400 Subject: [PATCH] chore: remove playwright-ephemeral skill Co-Authored-By: Claude Opus 4.6 --- .../references/job-template.yaml | 51 ----------- .../references/svc-template.yaml | 16 ---- playwright-ephemeral/scripts/provision.sh | 88 ------------------- playwright-ephemeral/scripts/teardown.sh | 24 ----- 4 files changed, 179 deletions(-) delete mode 100644 playwright-ephemeral/references/job-template.yaml delete mode 100644 playwright-ephemeral/references/svc-template.yaml delete mode 100755 playwright-ephemeral/scripts/provision.sh delete mode 100755 playwright-ephemeral/scripts/teardown.sh diff --git a/playwright-ephemeral/references/job-template.yaml b/playwright-ephemeral/references/job-template.yaml deleted file mode 100644 index 0de1f1b..0000000 --- a/playwright-ephemeral/references/job-template.yaml +++ /dev/null @@ -1,51 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: "{{SESSION_NAME}}" - namespace: "{{NAMESPACE}}" - labels: - app: playwright-mcp - session: "{{SESSION_NAME}}" -spec: - ttlSecondsAfterFinished: {{TTL}} - activeDeadlineSeconds: {{DEADLINE}} - backoffLimit: 0 - template: - metadata: - labels: - app: playwright-mcp - session: "{{SESSION_NAME}}" - spec: - shareProcessNamespace: true - restartPolicy: Never - containers: - - name: playwright-mcp - image: mcr.microsoft.com/playwright/mcp - command: ["node"] - args: - - "cli.js" - - "--headless" - - "--browser" - - "chromium" - - "--no-sandbox" - - "--port" - - "8931" - - "--host" - - "0.0.0.0" - ports: - - containerPort: 8931 - protocol: TCP - resources: - requests: - memory: "{{MEMORY_REQUEST}}" - cpu: "250m" - limits: - memory: "{{MEMORY_LIMIT}}" - cpu: "1" - readinessProbe: - httpGet: - path: /mcp - port: 8931 - initialDelaySeconds: 5 - periodSeconds: 3 - failureThreshold: 20 diff --git a/playwright-ephemeral/references/svc-template.yaml b/playwright-ephemeral/references/svc-template.yaml deleted file mode 100644 index 045b52e..0000000 --- a/playwright-ephemeral/references/svc-template.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: "{{SESSION_NAME}}" - namespace: "{{NAMESPACE}}" - labels: - app: playwright-mcp - session: "{{SESSION_NAME}}" -spec: - type: ClusterIP - selector: - session: "{{SESSION_NAME}}" - ports: - - port: 8931 - targetPort: 8931 - protocol: TCP diff --git a/playwright-ephemeral/scripts/provision.sh b/playwright-ephemeral/scripts/provision.sh deleted file mode 100755 index 8487374..0000000 --- a/playwright-ephemeral/scripts/provision.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -die() { echo "ERROR: $*" >&2; exit 1; } - -# --- Dependencies --- -command -v kubectl >/dev/null 2>&1 || die "kubectl is not installed or not in PATH" - -# --- Configuration --- -NAMESPACE="${PLAYWRIGHT_NAMESPACE:-playwright-sessions}" -TIMEOUT="${PLAYWRIGHT_TIMEOUT:-120}" -TTL="${PLAYWRIGHT_TTL:-1800}" -DEADLINE="${PLAYWRIGHT_DEADLINE:-1800}" -MEMORY_REQUEST="${PLAYWRIGHT_MEMORY_REQUEST:-512Mi}" -MEMORY_LIMIT="${PLAYWRIGHT_MEMORY_LIMIT:-1Gi}" - -# Generate unique session name -AGENT_NAME="${PAPERCLIP_AGENT_ID:-agent}" -# Use first 8 chars of agent ID + random suffix -AGENT_SHORT="${AGENT_NAME:0:8}" -SHORT_UUID=$(head -c 6 /dev/urandom | od -An -tx1 | tr -d ' \n' | head -c 8) -SESSION_NAME="playwright-${AGENT_SHORT}-${SHORT_UUID}" - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -REF_DIR="${SCRIPT_DIR}/../references" - -# --- Ensure namespace exists --- -if ! kubectl get namespace "$NAMESPACE" >/dev/null 2>&1; then - echo "Creating namespace $NAMESPACE..." >&2 - kubectl create namespace "$NAMESPACE" -fi - -# --- Render and apply Job manifest --- -sed \ - -e "s|{{SESSION_NAME}}|${SESSION_NAME}|g" \ - -e "s|{{NAMESPACE}}|${NAMESPACE}|g" \ - -e "s|{{TTL}}|${TTL}|g" \ - -e "s|{{DEADLINE}}|${DEADLINE}|g" \ - -e "s|{{MEMORY_REQUEST}}|${MEMORY_REQUEST}|g" \ - -e "s|{{MEMORY_LIMIT}}|${MEMORY_LIMIT}|g" \ - "$REF_DIR/job-template.yaml" | kubectl apply -f - >&2 - -# --- Render and apply Service manifest --- -sed \ - -e "s|{{SESSION_NAME}}|${SESSION_NAME}|g" \ - -e "s|{{NAMESPACE}}|${NAMESPACE}|g" \ - "$REF_DIR/svc-template.yaml" | kubectl apply -f - >&2 - -# --- Wait for pod to be Ready --- -echo "Waiting for pod to be ready (timeout: ${TIMEOUT}s)..." >&2 -SECONDS=0 -POD_READY=false - -while [ "$SECONDS" -lt "$TIMEOUT" ]; do - POD_NAME=$(kubectl get pods -n "$NAMESPACE" -l "session=${SESSION_NAME}" -o jsonpath='{.items[0].metadata.name}' 2>/dev/null || true) - - if [ -n "$POD_NAME" ]; then - PHASE=$(kubectl get pod -n "$NAMESPACE" "$POD_NAME" -o jsonpath='{.status.phase}' 2>/dev/null || true) - if [ "$PHASE" = "Running" ]; then - READY=$(kubectl get pod -n "$NAMESPACE" "$POD_NAME" -o jsonpath='{.status.containerStatuses[0].ready}' 2>/dev/null || true) - if [ "$READY" = "true" ]; then - POD_READY=true - break - fi - elif [ "$PHASE" = "Failed" ] || [ "$PHASE" = "Succeeded" ]; then - # Cleanup on failure - echo "Pod entered $PHASE state unexpectedly. Cleaning up..." >&2 - kubectl delete job "$SESSION_NAME" -n "$NAMESPACE" --ignore-not-found >&2 - kubectl delete service "$SESSION_NAME" -n "$NAMESPACE" --ignore-not-found >&2 - die "Pod failed to start (phase: $PHASE)" - fi - fi - - sleep 3 -done - -if [ "$POD_READY" != "true" ]; then - echo "Timed out waiting for MCP server. Cleaning up..." >&2 - kubectl delete job "$SESSION_NAME" -n "$NAMESPACE" --ignore-not-found >&2 - kubectl delete service "$SESSION_NAME" -n "$NAMESPACE" --ignore-not-found >&2 - die "Playwright MCP server did not become ready within ${TIMEOUT}s" -fi - -MCP_URL="http://${SESSION_NAME}.${NAMESPACE}.svc.cluster.local:8931/mcp" - -echo "Playwright MCP session ready." >&2 -echo "SESSION_NAME=${SESSION_NAME}" -echo "MCP_URL=${MCP_URL}" diff --git a/playwright-ephemeral/scripts/teardown.sh b/playwright-ephemeral/scripts/teardown.sh deleted file mode 100755 index f093c4c..0000000 --- a/playwright-ephemeral/scripts/teardown.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -die() { echo "ERROR: $*" >&2; exit 1; } - -# --- Dependencies --- -command -v kubectl >/dev/null 2>&1 || die "kubectl is not installed or not in PATH" - -# --- Arguments --- -SESSION_NAME="${1:-}" -[ -n "$SESSION_NAME" ] || die "Usage: teardown.sh " - -NAMESPACE="${PLAYWRIGHT_NAMESPACE:-playwright-sessions}" - -# --- Delete Job and Service --- -echo "Tearing down session: ${SESSION_NAME} in namespace: ${NAMESPACE}" >&2 - -kubectl delete job "$SESSION_NAME" -n "$NAMESPACE" --ignore-not-found >&2 -echo "Job deleted." >&2 - -kubectl delete service "$SESSION_NAME" -n "$NAMESPACE" --ignore-not-found >&2 -echo "Service deleted." >&2 - -echo "Session ${SESSION_NAME} torn down successfully." >&2