windmill: init at 1.100.1

This commit is contained in:
Mostly Void 2022-12-26 01:05:51 +05:30 committed by Anderson Torres
parent 0c6a3aa6b7
commit 78576e1a6f
7 changed files with 5857 additions and 1 deletions

5592
pkgs/servers/windmill/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,143 @@
{ lib
, rustPlatform
, fetchFromGitHub
, buildNpmPackage
, bash
, cairo
, deno
, fetchurl
, go
, lld
, makeWrapper
, nsjail
, openssl
, pango
, pixman
, pkg-config
, python3
, rust
, rustfmt
, stdenv
, swagger-cli
}:
let
pname = "windmill";
version = "1.100.1";
fullSrc = fetchFromGitHub {
owner = "windmill-labs";
repo = pname;
rev = "v${version}";
sha256 = "sha256-o9obIvtFRNGfyOWmAQVLfAmLhwtJVHZWNxGaG7lbbC8=";
};
pythonEnv = python3.withPackages (ps: [ ps.pip-tools ]);
frontend-build = buildNpmPackage {
inherit version;
pname = "windmill-ui";
src = fullSrc;
sourceRoot = "source/frontend";
npmDepsHash = "sha256-nRx/UQ7GU1iwhddTotCTG08RoOmdbP66zGKYsEp9XOE=";
preBuild = ''
npm run generate-backend-client
'';
buildInputs = [ pixman cairo pango ];
nativeBuildInputs = [ python3 pkg-config ];
installPhase = ''
mkdir -p $out/share
mv build $out/share/windmill-frontend
'';
};
in
rustPlatform.buildRustPackage {
inherit pname version;
src = "${fullSrc}/backend";
SQLX_OFFLINE = "true";
RUSTY_V8_ARCHIVE =
let
arch = rust.toRustTarget stdenv.hostPlatform;
fetch_librusty_v8 = args:
fetchurl {
name = "librusty_v8-${args.version}";
url = "https://github.com/denoland/rusty_v8/releases/download/v${args.version}/librusty_v8_release_${arch}.a";
sha256 = args.shas.${stdenv.hostPlatform.system} or (throw "Unsupported platform ${stdenv.hostPlatform.system}");
meta = { inherit (args) version; };
};
in
fetch_librusty_v8 {
version = "0.71.0";
shas = {
x86_64-linux = "sha256-52usT7MsLme3o3tjxcRJ0U3iX0fKtnvEvyKJeuL1Bvc=";
aarch64-linux = "sha256-E7CjpBO1cV5wFtLTIPPltGAyX1OEPjfhnVUQ4u3Mzxs=";
x86_64-darwin = "sha256-+Vj0SgvenrCuHPSYKFoxXTyfWDFbnUgHtWibNnXwbVk=";
aarch64-darwin = "sha256-p7BaC2nkZ+BGRPSXogpHshBblDe3ZDMGV93gA4sqpUc=";
};
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"progenitor-0.3.0" = "sha256-EPiAeAKCYBHiISGdXyuqlX/+Xp1feQmniLzt/FIDiLw=";
"typify-0.0.12" = "sha256-LfFUhr40jKQNO6be2RWend3mbZ/b6i2eljGLx0UTunY=";
};
};
patches = [
./swagger-cli.patch
./run.go.config.proto.patch
./run.python3.config.proto.patch
./run.bash.config.proto.patch
];
postPatch = ''
substituteInPlace windmill-worker/src/worker.rs \
--replace '"/bin/bash"' '"${bash}/bin/bash"'
'';
buildInputs = [ openssl rustfmt lld ];
nativeBuildInputs = [ pkg-config makeWrapper swagger-cli ];
preBuild = ''
pushd ..
mkdir -p frontend/build
cp -R ${frontend-build}/share/windmill-frontend/* frontend/build
cp ${fullSrc}/openflow.openapi.yaml .
popd
'';
# needs a postgres database running
doCheck = false;
postFixup = ''
patchelf --set-rpath ${lib.makeLibraryPath [openssl]} $out/bin/windmill
wrapProgram "$out/bin/windmill" \
--prefix PATH : ${lib.makeBinPath [go pythonEnv deno nsjail bash]} \
--set PYTHON_PATH "${pythonEnv}/bin/python3" \
--set GO_PATH "${go}/bin/go" \
--set DENO_PATH "${deno}/bin/deno" \
--set NSJAIL_PATH "${nsjail}/bin/nsjail"
'';
meta = with lib; {
description = "Open-source web IDE, scalable runtime and platform for serverless, workflows and UIs";
homepage = "https://windmill.dev";
license = licenses.agpl3;
maintainers = with maintainers; [ dit7ya ];
# limited by librusty_v8
platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
};
}

View File

@ -0,0 +1,41 @@
diff --git a/windmill-worker/nsjail/run.bash.config.proto b/backend/windmill-worker/nsjail/run.bash.config.proto
index e93e6b45..bbedb165 100644
--- a/windmill-worker/nsjail/run.bash.config.proto
+++ b/windmill-worker/nsjail/run.bash.config.proto
@@ -18,6 +18,12 @@ clone_newuser: {CLONE_NEWUSER}
keep_caps: false
keep_env: true
+mount {
+ src: "/nix/store"
+ dst: "/nix/store"
+ is_bind: true
+}
+
mount {
src: "/bin"
dst: "/bin"
@@ -25,6 +31,7 @@ mount {
}
mount {
+ mandatory: false
src: "/lib"
dst: "/lib"
is_bind: true
@@ -32,6 +39,7 @@ mount {
mount {
+ mandatory: false
src: "/lib64"
dst: "/lib64"
is_bind: true
@@ -39,6 +47,7 @@ mount {
mount {
+ mandatory: false
src: "/usr"
dst: "/usr"
is_bind: true

View File

@ -0,0 +1,34 @@
diff --git a/windmill-worker/nsjail/run.go.config.proto b/windmill-worker/nsjail/run.go.config.proto
index 3af548d1..39ff4da7 100644
--- a/windmill-worker/nsjail/run.go.config.proto
+++ b/windmill-worker/nsjail/run.go.config.proto
@@ -25,6 +25,13 @@ mount {
}
mount {
+ src: "/nix/store"
+ dst: "/nix/store"
+ is_bind: true
+}
+
+mount {
+ mandatory: false
src: "/lib"
dst: "/lib"
is_bind: true
@@ -32,6 +39,7 @@ mount {
mount {
+ mandatory: false
src: "/lib64"
dst: "/lib64"
is_bind: true
@@ -39,6 +47,7 @@ mount {
mount {
+ mandatory: false
src: "/usr"
dst: "/usr"
is_bind: true

View File

@ -0,0 +1,34 @@
diff --git a/windmill-worker/nsjail/run.python3.config.proto b/windmill-worker/nsjail/run.python3.config.proto
index 9f106c23..9da2d2a8 100644
--- a/windmill-worker/nsjail/run.python3.config.proto
+++ b/windmill-worker/nsjail/run.python3.config.proto
@@ -27,6 +27,13 @@ mount {
}
mount {
+ src: "/nix/store"
+ dst: "/nix/store"
+ is_bind: true
+}
+
+mount {
+ mandatory: false
src: "/lib"
dst: "/lib"
is_bind: true
@@ -34,6 +35,7 @@ mount {
mount {
+ mandatory: false
src: "/lib64"
dst: "/lib64"
is_bind: true
@@ -41,6 +43,7 @@ mount {
mount {
+ mandatory: false
src: "/usr"
dst: "/usr"
is_bind: true

View File

@ -0,0 +1,10 @@
diff --git a/windmill-api-client/bundle.sh b/windmill-api-client/bundle.sh
index 0fe4b172..bd66b49f 100644
--- a/windmill-api-client/bundle.sh
+++ b/windmill-api-client/bundle.sh
@@ -1,3 +1,3 @@
#!/bin/sh
-npx swagger-cli bundle ../windmill-api/openapi.yaml > bundled.json
\ No newline at end of file
+swagger-cli bundle ../windmill-api/openapi.yaml > bundled.json

View File

@ -27951,7 +27951,9 @@ with pkgs;
vdo = callPackage ../os-specific/linux/vdo { };
windows = callPackages ../os-specific/windows { };
windmill = callPackage ../servers/windmill {};
windows = callPackages ../os-specific/windows {};
wirelesstools = callPackage ../os-specific/linux/wireless-tools { };