Giter Site home page Giter Site logo

andrzejressel / pulumi-wasm Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 16.59 MB

Pulumi support for WASM languages

Home Page: https://andrzejressel.github.io/pulumi-wasm/

License: Mozilla Public License 2.0

Go 0.64% Rust 98.99% Just 0.18% Handlebars 0.19%
pulumi rust wasm

pulumi-wasm's Introduction

Pulumi support for WASM

GitHub Release Build Deploy

Pulumi support for WASM.

Quick start

https://github.com/andrzejressel/pulumi-wasm-example

Installation

Language plugin

pulumi plugin install language wasm "0.0.0-NIGHTLY-SHORTSHA1" --server github://api.github.com/andrzejressel/pulumi-wasm

WASM Runner

cargo binstall -y --index "sparse+https://cargo.cloudsmith.io/andrzej-ressel-github/pulumi-wasm/" [email protected]

Acknowledgements

Hosted By: Cloudsmith

Package repository hosting is graciously provided by Cloudsmith. Cloudsmith is the only fully hosted, cloud-native, universal package management solution, that enables your organization to create, store and share packages in any format, to any place, with total confidence.

pulumi-wasm's People

Contributors

renovate[bot] avatar andrzejressel avatar mergify[bot] avatar dependabot[bot] avatar

Watchers

 avatar  avatar

pulumi-wasm's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

cargo
Cargo.toml
  • anyhow 1.0.82
  • prost 0.13.1
  • prost-types 0.13.1
  • uuid 1.8.0
  • futures 0.3.30
  • once_cell 1.19.0
  • bitflags 2.5.0
  • wit-bindgen 0.30.0
  • wit-bindgen-rt 0.30.0
  • serde 1.0.200
  • serde_json 1.0.120
  • tonic 0.12.0
  • tonic-build 0.12.0
  • tonic-web 0.12.0
  • wasmtime 24.0.0
  • wasmtime-wasi 24.0.0
  • async-trait 0.1.80
  • log 0.4.21
  • log4rs 1.3.0
  • tokio 1.37.0
  • clap 4.5.4
  • regex 1.10.4
  • syn 2.0.60
  • quote 1.0.36
  • proc-macro2 1.0.81
  • assert_cmd 2.0.14
  • predicates 3.1.0
  • normpath 1.2
  • simple_logger 5.0.0
  • petgraph 0.6.4
  • cargo_metadata 0.18.1
  • itertools 0.13.0
  • testdir 0.9.1
  • fs_extra 1.3.0
  • handlebars 6.0.0
  • convert_case 0.6.0
  • mockall 0.13.0
  • wac-graph 0.5.0
  • serde_yaml 0.9.33
  • prettyplease 0.2.20
  • directories 5.0
  • reqwest 0.12.5
  • wit-component 0.216.0
  • wit-parser 0.216.0
  • wasmprinter 0.216.0
providers/pulumi_wasm_provider_cloudflare/Cargo.toml
providers/pulumi_wasm_provider_cloudflare_rust/Cargo.toml
providers/pulumi_wasm_provider_docker/Cargo.toml
providers/pulumi_wasm_provider_docker_rust/Cargo.toml
providers/pulumi_wasm_provider_random/Cargo.toml
providers/pulumi_wasm_provider_random_rust/Cargo.toml
pulumi_wasm/Cargo.toml
pulumi_wasm_common/Cargo.toml
pulumi_wasm_core/Cargo.toml
pulumi_wasm_generator/Cargo.toml
pulumi_wasm_generator_lib/Cargo.toml
pulumi_wasm_proto/Cargo.toml
pulumi_wasm_runner/Cargo.toml
pulumi_wasm_runner_component_creator/Cargo.toml
pulumi_wasm_rust/Cargo.toml
pulumi_wasm_rust_macro/Cargo.toml
pulumi_wasm_wit/Cargo.toml
github-actions
.github/workflows/build.yml
  • actions/checkout v4
  • extractions/setup-just v2
  • nick-fields/retry v3
  • actions/setup-go v5
  • arduino/setup-protoc v3
  • Swatinem/rust-cache v2
  • actions/upload-artifact v4
  • actions/checkout v4
  • extractions/setup-just v2
  • nick-fields/retry v3
  • actions/setup-go v5
  • arduino/setup-protoc v3
  • Swatinem/rust-cache v2
  • benjlevesque/short-sha v3.0
