Skip to content

Commit

Permalink
Merge branch 'main' into feat/shuttle-runtime-scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
oddgrd committed Jun 5, 2023
2 parents 73f0a9f + f2a3c4d commit 292b6ec
Show file tree
Hide file tree
Showing 114 changed files with 3,429 additions and 1,816 deletions.
335 changes: 311 additions & 24 deletions .circleci/config.yml

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions .circleci/production-ssh-config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#! /usr/bin/env sh

set -ue

# add our config to the .ssh/config in circleci
cat >> $HOME/.ssh/config <<- EOF
Host admin
HostName 18.132.154.166
User ec2-user
Host *.shuttle.prod.internal
User ec2-user
ProxyJump ec2-user@admin
EOF
32 changes: 32 additions & 0 deletions .circleci/qa-docker.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Would actually like to error on all errors, but `Enable-ExperimentalFeature`
# does not work for this version of Windows
# https://github.com/PowerShell/PowerShell/issues/3415#issuecomment-1354457563
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"

# Add cargo to PATH
$env:Path += [IO.Path]::PathSeparator + "$env:USERPROFILE/.cargo/bin"

# Start locally
$job = Start-Job -Name "local-run" -ScriptBlock { cd examples/rocket/postgres; cargo shuttle run }
Start-Sleep -Seconds 300

echo "Testing local docker endpoint"
$postParams = @{note='test'}
$output=curl http://localhost:8000/todo -Method Post -Body $postParams | Select-Object -ExpandProperty Content
if ( $output -ne '{"id":1,"note":"test"}')
{
echo "Did not expect POST output: $output"
exit 1
}

$output=curl http://localhost:8000/todo/1 | Select-Object -ExpandProperty Content
if ( $output -ne '{"id":1,"note":"test"}')
{
echo "Did not expect output: $output"
exit 1
}

Stop-Job $job

exit 0
30 changes: 30 additions & 0 deletions .circleci/qa-wasm.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Would actually like to error on all errors, but `Enable-ExperimentalFeature`
# does not work for this version of Windows
# https://github.com/PowerShell/PowerShell/issues/3415#issuecomment-1354457563
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"

# Add cargo to PATH
$env:Path += [IO.Path]::PathSeparator + "$env:USERPROFILE/.cargo/bin"

# Install the WASM target
rustup target add wasm32-wasi

# Install wasm runtime from checked out code
cargo install shuttle-runtime --path runtime --bin shuttle-next --features next

# Start locally
$job = Start-Job -Name "local-run" -ScriptBlock { cd examples/next/hello-world; cargo shuttle run }
Start-Sleep -Seconds 70

echo "Testing local wasm endpoint"
$output=curl http://localhost:8000 | Select-Object -ExpandProperty Content
if ( $output -ne "Hello, world!")
{
echo "Did not expect output: $output"
exit 1
}

Stop-Job $job

exit 0
4 changes: 2 additions & 2 deletions .circleci/qa-wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cargo shuttle run &
sleep 70

echo "Testing local wasm endpoint"
output=$(curl --silent localhost:8000/hello)
[ "$output" != "Hello, world!" ] && ( echo "Did not expect output: $output"; exit 1 )
output=$(curl --silent localhost:8000)
[ "$output" != "Hello, World!" ] && ( echo "Did not expect output: $output"; exit 1 )

killall cargo-shuttle
45 changes: 45 additions & 0 deletions .circleci/qa.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Would actually like to error on all errors, but `Enable-ExperimentalFeature`
# does not work for this version of Windows
# https://github.com/PowerShell/PowerShell/issues/3415#issuecomment-1354457563
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"

# Prepare directory
mkdir -p /tmp/qa-windows
cd /tmp/qa-windows

# Add cargo to PATH
$env:Path += [IO.Path]::PathSeparator + "$env:USERPROFILE/.cargo/bin"

# Init app
cargo shuttle init --name qa-windows --template axum

# # Start locally
$job = Start-Job -Name "local-run" -ScriptBlock { cd /tmp/qa-windows; cargo shuttle run }
Start-Sleep -Seconds 270

echo "Testing local hello endpoint"
$output=curl http://localhost:8000 | Select-Object -ExpandProperty Content
if ( $output -ne "Hello, world!")
{
echo "Did not expect output: $output"
exit 1
}

Stop-Job $job

