Skip to content

Commit

Permalink
feat(containers): helm output (#223)
Browse files Browse the repository at this point in the history
Introduce an experimental parameter `provider` in `wing.toml` to allow specifying the backend for containers.

Also - fix how readiness checks are implemented.
  • Loading branch information
eladb authored May 15, 2024
1 parent d457129 commit b337683
Show file tree
Hide file tree
Showing 20 changed files with 908 additions and 200 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/containers-pull.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,17 @@ jobs:
run: npm install --include=dev
working-directory: containers
- name: Test
run: wing test
run: |
#!/bin/sh
if [ -n "$CI" ]; then
snapshot_mode="assert"
else
snapshot_mode="update"
fi
DEBUG=1 wing test
wing test -t tf-aws -s $snapshot_mode containers.test.w
wing test -t tf-aws -s $snapshot_mode containers-with-readiness.test.w
working-directory: containers
- name: Pack
run: wing pack
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/containers-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,17 @@ jobs:
run: npm install --include=dev
working-directory: containers
- name: Test
run: wing test
run: |
#!/bin/sh
if [ -n "$CI" ]; then
snapshot_mode="assert"
else
snapshot_mode="update"
fi
DEBUG=1 wing test
wing test -t tf-aws -s $snapshot_mode containers.test.w
wing test -t tf-aws -s $snapshot_mode containers-with-readiness.test.w
working-directory: containers
- name: Pack
run: wing pack
Expand Down
32 changes: 32 additions & 0 deletions containers/containers-with-readiness.test.w
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
bring "./workload.w" as containers;
bring expect;
bring http;

let message = "hello, wing change!!";

let hello = new containers.Workload(
name: "hello",
image: "paulbouwer/hello-kubernetes:1",
port: 8080,
readiness: "/",
replicas: 2,
env: {
"MESSAGE" => message,
},
public: true,
) as "hello";


let httpGet = inflight (url: str?): str => {
if let url = url {
return http.get(url).body;
}

throw "no body";
};

test "access public url" {
let helloBody = httpGet(hello.publicUrl);
log(helloBody);
assert(helloBody.contains(message));
}
Loading

0 comments on commit b337683

Please sign in to comment.