Commit Graph

123 Commits

Author SHA1 Message Date
Ruben Fiszel
45d434c875 prettify cache msg 2024-11-29 13:01:54 +01:00
Ruben Fiszel
b1603690f3 nit pip install 2024-11-29 12:37:52 +01:00
Ruben Fiszel
d36e2a2647 add total time 2024-11-29 12:35:10 +01:00
Ruben Fiszel
9db86306a9 small uv s3 pull fix 2024-11-29 12:31:50 +01:00
Ruben Fiszel
8954b0b68c skip s3 python cache on windows and pro 2024-11-29 08:35:08 +01:00
pyranota
96371bc89d feat: Parallelize uv install (#4774)
* Implement MVP of Parallel uv installation

* Implement PY_CONCURRENT_DOWNLOADS

* Remove Flock for uv installs

* Make S3 pull/push parallel

* Refactor and allow to Cancel installation

* Dont print S3 in output if disabled

* Implement better error handling

* Polishing

* More polishing

* Implement error-handler for kill_tx_2.send()

* Fix and Format prev merge

* Presubscribe to all kill_tx's

We do it now before first event could fire
Meaning no events can be lost anymore

* Early print errors and safer error handling

* Return Err if installation failed

* Final changes

* Return error instead of just printing it

* Safer the way to acquire permit

* Fix compilation error

* Remove double error logs
2024-11-29 08:21:51 +01:00
pyranota
a853c8d6a5 Remove flock (#4809) 2024-11-28 12:42:25 +01:00
pyranota
e876ae4f42 fix(python): Merge to site-packages packages with same name (#4793)
* (python) Initially implement merge

Iterate overall all python paths and if same folder has same name multiple times,
then merge the content and put to <job_dir>/site-packages

Solves problem with imports for some dependencies.

Default layout (/windmill/cache/):

dep==x.y.z
└── X
   └── A
dep-ext==x.y.z
└── X
   └── B

In this case python would be confused with finding B module.

This function will convert it to (/<job_id>):

site-packages
└── X
   ├── A
   └── B

This way python has no problems with finding correct module

* Better error-handling

* Optimize and fix bug

* Update backend/windmill-worker/src/python_executor.rs

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* Update backend/windmill-worker/src/python_executor.rs

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* Polish

* Add path to PathBuf

* Add & before PathBuf

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2024-11-26 18:24:26 +01:00
Ruben Fiszel
b868e446fc improve error messages on windows 2024-11-15 09:43:54 +01:00
Ruben Fiszel
029462bc57 nits logs 2024-11-15 01:15:51 +01:00
Ruben Fiszel
089826e5b5 delete venv folder if pip install didn't succeed 2024-11-15 01:11:17 +01:00
pyranota
f240d1322a feat: Handle pip install by uv (#4517)
* feat: Handle `pip install` by `uv`

Dirty and untested, but already something working

* Integrate with NSJAIL and prepare fallbacks

* Refactor fallback
no_uv disable compile and install
where no_uv_install and no_uv_compile are a bit more specific

* Remove `--disable-pip-version-check`
Reason:
   warning: pip's `--disable-pip-version-check` has no effect

* Fix backend compilation error

* Pip fallback overwrite UV's cache

* Initially refactor cache (No S3)

* Support S3

* Remove unused import

* Handle flags for NSJAIL

* Return deleted flag

* Update Dockerfile

* Update docker-image.yml

* Update docker-image.yml

* Add --link-mode=copy and remove -v

* Fix NSJAIL INDEX_URL

* Fix flock and windows

* Update python_executor.rs

* Remove line from Dockerfile

We dont need it and to trigger build

* fixing for windows

* Dont pin python to specific version

* Change TMP for windows

* Revert docker-image.yml

* Disable UV for ansible

Will be enabled later.
Needs proper testing and its better to split onto 2 PRs with first modifying python and second ansible

---------

Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
Co-authored-by: Alexander Petric <petric.al@gmail.com>
2024-11-15 00:12:56 +01:00
Ruben Fiszel
50861fccc0 fix: support multiple pip-extra-index-url with commas 2024-11-12 23:31:00 +01:00
Ruben Fiszel
e11cc13c92 fix: apply NO_PROXY and HTTP_PROXY, HTTPS_PROXY more consistently 2024-11-02 13:57:30 +01:00
pyranota
ef37928865 Add rollback for multipython (#4610) 2024-10-31 14:27:34 +01:00
pyranota
c3ba832444 Annotations refactor (#4512)
* Refactor annotation system

* Move tests to different location

* Limit annotations per line (15)

* Write initial benchmark

* Optimize

* More optimizations

* Rewrite with 3x speed!

* Remove benchmarks

They were in wrong place and for development

* Polishing

* Remove unused leftover

* Integrate new annotation system

* Add comment explanation

* Remove `hashe-based matching`

Turned to be it is impure and non-deterministic method

* Add `tracing::error` for `// native` without `deno_core`

If you build backend without `deno_core` feature flag, and add //native
annotation to ts script, it would just silently exit.

This commit prints error to logs

* add more tests

* Update annotations.rs

---------

Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
2024-10-17 09:14:31 +02:00
Ruben Fiszel
fac41fd700 fix: fix script persistence in url + add support for extra error args in python 2024-10-17 01:07:56 +02:00
Ruben Fiszel
7c0950d9da fix: fix uv path 2024-10-03 22:42:34 +02:00
pyranota
1e7a37ac8b feat: Replace pip-compile with uv (#4460)
* Update `shell.nix`

- Replace pip-compile with uv packages
- Pin rust version
- Add var to trigger windmill print more info in stdout

* Replace `pip-compile` with `uv` (dirty + untested)

* Fix arguments passed to uv

Some of the flags are included by default in UV and can be safely removed:
- --resolver=backtracking
- --no-emit-index-url

Also uv does not support `--pip-args` and suggests to directly pass args to uv.

* Remove extra `dbg!`

* Replace 'pip-compile' with 'uv' in Dockerfile

* Add fallback option to `pip-compile` (Disabled)

* Add `uv` to `docker/DockerfileSlim*`

* Add `get_annotation_python` and rename `get_annotation` to `get_annotation_ts`

* Add option to fallback to pip-compile

Put `# no_uv` on top the file for specific python script

Or set `USE_PIP_COMPILE` variable to `true`

* Put back `pip-tools` into shell.nix

* Make sure lockfile resolves again if `#no_uv` used

Add #no_uv to the end of requirements (requirements.in)
That way if something breaks for customer, then they put #no_uv and new lockfile will be resolved

* Put `pip install pip-tools` in original spot

* Fix compilation error

* Fix EE compilation error

error[E0658]: attributes on expressions are experimental
   --> windmill-worker/src/python_executor.rs:144:5
    |
144 |     #[cfg(feature = "enterprise")]
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information

* Add `no_cache` annotation

Will force recalculation of lockfile
And block uv from using cached values

* Target uv cache to /tmp/windmill/cache

* Prohibit uv from managing python

* Add uv to DockerfileBackendTests

* Pin uv version to 0.4.18 in Dockerfiles

* Dont put `#no_uv` in requirements.in

Instead postfix hash for requirements.in with `-no_uv`

* Push Warning to logs if fallbacked to pip-compile

---------

Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
2024-10-03 16:00:35 +02:00
Alexander Petric
6eb7f8ce81 feat(worker): support workers to run natively on windows (#4446)
* minimal code change to get windmill worker on windows for bun and python + rustfmt

* adding support for powershell

* compiling error on unix

* rust linting comments

* comments hugo: PSModulePath

* comments ruben, refactor to simplify

* adding build workflow

* editing workflow

* editing workflow

* editing workflow

* editing workflow

* editing workflow

* skip migration env, ee fixes

* improvements powershell

* testing windows runner

* testing windows runner

* testing windows runner

* testing windows runner

* testing windows runner

* install postgres on runner

* install postgres on runner

* install postgres on runner

* install postgres on runner

* install postgres on runner

* install postgres on runner

* install postgres on runner

* install postgres on runner

* killing process tree in windows

* sqlx_offline

* install openssl for github windows runner

* used pre-installed openssl

* used pre-installed openssl

* build ee

* build ee

* build ee

* build ee

* adding commented out steps for artifact publishing

* build on tag matchinv v* pattern

* ren instead of mv on Windows

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* fix merging issue

* gate imports for windows

* fixing default cargo home path...

* fixing default cargo home path...

* comments ruben

* make pwsh default modules loading more robust on unix (#4448)

Co-authored-by: Ruben Fiszel <ruben@windmill.dev>

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: HugoCasa <hugo@casademont.ch>
Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
2024-10-03 15:59:12 +02:00
Ruben Fiszel
bd6ddc166b feat(cli): add queues, workers and worker-groups commands (#4439)
* all

* all

* all

* all

* all

* all

* all

* all

* all

* all

* all

* all

* all

* all
2024-09-26 11:27:37 +02:00
HugoCasa
ae8f29a4cb feat: http routing (#4339)
* feat: http routing

* all

* feat: improve UI

* final stuff

* fix: sqlx

* fix: nit

* fix: nits

* fix: error handler display

* fix: routes panel perms

* all

* fix: improve ability to paste from macos in vscode extension

* fix lock-write for deno

* all

* cleaning

* fix

* cli preprocessor

* nits

* nits

---------

Co-authored-by: Ruben Fiszel <ruben@rubenfiszel.com>
2024-09-20 15:38:38 +02:00
Ruben Fiszel
e1223a6f24 fix: cache hub scripts in more cases + pre-cache hub scripts deps in deno 2024-08-27 02:30:54 +02:00
Ruben Fiszel
2b3e86e341 feat: add vim support for monaco/webeditor 2024-08-26 22:31:23 +02:00
Ruben Fiszel
211e80b69e fix: make result_json path stable for python executors 2024-07-23 17:39:40 +02:00
Ruben Fiszel
be25101377 fix: add WM_SCHEDULED_FOR to contextual variables and early stop of flows 2024-07-18 02:10:15 +02:00
Ruben Fiszel
2812792326 fix: memory optimization for flow with big args (#4019) 2024-07-04 10:08:42 +02:00
Ruben Fiszel
0ad858ee5c fix: improve support of relative paths in subflows and apps 2024-06-21 18:07:58 +02:00
Ruben Fiszel
c8915063c4 feat: track dependency map for bun + inline script of flows 2024-06-08 16:43:48 +02:00
Ruben Fiszel
157e4d8e53 improve bun dedicated worker to use nodejs 2024-05-01 02:10:58 +02:00
Ruben Fiszel
b5db06d742 add base_internal_url to dedicated python workers 2024-04-30 22:48:40 +02:00
Ruben Fiszel
1cac7bf239 more logs for dedicated workers 2024-04-30 17:19:34 +02:00
Ruben Fiszel
2cb1595cae fix(python): supports folders starting with numbers for execution 2024-04-30 11:23:48 +02:00
wendrul
c3325c2cbf Instrument logs (#3566)
* Add spans to show worker_name and job_id

Always show worker_name and job_id when relevant, by creating spans that
live as long as the worker and the job.

* Remove redundant worker names from fn run_worker

Remove the now redundant worker_name tracing, as the information now
lives at the span level

* Use span when spawning new thread

* Instrument more pertinent functions

Move spans to more pertinent functions. Remove more redundant info, and
change worker_name to just worker

* Change tracing subscriber to log path:line_no

Change from logging target (module name usually) to file path and line
number
2024-04-18 01:11:14 +02:00
Ruben Fiszel
d63f5ee26e fix: add support for azure storage on distributed cache/logs 2024-03-23 18:42:38 +01:00
HugoCasa
6b719fecea feat: add workspace environment vars (custom contextual vars) (#3455)
* feat: custom contextual variables

* chore: sqlx prepare

* fix: main merge
2024-03-23 11:40:55 +01:00
Ruben Fiszel
7714221f3e feat: large log disk and distributed storage compaction 2024-03-23 10:55:29 +01:00
Ruben Fiszel
f8d3ba12af generalize cache object store 2024-03-21 08:50:10 +01:00
Ruben Fiszel
d616735174 fix compile on non ee 2024-03-20 15:34:25 +01:00
Ruben Fiszel
7dafa3d62a fix compile on non ee 2024-03-20 15:09:28 +01:00
Ruben Fiszel
a0a42067fb feat: s3 cache config added to instance settings + parallelized tar pulling 2024-03-20 14:19:34 +01:00
Ruben Fiszel
ab18058405 fix: allow multiple PIP_SECRETS 2024-03-17 15:15:36 +01:00
Ruben Fiszel
958df4f62c feat: refactor logging to improve performance by order of magnitude for longer jobs 2024-03-16 17:55:34 +01:00
Ruben Fiszel
543d2a1577 fix: s3 cache is an instance settings (#3421)
* s3

* s3
2024-03-15 15:09:05 +01:00
Ruben Fiszel
e5aec9c445 fix: improve pip_secret interpolation 2024-03-15 11:17:41 +01:00
Ruben Fiszel
14154d2e79 feat: workflow as code for typescript 2024-03-05 23:14:04 +01:00
Ruben Fiszel
426c2a87b5 feat: workflow as code with timelines 2024-03-05 12:45:24 +01:00
Ruben Fiszel
ff3aa8ab06 feat: workflow as code v0 2024-03-04 20:19:34 +01:00
Ruben Fiszel
d951d17b78 fix: add HOME to pip install 2024-02-26 15:27:56 +01:00
Ruben Fiszel
2ee069a1b8 fix(python): handle recursive python imports with loop 2024-02-20 19:42:11 +01:00