cargo shuttle project start

cargo shuttle deploy --allow-dirty

echo "Testing remote hello endpoint"
$output=curl https://qa-windows.unstable.shuttleapp.rs | Select-Object -ExpandProperty Content
if ( $output -ne "Hello, world!")
{
echo "Did not expect output: $output"
exit 1
}

cargo shuttle project stop

exit 0
6 changes: 3 additions & 3 deletions .circleci/qa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ mkdir -p /tmp/qa-$1
cd /tmp/qa-$1

# Init app
cargo shuttle init --name qa-$1 --axum
cargo shuttle init --name qa-$1 --template axum

# Start locally
cargo shuttle run &
sleep 150

echo "Testing local hello endpoint"
output=$(curl --silent localhost:8000/hello)
output=$(curl --silent localhost:8000)
[ "$output" != "Hello, world!" ] && ( echo "Did not expect output: $output"; exit 1 )

killall cargo-shuttle
Expand All @@ -24,7 +24,7 @@ cargo shuttle project start
cargo shuttle deploy --allow-dirty

echo "Testing remote hello endpoint"
output=$(curl --silent https://qa-$1.unstable.shuttleapp.rs/hello)
output=$(curl --silent https://qa-$1.unstable.shuttleapp.rs)
[ "$output" != "Hello, world!" ] && ( echo "Did not expect output: $output"; exit 1 )

cargo shuttle project stop
Expand Down
14 changes: 14 additions & 0 deletions .circleci/unstable-ssh-config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#! /usr/bin/env sh

set -ue

# add our config to the .ssh/config in circleci
cat >> $HOME/.ssh/config <<- EOF
Host admin.unstable
HostName 3.11.51.209
User ec2-user
Host *.shuttle.internal
User ec2-user
ProxyJump ec2-user@admin.unstable
EOF
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Indentation settings matching the default rustfmt config
[*.rs]
charset = utf-8
indent_style = space
indent_size = 4

9 changes: 5 additions & 4 deletions .github/ISSUE_TEMPLATE/BUG-REPORT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
value: Thanks for taking the time to fill out this bug report!
- type: textarea
id: what-happened
attributes:
Expand All @@ -21,18 +20,19 @@ body:
attributes:
label: Version
description: What version of `cargo-shuttle` are you running (`cargo shuttle --version`)?
placeholder: "v0.11.0"
placeholder: "v0.18.0"
validations:
required: true
- type: dropdown
id: os
attributes:
label: Which operating systems are you seeing the problem on?
label: Which operating system(s) are you seeing the problem on?
multiple: true
options:
- macOS
- Windows
- Linux
- In deployment
validations:
required: true
- type: dropdown
Expand All @@ -44,6 +44,7 @@ body:
- x86_64
- ARM64
- Other
- In deployment
- type: textarea
id: logs
attributes:
Expand Down
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/FEATURE-SUGGESTION.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: Feature suggestion
description: Suggest a feature or improvement
description: Suggest a new feature
title: "[Feature]: "
labels: ["enhancement"]
labels: ["feature request"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to suggest a feature!
value: Thanks for taking the time to suggest a feature!
- type: textarea
id: describe
attributes:
Expand Down
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/IMPROVEMENT.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Improvement suggestion
description: Suggest an improvement to an existing feature
title: "[Improvement]: "
labels: ["improvement"]
body:
- type: markdown
attributes:
value: Thanks for taking the time to suggest an improvement!
- type: textarea
id: describe
attributes:
label: Describe the improvement
description: A high level description.
placeholder: Add functionality that allows users to ...
validations:
required: true
- type: checkboxes
id: duplicate
attributes:
label: Duplicate declaration
description: Please confirm that you are not creating a duplicate issue.
options:
- label: I have searched the issues and this improvement has not been requested before.
required: true
9 changes: 5 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
## Description of change
<!-- Please write a summary of your changes and why you made them. -->
<!-- Be sure to reference any related issues by adding `Closes #`. -->

Please write a summary of your changes and why you made them.

Be sure to reference any related issues by adding `closes issue #`.

## How Has This Been Tested (if applicable)?
## How has this been tested? (if applicable)
<!-- Please describe the tests that you ran to verify your changes. -->


Please describe the tests that you ran to verify your changes.
Loading

0 comments on commit 292b6ec

Please sign in to comment.