Skip to content

Commit 278ab4b

Browse files
committed
remove rust embed in dev mode
1 parent 34392ef commit 278ab4b

File tree

10 files changed

+29
-18
lines changed

10 files changed

+29
-18
lines changed

.github/workflows/build-publish-rh-image.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
platforms: linux/amd64
6565
push: true
6666
build-args: |
67-
features=enterprise,enterprise_saml,stripe,embedding,parquet,prometheus,openidconnect,cloud,jemalloc,deno_core,license,http_trigger,zip,oauth2,kafka,php,mysql,mssql,bigquery,websocket,python,smtp,csharp,rust
67+
features=enterprise,enterprise_saml,stripe,embedding,parquet,prometheus,openidconnect,cloud,jemalloc,deno_core,license,http_trigger,zip,oauth2,kafka,php,mysql,mssql,bigquery,websocket,python,smtp,csharp,static_frontend,rust
6868
secrets: |
6969
rh_username=${{ secrets.RH_USERNAME }}
7070
rh_password=${{ secrets.RH_PASSWORD }}
@@ -81,7 +81,7 @@ jobs:
8181
platforms: linux/arm64
8282
push: true
8383
build-args: |
84-
features=enterprise,enterprise_saml,stripe,embedding,parquet,prometheus,openidconnect,cloud,jemalloc,deno_core,license,http_trigger,zip,oauth2,kafka,php,mysql,mssql,bigquery,websocket,python,smtp,csharp,rust
84+
features=enterprise,enterprise_saml,stripe,embedding,parquet,prometheus,openidconnect,cloud,jemalloc,deno_core,license,http_trigger,zip,oauth2,kafka,php,mysql,mssql,bigquery,websocket,python,smtp,csharp,static_frontend,rust
8585
secrets: |
8686
rh_username=${{ secrets.RH_USERNAME }}
8787
rh_password=${{ secrets.RH_PASSWORD }}

.github/workflows/build-staging-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
platforms: linux/amd64,linux/arm64
6363
push: true
6464
build-args: |
65-
features=enterprise,enterprise_saml,stripe,embedding,parquet,prometheus,openidconnect,cloud,jemalloc,deno_core,license,http_trigger,zip,oauth2,kafka,php,mysql,mssql,bigquery,websocket,python,smtp,csharp,rust
65+
features=enterprise,enterprise_saml,stripe,embedding,parquet,prometheus,openidconnect,cloud,jemalloc,deno_core,license,http_trigger,zip,oauth2,kafka,php,mysql,mssql,bigquery,websocket,python,smtp,csharp,static_frontend,rust
6666
tags: |
6767
${{ steps.meta-ee-public.outputs.tags }}
6868
labels: |

.github/workflows/build_windows_worker_.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
$env:OPENSSL_DIR="${Env:VCPKG_INSTALLATION_ROOT}\installed\x64-windows-static"
4646
mkdir frontend/build && cd backend
4747
New-Item -Path . -Name "windmill-api/openapi-deref.yaml" -ItemType "File" -Force
48-
cargo build --release --features=enterprise,stripe,embedding,parquet,prometheus,openidconnect,cloud,jemalloc,tantivy,deno_core,license,http_trigger,zip,oauth2,kafka,php,mysql,mssql,bigquery,websocket,python,smtp,csharp,rust
48+
cargo build --release --features=enterprise,stripe,embedding,parquet,prometheus,openidconnect,cloud,jemalloc,tantivy,deno_core,license,http_trigger,zip,oauth2,kafka,php,mysql,mssql,bigquery,websocket,python,smtp,csharp,static_frontend,rust
4949
5050
- name: Rename binary with corresponding architecture
5151
run: |

