Skip to content
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
24 changes: 12 additions & 12 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ resolver = "2"

[workspace.package]
edition = "2021"
version = "0.3.72"
version = "0.3.73"
description = "Tower is the best way to host Python data apps in production"
# Matches rust-toolchain.toml. The two had drifted: the toolchain has been 1.88
# for a while, and the dependency tree (testcontainers and its transitive deps,
Expand Down
10 changes: 6 additions & 4 deletions crates/tower-cmd/src/catalogs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1854,8 +1854,10 @@ mod tests {

#[test]
fn catalog_help_marks_storage_beta_in_short_and_long_help() {
let short_help = catalogs_cmd().render_help().to_string();
let long_help = catalogs_cmd().render_long_help().to_string();
// term_width(0) turns off help wrapping, which otherwise follows the
// width of the terminal the tests run in.
let short_help = catalogs_cmd().term_width(0).render_help().to_string();
let long_help = catalogs_cmd().term_width(0).render_long_help().to_string();

for help in [short_help, long_help] {
assert!(help.contains("includes Storage [beta]"));
Expand All @@ -1865,7 +1867,7 @@ mod tests {

#[test]
fn storage_specific_command_and_flag_are_marked_beta() {
let mut command = catalogs_cmd();
let mut command = catalogs_cmd().mut_subcommand("credentials", |c| c.term_width(0));
let credentials_help = command
.find_subcommand_mut("credentials")
.expect("credentials command should exist")
Expand All @@ -1874,7 +1876,7 @@ mod tests {
assert!(credentials_help
.contains("Vend short-lived catalog credentials for external tools [beta]"));

let mut command = catalogs_cmd();
let mut command = catalogs_cmd().mut_subcommand("list", |c| c.term_width(0));
let list_help = command
.find_subcommand_mut("list")
.expect("list command should exist")
Expand Down
4 changes: 3 additions & 1 deletion crates/tower-cmd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,9 @@ mod tests {

#[test]
fn root_help_scopes_beta_label_to_storage() {
let help = root_cmd().render_help().to_string();
// term_width(0) turns off help wrapping, which otherwise follows the
// width of the terminal the tests run in.
let help = root_cmd().term_width(0).render_help().to_string();

assert!(help.contains(
"Interact with the catalogs in your Tower account (includes Storage [beta])"
Expand Down
9 changes: 6 additions & 3 deletions crates/tower-cmd/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,12 @@ fn build_cli_execution_spec(
parameters: params,
env_vars,
resources: ResourceLimits {
cpu_millicores: None,
memory_mb: None,
storage_mb: None,
cpu_limit_millicores: None,
cpu_request_millicores: None,
memory_limit_mb: None,
memory_request_mb: None,
storage_limit_mb: None,
storage_request_mb: None,
max_pids: None,
gpu_count: 0,
timeout_seconds: 3600,
Expand Down
18 changes: 14 additions & 4 deletions crates/tower-runtime/src/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,27 @@ pub enum CacheBackend {
None,
}

/// ResourceLimits defines compute resource constraints
/// ResourceLimits defines compute resource requests and limits.
/// Missing values are resolved by the execution backend.
#[derive(Debug, Clone)]
pub struct ResourceLimits {
/// CPU limit in millicores (e.g., 1000 = 1 CPU)
pub cpu_millicores: Option<u32>,
pub cpu_limit_millicores: Option<u32>,

/// CPU request in millicores
pub cpu_request_millicores: Option<u32>,

/// Memory limit in megabytes
pub memory_mb: Option<u32>,
pub memory_limit_mb: Option<u32>,

/// Memory request in megabytes
pub memory_request_mb: Option<u32>,

/// Ephemeral storage limit in megabytes
pub storage_mb: Option<u32>,
pub storage_limit_mb: Option<u32>,

/// Ephemeral storage request in megabytes
pub storage_request_mb: Option<u32>,

/// Maximum number of processes
pub max_pids: Option<u32>,
Expand Down
9 changes: 6 additions & 3 deletions crates/tower-runtime/tests/subprocess_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,12 @@ async fn create_execution_spec(id: String, package: Package) -> ExecutionSpec {
command: None,
},
resources: ResourceLimits {
cpu_millicores: None,
memory_mb: None,
storage_mb: None,
cpu_limit_millicores: None,
cpu_request_millicores: None,
memory_limit_mb: None,
memory_request_mb: None,
storage_limit_mb: None,
storage_request_mb: None,
max_pids: None,
gpu_count: 0,
timeout_seconds: 300,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "maturin"

[project]
name = "tower"
version = "0.3.72"
version = "0.3.73"
description = "Tower CLI and runtime environment for Tower."
authors = [{ name = "Tower Computing GmbH", email = "brad@tower.dev" }]
readme = "README.md"
Expand Down
Loading
Loading