W
Windmillโ€ข12mo ago
Trevor Sullivan

Deploy Windmill worker on Windows platform

Is it possible to run the Windmill worker on the Windows platform as a native binary? I would like to run automation scripts against Hyper-V, using the PowerShell module. However, the Hyper-V module will only run on the Windows platform, not on Linux or MacOS. It would be nice to register the Windmill worker as a service, either using the Windows service manager, or by running it under Task Scheduler.
6 Replies
rubenf
rubenfโ€ข12mo ago
It can definitely be done, you just need to compile the binary from sources cargo build might be all you need once I start doing powershell (which I can probably do by next week) we could iterate with you on how to package this best for your use-case it's not a lot of work to add binaries target to our CI
Trevor Sullivan
Trevor Sullivanโ€ข12mo ago
I'll give cargo build a try. I'm trying to learn Rust anyway I would recommend to distribute the pre-compiled Windmill worker on Windows using the Scoop package manager. It's a command line package manager similar to Homebrew on MacOS or apt on Linux. I use it to install all my dev tools. https://scoop.sh/ https://github.com/ScoopInstaller/Scoop
rubenf
rubenfโ€ข12mo ago
๐Ÿ‘
Trevor Sullivan
Trevor Sullivanโ€ข12mo ago
Trying to get Windmill worker compiled and running on Windows: 1. Created Windows 11 VM on Hyper-V 1. Installed Scoop package manager 1. Install rustup with scoop install rustup 1. Install Microsoft C++ Build Tools 1. PowerShell: mkdir \git; cd \git 1. git clone https://github.com/windmill-labs/windmill/ 1. cd .\windmill\backend\windmill-worker\ 1. cargo build Build errors: see attached
Trevor Sullivan
Trevor Sullivanโ€ข12mo ago
error: error communicating with database: No such host is known. (os error 11001)
--> windmill-common\src\jobs.rs:197:8
|
197 | Ok(sqlx::query_scalar!(
| ________^
198 | | "select tag from script where hash = $1 AND workspace_id = $2",
199 | | script_hash.0,
200 | | w_id
201 | | )
| |_____^
|
= note: this error originates in the macro `$crate::sqlx_macros::expand_query` which comes from the expansion of the macro `sqlx::query_scalar` (in Nightly builds, run with -Z macro-backtrace for more info)
error: error communicating with database: No such host is known. (os error 11001)
--> windmill-common\src\jobs.rs:197:8
|
197 | Ok(sqlx::query_scalar!(
| ________^
198 | | "select tag from script where hash = $1 AND workspace_id = $2",
199 | | script_hash.0,
200 | | w_id
201 | | )
| |_____^
|
= note: this error originates in the macro `$crate::sqlx_macros::expand_query` which comes from the expansion of the macro `sqlx::query_scalar` (in Nightly builds, run with -Z macro-backtrace for more info)
Compiling data-url v0.2.0
error: error communicating with database: No such host is known. (os error 11001)
--> windmill-common\src\utils.rs:58:8
|
58 | Ok(sqlx::query_scalar!("SELECT now()")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in the macro `$crate::sqlx_macros::expand_query` which comes from the expansion of the macro `sqlx::query_scalar` (in Nightly builds, run with -Z macro-backtrace for more info)
Compiling data-url v0.2.0
error: error communicating with database: No such host is known. (os error 11001)
--> windmill-common\src\utils.rs:58:8
|
58 | Ok(sqlx::query_scalar!("SELECT now()")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in the macro `$crate::sqlx_macros::expand_query` which comes from the expansion of the macro `sqlx::query_scalar` (in Nightly builds, run with -Z macro-backtrace for more info)
error: error communicating with database: No such host is known. (os error 11001)
--> windmill-common\src/lib.rs:163:15
|
163 | let r_o = sqlx::query!(
| _______________^
164 | | "select hash, tag from script where path = $1 AND workspace_id = $2 AND
165 | | created_at = (SELECT max(created_at) FROM script WHERE path = $1 AND workspace_id = $2 AND
166 | | deleted = false AND archived = false AND lock IS not NULL AND lock_error_logs IS NULL)",
167 | | script_path,
168 | | w_id
169 | | )
| |_____^
|
= note: this error originates in the macro `$crate::sqlx_macros::expand_query` which comes from the expansion of the macro `sqlx::query` (in Nightly builds, run with -Z macro-backtrace for more info)
error: error communicating with database: No such host is known. (os error 11001)
--> windmill-common\src/lib.rs:163:15
|
163 | let r_o = sqlx::query!(
| _______________^
164 | | "select hash, tag from script where path = $1 AND workspace_id = $2 AND
165 | | created_at = (SELECT max(created_at) FROM script WHERE path = $1 AND workspace_id = $2 AND
166 | | deleted = false AND archived = false AND lock IS not NULL AND lock_error_logs IS NULL)",
167 | | script_path,
168 | | w_id
169 | | )
| |_____^
|
= note: this error originates in the macro `$crate::sqlx_macros::expand_query` which comes from the expansion of the macro `sqlx::query` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0432]: unresolved import `tokio::signal::unix`
--> windmill-common\src/lib.rs:55:24
|
55 | use tokio::signal::unix::SignalKind;
| ^^^^ could not find `unix` in `signal`

error[E0432]: unresolved import `hyper`
--> windmill-common\src\error.rs:17:5
|
17 | use hyper::StatusCode;
| ^^^^^ use of undeclared crate or module `hyper`
error[E0432]: unresolved import `tokio::signal::unix`
--> windmill-common\src/lib.rs:55:24
|
55 | use tokio::signal::unix::SignalKind;
| ^^^^ could not find `unix` in `signal`

error[E0432]: unresolved import `hyper`
--> windmill-common\src\error.rs:17:5
|
17 | use hyper::StatusCode;
| ^^^^^ use of undeclared crate or module `hyper`
Trevor Sullivan
Trevor Sullivanโ€ข12mo ago
Filed bug here for indexing on search engines: https://github.com/windmill-labs/windmill/issues/1836
GitHub
bug: Error while compiling Windmill worker on Windows platform ยท Is...
Describe the bug When I try to compile the Windmill worker on the Windows 11 platform, I am receiving an error. Compiling gosyn v0.2.3 Compiling deno_media_type v0.1.0 error: error communicating wi...