Skip to content

Refactor ee file structure #5828

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
agent_workers_oss proxy file
  • Loading branch information
diegoimbert committed May 28, 2025
commit ee1c7c300c55e57e001f205e3cd9b1647ad42540
31 changes: 31 additions & 0 deletions backend/windmill-api/src/agent_workers_oss.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Author: Ruben Fiszel
* Copyright: Windmill Labs, Inc 2042
* This file and its contents are licensed under the AGPLv3 License.
* Please see the included NOTICE for copyright information and
* LICENSE-AGPL for a copy of the license.
*/

use crate::db::DB;

use axum::Router;

use serde::{Deserialize, Serialize};

pub fn global_service() -> Router {
crate::agent_workers_ee::global_service()
}

pub fn workspaced_service(
db: DB,
_base_internal_url: String,
) -> (
Router,
Vec<tokio::task::JoinHandle<()>>,
Option<windmill_worker::JobCompletedSender>,
) {
crate::agent_workers_ee::workspaced_service(db, _base_internal_url)
}

pub use crate::agent_workers_ee::AgentAuth;
pub use crate::agent_workers_ee::AgentCache;
8 changes: 5 additions & 3 deletions backend/windmill-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use crate::{
};

#[cfg(feature = "agent_worker_server")]
use agent_workers_ee::AgentCache;
use agent_workers_oss::AgentCache;

use anyhow::Context;
use argon2::Argon2;
Expand Down Expand Up @@ -63,6 +63,8 @@ use windmill_common::error::AppError;

#[cfg(feature = "agent_worker_server")]
mod agent_workers_ee;
#[cfg(feature = "agent_worker_server")]
mod agent_workers_oss;
mod ai;
mod apps;
pub mod args;
Expand Down Expand Up @@ -497,7 +499,7 @@ pub async fn run_server(
#[cfg(feature = "agent_worker_server")]
let (agent_workers_router, agent_workers_bg_processor, agent_workers_killpill_tx) =
if server_mode {
agent_workers_ee::workspaced_service(db.clone(), _base_internal_url.clone())
agent_workers_oss::workspaced_service(db.clone(), _base_internal_url.clone())
} else {
(Router::new(), vec![], None)
};
Expand Down Expand Up @@ -621,7 +623,7 @@ pub async fn run_server(
.nest("/agent_workers", {
#[cfg(feature = "agent_worker_server")]
{
agent_workers_ee::global_service().layer(Extension(agent_cache.clone()))
agent_workers_oss::global_service().layer(Extension(agent_cache.clone()))
}
#[cfg(not(feature = "agent_worker_server"))]
{
Expand Down
Loading