.github/workflows/cleancache.yaml
.github/workflows/deploy.yaml
  • actions/checkout v4
  • extractions/setup-just v2
  • arduino/setup-protoc v3
  • actions/checkout v4
  • extractions/setup-just v2
  • arduino/setup-protoc v3
  • Swatinem/rust-cache v2
  • actions/upload-artifact v4
  • softprops/action-gh-release v2.0.8
  • actions/checkout v4
  • extractions/setup-just v2
  • actions/setup-go v5
  • softprops/action-gh-release v2.0.8
  • actions/checkout v4
  • extractions/setup-just v2
  • arduino/setup-protoc v3
  • Swatinem/rust-cache v2
  • softprops/action-gh-release v2.0.8
.github/workflows/docs.yml
  • actions/checkout v4
  • actions/setup-python v5
  • extractions/setup-just v2
  • actions/configure-pages v5
  • actions/upload-pages-artifact v3
  • actions/deploy-pages v4
.github/workflows/rust-clippy.yml
  • actions/checkout v4
  • Swatinem/rust-cache v2
  • arduino/setup-protoc v3
  • github/codeql-action v3
gomod
pulumi-language-wasm/go.mod
  • go 1.21
  • go 1.23.0
  • github.com/golang/protobuf v1.5.4
  • github.com/pkg/errors v0.9.1
  • github.com/pulumi/pulumi/sdk/v3 v3.130.0
  • google.golang.org/grpc v1.65.0
  • google.golang.org/protobuf v1.34.2
regex
rust-toolchain.toml
  • rust 1.80.1
justfile
  • cargo-nextest 0.9.72
  • cargo-component 0.15.0
  • sd 1.0.0

  • Check this box to trigger a request for Renovate to run again on this repository

Make properties more lazy

TODO:

  • Remove fields field from register-resource-result and replace it with single handle
  • Add new WIT method for extracting single field
  • Make all output object fields lazy. On invocation they invoke that new WIT method

Create test runner

cargo pulumi command that will find related wasm component (using metadata on glue code), combine them and generate single component.

example project should be transformed into first integration test

Implement server/client mode

Currently pulumi-wasm is developed as client module. User code is compiled to WASM and run using pulumi-wasm-runner. However this solution will probably not work with Automation APIs. Pulumi WASM should also work in server mode. In this mode client code is amd64 binary that contains WASM runtime - similar to Extism.

Implement typecheck mode

Third mode next to preview and running.

In this mode pulumi is not even invoked only. Program is passing and it saves fields that should not be null.

TODO: What to do with config?

Consider removing WASM providers

Do we really need another indirection layer like wasm providers? Shouldn't generated code just directly call register?

Should be considered only after all feature of Pulumi are implemented.

Macro for combining outputs

let output1: Output<String> = ???
let output2: Output<i32> = ???
output!{
   SomeObject {
      string_field: output1,
      int_field: output2,
   }
}

should be converted to

let output1: Output<String> = ???
let output2: Output<i32> = ???
Output::combine(output1, output2, |o1, o2| {
   SomeObject {
      string_field: o1,
      int_field: o2,
   }
}

Support transient outputs

Currently all outputs have to be serialized - but they don't have to be.

If we have output A and we map it to unserializable output B which is then mapped to serializable output C - it should be allowed.

Transient output must be true output only when used in component.

This is client only problem related to stacking functions. WASM code should work as is.

Support returning complex objects

Implement all TODOs in

fn protoc_to_messagepack(value: prost_types::Value) -> Value {
info!("Converting protoc value [{value:?}] to messagepack value");
let kind = match value.kind {
None => {
error!("Kind is none");
unreachable!("Kind is none")
}
Some(k) => k
};
let result = match kind {
Kind::NullValue(_) => todo!(),
Kind::NumberValue(n) => Value::F64(n),
Kind::StringValue(s) => Value::String(Utf8String::from(s)),
Kind::BoolValue(b) => Value::Boolean(b),
Kind::StructValue(_) => todo!(),
Kind::ListValue(_) => todo!()
};
info!("Result: [{result:?}]");
result
}
fn protoc_object_to_messagepack_map(o: prost_types::Struct) -> rmpv::Value {
let fields = o.fields.iter().map(|(k, v)| {
let k = Value::String(k.clone().into());
let v = protoc_to_messagepack(v.clone());
(k, v)
}).collect::<Vec<_>>();
Value::Map(fields)
}
fn messagepack_to_protoc(v: &Value) -> prost_types::Value {
info!("Converting value [{v}] to protoc value");
let result = match v {
Value::Integer(i) => prost_types::Value {
kind: Option::from(prost_types::value::Kind::NumberValue(i.as_f64().unwrap())),
},
_ => {
error!("Cannot convert [{v}]");
todo!("Cannot convert [{v}]")
}
};
info!("Result: [{result:?}]");
result
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.