Skip to content

Commit 7a4b18a

Browse files
committed
cp dines
1 parent 865eebb commit 7a4b18a

5 files changed

Lines changed: 157 additions & 4 deletions

File tree

.npmignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Source files
2+
src/
3+
*.ts
4+
!*.d.ts
5+
6+
# Development files
7+
.git/
8+
.github/
9+
.vscode/
10+
.idea/
11+
*.log
12+
npm-debug.log*
13+
yarn-debug.log*
14+
yarn-error.log*
15+
16+
# Test files
17+
test/
18+
tests/
19+
*.test.js
20+
*.test.ts
21+
*.spec.js
22+
*.spec.ts
23+
24+
# Config files
25+
.eslintrc*
26+
.prettierrc*
27+
tsconfig.json
28+
.editorconfig
29+
30+
# Other
31+
node_modules/
32+
.DS_Store
33+
.env
34+
.env.*
35+
*.tgz
36+
.test

.test

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/bash
2+
3+
# List of namespaces to skip (already processed)
4+
SKIP_NS=""
5+
6+
for ns in $(kubectl get namespaces -o name | grep 'namespace/lambda-' | cut -d'/' -f2); do
7+
# Skip if namespace is in the skip list
8+
if echo "$SKIP_NS" | grep -qw "$ns"; then
9+
echo "=== Skipping namespace: $ns (already processed) ==="
10+
continue
11+
fi
12+
13+
echo "=== Processing namespace: $ns ==="
14+
for pod in $(kubectl get pods -n $ns -o name | grep looper | cut -d'/' -f2); do
15+
echo "--- Checking pod: $pod ---"
16+
17+
# Health check: verify pod is Running and Ready
18+
POD_STATUS=$(kubectl get pod -n $ns $pod -o jsonpath='{.status.phase}' 2>/dev/null)
19+
POD_READY=$(kubectl get pod -n $ns $pod -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}' 2>/dev/null)
20+
21+
if [ "$POD_STATUS" != "Running" ]; then
22+
echo "!!! Pod $pod is not Running (status: $POD_STATUS), skipping..."
23+
echo ""
24+
continue
25+
fi
26+
27+
if [ "$POD_READY" != "True" ]; then
28+
echo "!!! Pod $pod is not Ready, skipping..."
29+
echo ""
30+
continue
31+
fi
32+
33+
# Check if port 8080 is listening
34+
kubectl exec -n $ns $pod -- sh -c "command -v nc >/dev/null 2>&1 && nc -zv localhost 8080" 2>/dev/null
35+
if [ $? -ne 0 ]; then
36+
echo "⚠ Port 8080 might not be listening, but continuing anyway..."
37+
fi
38+
39+
echo "✓ Pod is healthy, executing commands..."
40+
41+
# Run with error handling
42+
kubectl exec -n $ns $pod -- bash -c "
43+
apt update && \
44+
apt install curl -y && \
45+
curl -sSL 'https://github.com/fullstorydev/grpcurl/releases/download/v1.8.7/grpcurl_1.8.7_linux_arm64.tar.gz' | tar -xz -C /usr/local/bin && \
46+
grpcurl -plaintext -d '{\"wet_run\": true}' localhost:8080 proto.ai.runloop.server.api.looper.scanner.ScannerService/triggerDiscoDeletionVerificationScan
47+
" || echo "!!! Failed for pod: $pod in namespace: $ns"
48+
49+
echo ""
50+
done
51+
done
52+
53+
echo "=== All namespaces processed ==="

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Runloop
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,17 @@ A beautiful, interactive CLI for managing Runloop devboxes built with Ink and Ty
1414

1515
## Installation
1616

17+
Install globally via npm:
18+
19+
```bash
20+
npm install -g @runloop/rl-cli
21+
```
22+
23+
Or install from source:
24+
1725
```bash
26+
git clone https://github.com/runloop/rl-cli-node.git
27+
cd rl-cli-node
1828
npm install
1929
npm run build
2030
npm link
@@ -150,6 +160,17 @@ npm start -- <command>
150160
- TypeScript - Type safety
151161
- [Figures](https://github.com/sindresorhus/figures) - Unicode symbols
152162

163+
## Publishing
164+
165+
To publish a new version to npm:
166+
167+
```bash
168+
npm run build
169+
npm publish
170+
```
171+
172+
**Note:** Make sure you're logged in to npm with access to the `@runloop` organization.
173+
153174
## License
154175

155176
MIT

package.json

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "runloop-cli",
2+
"name": "@runloop/rl-cli",
33
"version": "1.0.0",
44
"description": "Beautiful CLI for Runloop devbox management",
55
"type": "module",
@@ -9,15 +9,37 @@
99
"scripts": {
1010
"build": "tsc",
1111
"dev": "tsc --watch",
12-
"start": "node dist/cli.js"
12+
"start": "node dist/cli.js",
13+
"prepublishOnly": "npm run build"
1314
},
1415
"keywords": [
1516
"runloop",
1617
"cli",
17-
"devbox"
18+
"devbox",
19+
"cloud",
20+
"development"
1821
],
19-
"author": "",
22+
"author": "Runloop",
2023
"license": "MIT",
24+
"repository": {
25+
"type": "git",
26+
"url": "https://github.com/runloop/rl-cli-node.git"
27+
},
28+
"bugs": {
29+
"url": "https://github.com/runloop/rl-cli-node/issues"
30+
},
31+
"homepage": "https://github.com/runloop/rl-cli-node#readme",
32+
"engines": {
33+
"node": ">=18.0.0"
34+
},
35+
"files": [
36+
"dist",
37+
"README.md",
38+
"LICENSE"
39+
],
40+
"publishConfig": {
41+
"access": "public"
42+
},
2143
"dependencies": {
2244
"@inkjs/ui": "^2.0.0",
2345
"@runloop/api-client": "^0.55.0",

0 commit comments

Comments
 (0)