-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from cosmonic/wadms
Adding wadm for hello world
- Loading branch information
Showing
4 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
# Hello world | ||
|
||
Click on the button below to launch Hello World on Cosmonic Now: | ||
|
||
[<img src="https://cosmonic.com/badge/deploy.svg" alt="Deploy on Cosmonic" width="400">](https://new.cosmonic.app/?yaml=https://raw.githubusercontent.com/cosmonic/awesome-cosmonic/main/hello-world/hello-cosmonic.wadm) | ||
|
||
This actor is the "Hello, World" of Cosmonic applications. It uses a single capability, HTTP server, and returns a string as a response. This project is actually a template, and if you'd like to try it for yourself, install the [cosmo cli](https://cosmonic.com/docs/getting-started/quickstart) and run: | ||
|
||
``` | ||
cosmo new actor --git https://github.com/cosmonic/things-to-build --path hello-world/rust hello | ||
cosmo launch -p hello | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# This is a full example of how to run the hello actor exposed with an HTTP server on Cosmonic. | ||
# This example leverages WADM running: https://github.com/wasmCloud/wadm/tree/main/wadm. | ||
# | ||
# All components are started on Cosmonic. See other examples for different scenarios. | ||
|
||
apiVersion: core.oam.dev/v1beta1 | ||
kind: Application | ||
metadata: | ||
name: hello | ||
annotations: | ||
version: v0.0.1-cosmonic | ||
description: "Cosmonic Hello World Example" | ||
spec: | ||
components: | ||
- name: hello | ||
type: actor | ||
properties: | ||
image: wasmcloud.azurecr.io/hello:0.1.7 | ||
traits: | ||
- type: spreadscaler | ||
properties: | ||
replicas: 1 | ||
- type: linkdef | ||
properties: | ||
target: httpserver | ||
- name: httpserver | ||
properties: | ||
contract: wasmcloud:httpserver | ||
image: cosmonic.azurecr.io/httpserver_wormhole:0.5.4 | ||
traits: | ||
- properties: | ||
replicas: 1 | ||
spread: | ||
- name: oncosmonic | ||
requirements: | ||
cosmonic_managed: 'true' | ||
type: spreadscaler | ||
type: capability |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# This is a full example of how to run the hello actor exposed with an HTTP server on Cosmonic. | ||
# This example leverages WADM running: https://github.com/wasmCloud/wadm/tree/main/wadm. | ||
# | ||
# This example starts a webserver on Cosmonic and runs the hello world on a remote host. | ||
# See other examples for different scenarios. | ||
|
||
apiVersion: core.oam.dev/v1beta1 | ||
kind: Application | ||
metadata: | ||
name: hello | ||
annotations: | ||
version: v0.0.1-stargate | ||
description: "Cosmonic Hello World Example" | ||
spec: | ||
components: | ||
- name: hello | ||
type: actor | ||
properties: | ||
image: wasmcloud.azurecr.io/hello:0.1.7 | ||
traits: | ||
- properties: | ||
replicas: 1 | ||
spread: | ||
- name: stargate | ||
requirements: | ||
# hostcore.os: macos | ||
stargate: 'true' | ||
type: spreadscaler | ||
- properties: | ||
target: httpserver | ||
type: linkdef | ||
- name: httpserver | ||
properties: | ||
contract: wasmcloud:httpserver | ||
image: cosmonic.azurecr.io/httpserver_wormhole:0.5.4 | ||
traits: | ||
- properties: | ||
replicas: 1 | ||
spread: | ||
- name: oncosmonic | ||
requirements: | ||
cosmonic_managed: 'true' | ||
type: spreadscaler | ||
type: capability |