@kradle/cli 0.0.15 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lib/challenge.js
CHANGED
|
@@ -180,6 +180,9 @@ export class Challenge {
|
|
|
180
180
|
*/
|
|
181
181
|
static async getLocalChallenges() {
|
|
182
182
|
const challengesDir = path.resolve(process.cwd(), "challenges");
|
|
183
|
+
if (!existsSync(challengesDir)) {
|
|
184
|
+
return {};
|
|
185
|
+
}
|
|
183
186
|
const entries = await readDirSorted(challengesDir);
|
|
184
187
|
const challenges = {};
|
|
185
188
|
for (const entry of entries) {
|
|
@@ -230,7 +230,7 @@ export class Evaluator {
|
|
|
230
230
|
console.log("");
|
|
231
231
|
}
|
|
232
232
|
if (options.openMetabase ?? true) {
|
|
233
|
-
openInBrowser(`https://daunt-fair.metabaseapp.com/dashboard/10-runs-analysis?
|
|
233
|
+
openInBrowser(`https://daunt-fair.metabaseapp.com/dashboard/10-runs-analysis?run_tags=${iterationTag}`);
|
|
234
234
|
}
|
|
235
235
|
const errors = this.runner?.getAllStates().filter((state) => state.status === "error");
|
|
236
236
|
if (errors?.length > 0) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const DEFAULT_MAX_CONCURRENT = 5;
|
|
2
|
-
const RATE_LIMIT_BACKOFF_MS =
|
|
2
|
+
const RATE_LIMIT_BACKOFF_MS = 15000;
|
|
3
3
|
const STATUS_POLL_INTERVAL_MS = 2000;
|
|
4
4
|
export class Runner {
|
|
5
5
|
runs;
|
|
@@ -135,7 +135,13 @@ export class Runner {
|
|
|
135
135
|
/**
|
|
136
136
|
* Start a single run
|
|
137
137
|
*/
|
|
138
|
-
async startRun(index) {
|
|
138
|
+
async startRun(index, tries = 0) {
|
|
139
|
+
if (tries > 5) {
|
|
140
|
+
this.updateState(index, { status: "error", error: "Failed to start run after 3 tries" });
|
|
141
|
+
this.completedRuns.add(index);
|
|
142
|
+
this.activeRuns.delete(index);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
139
145
|
const state = this.states[index];
|
|
140
146
|
this.activeRuns.add(index);
|
|
141
147
|
this.updateState(index, { status: "initializing", startTime: Date.now() });
|
|
@@ -165,6 +171,7 @@ export class Runner {
|
|
|
165
171
|
this.updateState(index, { status: "queued", error: undefined });
|
|
166
172
|
this.activeRuns.delete(index);
|
|
167
173
|
await this.delay(RATE_LIMIT_BACKOFF_MS);
|
|
174
|
+
await this.startRun(index, tries + 1);
|
|
168
175
|
return;
|
|
169
176
|
}
|
|
170
177
|
this.updateState(index, { status: "error", error: errorMessage });
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -2,4 +2,4 @@ WEB_API_URL=https://dev-api.kradle.ai/v0 #https://api.kradle.ai/v0
|
|
|
2
2
|
WEB_URL=https://dev.kradle.ai #https:/.kradle.ai/workbench
|
|
3
3
|
STUDIO_API_URL=http://localhost:2999/api/v0
|
|
4
4
|
STUDIO_URL=kradle-dev://open #kradle://://open
|
|
5
|
-
KRADLE_CHALLENGES_PATH=~/Documents/kradle-studio/challenges
|
|
5
|
+
KRADLE_CHALLENGES_PATH=~/Documents/kradle-studio/challenges-dev
|