Skip to content

Commit

Permalink
Publish Package Metadata for [email protected] (#5343)
Browse files Browse the repository at this point in the history
  • Loading branch information
pulumi-bot authored Sep 5, 2024
1 parent 3a5a4fe commit 1f106c8
Show file tree
Hide file tree
Showing 3 changed files with 272 additions and 8 deletions.
274 changes: 268 additions & 6 deletions themes/default/content/registry/packages/threefold/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The Threefold Resource Provider for the [threefold grid](https://threefold.io) l

### Network resource

{{< chooser language "go,python,yaml" >}}
{{< chooser language "go,python,yaml,nodejs" >}}

{{% choosable language go %}}

Expand Down Expand Up @@ -132,11 +132,35 @@ outputs:
{{% /choosable %}}
{{% choosable language nodejs %}}
```ts
import * as threefold from "@threefold/pulumi";

const provider = new threefold.Provider("provider", {mnemonic: process.env.MNEMONIC, network: process.env.NETWORK});
const scheduler = new threefold.Scheduler("scheduler", {farm_ids: [1]}, {
provider: provider,
});
const network = new threefold.Network("network", {
name: "testing",
description: "test network",
nodes: [scheduler.nodes[0]],
ip_range: "10.1.0.0/16",
}, {
provider: provider,
dependsOn: [scheduler],
});
export const nodeDeploymentId = network.node_deployment_id;
export const nodesIpRange = network.nodes_ip_range;
```

{{% /choosable %}}

{{< /chooser >}}

### Virtual machine resource

{{< chooser language "go,python,yaml" >}}
{{< chooser language "go,python,yaml,nodejs" >}}

{{% choosable language go %}}

Expand Down Expand Up @@ -367,11 +391,71 @@ outputs:
{{% /choosable %}}
{{% choosable language nodejs %}}
```ts
import * as threefold from "@threefold/pulumi";

const provider = new threefold.Provider("provider", {mnemonic: process.env.MNEMONIC, network: process.env.NETWORK});
const scheduler = new threefold.Scheduler("scheduler", {
mru: 0.25,
sru: 2,
farm_ids: [1],
}, {
provider: provider,
});
const network = new threefold.Network("network", {
name: "test",
description: "test network",
nodes: [scheduler.nodes[0]],
ip_range: "10.1.0.0/16",
mycelium: true,
}, {
provider: provider,
dependsOn: [scheduler],
});
const deployment = new threefold.Deployment("deployment", {
node_id: scheduler.nodes[0],
name: "deployment",
network_name: "test",
vms: [{
name: "vm",
node_id: scheduler.nodes[0],
flist: "https://hub.grid.tf/tf-official-apps/base:latest.flist",
entrypoint: "/sbin/zinit init",
network_name: "test",
cpu: 2,
memory: 256,
planetary: true,
mycelium: true,
mounts: [{
disk_name: "data",
mount_point: "/app",
}],
env_vars: {
SSH_KEY: "",
},
}],
disks: [{
name: "data",
size: 2,
}],
}, {
provider: provider,
dependsOn: [network],
});
export const nodeDeploymentId = deployment.node_deployment_id;
export const planetaryIp = deployment.vms_computed.apply(vms_computed => vms_computed[0].planetary_ip);
export const myceliumIp = deployment.vms_computed.apply(vms_computed => vms_computed[0].mycelium_ip);
```

{{% /choosable %}}

{{< /chooser >}}

### Kubernetes resource

{{< chooser language "go,python,yaml" >}}
{{< chooser language "go,python,yaml,nodejs" >}}

{{% choosable language go %}}

Expand Down Expand Up @@ -612,11 +696,74 @@ outputs:
{{% /choosable %}}
{{% choosable language nodejs %}}
```ts
import * as threefold from "@threefold/pulumi";

const provider = new threefold.Provider("provider", {mnemonic: process.env.MNEMONIC, network: process.env.NETWORK});
const scheduler = new threefold.Scheduler("scheduler", {
mru: 6,
sru: 6,
farm_ids: [1],
}, {
provider: provider,
});
const network = new threefold.Network("network", {
name: "test",
description: "test network",
nodes: [scheduler.nodes[0]],
ip_range: "10.1.0.0/16",
}, {
provider: provider,
dependsOn: [scheduler],
});
const kubernetes = new threefold.Kubernetes("kubernetes", {
master: {
name: "kubernetes",
network_name: "test",
node: scheduler.nodes[0],
disk_size: 2,
planetary: true,
cpu: 2,
memory: 2048,
},
workers: [
{
name: "worker1",
network_name: "test",
node: scheduler.nodes[0],
disk_size: 2,
cpu: 2,
memory: 2048,
},
{
name: "worker2",
network_name: "test",
node: scheduler.nodes[0],
disk_size: 2,
cpu: 2,
memory: 2048,
},
],
token: "t123456789",
network_name: "test",
ssh_key: undefined,
}, {
provider: provider,
dependsOn: [network],
});
export const nodeDeploymentId = kubernetes.node_deployment_id;
export const planetaryIp = kubernetes.master_computed.apply(master_computed => master_computed.planetary_ip);
```

{{% /choosable %}}

{{< /chooser >}}

### Name gateway resource

{{< chooser language "go,python,yaml" >}}
{{< chooser language "go,python,yaml,nodejs" >}}

{{% choosable language go %}}

Expand Down Expand Up @@ -741,11 +888,38 @@ outputs:
{{% /choosable %}}
{{% choosable language nodejs %}}
```ts
import * as threefold from "@threefold/pulumi";

const provider = new threefold.Provider("provider", {mnemonic: process.env.MNEMONIC, network: process.env.NETWORK});
const scheduler = new threefold.Scheduler("scheduler", {
farm_ids: [1],
ipv4: true,
free_ips: 1,
}, {
provider: provider,
});
const gatewayName = new threefold.GatewayName("gatewayName", {
name: "pulumi",
node_id: scheduler.nodes[0],
backends: ["http://69.164.223.208"],
}, {
provider: provider,
dependsOn: [scheduler],
});
export const nodeDeploymentId = gatewayName.node_deployment_id;
export const fqdn = gatewayName.fqdn;
```

{{% /choosable %}}

{{< /chooser >}}

### FQDN gateway resource

{{< chooser language "go,python,yaml" >}}
{{< chooser language "go,python,yaml,nodejs" >}}

{{% choosable language go %}}

Expand Down Expand Up @@ -971,11 +1145,67 @@ outputs:
{{% /choosable %}}
{{% choosable language nodejs %}}
```ts
import * as pulumi from "@pulumi/pulumi";
import * as threefold from "@threefold/pulumi";

const provider = new threefold.Provider("provider", {mnemonic: process.env.MNEMONIC, network: process.env.NETWORK});
const scheduler = new threefold.Scheduler("scheduler", {
mru: 0.25,
farm_ids: [1],
ipv4: true,
free_ips: 1,
}, {
provider: provider,
});
const network = new threefold.Network("network", {
name: "test",
description: "test network",
nodes: [scheduler.nodes[0]],
ip_range: "10.1.0.0/16",
}, {
provider: provider,
dependsOn: [scheduler],
});
const deployment = new threefold.Deployment("deployment", {
node_id: scheduler.nodes[0],
name: "deployment",
network_name: "test",
vms: [{
name: "vm",
node_id: scheduler.nodes[0],
flist: "https://hub.grid.tf/tf-official-apps/base:latest.flist",
network_name: "test",
cpu: 2,
memory: 256,
planetary: true,
}],
}, {
provider: provider,
dependsOn: [network],
});
const gatewayFQDN = new threefold.GatewayFQDN("gatewayFQDN", {
name: "testing",
node_id: 14,
fqdn: "remote.omar.grid.tf",
backends: [pulumi.interpolate `http://[${deployment.vms_computed[0].planetary_ip}]:9000`],
}, {
provider: provider,
dependsOn: [deployment],
});
export const nodeDeploymentId = gatewayFQDN.node_deployment_id;
export const fqdn = gatewayFQDN.fqdn;
```

{{% /choosable %}}

{{< /chooser >}}

### ZDB resource

{{< chooser language "go,python,yaml" >}}
{{< chooser language "go,python,yaml,nodejs" >}}

{{% choosable language go %}}

Expand Down Expand Up @@ -1117,4 +1347,36 @@ outputs:
{{% /choosable %}}
{{% choosable language nodejs %}}
```ts
import * as pulumi from "@pulumi/pulumi";
import * as threefold from "@threefold/pulumi";

