Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Listing deployments from contracts instead of kvstore #2124

Merged
merged 49 commits into from
Mar 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
a64d3ef
Change the listing the deployments from the kvstore to contracts data
AhmedHanafy725 Feb 4, 2024
ac40295
Update filtering the contracts while listing the deployments
AhmedHanafy725 Feb 4, 2024
8b5beb8
Update the contract field on the failed deployment to the new naming
AhmedHanafy725 Feb 5, 2024
b4377a5
Remove saving the deployment data after deploying the workload from k…
AhmedHanafy725 Feb 5, 2024
7631999
chore: Merge branch 'development' into development_listing
MohamedElmdary Feb 6, 2024
6be3dae
feat: Add markAsFromAnotherClient helper
MohamedElmdary Feb 6, 2024
ab63505
feat: use markAsFromAnotherClient and add switch to toggle between sh…
MohamedElmdary Feb 6, 2024
3c6b9eb
feat: use markAsFromAnotherClient and add switch to toggle between sh…
MohamedElmdary Feb 6, 2024
70df69f
- feat: Support disable in icon_action_btn
MohamedElmdary Feb 6, 2024
faee502
refactor: Remove console logs
MohamedElmdary Feb 6, 2024
1994bf2
fix: Elimiate a possible error due to null value of gridStore.client
MohamedElmdary Feb 7, 2024
671f5ce
fix: if projectName was empty it causes a leading / which causes issu…
MohamedElmdary Feb 7, 2024
fd0996e
fix: mark only item from different client
MohamedElmdary Feb 7, 2024
204f684
feat: Move filter to graphql level instead of client level
MohamedElmdary Feb 7, 2024
ef75fac
feat: Store parsed value instead of parsing deploymentData over and over
MohamedElmdary Feb 7, 2024
715fff0
chore: Merge branch 'development' into development_listing
MohamedElmdary Feb 8, 2024
35183e1
fix: Stop filtering out workers from k8s clusters
MohamedElmdary Feb 11, 2024
0ee9dfa
fix: interfaces might be empty
MohamedElmdary Feb 11, 2024
af5e598
chore: Merge branch 'development' into development_listing
MohamedElmdary Feb 11, 2024
810f5c7
feat: Disable k8s clusters from other clients
MohamedElmdary Feb 12, 2024
3f955bd
fix: Add reload deployment with no projectName if failed to load with…
MohamedElmdary Feb 13, 2024
02c6027
fix: Add reload deployment with no projectName if failed to load with…
MohamedElmdary Feb 13, 2024
612a439
feat: Add tooltip for 'show all deployments' switch to make it more c…
MohamedElmdary Feb 13, 2024
ed73037
Merge branch 'development' into development_listing
AhmedHanafy725 Feb 15, 2024
c0bf57f
Get the network names from contracts and merge them with old ones sto…
AhmedHanafy725 Feb 15, 2024
dec42be
Load the network from the contracts
AhmedHanafy725 Feb 17, 2024
dbe8523
Load reserved ips from vm deployments
AhmedHanafy725 Feb 17, 2024
df1e4cb
Update workload's metadata of the newly created deployments
AhmedHanafy725 Feb 18, 2024
1efd99d
Update metadata interface to have version and change it to match the …
AhmedHanafy725 Feb 19, 2024
587760b
Set user access in the node to be set on the metadata when deploying …
AhmedHanafy725 Feb 19, 2024
3844f15
Update getting the wireguard config with fallback to kvstore
AhmedHanafy725 Feb 20, 2024
a7320ad
Update getting wireguard access from the playground
AhmedHanafy725 Feb 21, 2024
8b2817a
Get the reserved ips from zos instead of loop on all vms on this node
AhmedHanafy725 Feb 22, 2024
1840e6a
Add version 3 to the metadata
AhmedHanafy725 Feb 25, 2024
126c222
Disallow change the contract metadata by the user
AhmedHanafy725 Feb 25, 2024
2745adb
Merge branch 'development' into development_listing
AhmedHanafy725 Feb 25, 2024
aba9b0e
Merge branch 'development_listing' into development_load_networks
AhmedHanafy725 Feb 25, 2024
60d9490
Save the newly deployed contracts on the module to cover the delay fr…
AhmedHanafy725 Feb 25, 2024
fd07e71
Add the missing the fields for the resulted contracts
AhmedHanafy725 Feb 25, 2024
78ede80
Remove saving the network in the kvstore/filesystem
AhmedHanafy725 Feb 25, 2024
82b8e58
Store the user access on the network object instead of the node object
AhmedHanafy725 Feb 27, 2024
20e4235
Update kubernetes metadata
AhmedHanafy725 Feb 27, 2024
550b90b
Update scripts with the project name
AhmedHanafy725 Feb 27, 2024
f1dd744
Handle the case of the mount was set with null while getting the mach…
AhmedHanafy725 Feb 28, 2024
df14ae7
Return empty list for wireguard access in case there is no wireguard …
AhmedHanafy725 Feb 28, 2024
f747cb9
Update kubernetes projectname in the dashboard
AhmedHanafy725 Feb 29, 2024
a77edbf
Remove the repeated instances
AhmedHanafy725 Feb 29, 2024
6d21fed
Merge pull request #2239 from threefoldtech/development_load_networks
AhmedHanafy725 Mar 3, 2024
60f9260
Fix importing k8s worker as type
AhmedHanafy725 Mar 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions packages/grid_client/scripts/add_worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ async function deleteWorker(client, worker) {
}

async function main() {
const grid3 = await getClient();
const name = "testk8s";
const grid3 = await getClient(`kubernetes/${name}`);

const workerQueryOptions: FilterOptions = {
cru: 2,
Expand All @@ -36,7 +37,7 @@ async function main() {
};

const worker: AddWorkerModel = {
deployment_name: "testk8s",
deployment_name: name,
name: "worker2",
node_id: +(await grid3.capacity.filterNodes(workerQueryOptions))[0].nodeId,
cpu: 2,
Expand All @@ -53,10 +54,10 @@ async function main() {
await addWorker(grid3, worker);

//Get worker information
await getWorker(grid3, worker.deployment_name);
await getWorker(grid3, name);

//Uncomment the line below to delete the worker
// await deleteWorker(grid3, { name: worker.name, deployment_name: worker.deployment_name });
// await deleteWorker(grid3, { name: worker.name, deployment_name: name });

await grid3.disconnect();
}
Expand Down
9 changes: 5 additions & 4 deletions packages/grid_client/scripts/caprover_leader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ async function cancel(client, vms) {
}

async function main() {
const grid3 = await getClient();
const name = "newVMS5";
const grid3 = await getClient(`caprover/${name}`);

const vmQueryOptions: FilterOptions = {
cru: 4,
Expand All @@ -35,7 +36,7 @@ async function main() {
};

const vms: MachinesModel = {
name: "newVMS5",
name,
network: {
name: "wedtest",
ip_range: "10.249.0.0/16",
Expand Down Expand Up @@ -77,10 +78,10 @@ async function main() {
await deploy(grid3, vms);

//Get the deployment
await getDeployment(grid3, vms.name);
await getDeployment(grid3, name);

//Uncomment the line below to cancel the deployment
// await cancel(grid3, { name: vms.name });
// await cancel(grid3, { name });

await grid3.disconnect();
}
Expand Down
9 changes: 5 additions & 4 deletions packages/grid_client/scripts/caprover_worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ async function cancel(client, vms) {
}

async function main() {
const grid3 = await getClient();
const name = "newVMS5";
const grid3 = await getClient(`caprover/${name}`);

const vmQueryOptions: FilterOptions = {
cru: 4,
Expand All @@ -34,7 +35,7 @@ async function main() {
};

const vms: MachinesModel = {
name: "newVMS6",
name,
network: {
name: "wedtest",
ip_range: "10.249.0.0/16",
Expand Down Expand Up @@ -76,10 +77,10 @@ async function main() {
await deploy(grid3, vms);

//Get the deployment
await getDeployment(grid3, vms.name);
await getDeployment(grid3, name);

//Uncomment the line below to cancel the deployment
// await cancel(grid3, { name: vms.name });
// await cancel(grid3, { name });

await grid3.disconnect();
}
Expand Down
3 changes: 2 additions & 1 deletion packages/grid_client/scripts/client_loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ if (network === undefined || mnemonic === undefined || ssh_key === undefined) {
};
}

async function getClient(): Promise<GridClient> {
async function getClient(projectName = ""): Promise<GridClient> {
const gridClient = new GridClient({
network: config.network,
mnemonic: config.mnemonic,
storeSecret: config.storeSecret,
projectName,
});
await gridClient.connect();
return gridClient;
Expand Down
9 changes: 5 additions & 4 deletions packages/grid_client/scripts/dynamic_single_vm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ async function cancel(client, vms) {
}

async function main() {
const grid3 = await getClient();
const name = "dynamicVMS";
const grid3 = await getClient(`vm/${name}`);

const vmQueryOptions: FilterOptions = {
cru: 1,
Expand All @@ -35,7 +36,7 @@ async function main() {
};

const vms: MachinesModel = {
name: "dynamicVMS",
name,
network: {
name: "dynamictest",
ip_range: "10.249.0.0/16",
Expand Down Expand Up @@ -73,10 +74,10 @@ async function main() {
await deploy(grid3, vms);

//Get the deployment
await getDeployment(grid3, vms.name);
await getDeployment(grid3, name);

//Uncomment the line below to cancel the deployment
// await cancel(grid3, { name: vms.name });
// await cancel(grid3, { name });

await grid3.disconnect();
}
Expand Down
9 changes: 5 additions & 4 deletions packages/grid_client/scripts/kubernetes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ async function cancel(client, k8s) {
}

async function main() {
const grid3 = await getClient();
const name = "testk8s";
const grid3 = await getClient(`kubernetes/${name}`);

const masterQueryOptions: FilterOptions = {
cru: 2,
Expand All @@ -43,7 +44,7 @@ async function main() {
};

const k: K8SModel = {
name: "testk8s",
name,
secret: "secret",
network: {
name: "monNetwork",
Expand Down Expand Up @@ -87,10 +88,10 @@ async function main() {
await deploy(grid3, k);

//Get the deployment
await getDeployment(grid3, k.name);
await getDeployment(grid3, name);

//Uncomment the line below to cancel the deployment
// await cancel(grid3, { name: k.name });
// await cancel(grid3, { name });

await grid3.disconnect();
}
Expand Down
9 changes: 5 additions & 4 deletions packages/grid_client/scripts/kubernetes_mycelium.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ async function cancel(client, k8s) {
}

async function main() {
const grid3 = await getClient();
const name = "testk8sMy";
const grid3 = await getClient(`kubernetes/${name}`);

const k: K8SModel = {
name: "testk8sMy",
name,
secret: "secret",
network: {
name: "monNetwork",
Expand Down Expand Up @@ -100,10 +101,10 @@ async function main() {
await deploy(grid3, k);

//Get the deployment
await getDeployment(grid3, k.name);
await getDeployment(grid3, name);

//Uncomment the line below to cancel the deployment
// await cancel(grid3, { name: k.name });
// await cancel(grid3, { name });

await grid3.disconnect();
}
Expand Down
9 changes: 5 additions & 4 deletions packages/grid_client/scripts/kubernetes_with_qsfs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ async function deleteQsfs(client, qsfs) {
}

async function main() {
const grid3 = await getClient();
const name = "testk8sqsfs";
const grid3 = await getClient(`kubernetes/${name}`);

const qsfs_name = "testQsfsK8sq1";

Expand All @@ -64,7 +65,7 @@ async function main() {
farmId: 1,
};

const qsfsNodes = [];
const qsfsNodes: number[] = [];

const allNodes = await grid3.capacity.filterNodes(qsfsQueryOptions);
if (allNodes.length >= 2) {
Expand All @@ -85,7 +86,7 @@ async function main() {
};

const k: K8SModel = {
name: "testk8sqsfs",
name,
secret: "secret",
network: {
name: "k8sqsfsNetwork",
Expand Down Expand Up @@ -143,7 +144,7 @@ async function main() {
await deploy(grid3, k);

//Get the deployment
await getDeployment(grid3, k.name);
await getDeployment(grid3, name);

// //Uncomment the line below to cancel the deployment
// await cancel(grid3, { name: k.name });
Expand Down
9 changes: 5 additions & 4 deletions packages/grid_client/scripts/multiple_vms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ async function cancel(client, vms) {
}

async function main() {
const grid3 = await getClient();
const name = "monVMS2";
const grid3 = await getClient(`vm/${name}`);

const vmQueryOptions: FilterOptions = {
cru: 1,
Expand All @@ -35,7 +36,7 @@ async function main() {
};

const vms: MachinesModel = {
name: "monVMS2",
name,
network: {
name: "monNetwork",
ip_range: "10.238.0.0/16",
Expand Down Expand Up @@ -96,10 +97,10 @@ async function main() {
await deploy(grid3, vms);

//Get the deployment
await getDeployment(grid3, vms.name);
await getDeployment(grid3, name);

// //Uncomment the line below to cancel the deployment
// await cancel(grid3, { name: vms.name });
// await cancel(grid3, { name });

await grid3.disconnect();
}
Expand Down
9 changes: 5 additions & 4 deletions packages/grid_client/scripts/single_vm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ async function cancel(client, vms) {
}

async function main() {
const grid3 = await getClient();
const name = "newVMS";
const grid3 = await getClient(`vm/${name}`);

const vms: MachinesModel = {
name: "newVMS",
name,
network: {
name: "wedtest",
ip_range: "10.249.0.0/16",
Expand Down Expand Up @@ -65,10 +66,10 @@ async function main() {
await deploy(grid3, vms);

//Get the deployment
await getDeployment(grid3, vms.name);
await getDeployment(grid3, name);

//Uncomment the line below to cancel the deployment
// await cancel(grid3, { name: vms.name });
// await cancel(grid3, { name });

await grid3.disconnect();
}
Expand Down
9 changes: 5 additions & 4 deletions packages/grid_client/scripts/single_vm_mycelium.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ async function cancel(client, vms) {
}

async function main() {
const grid3 = await getClient();
const name = "newMY";
const grid3 = await getClient(`vm/${name}`);

const vms: MachinesModel = {
name: "newMY",
name,
network: {
name: "hellotest",
ip_range: "10.249.0.0/16",
Expand Down Expand Up @@ -72,10 +73,10 @@ async function main() {
await deploy(grid3, vms);

//Get the deployment
await getDeployment(grid3, vms.name);
await getDeployment(grid3, name);

//Uncomment the line below to cancel the deployment
// await cancel(grid3, { name: vms.name });
// await cancel(grid3, { name });

await grid3.disconnect();
}
Expand Down
11 changes: 6 additions & 5 deletions packages/grid_client/scripts/vm_with_gpu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ async function cancel(client, vms) {
}

async function main() {
const grid3 = await getClient();
const name = "vmgpu";
const grid3 = await getClient(`vm/${name}`);

const vmQueryOptions: FilterOptions = {
cru: 8,
Expand All @@ -48,7 +49,7 @@ async function main() {
}

const vms: MachinesModel = {
name: "vmgpu",
name,
network: {
name: "vmgpuNetwork",
ip_range: "10.249.0.0/16",
Expand Down Expand Up @@ -76,7 +77,7 @@ async function main() {
env: {
SSH_KEY: config.ssh_key,
},
gpus: gpuList[0].id,
gpus: [gpuList[0].id],
},
],
metadata: "",
Expand All @@ -87,10 +88,10 @@ async function main() {
await deploy(grid3, vms);

//Get the deployment
await getDeployment(grid3, vms.name);
await getDeployment(grid3, name);

//Uncomment the line below to cancel the deployment
// await cancel(grid3, { name: vms.name });
// await cancel(grid3, { name });

await grid3.disconnect();
}
Expand Down
Loading
Loading