Skip to content

Commit e67bee5

Browse files
Merge pull request #6 from WarpBuilds/feat/builder-v2
2 parents 54dcee7 + b1cddd6 commit e67bee5

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

.github/workflows/debug.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ env:
1212
jobs:
1313
test-multi-warp:
1414
name: Debug Run ${{ matrix.run_number }}
15-
runs-on: warpdev-ubuntu-latest-x64-2x
15+
runs-on: warpdev-ubuntu-latest-x64-8x
1616
strategy:
1717
matrix:
18-
run_number: [1]
18+
run_number: [1,2,3]
1919
fail-fast: false
2020
steps:
2121
- name: Checkout repository
@@ -25,6 +25,6 @@ jobs:
2525
uses: ./
2626
with:
2727
files: ./__tests__/bake.hcl
28-
profile-name: dev-eph
28+
profile-name: test-dev
2929

3030

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/warpbuild.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ interface BuilderConfig {
1616

1717
interface BuilderInstance {
1818
id: string;
19+
request_id: string;
1920
arch: string;
2021
metadata: {
2122
host: string;
@@ -478,13 +479,16 @@ export class WarpBuildRemoteBuilders {
478479
public async removeBuilderInstances(): Promise<void> {
479480
for (const builderInstance of this.builderInstances) {
480481
try {
481-
const removeBuilderEndpoint = `${this.apiDomain}/api/v1/builders/${builderInstance.id}/teardown`;
482+
core.info(`Removing builder instance ${builderInstance.id} request ${builderInstance.request_id}`);
483+
const removeBuilderEndpoint = `${this.apiDomain}/api/v1/builder-session-requests/complete`;
482484
const authHeader = this.isWarpBuildRunner ? `Bearer ${process.env.WARPBUILD_RUNNER_VERIFICATION_TOKEN}` : `Bearer ${this.apiKey}`;
483485

484486
const response = await fetch(removeBuilderEndpoint, {
485-
method: 'DELETE',
486-
headers: {Authorization: authHeader}
487-
});
487+
method: 'POST',
488+
headers: {Authorization: authHeader},
489+
body: JSON.stringify({request_id: builderInstance.request_id})
490+
},
491+
);
488492

489493
if (!response.ok) {
490494
const errorData = await response.json().catch(() => ({message: 'Unknown error'}));
@@ -493,7 +497,7 @@ export class WarpBuildRemoteBuilders {
493497

494498
core.info(`Builder instance ${builderInstance.id} removed successfully`);
495499
} catch (error) {
496-
core.warning(`Failed to remove builder instance: ${error.message}`);
500+
core.warning(`Failed to remove builder request ${builderInstance.request_id}: ${error.message}`);
497501
}
498502
}
499503
}

0 commit comments

Comments
 (0)