Repository navigation
kloud: use metadata for deploying klient - #10935
Conversation
|
Also it will be possible to use custom cloud-init script for the user_data field, so e.g. instead of injecting ssh keys with bash-fu, one can just create the following stack template: provider:
aws:
access_key: '${var.aws_access_key}'
secret_key: '${var.aws_secret_key}'
resource:
aws_instance:
aws-instance:
instance_type: 't2.nano'
ami: ''
tags:
Name: '${var.koding_user_username}-${var.koding_group_slug}'
user_data: |
#cloud-config
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EA... koding-350298856
runcmd:
- echo "hello world!" >> /helloworld.txt |
2c71a76 to
29ba040
Compare
Instead of templating the provision.sh script, pass the default configuration to it via terraform's variable block. The variables can be overwritten via environmental variables.
d86cd05 to
8c21e28
Compare
Embedded screen seems not to work on Red Hat.
Not all cloud-inits implementations support final_message directive, yield end of provisioning phase within the provision.sh script instead.
Allows for overwriting default timeout for "Checking remote vm" phase of building a stack - which is currently 5m.
| // TODO(rjeczalik): make it configurable during ./configure = add to kites/config/config.json | ||
| var ( | ||
| DefaultEntrypointBaseURL = "https://koding-klient.s3.amazonaws.com/entrypoint" | ||
| DefaultScreenURL = "https://koding-dl.s3.amazonaws.com/screen.tar.gz" |
There was a problem hiding this comment.
we could use https://koding.com/d/$1 instead of https://koding-dl.s3.amazonaws.com/$1
| // | ||
| // TODO(rjeczalik): make it configurable during ./configure = add to kites/config/config.json | ||
| var ( | ||
| DefaultEntrypointBaseURL = "https://koding-klient.s3.amazonaws.com/entrypoint" |
There was a problem hiding this comment.
we could utilize koding.com/s3 endpoint here or we could copy entrypoint to dl bucket and serve from there from now on
There was a problem hiding this comment.
Done, went with /s3.
| if [ $${USE_EMBEDDED} -eq 1 ]; then | ||
| install_screen | ||
| elif type yum &>/dev/null; then | ||
| yum install --assumeyes screen |
There was a problem hiding this comment.
could we install a specific and tested version of screen otherwise we might have problems and it would be hard to debug since we wont have any idea on which version is installed. Even on AWS some of the images(same version) has different versions of tools.
|
|
||
| RUN apt-get update && apt-get install -y git build-essential ubuntu-dev-tools dh-make && apt-get clean && \ | ||
| curl -sSL https://storage.googleapis.com/golang/go1.7.4.linux-amd64.tar.gz | tar -C /usr/local/ -zxf - && \ | ||
| curl -sSL https://storage.googleapis.com/golang/go1.8.linux-amd64.tar.gz | tar -C /usr/local/ -zxf - && \ |
There was a problem hiding this comment.
could we remove this dockerfile and use koding's base docker image? lets not maintain two images
cc/ @szkl
There was a problem hiding this comment.
FWIW this Dockerfile is going away, once the deb builds are removed.
Codecov Report
@@ Coverage Diff @@
## master #10935 +/- ##
=========================================
- Coverage 30.9% 30.9% -0.1%
=========================================
Files 100 100
Lines 11360 11323 -37
=========================================
- Hits 3514 3500 -14
+ Misses 7445 7423 -22
+ Partials 401 400 -1Continue to review full report at Codecov.
|
If terminfo exists on a vm use it instead. Fixes the following error when starting a session: Cannot find terminfo entry for 'xterm-256color'
|
@cihangir All addressed, ptal. |
| func guessTerm() string { | ||
| terms := [][2]string{ | ||
| {"xterm-256color", "/usr/share/terminfo/x/xterm-256color"}, | ||
| {"xterm-256color", "/usr/share/terminfo/78/xterm-256color"}, |
There was a problem hiding this comment.
78 is the new answer to life the universe and everything
There was a problem hiding this comment.
In fact 78 is hex code for x - under Linux terminfo files are grouped in directories after the first letter, under macOS - after hex code value of the first letter.
This PR wires kloud/metadata with stack/provider, allowing kloud to deploy a klient service without a .deb builder dependency. Since the metadata provisioning method is generic, it allows kloud to build stacks on images other than Ubuntu 14.04.
The following distributions were tested:
A big todo here is to create here terraform tests, which could be integrated with CI to test such stacks. This is an ongoing effort to introduce integration testing for kloud, but outside the scope of this PR. I'm planning to fix it after finalising kd.io - then use kd for the testing.
Blockers:
service: add support for running a service as a user service#6