Compare commits

..

No commits in common. "c0b1f5989ff4317b16b1ac660ddfc79add3f17cc" and "522d12929b0a27488eff22ecf1be0013643625bd" have entirely different histories.

6 changed files with 1 additions and 24 deletions

11
Cargo.lock generated
View file

@ -564,7 +564,6 @@ dependencies = [
"thiserror", "thiserror",
"tokio", "tokio",
"toml", "toml",
"users",
"uuid", "uuid",
] ]
@ -1778,16 +1777,6 @@ dependencies = [
"percent-encoding", "percent-encoding",
] ]
[[package]]
name = "users"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24cc0f6d6f267b73e5a2cadf007ba8f9bc39c6a6f9666f8cf25ea809a153b032"
dependencies = [
"libc",
"log",
]
[[package]] [[package]]
name = "utf16_iter" name = "utf16_iter"
version = "1.0.5" version = "1.0.5"

View file

@ -17,5 +17,4 @@ sqlx = { version = "0.8.3", features = ["postgres", "runtime-tokio"] }
thiserror = "2.0.11" thiserror = "2.0.11"
tokio = { version = "1.43.0", features = ["full"] } tokio = { version = "1.43.0", features = ["full"] }
toml = "0.8.19" toml = "0.8.19"
users = "0.11.0"
uuid = { version = "1.11.0", features = ["v7", "fast-rng"] } uuid = { version = "1.11.0", features = ["v7", "fast-rng"] }

View file

@ -39,8 +39,6 @@ Once you've created your config, just run gregory with `gregory run` - that's it
- Add multithreading - Add multithreading
- Add hook system - Add hook system
- Fix dependencies/running jobs
- update docs with uid
## Other stuff ## Other stuff

View file

@ -12,8 +12,7 @@ max-threads = 10
revision = "2" revision = "2"
threads = 6 threads = 6
image = "docker.io/library/debian" image = "docker.io/library/debian"
commands = ["echo hi", "sleep 2.432", "whoami"] commands = ["echo hi", "sleep 2.432", "echo helloooooooooo"]
uid = 1000
volumes = ["librewolf"] volumes = ["librewolf"]
[packages.librewolf.packaging.fedora] [packages.librewolf.packaging.fedora]

View file

@ -4,7 +4,6 @@ use crate::errors::Error;
use serde::Deserialize; use serde::Deserialize;
use std::time; use std::time;
use std::{collections::HashMap, fs, thread}; use std::{collections::HashMap, fs, thread};
use users::get_current_uid;
/// The config for gregory /// The config for gregory
#[derive(Debug, Clone, Deserialize)] #[derive(Debug, Clone, Deserialize)]
@ -75,8 +74,6 @@ pub(crate) struct Job {
pub(crate) privileged: bool, pub(crate) privileged: bool,
#[serde(default = "shell")] #[serde(default = "shell")]
pub(crate) shell: String, pub(crate) shell: String,
#[serde(default = "uid")]
pub(crate) uid: u64,
} }
/// Holds the data for a certain package's config /// Holds the data for a certain package's config
@ -174,7 +171,3 @@ pub(crate) fn data() -> String {
pub(crate) fn dependencies() -> Vec<String> { pub(crate) fn dependencies() -> Vec<String> {
return Vec::new(); return Vec::new();
} }
pub(crate) fn uid() -> u64 {
return get_current_uid() as u64;
}

View file

@ -180,7 +180,6 @@ fn run_job(conf: &Config, job_id: String, job: Job) -> JobExitStatus {
let mut cmd_args: Vec<String> = vec![ let mut cmd_args: Vec<String> = vec![
"run".to_string(), "run".to_string(),
"--rm".to_string(), "--rm".to_string(),
format!("--user={}", job.uid),
format!("--name={job_id}-{run_id}"), format!("--name={job_id}-{run_id}"),
format!("--cpus={threads}"), format!("--cpus={threads}"),
format!("--privileged={}", job.privileged), format!("--privileged={}", job.privileged),