Skip to content

Commit 24d876e

Browse files
committed
Bump version to v1.9.99
1 parent 1cc4779 commit 24d876e

File tree

5 files changed

+140
-24
lines changed

5 files changed

+140
-24
lines changed

sdk/python/README.md

Lines changed: 69 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,26 @@ layout: package
77
The Runpod provider for Pulumi can be used to provision [Runpod](https://www.runpod.io) resources.
88
The Runpod provider must be configured with Runpod's API keys to deploy and update resources in Runpod.
99

10+
## Pulumi guide
11+
Create an empty directory and navigate inside
12+
13+
```bash
14+
mkdir -p empty
15+
cd empty
16+
```
17+
18+
Create a new pulumi stack:
19+
```
20+
pulumi new
21+
```
22+
23+
A dropdown box will appear. Please select a minimal project from in there. For example, if you prefer using Go, you would select the following:
24+
```bash
25+
go A minimal Go Pulumi program
26+
```
27+
28+
Then populate the entrypoint file (__main__.py/main.go/index.ts) with the your data. Please use the guide below to understand more about what parameters are possible for each resource. For Python, please remember to activate the virtual environment.
29+
1030
## Config
1131

1232
To begin with, please set your runpod API key to use with Pulumi.
@@ -17,16 +37,15 @@ To begin with, please set your runpod API key to use with Pulumi.
1737

1838
## Example
1939

20-
This is an example of how to deploy it over Golang. We also serve pulumi over Typescript and Python. For more examples, please navigate to the examples directory
21-
or the documents inside docs. If you have any problems in doing so, please contact [email protected].
40+
This is an example of how to deploy it over Golang. We also serve pulumi over Typescript and Python. For more examples, please navigate to the examples directory or the docs/installation-configuration.md file. If you have any problems in doing so, please contact [email protected].
2241

2342
1. Create a new Pulumi Go example:
2443
```
2544
pulumi new
2645
```
2746
Select either the Go template or Runpod's Go template.
2847

29-
2. Set your API keys using the config shown above.
48+
2. Set your API keys using the process shown above.
3049

3150
3. Install the official Go package:
3251

@@ -49,22 +68,23 @@ func main() {
4968
pulumi.Run(func(ctx *pulumi.Context) error {
5069
testNetworkStorage, err := runpod.NewNetworkStorage(ctx, "testNetworkStorage", &runpod.NetworkStorageArgs{
5170
Name: pulumi.String("testStorage1"),
52-
Size: pulumi.Int(20),
53-
DataCenterId: pulumi.String("US-NJ"),
71+
Size: pulumi.Int(5),
72+
DataCenterId: pulumi.String("EU-RO-1"),
5473
})
5574
if err != nil {
5675
return err
5776
}
58-
5977
myRandomPod, err := runpod.NewPod(ctx, "myRandomPod", &runpod.PodArgs{
60-
CloudType: pulumi.String("ALL"),
61-
NetworkVolumeId: testNetworkStorage.NetworkStorage.Id(),
78+
CloudType: pulumi.String("ALL"),
79+
NetworkVolumeId: testNetworkStorage.NetworkStorage.ApplyT(func(networkStorage runpod.NetworkStorageType) (*string, error) {
80+
return &networkStorage.Id, nil
81+
}).(pulumi.StringPtrOutput),
6282
GpuCount: pulumi.Int(1),
6383
VolumeInGb: pulumi.Int(50),
6484
ContainerDiskInGb: pulumi.Int(50),
6585
MinVcpuCount: pulumi.Int(2),
6686
MinMemoryInGb: pulumi.Int(15),
67-
GpuTypeId: pulumi.String("NVIDIA GeForce RTX 3070"),
87+
GpuTypeId: pulumi.String("NVIDIA GeForce RTX 4090"),
6888
Name: pulumi.String("RunPod Pytorch"),
6989
ImageName: pulumi.String("runpod/pytorch"),
7090
DockerArgs: pulumi.String(""),
@@ -77,12 +97,50 @@ func main() {
7797
},
7898
},
7999
})
100+
if err != nil {
101+
return err
102+
}
103+
myTemplate, err := runpod.NewTemplate(ctx, "myTemplate", &runpod.TemplateArgs{
104+
ContainerDiskInGb: pulumi.Int(5),
105+
DockerArgs: pulumi.String("python3 -m http.server 8080"),
106+
Env: runpod.PodEnvArray{
107+
&runpod.PodEnvArgs{
108+
Key: pulumi.String("JUPYTER_PASSWORD"),
109+
Value: pulumi.String("rns1hunbsstltcpad22d"),
110+
},
111+
},
112+
ImageName: pulumi.String("runpod/serverless-hello-world:latest"),
113+
IsServerless: pulumi.Bool(true),
114+
Name: pulumi.String("Testing Pulumi V1"),
115+
Readme: pulumi.String("## Hello, World!"),
116+
VolumeInGb: pulumi.Int(0),
117+
})
118+
119+
if err != nil {
120+
return err
121+
}
122+
123+
myEndpoint, err := runpod.NewEndpoint(ctx, "myEndpoint", &runpod.EndpointArgs{
124+
GpuIds: pulumi.String("AMPERE_16"),
125+
Name: pulumi.String("Pulumi Endpoint Test V2 -fb"),
126+
TemplateId: myTemplate.Template.Id(),
127+
WorkersMax: pulumi.Int(2),
128+
WorkersMin: pulumi.Int(1),
129+
IdleTimeout: pulumi.Int(6),
130+
Locations: pulumi.String("EU-RO-1"),
131+
NetworkVolumeId: testNetworkStorage.NetworkStorage.Id(),
132+
ScalerType: pulumi.String("QUEUE_DELAY"),
133+
ScalerValue: pulumi.Int(4),
134+
})
135+
80136
if err != nil {
81137
return err
82138
}
83139

84-
ctx.Export("pod", myRandomPod)
85-
ctx.Export("networkStorage", testNetworkStorage)
140+
ctx.Export("pod", myRandomPod.Pod.Id())
141+
ctx.Export("networkStorage", testNetworkStorage.NetworkStorage.Id())
142+
ctx.Export("template", myTemplate.Template.Id())
143+
ctx.Export("endpoint", myEndpoint.Endpoint.Id())
86144
return nil
87145
})
88146
}
-18.2 KB
Binary file not shown.
19.5 KB
Binary file not shown.

