Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and update all markdown files + some more #666

Merged
merged 3 commits into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 94 additions & 72 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 2.1

orbs:
orbs:
docker-buildx: sensu/docker-buildx@1.1.1
aws-ecr: circleci/aws-ecr@8.1.2
win: circleci/windows@5.0
Expand Down Expand Up @@ -154,7 +154,7 @@ jobs:
- install-protoc
- run: cargo fmt --all --check
- run: cargo install cargo-sort
# TODO: this is incompatible with workspace inheritance, uncomment when
# TODO: this is incompatible with workspace inheritance, uncomment when
# https://github.com/DevinR528/cargo-sort/pull/29 is merged
# - run: cargo sort --check --workspace
- run: cargo check --workspace --all-targets
Expand Down Expand Up @@ -191,7 +191,7 @@ jobs:
- apply-patches
- run: cargo fmt --all --check --manifest-path << parameters.path >>/Cargo.toml
- run: cargo install cargo-sort
# TODO: this is incompatible with workspace inheritance, uncomment when
# TODO: this is incompatible with workspace inheritance, uncomment when
# https://github.com/DevinR528/cargo-sort/pull/29 is merged
# - run: cargo sort --check << parameters.path >>
- run: |
Expand Down Expand Up @@ -388,79 +388,101 @@ jobs:
workflows:
ci:
jobs:
- workspace-fmt
- workspace-clippy:
name: workspace-clippy-<< matrix.framework >>
requires:
- workspace-fmt
matrix:
parameters:
framework: ["web-actix-web", "web-axum", "web-rocket", "web-poem", "web-thruster", "web-tide", "web-tower","web-warp", "web-salvo", "bot-serenity", "bot-poise"]
- check-standalone:
matrix:
parameters:
path:
- resources/aws-rds
- resources/persist
- resources/secrets
- resources/shared-db
- resources/static-folder
- service-test:
requires:
- workspace-clippy
- platform-test:
requires:
- workspace-clippy
matrix:
parameters:
crate: ["shuttle-auth", "shuttle-deployer", "cargo-shuttle", "shuttle-codegen", "shuttle-common", "shuttle-proto", "shuttle-provisioner"]
- e2e-test:
requires:
- service-test
- platform-test
- check-standalone
filters:
branches:
only: production
- build-and-push:
requires:
- e2e-test
filters:
branches:
only: production
- build-binaries-linux:
name: build-binaries-x86_64-gnu
image: ubuntu-2204:2022.04.1
target: x86_64-unknown-linux-gnu
resource_class: medium
filters:
branches:
only: production
- build-binaries-linux:
name: build-binaries-x86_64-musl
image: ubuntu-2204:2022.04.1
target: x86_64-unknown-linux-musl
resource_class: medium
filters:
branches:
only: production
- build-binaries-linux:
name: build-binaries-aarch64
image: ubuntu-2004:202101-01
target: aarch64-unknown-linux-musl
resource_class: arm.medium
filters:
branches:
only: production
- build-binaries-windows:
- workspace-fmt
- workspace-clippy:
name: workspace-clippy-<< matrix.framework >>
requires:
- workspace-fmt
matrix:
parameters:
framework:
[
"web-actix-web",
"web-axum",
"web-rocket",
"web-poem",
"web-thruster",
"web-tide",
"web-tower",
"web-warp",
"web-salvo",
"bot-serenity",
"bot-poise",
]
- check-standalone:
matrix:
parameters:
path:
- resources/aws-rds
- resources/persist
- resources/secrets
- resources/shared-db
- resources/static-folder
- service-test:
requires:
- workspace-clippy
- platform-test:
requires:
- workspace-clippy
matrix:
parameters:
crate:
[
"shuttle-auth",
"shuttle-deployer",
"cargo-shuttle",
"shuttle-codegen",
"shuttle-common",
"shuttle-proto",
"shuttle-provisioner",
]
- e2e-test:
requires:
- service-test
- platform-test
- check-standalone
filters:
branches:
only: production
- build-and-push:
requires:
- e2e-test
filters:
branches:
only: production
- build-binaries-linux:
name: build-binaries-x86_64-gnu
image: ubuntu-2204:2022.04.1
target: x86_64-unknown-linux-gnu
resource_class: medium
filters:
branches:
only: production
- build-binaries-mac:
- build-binaries-linux:
name: build-binaries-x86_64-musl
image: ubuntu-2204:2022.04.1
target: x86_64-unknown-linux-musl
resource_class: medium
filters:
branches:
only: production
- publish-github-release:
only: production
- build-binaries-linux:
name: build-binaries-aarch64
image: ubuntu-2004:202101-01
target: aarch64-unknown-linux-musl
resource_class: arm.medium
filters:
branches:
only: production
- build-binaries-windows:
filters:
branches:
only: production
- build-binaries-mac:
filters:
branches:
only: production
- publish-github-release:
requires:
- build-binaries-x86_64-gnu
- build-binaries-x86_64-musl
Expand All @@ -469,4 +491,4 @@ workflows:
- build-binaries-mac
filters:
branches:
only: production
only: production
17 changes: 11 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@
## Raise an Issue

