How does it work app deploy/run and watcher flow?

38 views
Skip to first unread message

xilarra...@qdqmedia.com

unread,
Apr 23, 2015, 8:42:00 AM4/23/15
to tsuru...@googlegroups.com
Hi!

First of all I like to say that you are doing an awesome work :)

At work we started testing Tsuru, and we have some doubts about the application deployment.

How does it work the deployment flow between circus, procfile and tsuru unit agent? Isn't clear in the docs. I deployed and application in Go but if I kill the app the watcher doesn't restart the application automatically, How can I configure that? it's implemented?

Also the stdout doesn't log with app-log, is that a bug? the docs say that app-log captures stdout and stderr.

Thank you!

Francisco Souza

unread,
Apr 23, 2015, 9:07:57 AM4/23/15
to xilarra...@qdqmedia.com, tsuru...@googlegroups.com
On Thu, Apr 23, 2015 at 4:54 AM, <xilarra...@qdqmedia.com> wrote:
> Hi!

Hey there! :)

> [...]
>
> How does it work the deployment flow between circus, procfile and tsuru unit
> agent? Isn't clear in the docs. I deployed and application in Go but if I
> kill the app the watcher doesn't restart the application automatically, How
> can I configure that? it's implemented?

How did you deploy the application? Which platform you're using? You
need to check whether circus is actually managing the application
process, this is defined by the platform. FTR, our Go platform doesn't
use circus [1], but it should, so I will work to fix it today.

Here is the relation:

- tsuru-unit-agent is reponsible for the start-up of the unit, it does
the initial communication with tsuru (registering the unit there and
retrieving environment variables from the tsuru API), and invokes the
start script defined in the platform. Usually, the start script just
calls Circus [2], but this isn't the case for the Go platform [1]
- before calling the start script, tsuru-unit-agent reads the Procfile
and generates the circus configuration file

> Also the stdout doesn't log with app-log, is that a bug? the docs say that
> app-log captures stdout and stderr.

tsuru depends on Circus for capturing stdout and stderr, so it's
another bug in the Go platform. I'm working to fix it right now.

[1] https://github.com/tsuru/basebuilder/blob/master/go/start
[2] https://github.com/tsuru/basebuilder/blob/master/python/install

Thanks,
Francisco

xilarra...@qdqmedia.com

unread,
Apr 23, 2015, 9:35:55 AM4/23/15
to tsuru...@googlegroups.com, xilarra...@qdqmedia.com
Thank you for the response!

Yeah I'm using tsuru's default go platform. 

I understand now :D. 

But reading the install script of python I have another question. I understand that go platform calls start script, but python doesn't have start script, so I guess that you call the start script from base platform, the question is, who, when and where decides wich script to run?

Thanks!

Francisco Souza

unread,
Apr 23, 2015, 11:45:24 AM4/23/15
to xilarra...@qdqmedia.com, tsuru...@googlegroups.com
Hi!

I just updated the Go platform, so you can fix it by running
tsuru-admin platform-update:

$ tsuru-admin platform-update go -d
https://raw.githubusercontent.com/tsuru/basebuilder/master/go/Dockerfile

On Thu, Apr 23, 2015 at 10:35 AM, <xilarra...@qdqmedia.com> wrote:
> Thank you for the response!
>
> Yeah I'm using tsuru's default go platform.
>
> I understand now :D.
>
> But reading the install script of python I have another question. I
> understand that go platform calls start script, but python doesn't have
> start script, so I guess that you call the start script from base platform,
> the question is, who, when and where decides wich script to run?

tsuru-unit-agent will always invoke /var/lib/tsuru/start. It's up to
the platform to place the proper start script in this path. We do
provide a base start script, but the platform still needs to copy it
to the path /var/lib/tsuru/start.

The Go platform now doesn't have a custom start script anymore, so it
also copies the base start. All platforms do the start copying inside
the Dockerfile, so you can see it for the Python platform:
https://github.com/tsuru/basebuilder/blob/master/python/Dockerfile#L12.

Best wishes,
Francisco

xilarra...@qdqmedia.com

unread,
Apr 24, 2015, 3:12:15 AM4/24/15
to tsuru...@googlegroups.com, xilarra...@qdqmedia.com
Thank you!

We will try it today :)

xilarra...@qdqmedia.com

unread,
Apr 27, 2015, 7:06:33 AM4/27/15
to tsuru...@googlegroups.com, xilarra...@qdqmedia.com
Hi!

I just tried and it seems that the app has GOPATH env var problems when I deploy it:

remote: tar: Removing leading `/' from member names
remote: package github.com/jmoiron/sqlx: cannot download, $GOPATH not set. For more details see: go help gopath
remote: package github.com/jmoiron/sqlx/types: cannot download, $GOPATH not set. For more details see: go help gopath
remote: package github.com/lib/pq: cannot download, $GOPATH not set. For more details see: go help gopath
remote: package github.com/nu7hatch/gouuid: cannot download, $GOPATH not set. For more details see: go help gopath
remote: package github.com/streadway/amqp: cannot download, $GOPATH not set. For more details see: go help gopath

I'm doing regular source code deploy (not binary)

Regards.

Francisco Souza

unread,
Apr 27, 2015, 10:18:07 AM4/27/15
to xilarra...@qdqmedia.com, tsuru...@googlegroups.com
Hi!

My bad, there was another bug in the platform. Now it's _truly_ fixed.
Can you please try again?

Sorry about the incovenience!

Thanks,
Francisco
> --
> You received this message because you are subscribed to the Google Groups
> "tsuru" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to tsuru-users...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

xilarra...@qdqmedia.com

unread,
Apr 30, 2015, 3:29:15 AM4/30/15
to tsuru...@googlegroups.com, xilarra...@qdqmedia.com
Hi!

Now the app builts perfectly.

Many thanks, good job! :D
Reply all
Reply to author
Forward
0 new messages