Skip to content
This repository has been archived by the owner on Aug 15, 2022. It is now read-only.

use kd link for installing klient on connected vms #8514

Closed
rjeczalik opened this issue Jul 21, 2016 · 18 comments
Closed

use kd link for installing klient on connected vms #8514

rjeczalik opened this issue Jul 21, 2016 · 18 comments

Comments

@rjeczalik
Copy link
Member

rjeczalik commented Jul 21, 2016

Currently we use the following link to install klient on user vms:

curl -sL https://kodi.ng/s | bash -s 629a9f26

Since we disabled auto-updates for managed klient due to kd mount issues, user has no mean to update klient on his connected vm.

We should instead use regular kd link for connecting vm:

curl -sL https://kodi.ng/c/p/kd | bash -s 17ec2083

Which will also install kd and make it possible to sudo kd update. We would also have only one way for installing klient which will greatly reduce maintenance cost.

We should also ensure a managed klient installed via kd link shows up on the sidebar, I've tested it on current production and it does not show up. It shows up, I was not patient enough.

In the long term we should enable the auto-updates. (/cc @leeola)

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@rjeczalik
Copy link
Member Author

On a second though it's possible to enable autoupdate for connected vms only - #8515.

However it would be nice to have only one way to install klient.

Ideally I would move the whole functionality from bash scripts to the binary (either kd or klient - kd currently is able to install klient) and store kite keys and whole configuration in boltdb (related #8509).

wdyt? (/cc @cihangir @szkl)

@rjeczalik
Copy link
Member Author

connected vm link does not work for ubuntu 16.04, using kd link instead would have fixed that

@gokmen
Copy link
Contributor

gokmen commented Jul 29, 2016

so, will kd installer provide the same functionality with klient installer? I mean will it start running klient and register the machine to kontrol automatically? or do user need to do something else after installation?

@rjeczalik
Copy link
Member Author

Right both kd and klient installers do the same - they both register machine to kontrol and start klient. The only difference is that no managed jMachine doc is created for klient kontrol (as there's no managed machine modal for kd that does this I guess).

I'm going to rework machine registration with #8548, so taking the opportunity I could also make kontrol insert managed jMachine doc so user machine shows on the sidebar. This way separate "connected machine" or "your own machine" modal becomes obsolete. Moreover we have only one way of installing klient.

wdyt?

@gokmen
Copy link
Contributor

gokmen commented Jul 29, 2016

That would be perfect, we shouldn't provide two different ways to install same thing. Add your own machine modal was doing the check on kontrol to get the latest register machine that we still may need to update the machine list or we can send a notification to trigger reload for machines otherwise they won't see the machine on their sidebars until they reload.

@gokmen
Copy link
Contributor

gokmen commented Jul 29, 2016

Should I update the installer link to use the proposed one? Will it work as expected for now or do I need to wait for your updates on that?

@rjeczalik
Copy link
Member Author

Probably you'd need to wait, since right now installing kd won't make your vm appear in sidebar (I guess there's no manage doc created?).

What kind of relationships do we need in mongo in order to make a vm appear in sidebar under the Managed VMs?

@gokmen
Copy link
Contributor

gokmen commented Jul 29, 2016

We can still use the existing modal for that request but we will provide kd installer instead so it should work as is (I assume) because currently that modal is querying kontrol and if founds a new machine then it requests from backend to create the JMachine document.

No relationship is required only requirement is that the users list of JMachine document needs to be proper for the active user and group.

@rjeczalik
Copy link
Member Author

modal is querying kontrol and if founds a new machine then it requests from backend to create the JMachine document.

So if we just replace the link with the kd one it'll work out of the box and no need for kontrol to create jMachine docs, correct?

@gokmen
Copy link
Contributor

gokmen commented Jul 29, 2016

@rjeczalik yes, if that kd install scripts registers the machine we're good to go.

@rjeczalik
Copy link
Member Author

Let's do this 🎉

@gokmen
Copy link
Contributor

gokmen commented Jul 29, 2016

👍 will do that next week first thing.

@leeola
Copy link
Contributor

leeola commented Sep 1, 2016

I think the "Koding Connector Service" debian package is having issues with Ubuntu 14 now, lots of error cases. Can we bump this up in priority?

Also, @rjeczalik do you think #8935 blocks this? I know you mentioned it, but what are your thoughts?

@rjeczalik
Copy link
Member Author

The kontrol.register method should create a jMachine managed document with newly registered KD Daemon. This way we could get rid of connected VM modal and connect external vms just by installing kd.

/cc @gokmen

@gokmen
Copy link
Contributor

gokmen commented Jun 6, 2017

@rjeczalik this is the only change required

diff --git a/client/app/lib/providers/managed/addmanagedmachinemodal.coffee b/client/app/lib/providers/managed/addmanagedmachinemodal.coffee
index e47c8061f7..16d5c8e4a1 100644
--- a/client/app/lib/providers/managed/addmanagedmachinemodal.coffee
+++ b/client/app/lib/providers/managed/addmanagedmachinemodal.coffee
@@ -87,7 +87,7 @@ module.exports = class AddManagedMachineModal extends ContentModal
       then "export KONTROLURL=#{KodingKontrol.getKontrolUrl()} CHANNEL=devmanaged; "
       else ''

-    cmd = "#{kontrolUrl}curl -sL https://kodi.ng/s | bash -s #{token}"
+    cmd = "#{kontrolUrl}curl -sL https://kodi.ng/c/p/kd | bash -s #{token}"

     @loader.destroy()

but we do have a weird error with installer;

Installing "KD"...

    Current version: -
    Latest version: 0.1.108

error executing "install" command: error installing "KD": open /usr/local/bin/kd: text file busy

so, I couldn't try it out for the rest of the flow.

@gokmen
Copy link
Contributor

gokmen commented Aug 10, 2017

@rjeczalik can you check this out again? ^^

@rjeczalik
Copy link
Member Author

@gokmen Do I need to do anything special to reproduce it? I've just tried the new url and it works.

@gokmen
Copy link
Contributor

gokmen commented Aug 10, 2017

if it's working then we can apply the patch I provided and close the issue I believe.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants