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

Add initial setup for a basic shared cache server #1318

Merged
merged 8 commits into from
Jun 27, 2023
Merged

Conversation

JakeSiFive
Copy link
Contributor

This change is just to get us started down the development path for a shared caching server that can be used to repopulate the local shared caches.

@mmjconolly
Copy link
Contributor

It could help to have some discriptions for what these are
What is entity, gsc, migration and so on

@JakeSiFive
Copy link
Contributor Author

Oh sure, "entity" and "migration" are the standard names used by sea-orm to make sea-orm work. The "entity" package is generated by sea-orm from an active database but can be modified by hand easily enough as well. Each "entity" is a rust type that corresponds to a table in the database schema. An instance of an entity is equivalent to a row in the database. The "migration" crate is partially managed by sea-orm and partially not. The individual migrations have to be written by hand. Each migration has an "up" and a "down" to go back and forth between them and there's a list of migrations that is kept in chronological order. This lets you move a database up and down and give good error messages when you can't migrate all the way to the latest version expected by your current service. This is also how we plan on not loosing terrabytes of data in the shared cache when we inevitably update the schema.

The "gsc" crate is short for "global shared cache" and implements a JSON RPC web service.

@V-FEXrt
Copy link
Collaborator

V-FEXrt commented Jun 26, 2023

FWIW: Entity and Migration are standard terms in (web) API/backend development. We can change those but we probably shouldn't

rust/entity/src/job.rs Show resolved Hide resolved
rust/entity/src/main.rs Outdated Show resolved Hide resolved
rust/gsc/Cargo.toml Outdated Show resolved Hide resolved
rust/gsc/src/main.rs Outdated Show resolved Hide resolved
rust/gsc/src/main.rs Outdated Show resolved Hide resolved
rust/gsc/src/main.rs Show resolved Hide resolved
rust/gsc/src/main.rs Outdated Show resolved Hide resolved
rust/gsc/src/main.rs Outdated Show resolved Hide resolved
rust/migration/src/m20220101_000001_create_table.rs Outdated Show resolved Hide resolved
@JakeSiFive JakeSiFive merged commit 59fa278 into master Jun 27, 2023
12 checks passed
@JakeSiFive JakeSiFive deleted the rust_stuff branch June 27, 2023 17:47
);

// run it with hyper on localhost:3000
axum::Server::bind(&"127.0.0.1:3000".parse().unwrap())
Copy link
Contributor

@mmjconolly mmjconolly Jun 27, 2023

Choose a reason for hiding this comment

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

I realize this is early scaffold, but for later:

This relies on the host machine being able to route between the loopback device and other devices, and that the loopback hasn't been assigned to a WAN address. Can this be a less specific address like 0.0.0.0 or ::, or to take the interface and/or ip address/port from a configuration file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The plan is to take the ip address and port from an environment variable

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.

3 participants