From f8a60980b7f6b60ef0fcfeffa93e3c5bde9468a7 Mon Sep 17 00:00:00 2001 From: Jesse Eisses Date: Wed, 22 Nov 2023 14:56:24 +0100 Subject: [PATCH] Add layout of join-test-grid command --- dev/src/user.clj | 8 ++-- src/nosana_node/cli.clj | 11 ++++-- src/nosana_node/join_test_grid.clj | 10 +++++ src/nosana_node/main.clj | 60 ++++++++++++++---------------- src/nosana_node/nosana.clj | 12 ++---- src/nosana_node/system.clj | 11 ++++++ 6 files changed, 64 insertions(+), 48 deletions(-) create mode 100644 src/nosana_node/join_test_grid.clj diff --git a/dev/src/user.clj b/dev/src/user.clj index fb8b871..f7ca91e 100644 --- a/dev/src/user.clj +++ b/dev/src/user.clj @@ -13,7 +13,8 @@ [nosana-node.system :as nos-sys :refer [start-system use-jetty - use-wrap-ctx]] + use-wrap-ctx + use-nrepl]] [nosana-node.util :refer [bytes->hex hex->bytes base58] :as util] [nos.ops.docker :as docker] [aero.core :refer (read-config)] @@ -22,7 +23,6 @@ [nos.store :as store] [nos.system :refer [use-nostromo]] [clojure.java.io :as io] - [nosana-node.main :as main] [nosana-node.cli :as cli] [nosana-node.pipeline :as pl] [nosana-node.nosana :as nos :refer [use-nosana]] @@ -44,15 +44,17 @@ (-> (update sys :nos/vault merge config) (assoc :run-server? true - :nos/start-job-loop? true)))) + :nos/start-job-loop? false)))) (defn go [] + (taoensso.timbre/set-min-level! :info) (start-system system {:http/handler #'nos-sys/handler :system/components [use-vault use-config store/use-fs-store + use-nrepl use-nostromo use-nosana use-wrap-ctx diff --git a/src/nosana_node/cli.clj b/src/nosana_node/cli.clj index 6d6c1a8..43578fe 100644 --- a/src/nosana_node/cli.clj +++ b/src/nosana_node/cli.clj @@ -170,7 +170,7 @@ (not (contains? cli-actions action)) {:exit-message (str "Unknown action " action) :ok? false} - ;; parse the arguments for this action + ;; parse the inner options passed this the action :else (let [{a-summary :summary a-errors :errors a-args :arguments a-options :options} (cli/parse-opts (rest arguments) (get-in cli-options [action :options]))] @@ -204,7 +204,10 @@ ;; merge CLI over existing config (cond-> - (update sys :nos/vault merge state) + (-> sys + (assoc :nos/action action) + (update :nos/vault merge state)) (= "start" action) - (assoc :run-server? true - :nos/start-job-loop? true)))))) + (assoc :run-server? true) + (not= "start" action) + (:nos/start-job-loop? false)))))) diff --git a/src/nosana_node/join_test_grid.clj b/src/nosana_node/join_test_grid.clj new file mode 100644 index 0000000..2c51884 --- /dev/null +++ b/src/nosana_node/join_test_grid.clj @@ -0,0 +1,10 @@ +(ns nosana-node.join-test-grid + "Functions for handling the `join-test-grid` command" + (:require [nosana-node.nosana :as nos] + [nosana-node.solana :as sol])) + +(defn join-test-grid + "Handle the `join-test-grid` command." + [system] + (println "test grid") + ) \ No newline at end of file diff --git a/src/nosana_node/main.clj b/src/nosana_node/main.clj index 2e0fe23..5917928 100644 --- a/src/nosana_node/main.clj +++ b/src/nosana_node/main.clj @@ -9,21 +9,20 @@ (ns nosana-node.main (:require - [nosana-node.nosana :as nosana :refer [use-nosana]] + [nosana-node.nosana :as nosana :refer [use-nosana work-loop]] [nos.core :as flow] + [clojure.core.async :refer [ system (assoc - :nos/loop-chan - (when (and (:nos/start-job-loop? system) (= :success status)) - (