npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@runpod-infra/pulumi

v1.9.99

Published

--- title: Runpod meta_desc: Provides an overview of the Runpod Provider for Pulumi. layout: package ---

Downloads

11

Readme


title: Runpod meta_desc: Provides an overview of the Runpod Provider for Pulumi. layout: package

The Runpod provider for Pulumi can be used to provision Runpod resources. The Runpod provider must be configured with Runpod's API keys to deploy and update resources in Runpod.

Pulumi guide

Create an empty directory and navigate inside

mkdir -p empty
cd empty

Create a new pulumi stack:

    pulumi new

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:

    go                             A minimal Go Pulumi program

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.

Config

To begin with, please set your runpod API key to use with Pulumi.

  pulumi config set --secret runpod:token

Example

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].

  1. Create a new Pulumi Go example:
    pulumi new

Select either the Go template or Runpod's Go template.

  1. Set your API keys using the process shown above.

  2. Install the official Go package:

    go get github.com/runpod/pulumi-runpod-native/sdk/go/[email protected]

Replace the version above to any that you want. We advise you to pin a certain version as there will be fewer breaking changes.

  1. Use this example as a simple building guide for your example project:
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/runpod/pulumi-runpod-native/sdk/go/runpod"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		testNetworkStorage, err := runpod.NewNetworkStorage(ctx, "testNetworkStorage", &runpod.NetworkStorageArgs{
			Name:         pulumi.String("testStorage1"),
			Size:         pulumi.Int(5),
			DataCenterId: pulumi.String("EU-RO-1"),
		})
		if err != nil {
			return err
		}
		myRandomPod, err := runpod.NewPod(ctx, "myRandomPod", &runpod.PodArgs{
			CloudType: pulumi.String("ALL"),
			NetworkVolumeId: testNetworkStorage.NetworkStorage.ApplyT(func(networkStorage runpod.NetworkStorageType) (*string, error) {
				return &networkStorage.Id, nil
			}).(pulumi.StringPtrOutput),
			GpuCount:          pulumi.Int(1),
			VolumeInGb:        pulumi.Int(50),
			ContainerDiskInGb: pulumi.Int(50),
			MinVcpuCount:      pulumi.Int(2),
			MinMemoryInGb:     pulumi.Int(15),
			GpuTypeId:         pulumi.String("NVIDIA GeForce RTX 4090"),
			Name:              pulumi.String("RunPod Pytorch"),
			ImageName:         pulumi.String("runpod/pytorch"),
			DockerArgs:        pulumi.String(""),
			Ports:             pulumi.String("8888/http"),
			VolumeMountPath:   pulumi.String("/workspace"),
			Env: runpod.PodEnvArray{
				&runpod.PodEnvArgs{
					Key:   pulumi.String("JUPYTER_PASSWORD"),
					Value: pulumi.String("rns1hunbsstltcpad22d"),
				},
			},
		})
		if err != nil {
			return err
		}
		myTemplate, err := runpod.NewTemplate(ctx, "myTemplate", &runpod.TemplateArgs{
			ContainerDiskInGb:       pulumi.Int(5),
			DockerArgs:              pulumi.String("python3 -m http.server 8080"),
		    Env: runpod.PodEnvArray{
				&runpod.PodEnvArgs{
					Key:   pulumi.String("JUPYTER_PASSWORD"),
					Value: pulumi.String("rns1hunbsstltcpad22d"),
				},
			},
			ImageName:       pulumi.String("runpod/serverless-hello-world:latest"),
			IsServerless:    pulumi.Bool(true),
			Name:            pulumi.String("Testing Pulumi V1"),
			Readme:          pulumi.String("## Hello, World!"),
			VolumeInGb:      pulumi.Int(0),
		})

		if err != nil {
			return err
		}

		myEndpoint, err := runpod.NewEndpoint(ctx, "myEndpoint", &runpod.EndpointArgs{
			GpuIds:         pulumi.String("AMPERE_16"),
			Name:           pulumi.String("Pulumi Endpoint Test V2 -fb"),
			TemplateId:     myTemplate.Template.Id(),
			WorkersMax:     pulumi.Int(2),
			WorkersMin:     pulumi.Int(1),
			IdleTimeout:    pulumi.Int(6),
			Locations:      pulumi.String("EU-RO-1"),
			NetworkVolumeId: testNetworkStorage.NetworkStorage.Id(),
			ScalerType:     pulumi.String("QUEUE_DELAY"),
			ScalerValue:    pulumi.Int(4),
		})

		if err != nil {
			return err
		}

		ctx.Export("pod", myRandomPod.Pod.Id())
		ctx.Export("networkStorage", testNetworkStorage.NetworkStorage.Id())
		ctx.Export("template", myTemplate.Template.Id())
		ctx.Export("endpoint", myEndpoint.Endpoint.Id())
		return nil
	})
}
  1. PULUMI UP Create your resources using the command below:
    pulumi up
  1. PULUMI DOWN If you want to remove your resources, you can use the command below:
    pulumi down

If you have any issues, please feel free to create an issue or reach out to us directly at [email protected].

Note: For examples in TypeScript and Python, please visit the documentation inside the docs directory or click here.