const provider = new threefold.Provider("provider", {mnemonic: process.env.MNEMONIC, network: process.env.NETWORK});
const scheduler = new threefold.Scheduler("scheduler", {
mru: 0.25,
sru: 2,
farm_ids: [1],
}, {
provider: provider,
});
const deployment = new threefold.Deployment("deployment", {
node_id: scheduler.nodes[0],
name: "zdb",
zdbs: [{
name: "zdbsTest",
size: 2,
password: "123456",
}],
}, {
provider: provider,
});
export const nodeDeploymentId = deployment.node_deployment_id;
export const zdbEndpoint = pulumi.all([deployment.zdbs_computed, deployment.zdbs_computed]).apply(([deploymentZdbs_computed, deploymentZdbs_computed1]) => `[${deploymentZdbs_computed[0].ips?.[1]}]:${deploymentZdbs_computed1[0].port}`);
export const zdbNamespace = deployment.zdbs_computed.apply(zdbs_computed => zdbs_computed[0].namespace);
```

{{% /choosable %}}

{{< /chooser >}}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ layout: package
The Pulumi Threefold provider is available as a package in those Pulumi languages:

* Go: [`github.com/threefoldtech/pulumi-threefold/sdk`](https://pkg.go.dev/github.com/threefoldtech/pulumi-threefold/sdk)
* JavaScript/TypeScript: [`@threefold/pulumi`](https://www.npmjs.com/package/@threefold/pulumi)
* Python: [`pulumi-threefold`](https://pypi.org/project/pulumi-threefold/)

## Setup

Expand Down
4 changes: 2 additions & 2 deletions themes/default/data/registry/packages/threefold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ publisher: Threefold
repo_url: https://github.com/threefoldtech/pulumi-threefold
schema_file_path: provider/cmd/pulumi-resource-threefold/schema.json
title: Threefold Grid
updated_on: 1725525540
version: v0.7.3
updated_on: 1725540669
version: v0.7.4

0 comments on commit 1f106c8

Please sign in to comment.