-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Functional TrainingWorkload for submitting to RCP - with hardcoded va…
…lues
- Loading branch information
Showing
8 changed files
with
191 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
use kube::CustomResource; | ||
use schemars::JsonSchema; | ||
use serde::{Deserialize, Serialize}; | ||
use serde_json::Value; | ||
|
||
#[derive(CustomResource, Debug, Serialize, Deserialize, Clone, JsonSchema)] | ||
#[kube( | ||
group = "run.ai", | ||
version = "v2alpha1", | ||
kind = "TrainingWorkload", | ||
namespaced | ||
)] | ||
pub struct TrainingWorkloadSpec { | ||
pub allow_privilege_escalation: Option<ValueField<bool>>, | ||
pub environment: Environment, | ||
pub gpu: ValueField<String>, // Using ValueField to match `value` structure | ||
pub image: ValueField<String>, | ||
#[serde(rename = "imagePullPolicy")] | ||
pub image_pull_policy: ValueField<String>, | ||
pub name: ValueField<String>, | ||
pub run_as_gid: Option<ValueField<u32>>, | ||
pub run_as_uid: Option<ValueField<u32>>, | ||
pub run_as_user: Option<ValueField<bool>>, | ||
pub service_type: Option<ValueField<String>>, | ||
pub usage: Option<String>, | ||
} | ||
|
||
#[derive(Debug, Serialize, Deserialize, JsonSchema, Clone)] | ||
pub struct Environment { | ||
pub items: EnvironmentItems, | ||
} | ||
|
||
#[derive(Debug, Serialize, Deserialize, JsonSchema, Clone)] | ||
pub struct EnvironmentItems { | ||
pub input_object_ids: ValueField<String>, | ||
pub s3_access_key: ValueField<String>, | ||
pub s3_bucket_id: ValueField<String>, | ||
pub s3_prefix: ValueField<String>, | ||
pub s3_secret_key: ValueField<String>, | ||
pub s3_url: ValueField<String>, | ||
pub submission_id: ValueField<String>, | ||
pub base_image: ValueField<String>, | ||
} | ||
|
||
#[derive(Debug, Serialize, Deserialize, JsonSchema, Clone)] | ||
pub struct ValueField<T> { | ||
pub value: T, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pub mod crd; | ||
pub mod models; | ||
pub mod services; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters