okteto / docker-desktop-extension

Docker Extension for Okteto
Apache License 2.0
5 stars 4 forks source link

Notify when environment is ready #75

Closed rlamana closed 7 months ago

rlamana commented 1 year ago

Describe the solution you'd like Related to #74, using the status of the environment we could notify users when the environment is done deploying and it is ready for development

Screenshot 2022-09-22 at 16 49 51

The Toast API is described here: https://docs.docker.com/desktop/extensions-sdk/dev/api/reference/interfaces/Toast/

aryabharat commented 1 year ago

Is anyone picking this issue? If no one is assigned, I can try this.

pchico83 commented 1 year ago

@aryabharat great! I assigned this issue to you :-)

aryabharat commented 1 year ago

Hi @pchico83, Just wanted to show the process before starting dev.

will add a function in /docker-desktop-extension/client/src/api/okteto.ts file to get status

const status = async (oktetoOnly = true): Promise<OktetoContextList> => { try { const result = await window.ddClient.extension?.host?.cli.exec( 'okteto', ['status'], ); if (result) { return result.parseJsonObject(); } return 'Failed' } catch (_) { console.error('Error executing "okteto status" command'); return 'Failed' } };

and update /docker-desktop-extension/client/src/views/Environment.tsx for status icon.

rlamana commented 1 year ago

@aryabharat That looks correct 👌 However, the call will return an object with the form: {"status": "activating"}. It would be nice if the function could return the status directly, and based on a defined type, instead of just a string.

rlamana commented 1 year ago

@aryabharat Don't hesitate to send a PR with those changes and we can discuss further there 👍

aryabharat commented 1 year ago

@rlamana I have completed the dev, Just facing some issues while starting the dev end. x Couldn't activate your development container Failed to create pod sandbox: rpc error: code = Unknown desc = failed to create containerd task: failed to create shim: OCI runtime create failed: runc create failed: unable to start container process: unable to init seccomp: error loading seccomp filter into kernel: error loading seccomp filter: errno 524: unknown

logs from file .okteto/aryabharat/cli/okteto.log

time="2022-10-04T13:31:06+05:30" level=info msg="pod event: SuccessfulAttachVolume:AttachVolume.Attach succeeded for volume \"pvc-0db0957b-ab37-48c7-9059-9861f0651755\" " action=ace68877-d365-42cf-8654-0edcca04bfc3 version=2.7.0 time="2022-10-04T13:31:06+05:30" level=info msg="pod event: FailedCreatePodSandBox:Failed to create pod sandbox: rpc error: code = Unknown desc = failed to create containerd task: failed to create shim: OCI runtime create failed: runc create failed: unable to start container process: unable to init seccomp: error loading seccomp filter into kernel: error loading seccomp filter: errno 524: unknown" action=ace68877-d365-42cf-8654-0edcca04bfc3 version=2.7.0 time="2022-10-04T13:31:06+05:30" level=info msg="starting shutdown sequence" action=ace68877-d365-42cf-8654-0edcca04bfc3 version=2.7.0 time="2022-10-04T13:31:06+05:30" level=info msg="sent cancellation signal" action=ace68877-d365-42cf-8654-0edcca04bfc3 version=2.7.0 time="2022-10-04T13:31:06+05:30" level=info msg="stopping syncthing" action=ace68877-d365-42cf-8654-0edcca04bfc3 version=2.7.0 time="2022-10-04T13:31:06+05:30" level=info msg="stopping forwarders" action=ace68877-d365-42cf-8654-0edcca04bfc3 version=2.7.0 time="2022-10-04T13:31:06+05:30" level=info msg="completed shutdown sequence" action=ace68877-d365-42cf-8654-0edcca04bfc3 version=2.7.0 time="2022-10-04T13:31:06+05:30" level=info msg="activate failed with: couldn't activate your development container\n Failed to create pod sandbox: rpc error: code = Unknown desc = failed to create containerd task: failed to create shim: OCI runtime create failed: runc create failed: unable to start container process: unable to init seccomp: error loading seccomp filter into kernel: error loading seccomp filter: errno 524: unknown" action=ace68877-d365-42cf-8654-0edcca04bfc3 version=2.7.0 time="2022-10-04T13:31:06+05:30" level=info msg="exit signal received due to error: couldn't activate your development container\n Failed to create pod sandbox: rpc error: code = Unknown desc = failed to create containerd task: failed to create shim: OCI runtime create failed: runc create failed: unable to start container process: unable to init seccomp: error loading seccomp filter into kernel: error loading seccomp filter: errno 524: unknown" action=ace68877-d365-42cf-8654-0edcca04bfc3 version=2.7.0

aryabharat commented 1 year ago

@rlamana

78

aryabharat commented 1 year ago

@rlamana waiting for #76 to get merged.

rlamana commented 1 year ago

@aryabharat 👌 it is almost ready. If you want to make some progress, you can start by adding the toast in the UI (https://docs.docker.com/desktop/extensions-sdk/dev/api/reference/interfaces/Toast/) while waiting for #76

aryabharat commented 1 year ago

@rlamana I have started the code for that.

const getStatus = async () => { if(!currentContext || !environment) return; const status = await okteto.status(environment.file, currentContext.name); **if(status.toLowerCase() ==='ready') okteto.toastSuccess('deployed')** setStatus(status); }

and one new function in client api: const toastSuccess = (message:string) => { window.ddClient.desktopUI.toast.success(message); returnl }

rlamana commented 1 year ago

Sounds good 👌

and one new function in client api: const toastSuccess = (message:string) => { window.ddClient.desktopUI.toast.success(message); returnl }

I would, however, leave all UI-dependant code to the components, in this case the one in charge of opening the toast should probably be the Environment component.

aryabharat commented 7 months ago

"Closing the previous open PR as it was determined we need to pursue a different approach. @rlamana, could you please provide insights on our next steps for this issue?"

rlamana commented 7 months ago

@aryabharat yes, we are going to close this one for now, as we don't have any plans for it yet. We will get back to you as soon as we decide how this feature fits into our latest changes. Thank you.