-
Notifications
You must be signed in to change notification settings - Fork 0
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 #2 from DominicBurkart/kubernetes
kubernetes support
- Loading branch information
Showing
26 changed files
with
1,142 additions
and
215 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,79 @@ | ||
name: examples | ||
|
||
on: | ||
push: | ||
branches: master | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
local_queue_example: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: build local queue example | ||
run: docker build -f examples/local_queue_example/Dockerfile . | ||
|
||
kubernetes_example_local_test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
path: './turbolift' | ||
- name: install rustup and rust nightly | ||
run: | | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly-2020-09-28 | ||
- name: run tests | ||
run: | | ||
cd turbolift/examples/kubernetes_example | ||
RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo test -- --nocapture | ||
kubernetes_example_local_run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
path: './turbolift' | ||
- name: install rustup and rust nightly | ||
run: | | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly-2020-09-28 | ||
- name: run tests | ||
run: | | ||
cd turbolift/examples/kubernetes_example | ||
RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo run | ||
kubernetes_example_distributed_test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
path: './turbolift' | ||
- name: install rustup and rust nightly | ||
run: | | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly-2020-09-28 | ||
- uses: engineerd/[email protected] | ||
with: | ||
version: "v0.11.0" | ||
- name: run tests | ||
run: | | ||
cd turbolift/examples/kubernetes_example | ||
sh setup_cluster.sh | ||
RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo test --features distributed -- --nocapture | ||
kubernetes_example_distributed_run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
path: './turbolift' | ||
- name: install rustup and rust nightly | ||
run: | | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly-2020-09-28 | ||
- uses: engineerd/[email protected] | ||
with: | ||
version: "v0.11.0" | ||
- name: run tests | ||
run: | | ||
cd turbolift/examples/kubernetes_example | ||
sh setup_cluster.sh | ||
RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo run --features distributed |
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,4 +1,5 @@ | ||
/target | ||
target/ | ||
Cargo.lock | ||
.turbolift/ | ||
.turbolift/ | ||
.idea |
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,22 +1,26 @@ | ||
[package] | ||
name = "turbolift" | ||
version = "0.1.0" | ||
version = "0.1.1" | ||
authors = ["Dominic Burkart <@DominicBurkart>"] | ||
edition = "2018" | ||
description = "WIP" | ||
description = "Easy distribution interface" | ||
keywords = ["distribution", "distributed", "kubernetes", "K8s"] | ||
categories = ["build-utils", "development-tools", "concurrency", "network-programming", "asynchronous"] | ||
readme = "README.md" | ||
homepage = "https://dominic.computer/turbolift" | ||
license = "Hippocratic-2.1" | ||
repository = "https://github.com/dominicburkart/turbolift/" | ||
|
||
[features] | ||
distributed = ["chrono", "cached", "async-std"] | ||
service = ["actix-web", "serde_json"] | ||
distributed = ["chrono", "turbolift_macros/distributed"] | ||
# todo we can optimize reqs for children with this load | ||
|
||
[dependencies] | ||
turbolift_macros = { path = "./turbolift_macros" } | ||
turbolift_internals = { path = "./turbolift_internals" } | ||
async-std = { version = "1.6", optional = true } | ||
chrono = { version = "0.4", optional = true } | ||
cached = { version = "0.19", optional = true } | ||
actix-web = { version = "3", optional = true } | ||
serde_json = { version = "1", optional = true } | ||
actix-web = { version = "3" } | ||
serde_json = { version = "1" } | ||
tokio-compat-02 = { version = "0.1" } | ||
tracing = {version="0.1", features=["attributes"]} | ||
tracing-futures = "0.2.4" |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Turbolift Examples | ||
|
||
## Kubernetes | ||
|
||
Builds a deployment, service, and ingress rule for the function to be | ||
distributed. Cool features: distribution-as-a-feature, automatically deleting | ||
the pods, deployments, services, and ingress rule when the main program | ||
completes. This implementation is BYOC (Bring Your Own Container, you have to | ||
pass a special function while instantiating the cluster interface that allows | ||
makes the containers available in the cluster, perhaps via a private registry). | ||
|
||
## Local Queue | ||
|
||
The local queue example should never be used in a production application. It's | ||
designed to test the core features of turbolift (automatically extracting | ||
microservices from a rust codebase and running them on an http server), without | ||
any of the platform-specific code for e.g. running on kubernetes. Check this | ||
example out if you're interested in a bare-bones example turbolift project | ||
without any platform-specific specialization. Note: if you're looking to run | ||
code locally in turbolift instead of using a distribution platform, you should | ||
deactivate the distributed turbolift feature in your project's `Cargo.toml`. | ||
This will let your program run all services locally, e.g. while developing. |
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,22 @@ | ||
[package] | ||
name = "kubernetes_example" | ||
version = "0.1.0" | ||
authors = ["Dominic Burkart <[email protected]>"] | ||
edition = "2018" | ||
|
||
[features] | ||
"distributed" = ["turbolift/distributed"] | ||
|
||
[dependencies] | ||
rand = "0.7" | ||
tokio = {version="1", features=["full"]} | ||
lazy_static = "1" | ||
futures = "0.3" | ||
cute = "0.3" | ||
anyhow = "1.0.41" | ||
turbolift = { path="../../" } | ||
|
||
# for printing out tracing | ||
tracing = "0.1" | ||
tracing-futures = "0.2" | ||
tracing-subscriber = {version="0.2", features=["fmt"]} |
Oops, something went wrong.