Raising [issues](https://github.com/shuttle-hq/shuttle/issues) is encouraged.

## Docs

If you found an error in our docs, or you simply want to make them better, contributions to our [docs](https://github.com/shuttle-hq/shuttle-docs)
are always appreciated!

## Running Locally

You can use Docker and docker-compose to test shuttle locally during development. See the [Docker install](https://docs.docker.com/get-docker/)
and [docker-compose install](https://docs.docker.com/compose/install/) instructions if you do not have them installed already.

> Note for Windows: The current [Makefile](https://github.com/shuttle-hq/shuttle/blob/main/Makefile) does not work on Windows systems by itself - if you want to build the local environment on Windows you could use [Windows Subsystem for Linux](https://learn.microsoft.com/en-us/windows/wsl/install). Additional Windows considerations are listed at the bottom of this page.

> Note for Linux: When building on Linux systems, if the error unknown flag: --build-arg is received, install the docker-buildx package using the package management tool for your particular system.

Clone the shuttle repository (or your fork):

```
```bash
git clone git@github.com:shuttle-hq/shuttle.git
cd shuttle
```
Expand All @@ -45,7 +46,7 @@ The API is now accessible on `localhost:8000` (for app proxies) and `localhost:8

In order to test local changes to the library crates, you may want to add the below to a `.cargo/config.toml` file. (See [Overriding Dependencies](https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html) for more)

``` toml
```toml
[patch.crates-io]
shuttle-service = { path = "[base]/shuttle/service" }
shuttle-common = { path = "[base]/shuttle/common" }
Expand Down Expand Up @@ -182,6 +183,7 @@ We will squash commits before merging to main. If you do want to squash commits,
after the review process has started, the commit history can be useful for reviewers.

Before committing:

- Make sure your commits don't trigger any warnings from Clippy by running: `cargo clippy --tests --all-targets`. If you have a good reason to contradict Clippy, insert an `#[allow(clippy::<lint>)]` macro, so that it won't complain.
- Make sure your code is correctly formatted: `cargo fmt --all --check`.
- Make sure your `Cargo.toml`'s are sorted: `cargo +nightly sort --workspace`. This command uses the [cargo-sort crate](https://crates.io/crates/cargo-sort) to sort the `Cargo.toml` dependencies alphabetically.
Expand Down Expand Up @@ -227,6 +229,7 @@ graph BT
First, `provisioner`, `gateway`, `deployer`, and `cargo-shuttle` are binary crates with `provisioner`, `gateway` and `deployer` being backend services. The `cargo-shuttle` binary is the `cargo shuttle` command used by users.

The rest are the following libraries:

- `common` contains shared models and functions used by the other libraries and binaries.
- `codegen` contains our proc-macro code which gets exposed to user services from `service` by the `codegen` feature flag. The redirect through `service` is to make it available under the prettier name of `shuttle_service::main`.
- `service` is where our special `Service` trait is defined. Anything implementing this `Service` can be loaded by the `deployer` and the local runner in `cargo-shuttle`.
Expand All @@ -238,20 +241,22 @@ Lastly, the `user service` is not a folder in this repository, but is the user s

## Windows Considerations

Currently, if you try to use 'make images' on Windows, you may find that the shell files cannot be read by Bash/WSL. This is due to the fact that Windows may have pulled the files in CRLF format rather than LF[^1], which causes problems with Bash as to run the commands, Linux needs the file in LF format.
Currently, if you try to use 'make images' on Windows, you may find that the shell files cannot be read by Bash/WSL. This is due to the fact that Windows may have pulled the files in CRLF format rather than LF[^1], which causes problems with Bash as to run the commands, Linux needs the file in LF format.

Thankfully, we can fix this problem by simply using the `git config core.autocrlf` command to change how Git handles line endings. It takes a single argument:

```
```bash
git config --global core.autocrlf input
```

This should allow you to run `make images` and other Make commands with no issues.

If you need to change it back for whatever reason, you can just change the last argument from 'input' to 'true' like so:
```

```bash
git config --global core.autocrlf true
```

After you run this command, you should be able to checkout projects that are maintained using CRLF (Windows) again.

[^1]: https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#_core_autocrlf
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ once_cell = "1.16.0"
opentelemetry = { version = "0.18.0", features = ["rt-tokio"] }
opentelemetry-http = "0.7.0"
pin-project = "1.0.12"
portpicker = "0.1.1"
rand = "0.8.5"
ring = "0.16.20"
serde = "1.0.148"
serde_json = "1.0.89"
strum = { version = "0.24.1", features = ["derive"] }
portpicker = "0.1.1"
thiserror = "1.0.37"
tower = "0.4.13"
tower-http = { version = "0.3.4", features = ["trace"] }
Expand Down
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<!-- markdownlint-disable -->
<p align="center">
<img width="300" src="https://raw.githubusercontent.com/shuttle-hq/shuttle/master/assets/logo-rectangle-transparent.png"/>
</p>
<br>
<p align=center>
<a href="https://docs.rs/shuttle-service">
<img alt="docs" src="https://img.shields.io/badge/doc-reference-orange">
<img alt="docs" src="https://img.shields.io/badge/docs-reference-orange">
</a>
<a href="https://github.com/shuttle-hq/shuttle/search?l=rust">
<img alt="language" src="https://img.shields.io/badge/language-Rust-orange.svg">
Expand All @@ -16,6 +17,7 @@
<img alt="discord" src="https://img.shields.io/discord/803236282088161321?logo=discord"/>
</a>
</p>
<!-- markdownlint-restore -->

---

Expand All @@ -24,9 +26,10 @@
[Shuttle](https://www.shuttle.rs/) is a Rust-native cloud development platform that lets you deploy your Rust apps for free.

Shuttle is built for productivity, reliability and performance:

- Zero-Configuration support for Rust using annotations
- Automatic resource provisioning (databases, caches, subdomains, etc.) via [Infrastructure-From-Code](https://www.shuttle.rs/blog/2022/05/09/ifc)
- First-class support for popular Rust frameworks ([Actix](https://docs.shuttle.rs/examples/actix), [Rocket](https://docs.shuttle.rs/examples/rocket), [Axum](https://docs.shuttle.rs/examples/axum),
- First-class support for popular Rust frameworks ([Actix](https://docs.shuttle.rs/examples/actix), [Rocket](https://docs.shuttle.rs/examples/rocket), [Axum](https://docs.shuttle.rs/examples/axum),
[Tide](https://docs.shuttle.rs/examples/tide), [Poem](https://docs.shuttle.rs/examples/poem) and [Tower](https://docs.shuttle.rs/examples/tower))
- Support for deploying Discord bots using [Serenity](https://docs.shuttle.rs/examples/serenity)
- Scalable hosting (with optional self-hosting)
Expand All @@ -52,10 +55,13 @@ cargo shuttle login
```

To initialize your project, simply write:

```bash
cargo shuttle init --axum hello-world
```

And to deploy it, write:

```bash
cargo shuttle project new
cargo shuttle project status // until the project is "ready"
Expand All @@ -75,14 +81,15 @@ $ cargo shuttle deploy
Created At: 2022-04-01 08:32:34.412602556 UTC
```

Feel free to build on-top of the generated `hello-world` boilerplate or take a stab at one of our [examples](https://docs.shuttle.rs/guide/axum-examples.html#hello-world).
Feel free to build on-top of the generated `hello-world` boilerplate or take a stab at one of our [examples](https://docs.shuttle.rs/examples/axum).

For the full documentation, visit [our docs](https://docs.shuttle.rs).

## Contributing to shuttle

Contributing to shuttle is highly encouraged!

If you want to setup a local environment to test code changes to core `shuttle` packages, or want to contribute to the project check out [our docs](https://docs.shuttle.rs/community/contribute).
If you want to setup a local environment to test code changes to core `shuttle` packages, or want to contribute to the project check out [our docs](https://docs.shuttle.rs/community/contribute).

Even if you are not planning to submit any code; joining our [Discord server](https://discord.gg/shuttle) and providing feedback helps us a lot!

Expand All @@ -102,12 +109,12 @@ If you have any requests or suggestions feel free to open an issue.
## Status

- [x] Alpha: We are testing Shuttle, API and deployments may be unstable
- [x] Public Alpha: Anyone can sign up, but go easy on us,
- [x] Public Alpha: Anyone can sign up, but go easy on us,
there are a few kinks
- [ ] Public Beta: Stable enough for most non-enterprise use-cases
- [ ] Public: Production-ready!

We are currently in Public Alpha. Watch "releases" of this repo to get
We are currently in Public Alpha. Watch "releases" of this repo to get
notified of major updates!

## Contributors ✨
Expand Down
8 changes: 6 additions & 2 deletions admin/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
_Small utility used by the shuttle admin for common tasks_
# Admin

<!-- markdownlint-disable-next-line -->
*Small utility used by the shuttle admin for common tasks*

## How to test custom domain certificates locally

For local testing it is easiest to use the [Pebble](https://github.com/letsencrypt/pebble) server. So install it using
whatever method works for your system. It is included in the nix environment if you use it though.

Expand Down Expand Up @@ -31,4 +35,4 @@ cargo run -p shuttle-admin -- --api-url http://localhost:8001 acme create-accoun

Safe the account JSON in a local file and use it to test creating new certificate. However, you'll the FQDN you're
using for testnig to resolve to your local machine. So create an `A` record for it on your DNS with the value
`127.0.0.1`. And Bob's your uncle 🎉
`127.0.0.1`. And Bob's your uncle 🎉
Loading