diff --git a/README.md b/README.md
index e177d282f..9d471b76f 100644
--- a/README.md
+++ b/README.md
@@ -108,7 +108,7 @@ yagna payment fund --network holesky
yagna payment status --network holesky
```
-#### Obtain an `app-key` to use with SDK
+### Obtain an `app-key` to use with SDK
If you don't have any app-keys available from `yagna app-key list`, go ahead and create one with the command below.
You will need this key in order to communicate with `yagna` from your application. You can set it
@@ -147,13 +147,13 @@ const order: MarketOrderSpec = {
try {
await glm.connect();
- // Lease a machine
- const lease = await glm.oneOf(order);
- await lease
+ // Rent a machine
+ const rental = await glm.oneOf(order);
+ await rental
.getExeUnit()
.then((exe) => exe.run("echo Hello, Golem! 👋"))
.then((res) => console.log(res.stdout));
- await lease.finalize();
+ await rental.stopAndFinalize();
} catch (err) {
console.error("Failed to run the example", err);
} finally {
@@ -188,27 +188,27 @@ const order: MarketOrderSpec = {
try {
await glm.connect();
- // create a pool that can grow up to 3 leases at the same time
+ // create a pool that can grow up to 3 rentals at the same time
const pool = await glm.manyOf({
concurrency: 3,
order,
});
// run 3 tasks in parallel on 3 different machines
await Promise.allSettled([
- pool.withLease(async (lease) =>
- lease
+ pool.withRental(async (rental) =>
+ rental
.getExeUnit()
.then((exe) => exe.run("echo Hello, Golem from the first machine! 👋"))
.then((res) => console.log(res.stdout)),
),
- pool.withLease(async (lease) =>
- lease
+ pool.withRental(async (rental) =>
+ rental
.getExeUnit()
.then((exe) => exe.run("echo Hello, Golem from the second machine! 👋"))
.then((res) => console.log(res.stdout)),
),
- pool.withLease(async (lease) =>
- lease
+ pool.withRental(async (rental) =>
+ rental
.getExeUnit()
.then((exe) => exe.run("echo Hello, Golem from the third machine! 👋"))
.then((res) => console.log(res.stdout)),
@@ -270,8 +270,8 @@ securely between the nodes.
```ts
const network = await glm.createNetwork({ ip: "192.168.7.0/24" });
// ...
-const exe1 = await lease1.getExeUnit();
-const exe2 = await lease2.getExeUnit();
+const exe1 = await rental1.getExeUnit();
+const exe2 = await rental2.getExeUnit();
await exe1
.run(`ping ${exe2.getIp()} -c 4`)
.then((res) => console.log(`Response from provider: ${exe1.provider.name} (ip: ${exe1.getIp()})`, res.stdout));
diff --git a/examples/advanced/local-image/serveLocalGvmi.ts b/examples/advanced/local-image/serveLocalGvmi.ts
index 29cce32c1..45de3cc64 100644
--- a/examples/advanced/local-image/serveLocalGvmi.ts
+++ b/examples/advanced/local-image/serveLocalGvmi.ts
@@ -39,9 +39,9 @@ const getImagePath = (path: string) => new URL(path, import.meta.url).toString()
},
};
- const lease = await glm.oneOf(order);
+ const rental = await glm.oneOf(order);
// in our Dockerfile we have created a file called hello.txt, let's read it
- const result = await lease
+ const result = await rental
.getExeUnit()
.then((exe) => exe.run("cat hello.txt"))
.then((res) => res.stdout);
diff --git a/examples/advanced/manual-pools.ts b/examples/advanced/manual-pools.ts
index 490bbde41..6883e5897 100644
--- a/examples/advanced/manual-pools.ts
+++ b/examples/advanced/manual-pools.ts
@@ -55,29 +55,29 @@ const demandOptions = {
market: glm.market,
activity: glm.activity,
payment: glm.payment,
- lease: glm.lease,
+ rental: glm.rental,
};
- const pool = depModules.lease.createLeaseProcessPool(proposalPool, allocation, {
+ const pool = depModules.rental.createResourceRentalPool(proposalPool, allocation, {
replicas: { max: CONCURRENCY },
});
- const lease = await pool.acquire();
- const lease2 = await pool.acquire();
+ const rental1 = await pool.acquire();
+ const rental2 = await pool.acquire();
await Promise.allSettled([
- lease
+ rental1
.getExeUnit()
.then((exe) => exe.run("echo Hello from first activity 👋"))
.then((result) => console.log(result.stdout)),
- lease2
+ rental2
.getExeUnit()
.then((exe) => exe.run("echo Hello from second activity 👋"))
.then((result) => console.log(result.stdout)),
]);
- await pool.release(lease);
- await pool.release(lease2);
+ await pool.release(rental1);
+ await pool.release(rental2);
proposalSubscription.unsubscribe();
await pool.drainAndClear();
diff --git a/examples/advanced/override-module.ts b/examples/advanced/override-module.ts
index df49d26ba..8e7c5fa2d 100644
--- a/examples/advanced/override-module.ts
+++ b/examples/advanced/override-module.ts
@@ -58,12 +58,12 @@ const order: MarketOrderSpec = {
try {
await glm.connect();
- const lease = await glm.oneOf(order);
- await lease
+ const rental = await glm.oneOf(order);
+ await rental
.getExeUnit()
.then((exe) => exe.run("echo Hello, Golem! 👋"))
.then((res) => console.log(res.stdout));
- await lease.finalize();
+ await rental.stopAndFinalize();
} catch (err) {
console.error("Failed to run the example", err);
} finally {
diff --git a/examples/advanced/payment-filters.ts b/examples/advanced/payment-filters.ts
index adcb8254a..8d5e11e1c 100644
--- a/examples/advanced/payment-filters.ts
+++ b/examples/advanced/payment-filters.ts
@@ -61,12 +61,12 @@ const order: MarketOrderSpec = {
try {
await glm.connect();
- const lease = await glm.oneOf(order);
- await lease
+ const rental = await glm.oneOf(order);
+ await rental
.getExeUnit()
.then((exe) => exe.run("echo Hello, Golem! 👋"))
.then((res) => console.log(res.stdout));
- await lease.finalize();
+ await rental.stopAndFinalize();
} catch (err) {
console.error("Failed to run the example", err);
} finally {
diff --git a/examples/advanced/proposal-filter.ts b/examples/advanced/proposal-filter.ts
index 5278af3c6..226ab980c 100644
--- a/examples/advanced/proposal-filter.ts
+++ b/examples/advanced/proposal-filter.ts
@@ -35,12 +35,12 @@ const order: MarketOrderSpec = {
try {
await glm.connect();
- const lease = await glm.oneOf(order);
- await lease
+ const rental = await glm.oneOf(order);
+ await rental
.getExeUnit()
.then((exe) => exe.run(`echo [provider:${exe.provider.name}] Hello, Golem! 👋`))
.then((res) => console.log(res.stdout));
- await lease.finalize();
+ await rental.stopAndFinalize();
} catch (err) {
console.error("Failed to run the example", err);
} finally {
diff --git a/examples/advanced/proposal-predefined-filter.ts b/examples/advanced/proposal-predefined-filter.ts
index b584393e4..d3d6414fd 100644
--- a/examples/advanced/proposal-predefined-filter.ts
+++ b/examples/advanced/proposal-predefined-filter.ts
@@ -33,12 +33,12 @@ const order: MarketOrderSpec = {
try {
await glm.connect();
- const lease = await glm.oneOf(order);
- await lease
+ const rental = await glm.oneOf(order);
+ await rental
.getExeUnit()
.then((exe) => exe.run(`echo [provider:${exe.provider.name}] Hello, Golem! 👋`))
.then((res) => console.log(res.stdout));
- await lease.finalize();
+ await rental.stopAndFinalize();
} catch (err) {
console.error("Failed to run the example", err);
} finally {
diff --git a/examples/advanced/proposal-selector.ts b/examples/advanced/proposal-selector.ts
index 32c0da7b0..23e4878f1 100644
--- a/examples/advanced/proposal-selector.ts
+++ b/examples/advanced/proposal-selector.ts
@@ -41,12 +41,12 @@ const order: MarketOrderSpec = {
try {
await glm.connect();
- const lease = await glm.oneOf(order);
- await lease
+ const rental = await glm.oneOf(order);
+ await rental
.getExeUnit()
.then((exe) => exe.run(`echo [provider:${exe.provider.name}] Hello, Golem! 👋`))
.then((res) => console.log(res.stdout));
- await lease.finalize();
+ await rental.stopAndFinalize();
} catch (err) {
console.error("Failed to run the example", err);
} finally {
diff --git a/examples/advanced/reuse-allocation.ts b/examples/advanced/reuse-allocation.ts
index 5e1e99fa0..97a463ff6 100644
--- a/examples/advanced/reuse-allocation.ts
+++ b/examples/advanced/reuse-allocation.ts
@@ -52,20 +52,20 @@ import { pinoPrettyLogger } from "@golem-sdk/pino-logger";
},
};
- const lease1 = await glm.oneOf(firstOrder);
- const lease2 = await glm.oneOf(secondOrder);
+ const rental1 = await glm.oneOf(firstOrder);
+ const rental2 = await glm.oneOf(secondOrder);
- await lease1
+ await rental1
.getExeUnit()
- .then((exe) => exe.run("echo Running on first lease"))
+ .then((exe) => exe.run("echo Running on first rental"))
.then((res) => console.log(res.stdout));
- await lease2
+ await rental2
.getExeUnit()
- .then((exe) => exe.run("echo Running on second lease"))
+ .then((exe) => exe.run("echo Running on second rental"))
.then((res) => console.log(res.stdout));
- await lease1.finalize();
- await lease2.finalize();
+ await rental1.stopAndFinalize();
+ await rental2.stopAndFinalize();
await glm.payment.releaseAllocation(allocation);
} catch (err) {
console.error("Failed to run the example", err);
diff --git a/examples/basic/events.ts b/examples/basic/events.ts
index cde2b2b6d..3a6291d09 100644
--- a/examples/basic/events.ts
+++ b/examples/basic/events.ts
@@ -35,7 +35,7 @@ import { pinoPrettyLogger } from "@golem-sdk/pino-logger";
console.warn("Proposal rejected by provider", event);
});
- const lease = await glm.oneOf({
+ const rental = await glm.oneOf({
demand: {
workload: { imageTag: "golem/alpine:latest" },
},
@@ -50,12 +50,12 @@ import { pinoPrettyLogger } from "@golem-sdk/pino-logger";
},
});
- await lease
+ await rental
.getExeUnit()
.then((exe) => exe.run("echo Hello, Golem! 👋"))
.then((res) => console.log(res.stdout));
- await lease.finalize();
+ await rental.stopAndFinalize();
} catch (err) {
console.error("Failed to run the example", err);
} finally {
diff --git a/examples/basic/many-of.ts b/examples/basic/many-of.ts
index 7b9f855fe..2c7e39ef7 100644
--- a/examples/basic/many-of.ts
+++ b/examples/basic/many-of.ts
@@ -1,5 +1,5 @@
/**
- * This example demonstrates how easily lease multiple machines at once.
+ * This example demonstrates how easily rent multiple machines at once.
*/
import { GolemNetwork, MarketOrderSpec } from "@golem-sdk/golem-js";
@@ -29,26 +29,26 @@ const order: MarketOrderSpec = {
try {
await glm.connect();
- // create a pool that can grow up to 3 leases at the same time
+ // create a pool that can grow up to 3 rentals at the same time
const pool = await glm.manyOf({
concurrency: 3,
order,
});
await Promise.allSettled([
- pool.withLease(async (lease) =>
- lease
+ pool.withRental(async (rental) =>
+ rental
.getExeUnit()
.then((exe) => exe.run("echo Hello, Golem from the first machine! 👋"))
.then((res) => console.log(res.stdout)),
),
- pool.withLease(async (lease) =>
- lease
+ pool.withRental(async (rental) =>
+ rental
.getExeUnit()
.then((exe) => exe.run("echo Hello, Golem from the second machine! 👋"))
.then((res) => console.log(res.stdout)),
),
- pool.withLease(async (lease) =>
- lease
+ pool.withRental(async (rental) =>
+ rental
.getExeUnit()
.then((exe) => exe.run("echo Hello, Golem from the third machine! 👋"))
.then((res) => console.log(res.stdout)),
diff --git a/examples/basic/one-of.ts b/examples/basic/one-of.ts
index b53fe2716..c22007c08 100644
--- a/examples/basic/one-of.ts
+++ b/examples/basic/one-of.ts
@@ -25,12 +25,12 @@ const order: MarketOrderSpec = {
try {
await glm.connect();
- const lease = await glm.oneOf(order);
- await lease
+ const rental = await glm.oneOf(order);
+ await rental
.getExeUnit()
.then((exe) => exe.run("echo Hello, Golem! 👋"))
.then((res) => console.log(res.stdout));
- await lease.finalize();
+ await rental.stopAndFinalize();
} catch (err) {
console.error("Failed to run the example", err);
} finally {
diff --git a/examples/basic/run-and-stream.ts b/examples/basic/run-and-stream.ts
index 546f08aa1..efcb19408 100644
--- a/examples/basic/run-and-stream.ts
+++ b/examples/basic/run-and-stream.ts
@@ -30,8 +30,8 @@ const order: MarketOrderSpec = {
try {
await glm.connect();
- const lease = await glm.oneOf(order);
- const exe = await lease.getExeUnit();
+ const rental = await glm.oneOf(order);
+ const exe = await rental.getExeUnit();
const remoteProcess = await exe.runAndStream(
`
@@ -50,7 +50,7 @@ const order: MarketOrderSpec = {
remoteProcess.stderr.on("data", (data) => console.error("stderr>", data));
await remoteProcess.waitForExit();
- await lease.finalize();
+ await rental.stopAndFinalize();
} catch (err) {
console.error("Failed to run the example", err);
} finally {
diff --git a/examples/basic/transfer.ts b/examples/basic/transfer.ts
index c0b005879..890a46f53 100644
--- a/examples/basic/transfer.ts
+++ b/examples/basic/transfer.ts
@@ -30,11 +30,11 @@ const order: MarketOrderSpec = {
concurrency: 2,
order,
});
- const lease1 = await pool.acquire();
- const lease2 = await pool.acquire();
+ const rental1 = await pool.acquire();
+ const rental2 = await pool.acquire();
- const exe1 = await lease1.getExeUnit();
- const exe2 = await lease2.getExeUnit();
+ const exe1 = await rental1.getExeUnit();
+ const exe2 = await rental2.getExeUnit();
await exe1
.beginBatch()
@@ -54,8 +54,8 @@ const order: MarketOrderSpec = {
console.log("File content: ");
console.log(await readFile("./results.txt", { encoding: "utf-8" }));
- await lease1.finalize();
- await lease2.finalize();
+ await rental1.stopAndFinalize();
+ await rental2.stopAndFinalize();
} catch (err) {
console.error("Failed to run the example", err);
} finally {
diff --git a/examples/basic/vpn.ts b/examples/basic/vpn.ts
index d277aced8..b4381a411 100644
--- a/examples/basic/vpn.ts
+++ b/examples/basic/vpn.ts
@@ -26,23 +26,23 @@ import { pinoPrettyLogger } from "@golem-sdk/pino-logger";
},
network,
};
- // create a pool that can grow up to 2 leases at the same time
+ // create a pool that can grow up to 2 rentals at the same time
const pool = await glm.manyOf({
concurrency: 2,
order,
});
- const lease1 = await pool.acquire();
- const lease2 = await pool.acquire();
- const exe1 = await lease1.getExeUnit();
- const exe2 = await lease2.getExeUnit();
+ const rental1 = await pool.acquire();
+ const rental2 = await pool.acquire();
+ const exe1 = await rental1.getExeUnit();
+ const exe2 = await rental2.getExeUnit();
await exe1
.run(`ping ${exe2.getIp()} -c 4`)
.then((res) => console.log(`Response from provider: ${exe1.provider.name} (ip: ${exe1.getIp()})`, res.stdout));
await exe2
.run(`ping ${exe1.getIp()} -c 4`)
.then((res) => console.log(`Response from provider: ${exe2.provider.name} (ip: ${exe2.getIp()})`, res.stdout));
- await pool.destroy(lease1);
- await pool.destroy(lease2);
+ await pool.destroy(rental1);
+ await pool.destroy(rental2);
await glm.destroyNetwork(network);
} catch (err) {
diff --git a/examples/experimental/deployment/new-api.ts b/examples/experimental/deployment/new-api.ts
index 42ff943db..607e049bd 100644
--- a/examples/experimental/deployment/new-api.ts
+++ b/examples/experimental/deployment/new-api.ts
@@ -18,7 +18,7 @@ async function main() {
.createNetwork("basic", {
ip: "192.168.7.0/24",
})
- .createLeaseProcessPool("app", {
+ .createResourceRentalPool("app", {
demand: {
workload: {
imageTag: "golem/node:latest",
@@ -32,17 +32,13 @@ async function main() {
maxCpuPerHourPrice: 1,
maxEnvPerHourPrice: 1,
},
- withProviders: ["0x123123"],
- withoutProviders: ["0x123123"],
- withOperators: ["0x123123"],
- withoutOperators: ["0x123123"],
},
deployment: {
replicas: 2,
network: "basic",
},
})
- .createLeaseProcessPool("db", {
+ .createResourceRentalPool("db", {
demand: {
workload: {
imageTag: "golem/alpine:latest",
@@ -72,8 +68,8 @@ async function main() {
await deployment.start();
// Get your pool of activities for specified need
- const appPool = deployment.getLeaseProcessPool("app");
- const dbPool = deployment.getLeaseProcessPool("db");
+ const appPool = deployment.getResourceRentalPool("app");
+ const dbPool = deployment.getResourceRentalPool("db");
// Get an instance out of the pool for use
const appReplica1 = await appPool.acquire();
diff --git a/examples/web/hello.html b/examples/web/hello.html
index 557cdbf93..cb083025c 100644
--- a/examples/web/hello.html
+++ b/examples/web/hello.html
@@ -113,15 +113,15 @@
Results
try {
appendResults("Establishing a connection to the Golem Network");
await glm.connect();
- appendResults("Request for leasing a provider machine");
- const lease = await glm.oneOf(order);
- await lease
+ appendResults("Request for renting a provider machine");
+ const rental = await glm.oneOf(order);
+ await rental
.getExeUnit()
.then(async (exe) =>
appendResults("Reply: " + (await exe.run(`echo 'Hello Golem! 👋 from ${exe.provider.name}!'`)).stdout),
);
- await lease.finalize();
- appendResults("Finalized leasing process");
+ await rental.stopAndFinalize();
+ appendResults("Finalized renting process");
} catch (err) {
console.error("Failed to run the example", err);
} finally {
diff --git a/src/experimental/deployment/builder.test.ts b/src/experimental/deployment/builder.test.ts
index bf1b1d708..b7e9c31e2 100644
--- a/src/experimental/deployment/builder.test.ts
+++ b/src/experimental/deployment/builder.test.ts
@@ -10,7 +10,7 @@ describe("Deployment builder", () => {
const builder = new GolemDeploymentBuilder(mockGolemNetwork);
expect(() => {
builder
- .createLeaseProcessPool("my-pool", {
+ .createResourceRentalPool("my-pool", {
demand: {
workload: {
imageTag: "image",
@@ -32,7 +32,7 @@ describe("Deployment builder", () => {
replicas: 1,
},
})
- .createLeaseProcessPool("my-pool", {
+ .createResourceRentalPool("my-pool", {
demand: {
workload: {
imageTag: "image",
@@ -54,7 +54,7 @@ describe("Deployment builder", () => {
replicas: 1,
},
});
- }).toThrow(new GolemConfigError(`Lease Process Pool with name my-pool already exists`));
+ }).toThrow(new GolemConfigError(`Resource Rental Pool with name my-pool already exists`));
});
it("throws an error when creating a network with the same name", () => {
const builder = new GolemDeploymentBuilder(mockGolemNetwork);
@@ -67,7 +67,7 @@ describe("Deployment builder", () => {
expect(() => {
builder
.createNetwork("existing-network")
- .createLeaseProcessPool("my-pool", {
+ .createResourceRentalPool("my-pool", {
demand: {
workload: { imageTag: "image", minCpuCores: 1, minMemGib: 1, minStorageGib: 1 },
},
diff --git a/src/experimental/deployment/builder.ts b/src/experimental/deployment/builder.ts
index 564b23500..3764d7af2 100644
--- a/src/experimental/deployment/builder.ts
+++ b/src/experimental/deployment/builder.ts
@@ -9,31 +9,31 @@ export interface DeploymentOptions {
network?: string;
}
-export interface CreateLeaseProcessPoolOptions extends MarketOrderSpec {
+export interface CreateResourceRentalPoolOptions extends MarketOrderSpec {
deployment: DeploymentOptions;
}
export class GolemDeploymentBuilder {
private components: DeploymentComponents = {
- leaseProcessPools: [],
+ resourceRentalPools: [],
networks: [],
};
public reset() {
this.components = {
- leaseProcessPools: [],
+ resourceRentalPools: [],
networks: [],
};
}
constructor(private glm: GolemNetwork) {}
- createLeaseProcessPool(name: string, options: CreateLeaseProcessPoolOptions): this {
- if (this.components.leaseProcessPools.some((pool) => pool.name === name)) {
- throw new GolemConfigError(`Lease Process Pool with name ${name} already exists`);
+ createResourceRentalPool(name: string, options: CreateResourceRentalPoolOptions): this {
+ if (this.components.resourceRentalPools.some((pool) => pool.name === name)) {
+ throw new GolemConfigError(`Resource Rental Pool with name ${name} already exists`);
}
- this.components.leaseProcessPools.push({ name, options });
+ this.components.resourceRentalPools.push({ name, options });
return this;
}
@@ -57,7 +57,7 @@ export class GolemDeploymentBuilder {
market: this.glm.market,
activity: this.glm.activity,
network: this.glm.network,
- lease: this.glm.lease,
+ rental: this.glm.rental,
});
this.reset();
diff --git a/src/experimental/deployment/deployment.ts b/src/experimental/deployment/deployment.ts
index cef2e19d0..66e0b35af 100644
--- a/src/experimental/deployment/deployment.ts
+++ b/src/experimental/deployment/deployment.ts
@@ -6,9 +6,9 @@ import { Network, NetworkModule, NetworkOptions } from "../../network";
import { validateDeployment } from "./validate-deployment";
import { DraftOfferProposalPool, MarketModule } from "../../market";
import { PaymentModule } from "../../payment";
-import { CreateLeaseProcessPoolOptions } from "./builder";
+import { CreateResourceRentalPoolOptions } from "./builder";
import { Subscription } from "rxjs";
-import { LeaseModule, LeaseProcessPool } from "../../lease-process";
+import { RentalModule, ResourceRentalPool } from "../../resource-rental";
export enum DeploymentState {
INITIAL = "INITIAL",
@@ -43,7 +43,7 @@ export interface DeploymentEvents {
}
export type DeploymentComponents = {
- leaseProcessPools: { name: string; options: CreateLeaseProcessPoolOptions }[];
+ resourceRentalPools: { name: string; options: CreateResourceRentalPoolOptions }[];
networks: { name: string; options: NetworkOptions }[];
};
@@ -65,7 +65,7 @@ export class Deployment {
{
proposalPool: DraftOfferProposalPool;
proposalSubscription: Subscription;
- leaseProcessPool: LeaseProcessPool;
+ resourceRentalPool: ResourceRentalPool;
}
>();
@@ -76,7 +76,7 @@ export class Deployment {
activity: ActivityModule;
payment: PaymentModule;
network: NetworkModule;
- lease: LeaseModule;
+ rental: RentalModule;
};
constructor(
@@ -88,7 +88,7 @@ export class Deployment {
activity: ActivityModule;
payment: PaymentModule;
network: NetworkModule;
- lease: LeaseModule;
+ rental: RentalModule;
},
) {
validateDeployment(components);
@@ -129,8 +129,8 @@ export class Deployment {
// Allocation is re-used for all demands so the expiration date should
// be the equal to the longest expiration date of all demands
const longestExpiration =
- Math.max(...this.components.leaseProcessPools.map((pool) => pool.options.market.rentHours)) * 3600;
- const totalBudget = this.components.leaseProcessPools.reduce(
+ Math.max(...this.components.resourceRentalPools.map((pool) => pool.options.market.rentHours)) * 3600;
+ const totalBudget = this.components.resourceRentalPools.reduce(
(acc, pool) =>
acc +
this.modules.market.estimateBudget({
@@ -145,7 +145,7 @@ export class Deployment {
expirationSec: longestExpiration,
});
- for (const pool of this.components.leaseProcessPools) {
+ for (const pool of this.components.resourceRentalPools) {
const network = pool.options?.deployment?.network
? this.networks.get(pool.options?.deployment.network)
: undefined;
@@ -165,10 +165,10 @@ export class Deployment {
const proposalSubscription = proposalPool.readFrom(draftProposal$);
- const leaseProcessPool = this.modules.lease.createLeaseProcessPool(proposalPool, allocation, {
+ const resourceRentalPool = this.modules.rental.createResourceRentalPool(proposalPool, allocation, {
replicas: pool.options.deployment?.replicas,
network,
- leaseProcessOptions: {
+ resourceRentalOptions: {
activity: pool.options?.activity,
payment: pool.options?.payment,
},
@@ -179,7 +179,7 @@ export class Deployment {
this.pools.set(pool.name, {
proposalPool,
proposalSubscription,
- leaseProcessPool,
+ resourceRentalPool,
});
}
@@ -200,7 +200,7 @@ export class Deployment {
this.abortController.abort();
const stopPools = Array.from(this.pools.values()).map((pool) =>
- Promise.allSettled([pool.proposalSubscription.unsubscribe(), pool.leaseProcessPool.drainAndClear()]),
+ Promise.allSettled([pool.proposalSubscription.unsubscribe(), pool.resourceRentalPool.drainAndClear()]),
);
await Promise.allSettled(stopPools);
@@ -219,12 +219,12 @@ export class Deployment {
this.events.emit("end");
}
- getLeaseProcessPool(name: string): LeaseProcessPool {
+ getResourceRentalPool(name: string): ResourceRentalPool {
const pool = this.pools.get(name);
if (!pool) {
- throw new GolemUserError(`LeaseProcessPool ${name} not found`);
+ throw new GolemUserError(`ResourceRentalPool ${name} not found`);
}
- return pool.leaseProcessPool;
+ return pool.resourceRentalPool;
}
getNetwork(name: string): Network {
@@ -237,7 +237,7 @@ export class Deployment {
private async waitForDeployment() {
this.logger.info("Waiting for all components to be deployed...");
- const readyPools = [...this.pools.values()].map((component) => component.leaseProcessPool.ready());
+ const readyPools = [...this.pools.values()].map((component) => component.resourceRentalPool.ready());
await Promise.all(readyPools);
this.logger.info("Components deployed and ready to use");
}
diff --git a/src/experimental/deployment/validate-deployment.ts b/src/experimental/deployment/validate-deployment.ts
index 90b6b7ba1..43c81e61a 100644
--- a/src/experimental/deployment/validate-deployment.ts
+++ b/src/experimental/deployment/validate-deployment.ts
@@ -3,7 +3,7 @@ import { DeploymentComponents } from "./deployment";
function validateNetworks(components: DeploymentComponents) {
const networkNames = new Set(components.networks.map((network) => network.name));
- for (const pool of components.leaseProcessPools) {
+ for (const pool of components.resourceRentalPools) {
if (!pool.options.deployment?.network) {
continue;
}
diff --git a/src/experimental/job/job.test.ts b/src/experimental/job/job.test.ts
index db7032985..5df379040 100644
--- a/src/experimental/job/job.test.ts
+++ b/src/experimental/job/job.test.ts
@@ -3,22 +3,22 @@ import { WorkContext } from "../../activity/work";
import { anything, imock, instance, mock, reset, verify, when } from "@johanblumenberg/ts-mockito";
import { Logger } from "../../shared/utils";
import { GolemNetwork } from "../../golem-network";
-import { LeaseProcess } from "../../lease-process";
+import { ResourceRental } from "../../resource-rental";
const mockGlm = mock(GolemNetwork);
-const mockLease = mock(LeaseProcess);
+const mockRental = mock(ResourceRental);
const mockWorkContext = mock(WorkContext);
describe("Job", () => {
beforeEach(() => {
reset(mockGlm);
- reset(mockLease);
+ reset(mockRental);
reset(mockWorkContext);
});
describe("cancel()", () => {
it("stops the activity and releases the agreement when canceled", async () => {
- when(mockLease.getExeUnit()).thenResolve(instance(mockWorkContext));
- when(mockGlm.oneOf(anything())).thenResolve(instance(mockLease));
+ when(mockRental.getExeUnit()).thenResolve(instance(mockWorkContext));
+ when(mockGlm.oneOf(anything())).thenResolve(instance(mockRental));
const job = new Job(
"test_id",
instance(mockGlm),
@@ -49,7 +49,7 @@ describe("Job", () => {
await expect(job.waitForResult()).rejects.toThrow("Canceled");
- verify(mockLease.finalize()).once();
+ verify(mockRental.stopAndFinalize()).once();
});
});
});
diff --git a/src/experimental/job/job.ts b/src/experimental/job/job.ts
index 3387d5c6c..3285654a2 100644
--- a/src/experimental/job/job.ts
+++ b/src/experimental/job/job.ts
@@ -132,13 +132,13 @@ export class Job