Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Refactoring log upload #3087

Merged
merged 21 commits into from
May 16, 2023
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
154 changes: 150 additions & 4 deletions src/agent/Cargo.lock

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

9 changes: 9 additions & 0 deletions src/agent/onefuzz-agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ onefuzz-telemetry = { path = "../onefuzz-telemetry" }
backtrace = "0.3"
ipc-channel = { git = "https://github.com/servo/ipc-channel", rev = "7f432aa" }
dynamic-library = { path = "../dynamic-library" }
azure_core = { version = "0.11", default-features = false, features = [
"enable_reqwest",
] }
azure_storage = { version = "0.11", default-features = false, features = [
"enable_reqwest",
] }
azure_storage_blobs = { version = "0.11", default-features = false, features = [
"enable_reqwest",
] }


[target.'cfg(target_family = "unix")'.dependencies]
Expand Down
3 changes: 2 additions & 1 deletion src/agent/onefuzz-agent/src/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ impl Agent {
.await?;
Ok(Self {
previous_state: previous,
scheduler: Some(state.run().await?.into()),

scheduler: Some(state.run(self.machine_id).await?.into()),
..self
})
}
Expand Down
4 changes: 2 additions & 2 deletions src/agent/onefuzz-agent/src/agent/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl Fixture {
pub fn agent(&self) -> Agent {
let coordinator = Box::<CoordinatorDouble>::default();
let reboot = Box::<RebootDouble>::default();
let scheduler = Scheduler::new();
let scheduler = Scheduler::new(None);
let setup_runner = Box::<SetupRunnerDouble>::default();
let work_queue = Box::<WorkQueueDouble>::default();
let worker_runner = Box::<WorkerRunnerDouble>::default();
Expand Down Expand Up @@ -72,7 +72,7 @@ impl Fixture {
}

pub fn work_unit(&self) -> WorkUnit {
let config = r#"{ "hello": "world" }"#.to_owned().into();
let config = r#"{ "hello": "world", "task_id" : "ed1eeec9-2f39-442d-9e70-563454b866c0", "instance_id": "5220ff9b-2ab2-4cf8-b9ad-b948c3b94f08" }"#.to_owned().into();

WorkUnit {
job_id: self.job_id(),
Expand Down
3 changes: 2 additions & 1 deletion src/agent/onefuzz-agent/src/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,9 @@ async fn run_worker(mut work_set: WorkSet) -> Result<Vec<WorkerEvent>> {
let work_unit = work_set.work_units.pop().unwrap();
let setup_dir = work_set.setup_dir()?;
let extra_dir = work_set.extra_dir()?;
let work_dir = work_unit.working_dir(setup_runner.machine_id)?;

let mut worker = Worker::new(&setup_dir, extra_dir, work_unit);
let mut worker = Worker::new(work_dir, &setup_dir, extra_dir, work_unit);
while !worker.is_done() {
worker = worker
.update(
Expand Down
Loading