-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Launch Anvil From the Client #105
base: main
Are you sure you want to change the base?
Conversation
a15703c
to
c498fb8
Compare
9ce900a
to
5879279
Compare
a507109
to
8890732
Compare
30ae4a4
to
8c8a311
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really big task, good hustle!
frontend/src/App.jsx
Outdated
<AnvilConfigurationsModal | ||
open={configOpen} | ||
onRequestClose={() => setConfigOpen(false)} | ||
isInitial={true} | ||
appIsPackaged={appIsPackaged} | ||
/> | ||
|
||
{/* Confirmation */} | ||
<ClosableModal | ||
modalHeading="Would you like to run your anvil locally with your existing settings" | ||
size="md" | ||
primaryButtonText="Yes" | ||
secondaryButtonText="No" | ||
onRequestSubmit={confirmSettings} | ||
onRequestClose={() => { | ||
setConfirmationIsOpen(false); | ||
setConfigOpen(true); | ||
}} | ||
open={confirmationOpen} | ||
> | ||
<div className="flex flex-col gap-4 p-3"> | ||
{confirmationText.map((error, i) => { | ||
return <p key={"error-msg-" + i}>{error}</p>; | ||
})} | ||
</div> | ||
<Loading active={loading} /> | ||
</ClosableModal> | ||
|
||
{/* Error */} | ||
<ClosableModal | ||
modalHeading="Following errors happened, please change your local config, or choose a cloud configuration" | ||
size="md" | ||
primaryButtonText="Yes" | ||
secondaryButtonText="No" | ||
passiveModal | ||
onRequestClose={() => { | ||
setErrModalOpen(false); | ||
setConfigOpen(true); | ||
}} | ||
open={errModalOpen} | ||
> | ||
<div className="flex flex-col gap-4 p-3"> | ||
{errText.map((error, i) => { | ||
return <p key={"error-msg-" + i}>{error}</p>; | ||
})} | ||
</div> | ||
</ClosableModal> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am thinking we might want to extract this to a new component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to treat AnvilConfigurationModal as it's own, but I refactored error and confirmation modals into one component
frontend/src/App.jsx
Outdated
<ClosableModal | ||
modalHeading="Would you like to run your anvil locally with your existing settings" | ||
size="md" | ||
primaryButtonText="Yes" | ||
secondaryButtonText="No" | ||
onRequestSubmit={confirmSettings} | ||
onRequestClose={() => { | ||
setConfirmationIsOpen(false); | ||
setConfigOpen(true); | ||
}} | ||
open={confirmationOpen} | ||
> | ||
<div className="flex flex-col gap-4 p-3"> | ||
{confirmationText.map((error, i) => { | ||
return <p key={"error-msg-" + i}>{error}</p>; | ||
})} | ||
</div> | ||
<Loading active={loading} /> | ||
</ClosableModal> | ||
|
||
{/* Error */} | ||
<ClosableModal | ||
modalHeading="Following errors happened, please change your local config, or choose a cloud configuration" | ||
size="md" | ||
primaryButtonText="Yes" | ||
secondaryButtonText="No" | ||
passiveModal | ||
onRequestClose={() => { | ||
setErrModalOpen(false); | ||
setConfigOpen(true); | ||
}} | ||
open={errModalOpen} | ||
> | ||
<div className="flex flex-col gap-4 p-3"> | ||
{errText.map((error, i) => { | ||
return <p key={"error-msg-" + i}>{error}</p>; | ||
})} | ||
</div> | ||
</ClosableModal> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are also similar to the ones in the AnvilConfigurationsModal
.
frontend/server/express.mjs
Outdated
}); | ||
}); | ||
|
||
app.post("/launch-anvil", (req, res) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not sure if I understand the difference between this endpoint and the one above it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of them is basically starts the anvil runs from an existing config, whereas the other creates/re-creates the config.
ea666ac
to
05ba4fb
Compare
f592666
to
c4ce412
Compare
b29f50b
to
56b8ee7
Compare
* fix zoom to pointer * fixed it
…aforge into f/client-launch-anvil pull the branch
This is currently in testing phase, This also address issue #193 #197
Release Notes for starting anvil directly from the client: NOTE: This feature is not available on pip, or development environment, but only in compiled apps. UX: 1) On a launch, the client first checks if it can ping the anvil with the given set of configuration. If it can ping(for e.g. if the settings are pointing to the cloud, or user starts anvil separately), then the client launches as usual. If not, then the client checks if the embedded anvil has a config file. If yes, then client displays a confirmation modal, that has the settings. If user wishes, it can just launch the anvil from that config file. If not, user is displayed with the Anvil Configuration modal. Anvil configurations Modal has two tabs, Anvil configurations and SetKubeContext. SetKubeContext is disabled if the chosen configuration does not point to a local address. Moreover, there’s Save & Relaunch Button, which is disabled if the configuration is not local OR it’s local but user hasn’t chosen a context and driver in SetKubeContext. From SetKubeContext, user can choose a context and driver(minikube or docker). And then from there, they can click Save & Relaunch button to launch anvil. Once the loading is complete user can close the modal and start using anvil. If in anytime, for any reason, we cannot ping anvil(client pings anvil in every 2 seconds), then we disable Run and Rebuild buttons. What to Test: 1) Local launch. 2) Change Local launch context/driver, and relaunch.
Run pipelines, both using docker-driver and minikube. 3) Failed launches(for e.g. try to run without opening docker desktop, to see the error) 4) Cloud.(Also, close and reopen the app after choosing cloud. It shouldn’t display the config modal)
Try to run on pip. Add the anvil folder manually to the pip PATH, and run it. It must not display the modals nor let you change the context. Configurations can still be changed tho(cloud vs. local)
Test agents, compilations and test runs(already tested on my end, they’re running fine, but it won’t hurt if other users also test them)