From e64fcab0288b4bdc54d2e4d92f1b58490527c063 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Mon, 20 Nov 2023 00:00:12 -0500 Subject: [PATCH] Switch from native TLS to rustls This should make for smaller and simpler binaries. --- Cargo.lock | 65 +++++++++++++++++-- crates/_types/reusable_types/Cargo.toml | 2 +- crates/_types/tokens/Cargo.toml | 2 +- crates/cli/dev_database_seed/Cargo.toml | 2 +- .../src/seeding/zero_shot_tts.rs | 7 ++ crates/cli/dev_upload_media_file/Cargo.toml | 2 +- crates/cli/elasticsearch-cli/Cargo.toml | 2 +- crates/lib/mysql_queries/Cargo.toml | 2 +- crates/lib/sqlx_mysql_helpers/Cargo.toml | 2 +- crates/service/job/analytics_job/Cargo.toml | 2 +- crates/service/job/download_job/Cargo.toml | 2 +- .../service/job/email_sender_job/Cargo.toml | 2 +- crates/service/job/inference_job/Cargo.toml | 2 +- .../service/job/tts_download_job/Cargo.toml | 2 +- .../service/job/tts_inference_job/Cargo.toml | 2 +- .../service/job/w2l_download_job/Cargo.toml | 2 +- .../service/job/w2l_inference_job/Cargo.toml | 2 +- .../other/twitch_pubsub_subscriber/Cargo.toml | 2 +- crates/service/plugins/billing/Cargo.toml | 2 +- crates/service/plugins/users/Cargo.toml | 2 +- crates/service/web/storyteller_web/Cargo.toml | 2 +- .../service/web/websocket_gateway/Cargo.toml | 2 +- my-workspace-hack/Cargo.toml | 8 ++- service_cpu.Dockerfile | 43 +----------- service_gpu.Dockerfile | 15 +---- 25 files changed, 93 insertions(+), 85 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 567b330e49..304bc0cd75 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4084,6 +4084,7 @@ dependencies = [ "socket2 0.4.7", "socket2 0.5.5", "sqlx", + "sqlx-core", "sqlx-macros", "sqlx-macros-core", "sqlx-mysql", @@ -5374,10 +5375,21 @@ dependencies = [ "base64 0.13.1", "log", "ring 0.16.20", - "sct", + "sct 0.6.1", "webpki", ] +[[package]] +name = "rustls" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +dependencies = [ + "ring 0.16.20", + "rustls-webpki", + "sct 0.7.0", +] + [[package]] name = "rustls-native-certs" version = "0.5.0" @@ -5385,11 +5397,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a07b7c1885bd8ed3831c289b7870b13ef46fe0e856d288c30d9cc17d75a2092" dependencies = [ "openssl-probe", - "rustls", + "rustls 0.19.1", "schannel", "security-framework", ] +[[package]] +name = "rustls-pemfile" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +dependencies = [ + "base64 0.21.0", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" +dependencies = [ + "ring 0.16.20", + "untrusted", +] + [[package]] name = "rustversion" version = "1.0.9" @@ -5493,6 +5524,16 @@ dependencies = [ "untrusted", ] +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring 0.16.20", + "untrusted", +] + [[package]] name = "security-framework" version = "2.2.0" @@ -5959,6 +6000,8 @@ dependencies = [ "once_cell", "paste", "percent-encoding", + "rustls 0.21.7", + "rustls-pemfile", "serde", "serde_json", "sha2 0.10.5", @@ -5969,6 +6012,7 @@ dependencies = [ "tokio-stream", "tracing", "url", + "webpki-roots 0.24.0", ] [[package]] @@ -6929,7 +6973,7 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" dependencies = [ - "rustls", + "rustls 0.19.1", "tokio 1.34.0", "webpki", ] @@ -6978,12 +7022,12 @@ dependencies = [ "futures-util", "log", "pin-project 1.0.7", - "rustls", + "rustls 0.19.1", "tokio 1.34.0", "tokio-rustls", "tungstenite", "webpki", - "webpki-roots", + "webpki-roots 0.21.1", ] [[package]] @@ -7242,7 +7286,7 @@ dependencies = [ "httparse", "log", "rand 0.8.5", - "rustls", + "rustls 0.19.1", "rustls-native-certs", "sha-1", "thiserror", @@ -7815,6 +7859,15 @@ dependencies = [ "webpki", ] +[[package]] +name = "webpki-roots" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b291546d5d9d1eab74f069c77749f2cb8504a12caa20f0f2de93ddbf6f411888" +dependencies = [ + "rustls-webpki", +] + [[package]] name = "websocket-gateway" version = "0.0.1" diff --git a/crates/_types/reusable_types/Cargo.toml b/crates/_types/reusable_types/Cargo.toml index 252160f242..7b87cc85e7 100644 --- a/crates/_types/reusable_types/Cargo.toml +++ b/crates/_types/reusable_types/Cargo.toml @@ -25,7 +25,7 @@ serde = "1.0.125" serde_derive = "1.0.125" # MySql Database -sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-native-tls", "chrono" ] } +sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] } my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" } [dev-dependencies] diff --git a/crates/_types/tokens/Cargo.toml b/crates/_types/tokens/Cargo.toml index c0ab4df4d2..9f242e6ee7 100644 --- a/crates/_types/tokens/Cargo.toml +++ b/crates/_types/tokens/Cargo.toml @@ -24,7 +24,7 @@ rand = "0.8.3" # "offline" supports typesafe builds without a live database # "rustls" doesn't appear to work with IP addresses, per: # https://github.com/launchbadge/sqlx/issues/1095#issuecomment-798050828 -sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-native-tls", "chrono" ] } +sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] } sqlx-core = { version = "0.7.2" } my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" } diff --git a/crates/cli/dev_database_seed/Cargo.toml b/crates/cli/dev_database_seed/Cargo.toml index 0566dd04cd..b2a4dcf25e 100644 --- a/crates/cli/dev_database_seed/Cargo.toml +++ b/crates/cli/dev_database_seed/Cargo.toml @@ -40,7 +40,7 @@ tokio = { version = "1.6.0", features = ["macros"] } # "offline" supports typesafe builds without a live database # "rustls" doesn't appear to work with IP addresses, per: # https://github.com/launchbadge/sqlx/issues/1095#issuecomment-798050828 -sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-native-tls", "chrono" ] } +sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] } elasticsearch = "8.5.0-alpha.1" my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" } diff --git a/crates/cli/dev_database_seed/src/seeding/zero_shot_tts.rs b/crates/cli/dev_database_seed/src/seeding/zero_shot_tts.rs index 5fb6906d6b..d0004aa182 100644 --- a/crates/cli/dev_database_seed/src/seeding/zero_shot_tts.rs +++ b/crates/cli/dev_database_seed/src/seeding/zero_shot_tts.rs @@ -92,8 +92,15 @@ async fn create_voice_records( dataset_token: &dataset_token, media_type: MediaUploadType::Audio, origin_category: MediaFileOriginCategory::Upload, + maybe_original_filename: None, + maybe_mime_type: None, + file_size_bytes: 0, + maybe_original_duration_millis: None, + maybe_original_audio_encoding: None, checksum_sha2: "", // TODO media_file_path: &public_upload_path, + maybe_public_bucket_prefix: None, + maybe_public_bucket_extension: None, maybe_creator_user_token: Some(&creator_user_token), maybe_creator_anonymous_visitor_token: None, creator_ip_address: "127.0.0.1", diff --git a/crates/cli/dev_upload_media_file/Cargo.toml b/crates/cli/dev_upload_media_file/Cargo.toml index 66b1bf1f5f..2b3c6b2626 100644 --- a/crates/cli/dev_upload_media_file/Cargo.toml +++ b/crates/cli/dev_upload_media_file/Cargo.toml @@ -37,7 +37,7 @@ tokio = { version = "1.6.0", features = ["macros"] } # "offline" supports typesafe builds without a live database # "rustls" doesn't appear to work with IP addresses, per: # https://github.com/launchbadge/sqlx/issues/1095#issuecomment-798050828 -sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-native-tls", "chrono" ] } +sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] } my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" } [dev-dependencies] diff --git a/crates/cli/elasticsearch-cli/Cargo.toml b/crates/cli/elasticsearch-cli/Cargo.toml index 44c5155e77..c3a234024c 100644 --- a/crates/cli/elasticsearch-cli/Cargo.toml +++ b/crates/cli/elasticsearch-cli/Cargo.toml @@ -37,7 +37,7 @@ tokio = { version = "1.6.0", features = ["macros"] } # "offline" supports typesafe builds without a live database # "rustls" doesn't appear to work with IP addresses, per: # https://github.com/launchbadge/sqlx/issues/1095#issuecomment-798050828 -sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-native-tls", "chrono" ] } +sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] } elasticsearch = "8.5.0-alpha.1" diff --git a/crates/lib/mysql_queries/Cargo.toml b/crates/lib/mysql_queries/Cargo.toml index 3911ddd630..e44db07008 100644 --- a/crates/lib/mysql_queries/Cargo.toml +++ b/crates/lib/mysql_queries/Cargo.toml @@ -43,6 +43,6 @@ toml = "0.5.8" # "offline" supports typesafe builds without a live database # "rustls" doesn't appear to work with IP addresses, per: # https://github.com/launchbadge/sqlx/issues/1095#issuecomment-798050828 -sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-native-tls", "chrono" ] } +sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] } my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" } diff --git a/crates/lib/sqlx_mysql_helpers/Cargo.toml b/crates/lib/sqlx_mysql_helpers/Cargo.toml index f91fd6c0b5..d094420abd 100644 --- a/crates/lib/sqlx_mysql_helpers/Cargo.toml +++ b/crates/lib/sqlx_mysql_helpers/Cargo.toml @@ -20,7 +20,7 @@ errors = { path = "../errors" } # "offline" supports typesafe builds without a live database # "rustls" doesn't appear to work with IP addresses, per: # https://github.com/launchbadge/sqlx/issues/1095#issuecomment-798050828 -sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-native-tls", "chrono" ] } +sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] } my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" } diff --git a/crates/service/job/analytics_job/Cargo.toml b/crates/service/job/analytics_job/Cargo.toml index fce6e7fd43..66509f8eb6 100644 --- a/crates/service/job/analytics_job/Cargo.toml +++ b/crates/service/job/analytics_job/Cargo.toml @@ -36,7 +36,7 @@ rand = "0.8.3" # "offline" supports typesafe builds without a live database # "rustls" doesn't appear to work with IP addresses, per: # https://github.com/launchbadge/sqlx/issues/1095#issuecomment-798050828 -sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-native-tls", "chrono" ] } +sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] } # Runtime # NB: We switched to Tokio from `async-std` for broader ecosystem support. diff --git a/crates/service/job/download_job/Cargo.toml b/crates/service/job/download_job/Cargo.toml index cb5aedc6f4..7b69a8a6cc 100644 --- a/crates/service/job/download_job/Cargo.toml +++ b/crates/service/job/download_job/Cargo.toml @@ -47,7 +47,7 @@ zip = "0.6.6" # "offline" supports typesafe builds without a live database # "rustls" doesn't appear to work with IP addresses, per: # https://github.com/launchbadge/sqlx/issues/1095#issuecomment-798050828 -sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-native-tls", "chrono" ] } +sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] } # Redis r2d2_redis = "0.14.0" diff --git a/crates/service/job/email_sender_job/Cargo.toml b/crates/service/job/email_sender_job/Cargo.toml index 4e5c0f04d4..e81a30619b 100644 --- a/crates/service/job/email_sender_job/Cargo.toml +++ b/crates/service/job/email_sender_job/Cargo.toml @@ -60,7 +60,7 @@ tempdir = "0.3.7" # "offline" supports typesafe builds without a live database # "rustls" doesn't appear to work with IP addresses, per: # https://github.com/launchbadge/sqlx/issues/1095#issuecomment-798050828 -sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-native-tls", "chrono" ] } +sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] } # Redis r2d2_redis = "0.14.0" diff --git a/crates/service/job/inference_job/Cargo.toml b/crates/service/job/inference_job/Cargo.toml index a18e4966dd..a9ab89ec83 100644 --- a/crates/service/job/inference_job/Cargo.toml +++ b/crates/service/job/inference_job/Cargo.toml @@ -55,7 +55,7 @@ tempdir = "0.3.7" # "offline" supports typesafe builds without a live database # "rustls" doesn't appear to work with IP addresses, per: # https://github.com/launchbadge/sqlx/issues/1095#issuecomment-798050828 -sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-native-tls", "chrono" ] } +sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] } # Redis r2d2_redis = "0.14.0" diff --git a/crates/service/job/tts_download_job/Cargo.toml b/crates/service/job/tts_download_job/Cargo.toml index c512b43ade..14d14e3793 100644 --- a/crates/service/job/tts_download_job/Cargo.toml +++ b/crates/service/job/tts_download_job/Cargo.toml @@ -38,7 +38,7 @@ tempdir = "0.3.7" # "offline" supports typesafe builds without a live database # "rustls" doesn't appear to work with IP addresses, per: # https://github.com/launchbadge/sqlx/issues/1095#issuecomment-798050828 -sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-native-tls", "chrono" ] } +sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] } # Redis r2d2_redis = "0.14.0" diff --git a/crates/service/job/tts_inference_job/Cargo.toml b/crates/service/job/tts_inference_job/Cargo.toml index 6509650a14..a72aa180ea 100644 --- a/crates/service/job/tts_inference_job/Cargo.toml +++ b/crates/service/job/tts_inference_job/Cargo.toml @@ -43,7 +43,7 @@ tempdir = "0.3.7" # "offline" supports typesafe builds without a live database # "rustls" doesn't appear to work with IP addresses, per: # https://github.com/launchbadge/sqlx/issues/1095#issuecomment-798050828 -sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-native-tls", "chrono" ] } +sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] } # Redis r2d2_redis = "0.14.0" diff --git a/crates/service/job/w2l_download_job/Cargo.toml b/crates/service/job/w2l_download_job/Cargo.toml index e13b3463eb..1619016588 100644 --- a/crates/service/job/w2l_download_job/Cargo.toml +++ b/crates/service/job/w2l_download_job/Cargo.toml @@ -38,7 +38,7 @@ tempdir = "0.3.7" # "offline" supports typesafe builds without a live database # "rustls" doesn't appear to work with IP addresses, per: # https://github.com/launchbadge/sqlx/issues/1095#issuecomment-798050828 -sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-native-tls", "chrono" ] } +sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] } # Redis r2d2_redis = "0.14.0" diff --git a/crates/service/job/w2l_inference_job/Cargo.toml b/crates/service/job/w2l_inference_job/Cargo.toml index 207a7080e4..85e15340c1 100644 --- a/crates/service/job/w2l_inference_job/Cargo.toml +++ b/crates/service/job/w2l_inference_job/Cargo.toml @@ -36,7 +36,7 @@ tempdir = "0.3.7" # "offline" supports typesafe builds without a live database # "rustls" doesn't appear to work with IP addresses, per: # https://github.com/launchbadge/sqlx/issues/1095#issuecomment-798050828 -sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-native-tls", "chrono" ] } +sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] } # Redis r2d2_redis = "0.14.0" diff --git a/crates/service/other/twitch_pubsub_subscriber/Cargo.toml b/crates/service/other/twitch_pubsub_subscriber/Cargo.toml index 04dd0ad482..63fc0921ff 100644 --- a/crates/service/other/twitch_pubsub_subscriber/Cargo.toml +++ b/crates/service/other/twitch_pubsub_subscriber/Cargo.toml @@ -51,7 +51,7 @@ futures_old_for_limiter = { package = "futures", version = "0.1.29" } # Older ve # "offline" supports typesafe builds without a live database # "rustls" doesn't appear to work with IP addresses, per: # https://github.com/launchbadge/sqlx/issues/1095#issuecomment-798050828 -sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-native-tls", "chrono" ] } +sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] } # Redis Database r2d2_redis = "0.14.0" diff --git a/crates/service/plugins/billing/Cargo.toml b/crates/service/plugins/billing/Cargo.toml index 7d3d20191e..8c6d59d8c8 100644 --- a/crates/service/plugins/billing/Cargo.toml +++ b/crates/service/plugins/billing/Cargo.toml @@ -54,7 +54,7 @@ async-trait = "0.1.58" # "offline" supports typesafe builds without a live database # "rustls" doesn't appear to work with IP addresses, per: # https://github.com/launchbadge/sqlx/issues/1095#issuecomment-798050828 -sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-native-tls", "chrono" ] } +sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] } my-workspace-hack = { version = "0.1", path = "../../../../my-workspace-hack" } [dev-dependencies] diff --git a/crates/service/plugins/users/Cargo.toml b/crates/service/plugins/users/Cargo.toml index 467f1f63ac..5033ae7d05 100644 --- a/crates/service/plugins/users/Cargo.toml +++ b/crates/service/plugins/users/Cargo.toml @@ -62,7 +62,7 @@ toml = "0.5.8" # "offline" supports typesafe builds without a live database # "rustls" doesn't appear to work with IP addresses, per: # https://github.com/launchbadge/sqlx/issues/1095#issuecomment-798050828 -sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-native-tls", "chrono" ] } +sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] } # TODO: Shouldn't really be a dependency, but need to add caching for the DDoS attack. # Redis Database diff --git a/crates/service/web/storyteller_web/Cargo.toml b/crates/service/web/storyteller_web/Cargo.toml index d9b4d3437f..219511dda8 100644 --- a/crates/service/web/storyteller_web/Cargo.toml +++ b/crates/service/web/storyteller_web/Cargo.toml @@ -101,7 +101,7 @@ pin-project-lite = "0.2.9" # NB: For middleware/futures upgrade # "offline" supports typesafe builds without a live database # "rustls" doesn't appear to work with IP addresses, per: # https://github.com/launchbadge/sqlx/issues/1095#issuecomment-798050828 -sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-native-tls", "chrono" ] } +sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] } # Redis Database limitation = "0.1.1" # Redis rate limiter diff --git a/crates/service/web/websocket_gateway/Cargo.toml b/crates/service/web/websocket_gateway/Cargo.toml index 0d3291edb8..5c41a0de9b 100644 --- a/crates/service/web/websocket_gateway/Cargo.toml +++ b/crates/service/web/websocket_gateway/Cargo.toml @@ -51,7 +51,7 @@ futures_old_for_limiter = { package = "futures", version = "0.1.29" } # Older ve # "offline" supports typesafe builds without a live database # "rustls" doesn't appear to work with IP addresses, per: # https://github.com/launchbadge/sqlx/issues/1095#issuecomment-798050828 -sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-native-tls", "chrono" ] } +sqlx = { version = "0.7.2", features = [ "mysql", "runtime-tokio", "tls-rustls", "chrono" ] } # Redis Database limitation = "0.1.1" # Redis rate limiter diff --git a/my-workspace-hack/Cargo.toml b/my-workspace-hack/Cargo.toml index 3c681bc18b..8448978ac9 100644 --- a/my-workspace-hack/Cargo.toml +++ b/my-workspace-hack/Cargo.toml @@ -68,7 +68,8 @@ sha2 = { version = "0.10.5" } simd-adler32 = { version = "0.3.7" } socket2-9fbad63c4bcf4a8f = { package = "socket2", version = "0.4.7", default-features = false, features = ["all"] } socket2-d8f496e17d97b5cb = { package = "socket2", version = "0.5.5", default-features = false, features = ["all"] } -sqlx = { version = "0.7.2", features = ["chrono", "mysql", "runtime-tokio-native-tls", "sqlite"] } +sqlx = { version = "0.7.2", features = ["chrono", "mysql", "runtime-tokio-native-tls", "sqlite", "tls-rustls"] } +sqlx-core = { version = "0.7.2", features = ["_rt-tokio", "_tls-native-tls", "_tls-rustls", "any", "chrono", "json", "migrate", "offline"] } sqlx-mysql = { version = "0.7.2", default-features = false, features = ["any", "chrono", "json", "migrate", "offline"] } sqlx-sqlite = { version = "0.7.2", default-features = false, features = ["any", "chrono", "json", "migrate", "offline"] } time = { version = "0.3.14", features = ["macros", "serde-well-known"] } @@ -128,8 +129,9 @@ serde = { version = "1.0.179", features = ["alloc", "derive", "rc"] } serde_json = { version = "1.0.108", features = ["raw_value"] } sha1 = { version = "0.10.4" } sha2 = { version = "0.10.5" } -sqlx-macros = { version = "0.7.2", features = ["_rt-tokio", "_tls-native-tls", "chrono", "json", "migrate", "mysql", "sqlite"] } -sqlx-macros-core = { version = "0.7.2", features = ["_rt-tokio", "_tls-native-tls", "chrono", "json", "migrate", "mysql", "sqlite"] } +sqlx-core = { version = "0.7.2", features = ["_rt-tokio", "_tls-native-tls", "_tls-rustls", "any", "chrono", "json", "migrate", "offline"] } +sqlx-macros = { version = "0.7.2", features = ["_rt-tokio", "_tls-native-tls", "_tls-rustls", "chrono", "json", "migrate", "mysql", "sqlite"] } +sqlx-macros-core = { version = "0.7.2", features = ["_rt-tokio", "_tls-native-tls", "_tls-rustls", "chrono", "json", "migrate", "mysql", "sqlite"] } sqlx-mysql = { version = "0.7.2", default-features = false, features = ["any", "chrono", "json", "migrate", "offline"] } sqlx-sqlite = { version = "0.7.2", default-features = false, features = ["any", "chrono", "json", "migrate", "offline"] } syn-dff4ba8e3ae991db = { package = "syn", version = "1.0.107", features = ["extra-traits", "fold", "full", "visit", "visit-mut"] } diff --git a/service_cpu.Dockerfile b/service_cpu.Dockerfile index 410617c429..5e186425b2 100644 --- a/service_cpu.Dockerfile +++ b/service_cpu.Dockerfile @@ -2,10 +2,6 @@ # =============== (1) set up core rust build image =============== # ================================================================ -# Custom base image -# Make sure to add this repository so it has read acces to the base image: -# https://github.com/orgs/storytold/packages/container/docker-base-images-rust-ssl/settings/actions_access -# FROM ghcr.io/storytold/docker-base-images-rust-ssl:d94ce4350c3b as rust-build FROM ubuntu:jammy as rust-base # NB: This can be "stable" or another version. @@ -16,7 +12,6 @@ WORKDIR /tmp # NB: cmake is required for freetype-sys-0.13.1, which in turn has only been added for egui. # NB: fontconfig is required by servo-fontconfig-sys, which is in the dependency chain for egui. # NB: libfontconfig-dev is required by servo-fontconfig-sys, which is in the dependency chain for egui. -# NB: pkg-config and libssl are for container TLS; we may switch to rustls in the future. RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y \ build-essential \ @@ -24,7 +19,6 @@ RUN apt-get update \ curl \ fontconfig \ libfontconfig1-dev \ - libssl-dev \ pkg-config # NB: Fix for fontconfig (servo-fontconfig-sys): https://github.com/alacritty/alacritty/issues/4423#issuecomment-727277235 @@ -135,31 +129,7 @@ RUN SQLX_OFFLINE=true \ LD_LIBRARY_PATH=/usr/lib:${LD_LIBRARY_PATH} \ $HOME/.cargo/bin/cargo build \ --release \ - --bin w2l-download-job - -RUN SQLX_OFFLINE=true \ - LD_LIBRARY_PATH=/usr/lib:${LD_LIBRARY_PATH} \ - $HOME/.cargo/bin/cargo build \ - --release \ - --bin tts-inference-job - -RUN SQLX_OFFLINE=true \ - LD_LIBRARY_PATH=/usr/lib:${LD_LIBRARY_PATH} \ - $HOME/.cargo/bin/cargo build \ - --release \ - --bin w2l-inference-job - -RUN SQLX_OFFLINE=true \ - LD_LIBRARY_PATH=/usr/lib:${LD_LIBRARY_PATH} \ - $HOME/.cargo/bin/cargo build \ - --release \ - --bin websocket-gateway - -RUN SQLX_OFFLINE=true \ - LD_LIBRARY_PATH=/usr/lib:${LD_LIBRARY_PATH} \ - $HOME/.cargo/bin/cargo build \ - --release \ - --bin twitch-pubsub-subscriber + --bin tts-inference-job \ # Print a report on disk space RUN echo "Disk usage at current directory (after all builds):" @@ -196,17 +166,6 @@ COPY --from=builder /tmp/target/release/email-sender-job / # Legacy apps: COPY --from=builder /tmp/target/release/tts-download-job / COPY --from=builder /tmp/target/release/tts-inference-job / -COPY --from=builder /tmp/target/release/w2l-download-job / -COPY --from=builder /tmp/target/release/w2l-inference-job / -COPY --from=builder /tmp/target/release/websocket-gateway / -COPY --from=builder /tmp/target/release/twitch-pubsub-subscriber / - -# SSL certs are required for crypto -COPY --from=builder /etc/ssl /etc/ssl - -# Required dynamically linked libraries -COPY --from=builder /usr/lib/x86_64-linux-gnu/libssl.* /lib/x86_64-linux-gnu/ -COPY --from=builder /usr/lib/x86_64-linux-gnu/libcrypto.* /lib/x86_64-linux-gnu/ # Container includes COPY includes/ /includes diff --git a/service_gpu.Dockerfile b/service_gpu.Dockerfile index 97d7a14b99..ef174a34af 100644 --- a/service_gpu.Dockerfile +++ b/service_gpu.Dockerfile @@ -2,10 +2,6 @@ # =============== (1) set up core rust build image =============== # ================================================================ -# Custom base image -# Make sure to add this repository so it has read acces to the base image: -# https://github.com/orgs/storytold/packages/container/docker-base-images-rust-ssl/settings/actions_access -# FROM ghcr.io/storytold/docker-base-images-rust-ssl:d94ce4350c3b as rust-build FROM ubuntu:jammy as rust-base # NB: This can be "stable" or another version. @@ -16,7 +12,6 @@ WORKDIR /tmp # NB: cmake is required for freetype-sys-0.13.1, which in turn has only been added for egui. # NB: fontconfig is required by servo-fontconfig-sys, which is in the dependency chain for egui. # NB: libfontconfig-dev is required by servo-fontconfig-sys, which is in the dependency chain for egui. -# NB: pkg-config and libssl are for container TLS; we may switch to rustls in the future. RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y \ build-essential \ @@ -24,7 +19,6 @@ RUN apt-get update \ curl \ fontconfig \ libfontconfig1-dev \ - libssl-dev \ pkg-config # NB: Fix for fontconfig (servo-fontconfig-sys): https://github.com/alacritty/alacritty/issues/4423#issuecomment-727277235 @@ -153,13 +147,6 @@ COPY --from=builder /tmp/target/release/dummy-service / COPY --from=builder /tmp/target/release/download-job / COPY --from=builder /tmp/target/release/inference-job / -# SSL certs are required for crypto -COPY --from=builder /etc/ssl /etc/ssl - -# Required dynamically linked libraries -COPY --from=builder /usr/lib/x86_64-linux-gnu/libssl.* /lib/x86_64-linux-gnu/ -COPY --from=builder /usr/lib/x86_64-linux-gnu/libcrypto.* /lib/x86_64-linux-gnu/ - # Container includes COPY includes/ /includes @@ -216,6 +203,6 @@ RUN apt-get clean autoclean && apt-get autoremove -y && rm -rf /var/lib/{apt,dp # NB(bt,2023-05-28): Python logging may be slowing down in k8s # See: https://github.com/kubernetes-client/python/issues/1867 COPY includes/container_includes/python_overrides/logger/__init__.py /usr/lib/python3.10/logging/__init__.py -COPY includes/container_includes/python_overrides/logger/__init__.py /usr/lib/python3.8/logging/__init__.py +# COPY includes/container_includes/python_overrides/logger/__init__.py /usr/lib/python3.8/logging/__init__.py EXPOSE 8080