sdk/python/runpodinfra.egg-info/PKG-INFO

Lines changed: 70 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.1
22
Name: runpodinfra
3-
Version: 1.9.98
3+
Version: 1.9.99
44
Summary: The Runpod Pulumi provider provides resources to interact with Runpod's native APIs.
55
Home-page: https://runpod.io
66
License: Apache-2.0
@@ -21,6 +21,26 @@ layout: package
2121
The Runpod provider for Pulumi can be used to provision [Runpod](https://www.runpod.io) resources.
2222
The Runpod provider must be configured with Runpod's API keys to deploy and update resources in Runpod.
2323

24+
## Pulumi guide
25+
Create an empty directory and navigate inside
26+
27+
```bash
28+
mkdir -p empty
29+
cd empty
30+
```
31+
32+
Create a new pulumi stack:
33+
```
34+
pulumi new
35+
```
36+
37+
A dropdown box will appear. Please select a minimal project from in there. For example, if you prefer using Go, you would select the following:
38+
```bash
39+
go A minimal Go Pulumi program
40+
```
41+
42+
Then populate the entrypoint file (__main__.py/main.go/index.ts) with the your data. Please use the guide below to understand more about what parameters are possible for each resource. For Python, please remember to activate the virtual environment.
43+
2444
## Config
2545

2646
To begin with, please set your runpod API key to use with Pulumi.
@@ -31,16 +51,15 @@ To begin with, please set your runpod API key to use with Pulumi.
3151

3252
## Example
3353

34-
This is an example of how to deploy it over Golang. We also serve pulumi over Typescript and Python. For more examples, please navigate to the examples directory
35-
or the documents inside docs. If you have any problems in doing so, please contact [email protected].
54+
This is an example of how to deploy it over Golang. We also serve pulumi over Typescript and Python. For more examples, please navigate to the examples directory or the docs/installation-configuration.md file. If you have any problems in doing so, please contact [email protected].
3655

3756
1. Create a new Pulumi Go example:
3857
```
3958
pulumi new
4059
```
4160
Select either the Go template or Runpod's Go template.
4261

43-
2. Set your API keys using the config shown above.
62+
2. Set your API keys using the process shown above.
4463

4564
3. Install the official Go package:
4665

@@ -63,22 +82,23 @@ func main() {
6382
pulumi.Run(func(ctx *pulumi.Context) error {
6483
testNetworkStorage, err := runpod.NewNetworkStorage(ctx, "testNetworkStorage", &runpod.NetworkStorageArgs{
6584
Name: pulumi.String("testStorage1"),
66-
Size: pulumi.Int(20),
67-
DataCenterId: pulumi.String("US-NJ"),
85+
Size: pulumi.Int(5),
86+
DataCenterId: pulumi.String("EU-RO-1"),
6887
})
6988
if err != nil {
7089
return err
7190
}
72-
7391
myRandomPod, err := runpod.NewPod(ctx, "myRandomPod", &runpod.PodArgs{
74-
CloudType: pulumi.String("ALL"),
75-
NetworkVolumeId: testNetworkStorage.NetworkStorage.Id(),
92+
CloudType: pulumi.String("ALL"),
93+
NetworkVolumeId: testNetworkStorage.NetworkStorage.ApplyT(func(networkStorage runpod.NetworkStorageType) (*string, error) {
94+
return &networkStorage.Id, nil
95+
}).(pulumi.StringPtrOutput),
7696
GpuCount: pulumi.Int(1),
7797
VolumeInGb: pulumi.Int(50),
7898
ContainerDiskInGb: pulumi.Int(50),
7999
MinVcpuCount: pulumi.Int(2),
80100
MinMemoryInGb: pulumi.Int(15),
81-
GpuTypeId: pulumi.String("NVIDIA GeForce RTX 3070"),
101+
GpuTypeId: pulumi.String("NVIDIA GeForce RTX 4090"),
82102
Name: pulumi.String("RunPod Pytorch"),
83103
ImageName: pulumi.String("runpod/pytorch"),
84104
DockerArgs: pulumi.String(""),
@@ -91,12 +111,50 @@ func main() {
91111
},
92112
},
93113
})
114+
if err != nil {
115+
return err
116+
}
117+
myTemplate, err := runpod.NewTemplate(ctx, "myTemplate", &runpod.TemplateArgs{
118+
ContainerDiskInGb: pulumi.Int(5),
119+
DockerArgs: pulumi.String("python3 -m http.server 8080"),
120+
Env: runpod.PodEnvArray{
121+
&runpod.PodEnvArgs{
122+
Key: pulumi.String("JUPYTER_PASSWORD"),
123+
Value: pulumi.String("rns1hunbsstltcpad22d"),
124+
},
125+
},
126+
ImageName: pulumi.String("runpod/serverless-hello-world:latest"),
127+
IsServerless: pulumi.Bool(true),
128+
Name: pulumi.String("Testing Pulumi V1"),
129+
Readme: pulumi.String("## Hello, World!"),
130+
VolumeInGb: pulumi.Int(0),
131+
})
132+
133+
if err != nil {
134+
return err
135+
}
136+
137+
myEndpoint, err := runpod.NewEndpoint(ctx, "myEndpoint", &runpod.EndpointArgs{
138+
GpuIds: pulumi.String("AMPERE_16"),
139+
Name: pulumi.String("Pulumi Endpoint Test V2 -fb"),
140+
TemplateId: myTemplate.Template.Id(),
141+
WorkersMax: pulumi.Int(2),
142+
WorkersMin: pulumi.Int(1),
143+
IdleTimeout: pulumi.Int(6),
144+
Locations: pulumi.String("EU-RO-1"),
145+
NetworkVolumeId: testNetworkStorage.NetworkStorage.Id(),
146+
ScalerType: pulumi.String("QUEUE_DELAY"),
147+
ScalerValue: pulumi.Int(4),
148+
})
149+
94150
if err != nil {
95151
return err
96152
}
97153

98-
ctx.Export("pod", myRandomPod)
99-
ctx.Export("networkStorage", testNetworkStorage)
154+
ctx.Export("pod", myRandomPod.Pod.Id())
155+
ctx.Export("networkStorage", testNetworkStorage.NetworkStorage.Id())
156+
ctx.Export("template", myTemplate.Template.Id())
157+
ctx.Export("endpoint", myEndpoint.Endpoint.Id())
100158
return nil
101159
})
102160
}

sdk/python/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from subprocess import check_call
99

1010

11-
VERSION = "v1.9.98"
11+
VERSION = "v1.9.99"
1212
def readme():
1313
try:
1414
with open('README.md', encoding='utf-8') as f:

0 commit comments

Comments
 (0)