ohwgiles / laminar

Fast and lightweight Continuous Integration
https://laminar.ohwg.net
GNU General Public License v3.0
300 stars 56 forks source link

Laminard terminates #7

Closed palica closed 7 years ago

palica commented 7 years ago

Hi I am trying to run laminar in a container (LXD gentoo with OpenRC). And this is what I am getting as output.

The container is named laminar-ci it has internet access,

`

laminard

terminate called after throwing an instance of 'kj::ExceptionImpl'
what(): kj/async-io-unix.c++:748: failed: DNS lookup failed.; params.host = unix-abstract; params.service = laminar; gai_strerror(status) = Servname not supported for ai_socktype
stack: 0x7f1abdbe3063 0x7f1abde311c1 0x7f1abde28e2d 0x7f1abde2963f 0x7f1abde11bb2 0x7f1abde23a10 0x42af70 0x42e99e 0x7f1abde18286 0x7f1abde117cb 0x7f1abde14e75 0x431d5f 0x42b4e2 0x4582eb 0x4297f8 0x7f1abc455f10 0x4299e9
Aborted ` So there is some problem with dns? Can you please help me? Thank you

seifertm commented 7 years ago

This looks like an exception from Capn Proto. Version 0.6.1 in Portage is too old, because it does not contain support for abstract unix sockets. You need the git version. Which version are you using?

Since you are using Gentoo, I would like to point to to the ebuild(s) I created for Capn Proto and laminar: https://gist.github.com/seifertm/908fd41e9cad0d4f8a747703aa29bc11 https://gist.github.com/seifertm/75f79b95b36dfbf623ac0887c1b84cf9

palica commented 7 years ago

yes, 0.6.1. I will try your ebuilds and will let you know. Thank you

palica commented 7 years ago

Your ebuilds worked. Thank you. I am getting garbled output from the port. Did I miss something?

ohwgiles commented 7 years ago

Could you please describe in more detail exactly what you ran and what you mean by "garbled output from the port"? The gentoo port or one of laminar's communication ports? Were you able to reach the web UI?

palica commented 7 years ago

I am sorry for not being clear. So to clarify, I am able to install from the supplied ebuilds and also to start laminard, but when trying to reach the interface I get this:

laminar-ci ~ # wget http://localhost:8080
--2017-10-24 22:43:35--  http://localhost:8080/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2442 (2.4K)
Saving to: 'index.html'

index.html                                           100%[=====================================================================================================================>]   2.38K  --.-KB/s   
 in 0s      

2017-10-24 22:43:35 (299 MB/s) - 'index.html' saved [2442/2442]

laminar-ci ~ # cat index.html 
nmo(MM6H8oWVL(Q!]ޥ]C$ΐÙ)uAQ3<
恊1\X11.p߆k<47VբӀdPHī;{z>+^3Ṋ%+4R2j)df
                                      \ EUwʽt
