diff --git a/config.json b/config.json index 965352c1..cec10ee2 100644 --- a/config.json +++ b/config.json @@ -15,7 +15,7 @@ "KubeContext": "zetaforge", "Local": { "BucketPort": 8333, - "Driver": "minikube" + "Driver": "docker-desktop" }, "Cloud": { diff --git a/frontend/electron-builder.json5 b/frontend/electron-builder.json5 index b84fffd8..e6103c92 100644 --- a/frontend/electron-builder.json5 +++ b/frontend/electron-builder.json5 @@ -16,7 +16,7 @@ binaries: ["launch.command"], }, win: { - target: ["tar.gz"], + target: ["tar.gz", "zip"], artifactName: "${productName}-${version}-windows-${arch}.${ext}", }, linux: { diff --git a/frontend/server/express.mjs b/frontend/server/express.mjs index 2d5e14ba..174947c4 100644 --- a/frontend/server/express.mjs +++ b/frontend/server/express.mjs @@ -341,19 +341,27 @@ function startExpressServer() { resolve(); } }); - + const regex = /listen tcp :\d+: bind: address already in use/; anvilProcess.stderr.on("data", (data) => { console.log(`[server] stderr: ${data}`); if ( data - .toString() - .toLowerCase() - .includes("failed to fetch kubernetes resources;") || - data - .toString() - .toLowerCase() - .includes("failed to get client config;") || - data.toString().toLowerCase().includes("failed to install argo;") + .toString() + .toLowerCase() + .includes("failed to fetch kubernetes resources;") || + data + .toString() + .toLowerCase() + .includes("failed to get client config;") || + data.toString().toLowerCase().includes("failed to install argo;") || + data.toString().toLowerCase().includes("failed to check for minikube profile;") || + data.toString().toLowerCase().includes("failed to marshall minikube profile;") || + data.toString().toLowerCase().includes("failed to marshall minikube profile;") || + data.toString().toLowerCase().includes("failed to find the profile;") || + data.toString().toLowerCase().includes("failed to check minikube status;") || + data.toString().toLowerCase().includes("failed to parse profile status;") || + data.toString().toLowerCase().includes("failed to check for minikube profile;") || + regex.test(data.toString().toLowerCase()) ) { console.log("AM I THROWING ERROR?") reject(new Error(`Kubeservices not found: ${data.toString()}`)); @@ -457,6 +465,7 @@ function startExpressServer() { resolve(); } }); + const regex = /listen tcp :\d+: bind: address already in use/; anvilProcess.stderr.on("data", (data) => { console.log(`[server] stderr: ${data}`); @@ -469,7 +478,15 @@ function startExpressServer() { .toString() .toLowerCase() .includes("failed to get client config;") || - data.toString().toLowerCase().includes("failed to install argo;") + data.toString().toLowerCase().includes("failed to install argo;") || + data.toString().toLowerCase().includes("failed to check for minikube profile;") || + data.toString().toLowerCase().includes("failed to marshall minikube profile;") || + data.toString().toLowerCase().includes("failed to marshall minikube profile;") || + data.toString().toLowerCase().includes("failed to find the profile;") || + data.toString().toLowerCase().includes("failed to check minikube status;") || + data.toString().toLowerCase().includes("failed to parse profile status;") || + data.toString().toLowerCase().includes("failed to check for minikube profile;") || + regex.test(data.toString().toLowerCase()) ) { reject(new Error(`Kubeservices not found: ${data.toString()}`)); } @@ -483,6 +500,10 @@ function startExpressServer() { res.sendStatus(200); }) .catch((err) => { + if(anvilProcess !== null) { + anvilProcess.kill("SIGINT"); + anvilProcess = null; + } res .status(500) .send({ err: "Error while launching anvil", kubeErr: err.message }); diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index ae0c926d..9ae926db 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -14,7 +14,6 @@ import SocketFetcher from "@/components/ui/SocketFetcher"; import "./styles/globals.scss"; import AnvilConfigurationsModal from "./components/ui/modal/AnvilConfigurationsModal"; -import StatusModal from "./components/ui/modal/StatusModal"; import { useState, useEffect } from "react"; import axios from "axios"; import { useAtom } from "jotai"; @@ -37,7 +36,10 @@ export default function App() { const [errText, setErrText] = useState([]); const [loading, setIsLoading] = useState(false); const [configuration] = useAtom(activeConfigurationAtom); + const [successModalOpen, setSuccessModalOpen] = useState(false); + const successMessage = ['You can close configurations modal, and start running pipelines'] + useEffect(() => { @@ -116,7 +118,8 @@ export default function App() { const res = await axios.post(`${serverAddress}/launch-anvil-from-config`); setConfirmationIsOpen(false); setIsLoading(false); - setConfigOpen(false) + setConfigOpen(false); + setSuccessModalOpen(true) } catch (err) { setErrText([err.message]); setErrModalOpen(true); @@ -125,7 +128,6 @@ export default function App() { }; const closeConfirmation = () => { - console.log("CHECK HERE") if(!loading) { setConfirmationIsOpen(false); setConfigOpen(true); @@ -162,6 +164,11 @@ export default function App() { }} errorOpen={errModalOpen} errorMessage={errText} + + successHeader="Local Anvil Launched Succesfully" + successClose={() => setSuccessModalOpen(false)} + successOpen={successModalOpen} + successMessage={successMessage} /> diff --git a/frontend/src/components/ui/AnvilLauncherStatus.jsx b/frontend/src/components/ui/AnvilLauncherStatus.jsx index 57a312f8..2b3b77a2 100644 --- a/frontend/src/components/ui/AnvilLauncherStatus.jsx +++ b/frontend/src/components/ui/AnvilLauncherStatus.jsx @@ -3,27 +3,38 @@ import StatusModal from "./modal/StatusModal"; export default function AnvilLauncherStatus(props) { - return (<> - + - ) + + + + ) } \ No newline at end of file diff --git a/frontend/src/components/ui/Navbar.jsx b/frontend/src/components/ui/Navbar.jsx index 8fc67b66..53ead85d 100644 --- a/frontend/src/components/ui/Navbar.jsx +++ b/frontend/src/components/ui/Navbar.jsx @@ -37,15 +37,7 @@ export default function Navbar({ children }) { const [configuration] = useAtom(activeConfigurationAtom); const [disable, setDisable] = useState(false); - const { pingPending, pingError, pingData } = useQuery({ - queryKey: ["ping"], - queryFn: async () => { - const res = await ping(configuration); - setDisable(res !== true); - return res; - }, - refetchInterval: 2 * 1000, - }); + const modalPopper = (content) => { setModalContent({ @@ -61,7 +53,6 @@ export default function Navbar({ children }) { diff --git a/frontend/src/components/ui/RunPipelineButton.jsx b/frontend/src/components/ui/RunPipelineButton.jsx index a317b8b9..814b482e 100644 --- a/frontend/src/components/ui/RunPipelineButton.jsx +++ b/frontend/src/components/ui/RunPipelineButton.jsx @@ -15,7 +15,7 @@ import { activeConfigurationAtom } from "@/atoms/anvilConfigurationsAtom"; import { useLoadServerPipeline } from "@/hooks/useLoadPipeline"; import { ping } from "@/client/anvil"; -export default function RunPipelineButton({ children, action, disabled }) { +export default function RunPipelineButton({ children, action}) { const [editor] = useAtom(drawflowEditorAtom); const [pipeline] = useImmerAtom(pipelineAtom); const [_, setWorkspace] = useImmerAtom(workspaceAtom); @@ -28,6 +28,15 @@ export default function RunPipelineButton({ children, action, disabled }) { const queryClient = useQueryClient(); const loadServerPipeline = useLoadServerPipeline(); + const { pingPending, pingError, data: pingData } = useQuery({ + queryKey: ["ping"], + queryFn: async () => { + const res = await ping(configuration); + return res; + }, + refetchInterval: 2 * 1000, + }); + const runPipeline = async () => { if (!validatePipelineExists()) return; setValidationErrorMsg([]); @@ -156,14 +165,13 @@ export default function RunPipelineButton({ children, action, disabled }) { margin: "5px", }; + return ( <>