Skip to content

Commit

Permalink
chore: move migrate to rivet binary
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFlurry committed Oct 17, 2024
1 parent 6a1442d commit 83c344d
Show file tree
Hide file tree
Showing 334 changed files with 800 additions and 3,711 deletions.
65 changes: 62 additions & 3 deletions Bolt.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,63 @@
# This is intentionally empty!
# [services]
# sql = [
# { kind = "cockroachdb", path = "svc/pkg/build/db/build", db_name = "db_build" },
# { kind = "cockroachdb", path = "svc/pkg/captcha/db/captcha", db_name = "db_captcha" },
# { kind = "cockroachdb", path = "svc/pkg/cdn/db/cdn", db_name = "db_cdn" },
# { kind = "cockroachdb", path = "svc/pkg/cf-custom-hostname/db/cf-custom-hostname", db_name = "db_cf_custom_hostname" },
# { kind = "cockroachdb", path = "svc/pkg/cloud/db/cloud", db_name = "db_cloud" },
# { kind = "cockroachdb", path = "svc/pkg/cluster/db/cluster", db_name = "db_cluster" },
# { kind = "cockroachdb", path = "svc/pkg/custom-user-avatar/db/custom-avatar", db_name = "db_custom_avatar" },
# { kind = "cockroachdb", path = "svc/pkg/ds/db/servers", db_name = "db_servers" },
# { kind = "cockroachdb", path = "svc/pkg/email-verification/db/email-verification", db_name = "db_email_verification" },
# { kind = "cockroachdb", path = "svc/pkg/game-user/db/game-user", db_name = "db_game_user" },
# { kind = "cockroachdb", path = "svc/pkg/game/db/game", db_name = "db_game" },
# { kind = "cockroachdb", path = "svc/pkg/identity-config/db/identity-config", db_name = "db_identity_config" },
# { kind = "cockroachdb", path = "svc/pkg/ip/db/info", db_name = "db_info" },
# { kind = "cockroachdb", path = "svc/pkg/job/db/config", db_name = "db_config" },
# { kind = "cockroachdb", path = "svc/pkg/job/db/state", db_name = "db_state" },
# { kind = "cockroachdb", path = "svc/pkg/kv-config/db/kv-config", db_name = "db_kv_config" },
# { kind = "cockroachdb", path = "svc/pkg/kv/db/kv", db_name = "db_kv" },
# { kind = "cockroachdb", path = "svc/pkg/linode/db/linode", db_name = "db_linode" },
# { kind = "cockroachdb", path = "svc/pkg/mm-config/db/mm-config", db_name = "db_mm_config" },
# { kind = "cockroachdb", path = "svc/pkg/mm/db/state", db_name = "db_state" },
# { kind = "cockroachdb", path = "svc/pkg/pegboard/db/pegboard", db_name = "db_pegboard" },
# { kind = "cockroachdb", path = "svc/pkg/team-invite/db/team-invite", db_name = "db_team_invite" },
# { kind = "cockroachdb", path = "svc/pkg/team/db/team", db_name = "db_team" },
# { kind = "cockroachdb", path = "svc/pkg/token/db/token", db_name = "db_token" },
# { kind = "cockroachdb", path = "svc/pkg/upload/db/upload", db_name = "db_upload" },
# { kind = "cockroachdb", path = "svc/pkg/user-dev/db/user-dev", db_name = "db_user_dev" },
# { kind = "cockroachdb", path = "svc/pkg/user-follow/db/user-follow", db_name = "db_user_follow" },
# { kind = "cockroachdb", path = "svc/pkg/user-identity/db/user-identity", db_name = "db_user_identity" },
# { kind = "cockroachdb", path = "svc/pkg/user-report/db/user-report", db_name = "db_user_report" },
# { kind = "cockroachdb", path = "svc/pkg/user/db/user", db_name = "db_user" },
# { kind = "cockroachdb", path = "svc/pkg/workflow/db/workflow", db_name = "db_workflow" },
#
# { kind = "clickhouse", path = "svc/pkg/ds-log/db/log", db_name = "db_log" },
# { kind = "clickhouse", path = "svc/pkg/job-log/db/log", db_name = "db_log" },
# ]
# buckets = [
# { name = "build" },
# { name = "cdn" },
# { name = "export" },
# { name = "banner" },
# { name = "logo" },
# { name = "artifacts" },
# { name = "export" },
# { name = "log" },
# { name = "imagor-result-storage" },
# { name = "svc-build" },
# { name = "lobby-history-export" },
# { name = "log" },
# { name = "avatar" },
# { name = "billing" },
# { name = "avatar" },
# ]
# redis = [
# { name = "redis-cdn", ephemeral = false },
# { name = "redis-job", ephemeral = false },
# { name = "redis-cache", ephemeral = true },
# { name = "redis-chirp", ephemeral = false },
# { name = "redis-chirp-ephemeral", ephemeral = true },
# { name = "redis-mm", ephemeral = false },
# ]
#
# See lib/bolt/config/src/project.rs