.github/workflows/docker-image-rpi4.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
platforms: linux/amd64,linux/arm64
6868
push: true
6969
build-args: |
70-
features=embedding,parquet,openidconnect,deno_core,license,http_trigger,zip,oauth2,php,mysql,mssql,bigquery,websocket,python,smtp,csharp,rust
70+
features=embedding,parquet,openidconnect,deno_core,license,http_trigger,zip,oauth2,php,mysql,mssql,bigquery,websocket,python,smtp,csharp,static_frontend,rust
7171
tags: |
7272
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:dev
7373
${{ steps.meta-public.outputs.tags }}

.github/workflows/docker-image.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
platforms: linux/amd64,linux/arm64
8282
push: true
8383
build-args: |
84-
features=embedding,parquet,openidconnect,jemalloc,deno_core,license,http_trigger,zip,oauth2,dind,php,mysql,mssql,bigquery,websocket,python,smtp,csharp,rust
84+
features=embedding,parquet,openidconnect,jemalloc,deno_core,license,http_trigger,zip,oauth2,dind,php,mysql,mssql,bigquery,websocket,python,smtp,csharp,static_frontend,rust
8585
tags: |
8686
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.DEV_SHA }}
8787
${{ steps.meta-public.outputs.tags }}
@@ -147,7 +147,7 @@ jobs:
147147
platforms: linux/amd64,linux/arm64
148148
push: true
149149
build-args: |
150-
features=enterprise,enterprise_saml,stripe,embedding,parquet,prometheus,openidconnect,cloud,jemalloc,tantivy,deno_core,license,http_trigger,zip,oauth2,kafka,otel,dind,php,mysql,mssql,bigquery,websocket,python,smtp,csharp,rust
150+
features=enterprise,enterprise_saml,stripe,embedding,parquet,prometheus,openidconnect,cloud,jemalloc,tantivy,deno_core,license,http_trigger,zip,oauth2,kafka,otel,dind,php,mysql,mssql,bigquery,websocket,python,smtp,csharp,static_frontend,rust
151151
tags: |
152152
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee:${{ env.DEV_SHA }}
153153
${{ steps.meta-ee-public.outputs.tags }}
@@ -209,7 +209,7 @@ jobs:
209209
platforms: linux/amd64
210210
push: true
211211
build-args: |
212-
features=enterprise,enterprise_saml,stripe,embedding,parquet,prometheus,openidconnect,cloud,jemalloc,tantivy,deno_core,license,http_trigger,zip,oauth2,kafka,otel,dind,php,mysql,mssql,bigquery,websocket,python,smtp,csharp,rust
212+
features=enterprise,enterprise_saml,stripe,embedding,parquet,prometheus,openidconnect,cloud,jemalloc,tantivy,deno_core,license,http_trigger,zip,oauth2,kafka,otel,dind,php,mysql,mssql,bigquery,websocket,python,smtp,csharp,static_frontend,rust
213213
PYTHON_IMAGE=python:3.12.2-slim-bookworm
214214
tags: |
215215
${{ steps.meta-ee-public-py312.outputs.tags }}

.github/workflows/publish_windows_worker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
$env:OPENSSL_DIR="${Env:VCPKG_INSTALLATION_ROOT}\installed\x64-windows-static"
4848
mkdir frontend/build && cd backend
4949
New-Item -Path . -Name "windmill-api/openapi-deref.yaml" -ItemType "File" -Force
50-
cargo build --release --features=enterprise,stripe,embedding,parquet,prometheus,openidconnect,cloud,jemalloc,tantivy,deno_core,license,http_trigger,zip,oauth2,kafka,php,mysql,mssql,bigquery,websocket,python,smtp,csharp,rust
50+
cargo build --release --features=enterprise,stripe,embedding,parquet,prometheus,openidconnect,cloud,jemalloc,tantivy,deno_core,license,http_trigger,zip,oauth2,kafka,php,mysql,mssql,bigquery,websocket,python,smtp,csharp,static_frontend,rust
5151
5252
- name: Rename binary with corresponding architecture
5353
run: |

