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

Rust rewrite: services and basic routing #165

Merged
merged 20 commits into from
Jul 7, 2024

Conversation

jr1221
Copy link
Contributor

@jr1221 jr1221 commented Jul 5, 2024

Rewrite in rust:

Stack

  • Axum for web routing: Reason -> everyone uses it and its got tokio integration
  • Socketoxide for socketio: Reason -> it supports engine v4 and its part of tokio
  • Prisma client rust for ORM: Reason -> its the only one which can take prisma files

This PR:

  • Basic CI/CD for devs, inc. format
  • all services
  • tests for all services
  • controllers and transformation functions for all which match client json
  • unit tests to ensure client json matches
  • routing framework with basic config

Future PR 1:

  • Socketoxide
  • MQTT connection
  • Batch upload in services
  • proxy clients
  • extended mock support, etc.
  • Dockerize, composeify, and document

Future PR 2:

  • Further CI/CD fixups
  • Axum caching, performance considerations
  • Investigate uneeded queries (marked TODO)
  • Investigate any structural changes

@jr1221 jr1221 marked this pull request as ready for review July 7, 2024 02:10
@jr1221 jr1221 self-assigned this Jul 7, 2024
@jr1221 jr1221 changed the base branch from develop to feature/scylla-rust-server July 7, 2024 02:44
Copy link
Contributor

@RChandler234 RChandler234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't worked with Rust a ton, so take what I say with a grain of salt.

scylla-server-rust/src/controller/data_controller.rs Outdated Show resolved Hide resolved
scylla-server-rust/src/controller/data_type_controller.rs Outdated Show resolved Hide resolved
scylla-server-rust/src/controller/data_controller.rs Outdated Show resolved Hide resolved
scylla-server-rust/src/controller/data_controller.rs Outdated Show resolved Hide resolved
scylla-server-rust/src/controller/data_controller.rs Outdated Show resolved Hide resolved
scylla-server-rust/src/controller/run_controller.rs Outdated Show resolved Hide resolved
scylla-server-rust/src/main.rs Show resolved Hide resolved
scylla-server-rust/src/services/data_service.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@Peyton-McKee Peyton-McKee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great

.github/workflows/scylla-rust-ci.yml Show resolved Hide resolved
scylla-server-rust/src/controller/data_controller.rs Outdated Show resolved Hide resolved
scylla-server-rust/src/controller/data_controller.rs Outdated Show resolved Hide resolved
scylla-server-rust/src/controller/data_controller.rs Outdated Show resolved Hide resolved
scylla-server-rust/src/controller/data_controller.rs Outdated Show resolved Hide resolved
scylla-server-rust/src/main.rs Show resolved Hide resolved
.unwrap()
.fixed_offset(),
prisma::run::id::equals(run_id),
vec![prisma::data::values::set(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very interesting syntax

scylla-server-rust/tests/data_service_test.rs Outdated Show resolved Hide resolved
scylla-server-rust/tests/data_service_test.rs Show resolved Hide resolved
DATA_TYPE_NAME.to_owned(),
)
.await
.expect_err("Should error, as no node exists");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should be expecting the proper error that its gonna have

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately the prisma client rust query errors are not typed. It basically is just a wrapper for the error the database returned as a string. Kinda sucks I know.

@jr1221 jr1221 merged commit 4e32b47 into feature/scylla-rust-server Jul 7, 2024
5 checks passed
@RChandler234 RChandler234 deleted the rust-rewrite-jack branch August 13, 2024 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants