These are chat archives for azukiapp/azk

6th
May 2015
Slobodan Mišković
@slobo
May 06 2015 22:48
What is the best way to extract ports/environment variables from a running azk containers onto the host machine?
Ex, say we have a mysql container which exports some ports and envs. If I wanted to connect to it from the host machine, right now I look at azk status to see which port it is bound on and then I run mysql -h dev.azk.io --port=49xxx.
But this is time consuming and not very scriptable. I suppose some awk/sed/... magic could be used to extract output of azk status, but that seem too brittle. Is there a way to get say a JSON, or even just key=value pairs that would be easy to use in other scripts? Ideally all env variables available to dependent systems would be easy to get to from the host machine.
Heitor Tashiro Sergent
@heitortsergent
May 06 2015 23:02
hey @slobo , we're looking into this. You could run azk shell -c "env" and that would return all environment variables inside the containers. But it wouldn't return the port information for example
I'm trying to think if there's another way to do it, but we might have to open an issue to implement this
Gullit Miranda
@gullitmiranda
May 06 2015 23:03

I believe @fearenales can help you with this, since he did some things like preparing the build azk.

We have discussed about adding a --json option for AZK stauts but this issue was not registered. He will be able registers it the he thinks it shouldnt be?

Felipe Arenales Santos
@fearenales
May 06 2015 23:08
@slobo please check if @heitortsergent 's solution works for you. In your case, I think it will.
But you're right, I don't think we have a proper way to get env vars. Would you mind to open an issue at Github reporting this?
Slobodan Mišković
@slobo
May 06 2015 23:09
@heitortsergent ok, getting somewhere. looking at the output tho i see some but not all env variables that are available in containers.
ex, i see stuff from mysql system, but not from say my postgres system.
and actually port information is available in MYSQL_DATA_PORT so that's great
ah, I see, it decided to run in the first system it found.
So I would have to execute azk shell in whatever system would have the vars. I suppose that will solve my immediate issue.
Slobodan Mišković
@slobo
May 06 2015 23:21
posted #394
Felipe Arenales Santos
@fearenales
May 06 2015 23:23
great, @slobo ! Good to hear the solution worked for you and thank you very much for your support!
Slobodan Mišković
@slobo
May 06 2015 23:26
very excited about azk. My only complaint is that I didn't find out about it until after I spent a weekend trying to mess with a giant Dockerfile :)
Felipe Arenales Santos
@fearenales
May 06 2015 23:31
we're sorry! haha :P
It's great to have support from the community!
Slobodan Mišković
@slobo
May 06 2015 23:36

Are there any downsides to specifying systems that are not meant to be running?
Ex, I use sqitch do manage database configuration changes, but I don't want to install it locally. Instead I just define a system that points to an image on docker registry, register some depends on a database system, and then use it via
azk shell sqitch -c "sqitch deploy" --target=\$DATABASE_URI

Is this a supported thing, or it just happens to work and might cause some issues?

Felipe Arenales Santos
@fearenales
May 06 2015 23:45
I think it's perfectly ok. Even you don't running it, you're using it in some way.
@gullitmiranda in the @slobo 's case, could he put the sqitch command in the Azkfile.js (provision or shell section) so that run when the system started? Does it would make things easier for you, @slobo ?
Slobodan Mišković
@slobo
May 06 2015 23:54
In this case I want to control when I run it - when developing database changes I run it lots of times till I'm happy with the changes. But yes, maybe useful when doing azk restart to migrate the database anyways so other devs don't forget
Is it true that shell section in Azkfile.js only takes full path, and we can't specify arguments to the shell?