18 changes: 18 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ tokio = { version = "1.29", features = ["full", "tracing"] }
global-error = { path = "lib/global-error" }
tracing = "0.1"
clap = { version = "4.3", features = ["derive"] }
rivet-migrate = { path = "lib/migrate" }

# Standalone
cluster-datacenter-tls-renew = { path = "svc/pkg/cluster/standalone/datacenter-tls-renew", optional = true }
Expand Down Expand Up @@ -347,6 +348,8 @@ members = [
"lib/chirp/types",
"lib/chirp/worker",
"lib/chirp/worker-attributes",
"lib/chirp-workflow/core",
"lib/chirp-workflow/macros",
"lib/bolt/cli",
"lib/bolt/core",
"lib/bolt/config",
Expand All @@ -360,7 +363,7 @@ members = [
"lib/cache/result",
"lib/pegboard/container-runner",
"lib/pegboard/manager",
"lib/pegboard/echo",
"lib/pegboard/echo", "lib/migrate",
]

# Speed up compilation
Expand Down
5 changes: 0 additions & 5 deletions lib/api-helper/Cargo.toml

This file was deleted.

13 changes: 0 additions & 13 deletions lib/bolt/Cargo.toml

This file was deleted.

80 changes: 0 additions & 80 deletions lib/bolt/cli/src/commands/db/migrate.rs

This file was deleted.

5 changes: 0 additions & 5 deletions lib/bolt/cli/src/commands/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ mod migrate;

#[derive(Parser)]
pub enum SubCommand {
Migrate {
#[clap(subcommand)]
command: migrate::SubCommand,
},
#[clap(alias = "sh")]
Shell {
#[clap(index = 1)]
Expand All @@ -24,7 +20,6 @@ pub enum SubCommand {
impl SubCommand {
pub async fn execute(self, ctx: ProjectContext) -> Result<()> {
match self {
Self::Migrate { command } => command.execute(ctx).await,
Self::Shell {
service,
query,
Expand Down
1 change: 0 additions & 1 deletion lib/bolt/config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ pub mod cache;
pub mod local;
pub mod ns;
pub mod project;
pub mod service;
41 changes: 39 additions & 2 deletions lib/bolt/config/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,51 @@ pub fn decode(s: &str) -> Result<Project, toml::de::Error> {
/// Configuration for the Bolt.toml at the root of the project.
#[derive(Deserialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[serde(rename_all = "kebab-case")]
pub struct Project {
#[serde(default)]
pub additional_roots: HashMap<String, AdditionalRoot>,
// pub services: Services,
}

#[derive(Clone, Debug, Default, Deserialize)]
#[serde(rename_all = "kebab-case", deny_unknown_fields)]
#[serde(deny_unknown_fields)]
pub struct AdditionalRoot {
pub path: PathBuf,
}

// #[derive(Clone, Debug, Deserialize)]
// #[serde(deny_unknown_fields)]
// pub struct Services {
// pub sql: Vec<SqlService>,
// pub buckets: Vec<S3Bucket>,
// pub redis: Vec<RedisService>,
// }
//
// #[derive(Clone, Debug, Deserialize)]
// #[serde(deny_unknown_fields)]
// pub struct SqlService {
// pub kind: SqlServiceKind,
// pub path: String,
// pub db_name: String,
// }
//
// #[derive(Deserialize, Clone, Debug)]
// pub enum SqlServiceKind {
// #[serde(rename = "cockroachdb")]
// CockroachDB,
// #[serde(rename = "clickhouse")]
// ClickHouse,
// }
//
// #[derive(Clone, Debug, Deserialize)]
// #[serde(deny_unknown_fields)]
// pub struct S3Bucket {
// pub name: String,
// }
//
// #[derive(Clone, Debug, Deserialize)]
// #[serde(deny_unknown_fields)]
// pub struct RedisService {
// pub name: String,
// pub ephemeral: bool,
// }
Loading

0 comments on commit 83c344d

Please sign in to comment.