backend/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ license = ["windmill-api/license"]
7878
oauth2 = ["windmill-api/oauth2"]
7979
http_trigger = ["windmill-api/http_trigger"]
8080
zip = ["windmill-api/zip"]
81+
static_frontend = ["windmill-api/static_frontend"]
8182

8283

8384
[dependencies]

backend/windmill-api/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ license = ["dep:rsa"]
2626
zip = ["dep:async_zip"]
2727
oauth2 = ["dep:async-oauth2"]
2828
http_trigger = ["dep:matchit"]
29+
static_frontend = ["dep:rust-embed", "dep:mime_guess"]
2930

3031
[dependencies]
3132
windmill-queue.workspace = true
@@ -60,8 +61,8 @@ base64.workspace = true
6061
base32.workspace = true
6162
serde_urlencoded.workspace = true
6263
cron.workspace = true
63-
mime_guess.workspace = true
64-
rust-embed.workspace = true
64+
mime_guess = { workspace = true, optional = true }
65+
rust-embed = { workspace = true, optional = true }
6566
tracing-subscriber.workspace = true
6667
quick_cache.workspace = true
6768
rand.workspace = true

backend/windmill-api/src/http_triggers.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
use crate::job_helpers_ee::get_workspace_s3_resource;
33
use crate::{
44
args::WebhookArgs,
5+
auth::{AuthCache, OptTokened},
56
db::{ApiAuthed, DB},
67
jobs::{
78
run_flow_by_path_inner, run_script_by_path_inner, run_wait_result_flow_by_path_internal,
89
run_wait_result_script_by_path_internal, RunJobQuery,
910
},
10-
users::{fetch_api_authed, AuthCache, OptTokened},
11+
users::fetch_api_authed,
1112
};
1213
use axum::{
1314
extract::{Path, Query},

backend/windmill-api/src/static_assets.rs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,23 @@
66
* LICENSE-AGPL for a copy of the license.
77
*/
88

9-
use axum::{
10-
body::Body,
11-
extract::OriginalUri,
12-
http::{header, Response},
13-
response::IntoResponse,
14-
};
9+
use axum::{body::Body, extract::OriginalUri, http::Response, response::IntoResponse};
10+
11+
#[cfg(feature = "static_frontend")]
12+
use axum::http::header;
1513

1614
use hyper::Uri;
15+
#[cfg(feature = "static_frontend")]
1716
use mime_guess::mime;
17+
#[cfg(feature = "static_frontend")]
1818
use rust_embed::RustEmbed;
1919

2020
// static_handler is a handler that serves static files from the
2121
pub async fn static_handler(OriginalUri(original_uri): OriginalUri) -> StaticFile {
2222
StaticFile(original_uri)
2323
}
2424

25+
#[cfg(feature = "static_frontend")]
2526
#[derive(RustEmbed)]
2627
#[folder = "${FRONTEND_BUILD_DIR:-../../frontend/build/}"]
2728
struct Asset;
@@ -34,13 +35,15 @@ impl IntoResponse for StaticFile {
3435
}
3536
}
3637

38+
#[cfg(feature = "static_frontend")]
3739
const TWO_HUNDRED: &str = "200.html";
3840

3941
fn serve_path(path: &str) -> Response<Body> {
4042
if path.starts_with("api/") {
4143
return Response::builder().status(404).body(Body::empty()).unwrap();
4244
}
4345

46+
#[cfg(feature = "static_frontend")]
4447
match Asset::get(path) {
4548
Some(content) => {
4649
let body = Body::from(content.data);
@@ -68,4 +71,9 @@ fn serve_path(path: &str) -> Response<Body> {
6871
}
6972
None => serve_path(TWO_HUNDRED),
7073
}
74+
75+
#[cfg(not(feature = "static_frontend"))]
76+
{
77+
Response::builder().status(404).body(Body::empty()).unwrap()
78+
}
7179
}

0 commit comments

Comments
 (0)