From 9a8586241f2d0db20f6c55881f6b67467a02fa11 Mon Sep 17 00:00:00 2001 From: Nicolas Luck Date: Fri, 15 Nov 2024 17:05:21 +0100 Subject: [PATCH 1/8] Move dep. package installation from CI workflow to Dockerfile (and update Rust to 1.81) --- .circleci/Dockerfile | 6 +++--- .circleci/config.yml | 5 +---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.circleci/Dockerfile b/.circleci/Dockerfile index 9c5c83e2a..cd0406c9f 100644 --- a/.circleci/Dockerfile +++ b/.circleci/Dockerfile @@ -5,7 +5,7 @@ USER root # Install system dependencies or any other tools you need RUN apt-get update && sudo apt-get install -y \ - libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf protobuf-compiler cmake + libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf protobuf-compiler cmake gobjc clang gnustep-devel libobjc4 libgnustep-base-dev libasound2-dev pkg-config fuse libfuse2 mesa-utils mesa-vulkan-drivers # Install Go ENV GO_VERSION 1.22.0 @@ -29,8 +29,8 @@ RUN echo 'export PATH="/usr/local/bin:$PATH"' >> $HOME/.bashrc # Install Rust RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y RUN echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> /home/circleci/.bashrc -RUN ~/.cargo/bin/rustup install 1.80 -RUN ~/.cargo/bin/rustup default 1.80 +RUN ~/.cargo/bin/rustup install 1.81 +RUN ~/.cargo/bin/rustup default 1.81 RUN ~/.cargo/bin/rustup target add wasm32-unknown-unknown # Install Deno diff --git a/.circleci/config.yml b/.circleci/config.yml index 71221b909..cae99c0a7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ orbs: jobs: build-and-test: docker: - - image: coasys/ad4m-ci-linux:latest@sha256:989a070068192050e61f2fab134f598739b0ec6756588fada602709081b28152 + - image: coasys/ad4m-ci-linux:latest@sha256:6af8e856b939580ad20a5411dfa2635668ff8ee89c08eea16 resource_class: xlarge steps: - checkout @@ -52,9 +52,6 @@ jobs: - run: name: cargo fmt --check command: cargo fmt --check - - run: - name: install gobjc - command: sudo apt-get install gobjc clang gnustep-devel libobjc4 libgnustep-base-dev libasound2-dev pkg-config fuse libfuse2 mesa-utils mesa-vulkan-drivers - run: name: Install dependencies command: pnpm install --no-frozen-lockfile From b9b99edcab07b2e79ca9093e552c84a0db3dfa61 Mon Sep 17 00:00:00 2001 From: Nicolas Luck Date: Fri, 15 Nov 2024 18:44:17 +0100 Subject: [PATCH 2/8] Fix new docker image hash --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cae99c0a7..96e88cad0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ orbs: jobs: build-and-test: docker: - - image: coasys/ad4m-ci-linux:latest@sha256:6af8e856b939580ad20a5411dfa2635668ff8ee89c08eea16 + - image: coasys/ad4m-ci-linux:latest@sha256:e6c4fa03aaa5dcaa74f6b820871554136010e4b146efe3dd745b9bf72711d1e1 resource_class: xlarge steps: - checkout From 0b9b08e37fed1267c51d3ac1275785ec512c7e78 Mon Sep 17 00:00:00 2001 From: Nicolas Luck Date: Fri, 15 Nov 2024 19:59:54 +0100 Subject: [PATCH 3/8] Fix new docker image hash --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 96e88cad0..dff815f31 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ orbs: jobs: build-and-test: docker: - - image: coasys/ad4m-ci-linux:latest@sha256:e6c4fa03aaa5dcaa74f6b820871554136010e4b146efe3dd745b9bf72711d1e1 + - image: coasys/ad4m-ci-linux:latest@sha256:2dd8206db5ee73ae58f48e2c2db595320ab88b94f5e0c0ddc99698191a03114f resource_class: xlarge steps: - checkout From 1b818d33aeb1b6c49d17913b5d25638ee7d02fa0 Mon Sep 17 00:00:00 2001 From: Nicolas Luck Date: Mon, 18 Nov 2024 11:45:30 +0100 Subject: [PATCH 4/8] Deactivate Tauri updater files for now to prevent signing error on package-ad4m --- ui/src-tauri/tauri.conf.json | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/ui/src-tauri/tauri.conf.json b/ui/src-tauri/tauri.conf.json index e9ac3df91..a357498b3 100644 --- a/ui/src-tauri/tauri.conf.json +++ b/ui/src-tauri/tauri.conf.json @@ -3,14 +3,6 @@ "mainBinaryName": "ADAM Launcher", "version": "0.10.0-rc9", "identifier": "dev.ad4m.ad4min", - "plugins": { - "updater": { - "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEM1OTBGNDkzMkI2MTczMEMKUldRTWMyRXJrL1NReGFTUVBTMjRhQWlEVTFuOHBkcEZwbmEwSG9DdWczeDdtRUdNK3hMMm1GUnoK", - "endpoints": [ - "https://launcher-update-worker.perspect3vism.workers.dev/update/{{target}}/{{current_version}}" - ] - } - }, "app": { "security": { "csp": null @@ -78,7 +70,6 @@ "appimage": { "bundleMediaFramework": true } - }, - "createUpdaterArtifacts": "v1Compatible" + } } } \ No newline at end of file From 53baa3ed330fc1db77f05f7ec6d171da496ea7fe Mon Sep 17 00:00:00 2001 From: Nicolas Luck Date: Mon, 18 Nov 2024 11:48:32 +0100 Subject: [PATCH 5/8] Fix name typo --- rust-executor/src/ai_service/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust-executor/src/ai_service/mod.rs b/rust-executor/src/ai_service/mod.rs index de2a382dd..80617878b 100644 --- a/rust-executor/src/ai_service/mod.rs +++ b/rust-executor/src/ai_service/mod.rs @@ -517,7 +517,7 @@ impl AIService { pub async fn open_transcription_stream(&self, _model_id: String) -> Result { let stream_id = uuid::Uuid::new_v4().to_string(); let stream_id_clone = stream_id.clone(); - let (samples_tx, sampels_rx) = futures_channel::mpsc::unbounded::>(); + let (samples_tx, samples_rx) = futures_channel::mpsc::unbounded::>(); //TODO: use drop_rx to exit thread let (drop_tx, drop_rx) = oneshot::channel(); let (done_tx, done_rx) = oneshot::channel(); @@ -534,7 +534,7 @@ impl AIService { if let Ok(whisper) = maybe_model { let audio_stream = AudioStream { read_data: Vec::new(), - receiver: Box::pin(sampels_rx.map(futures_util::stream::iter).flatten()), + receiver: Box::pin(samples_rx.map(futures_util::stream::iter).flatten()), }; let mut word_stream = audio_stream From fb2e7dd267470e0f526decfae00bdc582e5cf698 Mon Sep 17 00:00:00 2001 From: Nicolas Luck Date: Mon, 18 Nov 2024 12:07:06 +0100 Subject: [PATCH 6/8] Make internal model thread spawning functions private --- rust-executor/src/ai_service/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust-executor/src/ai_service/mod.rs b/rust-executor/src/ai_service/mod.rs index 80617878b..7aaa56c7f 100644 --- a/rust-executor/src/ai_service/mod.rs +++ b/rust-executor/src/ai_service/mod.rs @@ -254,7 +254,7 @@ impl AIService { Ok(tasks) } - pub async fn spawn_embedding_model(&self, model_id: String) { + async fn spawn_embedding_model(&self, model_id: String) { let (bert_tx, mut bert_rx) = mpsc::unbounded_channel::(); thread::spawn({ @@ -296,7 +296,7 @@ impl AIService { .insert(model_id, bert_tx); } - pub async fn spawn_llm_model(&self, model_id: String) { + async fn spawn_llm_model(&self, model_id: String) { let (llama_tx, mut llama_rx) = mpsc::unbounded_channel::(); thread::spawn({ From e9ac36a2719037272ba9d6fd402cb711654476b2 Mon Sep 17 00:00:00 2001 From: Nicolas Luck Date: Mon, 18 Nov 2024 12:15:49 +0100 Subject: [PATCH 7/8] Turn on clippy in CI again --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dff815f31..26f602add 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -77,10 +77,10 @@ jobs: paths: - ./target/release/ad4m - ./target/release/ad4m-executor - #- run: - # name: cargo clippy - # no_output_timeout: 30m - # command: cargo clippy --all --exclude ad4m-launcher + - run: + name: cargo clippy + no_output_timeout: 30m + command: cargo clippy --all --exclude ad4m-launcher - run: name: Remove pnpm patches command: node removePnpm.js From 8d3d1b2bc79bd3c57e3719480306f15fa8cb2bea Mon Sep 17 00:00:00 2001 From: Nicolas Luck Date: Mon, 18 Nov 2024 12:30:23 +0100 Subject: [PATCH 8/8] clippy --- ui/src-tauri/src/lib.rs | 9 ++++----- ui/src-tauri/src/system_tray.rs | 10 ++++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ui/src-tauri/src/lib.rs b/ui/src-tauri/src/lib.rs index 2e3409a97..a0b77a388 100644 --- a/ui/src-tauri/src/lib.rs +++ b/ui/src-tauri/src/lib.rs @@ -253,8 +253,8 @@ pub fn run() { open_logs_folder(); }); - build_menu(&app.handle())?; - build_system_tray(&app.handle())?; + build_menu(app.handle())?; + build_system_tray(app.handle())?; let config = rust_executor::Ad4mConfig { admin_credential: Some(req_credential.to_string()), @@ -295,15 +295,14 @@ pub fn run() { Ok(()) }) - .on_window_event(|window, event| match event { - tauri::WindowEvent::CloseRequested { api, .. } => { + .on_window_event(|window, event| { + if let tauri::WindowEvent::CloseRequested { api, .. } = event { if let Err(e) = window.hide() { println!("Error trying to hide window: {:?}", e); } else { api.prevent_close(); } } - _ => {} }) .build(tauri::generate_context!()); diff --git a/ui/src-tauri/src/system_tray.rs b/ui/src-tauri/src/system_tray.rs index 34730149b..db8575f83 100644 --- a/ui/src-tauri/src/system_tray.rs +++ b/ui/src-tauri/src/system_tray.rs @@ -59,13 +59,15 @@ pub fn build_system_tray(app: &AppHandle) -> Result<()> { _ => log::error!("Event is not defined."), }) .menu_on_left_click(false) - .on_tray_icon_event(|tray, event| match event { - TrayIconEvent::Click { + .on_tray_icon_event(|tray, event| { + if let TrayIconEvent::Click { button: MouseButton::Left, button_state: MouseButtonState::Up, .. - } => toggle_main_window(tray.app_handle()), - _ => {} + } = event + { + toggle_main_window(tray.app_handle()) + } }) .build(app)?;