Ab`j_V\?nPJtvz7+,-`%ڃiA|@ϊ+dՖ,[*azӧdb\?,2ñfd,HņʡW: VIʌE"M
     Zps^FXf
            Ӕj~~z
4:b-zoXWӢXgm4Y?gJ#-     JqAn%$eS8wkfRM#
                                       `)$lc+y+ Z,4sV?v�^8p
]s0[    /qR\e1x˂&|AF
e31fS                {`:07oARyH^?%-["N`Bt ooGcBd{
    s'F\*?{;~Ax
               S|O

Almost the same happens when trying to reach with firefox over a proxy, I get a prompt saying compressed content and download option. Opening the "archive" gives similar non-readable content.

Using caddy as proxy. I might try it with nginx. It has to probably do something with the websocks I would guess.

ohwgiles commented 7 years ago

I doubt it has to do with the websockets since they are launched only from javascript and with wget you are fetching just the basic html.

Since wget reports 200 OK, only the HTTP body seems affected. Laminar's static files (including its index HTML page) are all served unconditionally with gzip compression. Perhaps this is what you're seeing. Is laminard listening directly on port 8080 in your command or is it already via your proxy? Can you dump the HTTP headers (curl -v localhost:8080) and check the Content-Encoding header?

palica commented 7 years ago

on the localhost it is directly listening on port 8080 and yes you are right it is served using gzip.

curl -v localhost:8080
* Rebuilt URL to: localhost:8080/
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 8080 (#0)
> GET / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.54.0
> Accept: */*
> 
< HTTP/1.1 200 OK
< Content-Encoding: gzip
< Content-Length: 2442
< Content-Transfer-Encoding: binary
< Server: WebSocket++/0.7.0
< 
nmo(MM6H8oWVL(Q!]ޥ]C$ΐÙ)uAQ3<
恊1\X11.p߆k<47VբӀdPHī;{z>+^3Ṋ%+4R2j)df
                                      \ EUwʽt
Ab`j_V\?nPJtvz7+,-`%ڃiA|@ϊ+dՖ,[*azӧdb\?,2ñfd,HņʡW: VIʌE"M
     Zps^FXf
            Ӕj~~z
4:b-zoXWӢXgm4Y?gJ#-     JqAn%$eS8wkfRM#
                                       `)$lc+y+ Z,4sV?v�^8p
]s0[    /qR\e1x˂&|AF
e31fS                {`:07oARyH^?%-["N`Bt ooGcBd{
    s'F\*?{;~Ax
               S|O

so laminard works as expected.

this is when trying it over proxy with curl

* Rebuilt URL to: 192.168.1.112:8080/
*   Trying 192.168.1.112...
* TCP_NODELAY set
* Connected to 192.168.1.112 (192.168.1.112) port 8080 (#0)
> GET / HTTP/1.1
> Host: 192.168.1.112:8080
> User-Agent: curl/7.54.0
> Accept: */*
> 
< HTTP/1.1 200 OK
< Content-Transfer-Encoding: binary
< Server: Caddy
< Server: WebSocket++/0.7.0
< Date: Tue, 31 Oct 2017 07:19:36 GMT
< Content-Type: text/html; charset=utf-8
< Transfer-Encoding: chunked
< 
<!doctype html>
<html>
<head>
 <base href="/">
 <meta charset="utf-8">
 <meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta name="viewport" content="width=device-width, initial-scale=1">
 <meta name="apple-mobile-web-app-capable" content="yes" />
 <link rel="apple-touch-icon-precomposed" href="/favicon-152.png">
 <title>Laminar</title>
 <script src="/js/vue.min.js"></script>
 <script src="/js/vue-router.min.js"></script>
 <script src="/js/ansi_up.js"></script>
 <script src="/js/Chart.min.js"></script>
 <script src="/js/Chart.HorizontalBar.js"></script>
 <link href="/css/bootstrap.min.css" rel="stylesheet">
 <script src="/js/app.js" defer></script>
 <style>
  body, html { height: 100%; }
  .navbar { margin-bottom: 0; }
  .navbar-brand { margin: 0 -15px; padding: 7px 15px }
  .navbar-brand>img { display: inline; }
  a.navbar-btn { color: #9d9d9d; }
  a.navbar-btn.active { color: #fff; }
  a.navbar-btn:hover { color: #fff; text-decoration: none; }
  a.navbar-btn:focus { color: #fff; }
  dt,dd { line-height: 2; }
  canvas {
   width: 100% !important;
   max-width: 800px;
   height: auto !important;
  }
  .progress {
   height: 10px;
   margin-top: 5px;
   margin-bottom: 0;
  }
  table#joblist tr:first-child td { border-top: 0; }
 </style>
</head>
<body>
 <template id="home"><div>
  <ol class="breadcrumb"><li class="active">Home</li></ol>
  <div class="container-fluid"><div class="row">
   <div class="col-sm-5 col-md-4 col-lg-3 dash">
    <table class="table table-bordered">
     <tr v-for="job in jobsQueued">
      <td><router-link :to="'/jobs/'+job.name">{{job.name}}</router-link> <i>queued</i></td>
     </tr>
     <tr v-for="job in jobsRunning">
      <td><img class="spin small" src="/progress.gif"> <router-link :to="'/jobs/'+job.name">{{job.name}}</router-link> <router-link :to="'/jobs/'+job.name+'/'+job.number">#{{job.number}}</router-link> <div class="progress">
       <div class="progress-bar progress-bar-striped" :class="'progress-bar-'+(job.overtime?'warning':'info')" :class="job.etc?'':'active'" :style="'width:'+(!job.etc?'100':job.progress)+'%'"></div>
       </div>
      </td>
     </tr>
     <tr v-for="job in jobsRecent">
      <td><span v-html="runIcon(job.result)"></span> <router-link :to="'/jobs/'+job.name">{{job.name}}</router-link> <router-link :to="'/jobs/'+job.name+'/'+job.number">#{{job.number}}</router-link><br><small>Took {{job.duration}}s at {{formatDate(job.started)}}</small></td>
     </tr>
    </table>
   </div>
   <div class="col-sm-7 col-md-8 col-lg-9"><div class="row">
    <div class="col-md-6">
     <div class="panel panel-default">
      <div class="panel-heading">Total builds per day this week</div>
      <div class="panel-body">
       <canvas id="chartBpd"></canvas>
      </div>
     </div>
    </div>
    <div class="col-md-6">
     <div class="panel panel-default">
      <div class="panel-heading">Builds per job in the last 24 hours</div>
      <div class="panel-body" id="chartStatus">
       <canvas id="chartBpj"></canvas>
      </div>
     </div>
    </div>
    <div class="col-md-6">
     <div class="panel panel-default">
      <div class="panel-heading">Average build time per job this week</div>
      <div class="panel-body">
       <canvas id="chartTpj"></canvas>
      </div>
     </div>
    </div>
    <div class="col-md-6">
     <div class="panel panel-default">
      <div class="panel-heading">Current executor utilization</div>
      <div class="panel-body">
       <canvas id="chartUtil"></canvas>
      </div>
     </div>
    </div>
   </div></div>
  </div></div> 
 </div></template>

 <template id="jobs"><div>
  <ol class="breadcrumb"><li><router-link to="/">Home</router-link></li><li class="active">Jobs</li></ol>
  <div class="container-fluid"><div class="row">
   <div class="col-xs-12">
    <div class="pull-right">
     <input class="form-control" id="jobFilter" v-model="search" placeholder="Filter...">
    </div>
    <ul class="nav nav-tabs">
     <li :class="{'active':tag==null}"><a href v-on:click.prevent="tag = null">All Jobs</a></li>
     <li v-for="t in tags" :class="{'active':t==tag}"><a href v-on:click.prevent="tag = t">{{t}}</a></li>
    </ul>
    <table class="table table-striped" id="joblist">
     <tr   v-for="job in filteredJobs">
      <td><router-link :to="'/jobs/'+job.name">{{job.name}}</router-link></td>
      <td class="text-center"><span v-html="runIcon(job.result)"></span> <router-link :to="'/jobs/'+job.name+'/'+job.number">#{{job.number}}</router-link></td>
      <td class="text-center">{{formatDate(job.started)}}</td>
     </tr>
    </table>
   </div>
  </div></div>
 </div></template>

 <template id="job"><div>
  <ol class="breadcrumb"><li><router-link to="/">Home</router-link></li><li><router-link to="/jobs">Jobs</router-link></li><li class="active">{{$route.params.name}}</li></ol></ol>
  <div class="container-fluid">
   <div class="row">
    <div class="col-sm-5 col-md-6 col-lg-7">
    <h3>{{$route.params.name}}</h3>
    <dl class="dl-horizontal">
     <dt>Last Successful Run</dt>
     <dd><router-link v-if="lastSuccess" :to="'/jobs/'+$route.params.name+'/'+lastSuccess.number">#{{lastSuccess.number}}</router-link> {{lastSuccess?' - at '+formatDate(lastSuccess.started):'never'}}</dd>
     <dt>Last Failed Run</dt>
     <dd><router-link v-if="lastFailed" :to="'/jobs/'+$route.params.name+'/'+lastFailed.number">#{{lastFailed.number}}</router-link> {{lastFailed?' - at '+formatDate(lastFailed.started):'never'}}</dd>
    </dl>
    </div>
    <div class="col-sm-7 col-md-6 col-lg-5">
    <div class="panel panel-default">
      <div class="panel-heading">Build time</div>
      <div class="panel-body">
      <canvas id="chartBt"></canvas>
      </div>
    </div>
    </div>
   </div>
   <div class="row"><div class="col-xs-12">
    <table class="table table-striped"><thead>
     <tr><th>Run</th><th class="text-center">Started</th><th class="text-center">Duration</th><th class="text-center hidden-xs">Reason</th></tr></thead>
     <tr v-show="nQueued">
      <td colspan="4"><i>{{nQueued}} run(s) queued</i></td>
     </tr>
     <tr v-for="job in jobsRunning" track-by="$index">
      <td><img class="spin small" src="/progress.gif"> <router-link :to="'/jobs/'+$route.params.name+'/'+job.number">#{{job.number}}</router-link></td>
      <td class="text-center">{{formatDate(job.started)}}</td>
      <td class="text-center">--</td>
      <td class="text-center hidden-xs">{{job.reason}}</td>
     </tr>
     <tr v-for="job in jobsRecent" track-by="$index">
      <td><span v-html="runIcon(job.result)"></span> <router-link :to="'/jobs/'+$route.params.name+'/'+job.number">#{{job.number}}</router-link></td>
      <td class="text-center">{{formatDate(job.started)}}</td>
      <td class="text-center">{{job.duration + " seconds"}}</td>
      <td class="text-center hidden-xs">{{job.reason}}</td>
     </tr>
    </table>
   </div></div>
  </div>
 </div></template>

 <template id="run"><div>
  <ol class="breadcrumb"><li><router-link to="/">Home</router-link></li><li><router-link to="/jobs">Jobs</router-link></li><li><router-link :to="'/jobs/'+$route.params.name">{{$route.params.name}}</router-link></li><li class="active">#{{$route.params.number}}</li></ol></ol>
  <div class="container-fluid">
   <div class="row">
    <div class="col-sm-5 col-md-6 col-lg-7">
     <h3 style="float:left"><img class="spin" src="/progress.gif" v-show="job.result === 'running'"><span v-html="runIcon(job.result)"></span> {{$route.params.name}} #{{$route.params.number}}</h3>
     <nav class="pull-left">
      <ul class="pagination" style="margin:15px 20px">
       <li v-show="$route.params.number > 1"><router-link :to="'/jobs/'+$route.params.name+'/'+($route.params.number-1)">&laquo;</router-link></li>
       <li v-show="latestNum > $route.params.number"><router-link :to="'/jobs/'+$route.params.name+'/'+(parseInt($route.params.number)+1)">&raquo;</router-link></li>
      </ul>
     </nav>
     <div style="clear:both;"></div>
     <dl class="dl-horizontal">
      <dt>Reason</dt><dd>{{job.reason}}</dd>
      <dt>Queued for</dt><dd>{{job.queued}}s</dd>
      <dt>Started</dt><dd>{{formatDate(job.started)}}</dd>
      <dt v-show="runComplete(job)">Completed</dt><dd v-show="job.completed">{{formatDate(job.completed)}}</dd>
      <dt v-show="runComplete(job)">Duration</dt><dd v-show="runComplete(job)">{{job.duration}}s</dd>
     </dl>
    </div>
    <div class="col-sm-7 col-md-6 col-lg-5">
     <div class="progress" v-show="job.result == 'running'">
      <div class="progress-bar  progress-bar-striped" :class="'progress-bar-'+(job.overtime?'warning':'info')" :class="job.etc?'':'active'" :style="{width:!job.etc?100:job.progress + '%'}"></div>
     </div>
     <div class="panel panel-default" v-show="job.artifacts.length">
      <div class="panel-heading">Artifacts</div>
      <div class="panel-body">
       <ul class="list-unstyled" style="margin-bottom: 0">
        <li v-for="art in job.artifacts"><a :href="art.url" target="_self">{{art.filename}}</a></li>
       </ul>
      </div>
     </div>
    </div>
   </div>
   <div class="row"><div class="col-xs-12">
    <button type="button" class="btn btn-default btn-xs pull-right" :class="{'active':autoscroll}" v-on:click="autoscroll = !autoscroll" style="margin-top:10px">Autoscroll</button>
    <h4>Console output</h4>
    <pre v-html="log"></pre>
   </div></div>
  </div>
 </div></template>

 <div id="app">
  <nav class="navbar navbar-inverse">
   <div class="container-fluid">
    <div>
     <router-link to="/" class="navbar-brand"><img src="/icon.png">{{title}}</router-link>
     <router-link to="/jobs" class="btn navbar-btn pull-right">Jobs</router-link>
    </div>
   </div>
  </nav>
  <router-view></router-view>
 </div>
</body>
</html>

* Connection #0 to host 192.168.1.112 left intact

but this is still what I am getting with firefox

Firefox source

Firefox trying to save gz content

Is it something with my browser then?

ohwgiles commented 7 years ago

It looks like at least with curl, your proxy is handling the decompression. So the next place I would look is your browser. Can you post the request and response headers from its Inspect/Developer mode? (I'm not that familiar with Firefox)

palica commented 7 years ago

Will this help?

Firefox

palica commented 7 years ago

Or this?

Firefox

ohwgiles commented 7 years ago

Yes that helps. It looks like something is inserting Content-Type: application/x-gzip in the response headers, which is probably what causes Firefox to present it as a download rather than decompressing it and displaying the html. What I don't understand is why it happens from Firefox but not from curl.

Anyway it's probably my fault for being lazy. I don't actually explicitly set the Content-Type header anywhere, which would be the smart thing to do. I'll prepare a fix and let's see if it helps

palica commented 7 years ago

Perfect, will wait for fix and test for you. Thank you very much.

ohwgiles commented 7 years ago

Fix pushed to master

palica commented 7 years ago

Works, big thank you.

Screenshot

palica commented 7 years ago

And it works :)

Screenshot

palica commented 7 years ago

Loving it! Thank you.