These are chat archives for azukiapp/azk

14th
May 2015
Slobodan Mišković
@slobo
May 14 2015 18:51
for { mounts: { '/path': persistent('foo')}} documentation says "persistent allows to share data across applications". Does that mean that if I have /folder1/Azkfile.js and /folder2/Azkfile.js both will get the same data for persistent('foo')?
Gullit Miranda
@gullitmiranda
May 14 2015 18:52
no
Slobodan Mišković
@slobo
May 14 2015 18:53
ok, good, i was dreading having to ensure different persistent names :)
Gullit Miranda
@gullitmiranda
May 14 2015 18:54
it allows sharing between of the same project applications (Azkfile.js).
it is not necessary =D
Slobodan Mišković
@slobo
May 14 2015 18:56
consider changing the docs wording to clarify: "Using the same parameter with the persistent option allows you to share data across systems in the same Azkfile.js".
Gullit Miranda
@gullitmiranda
May 14 2015 18:58
You could open an issue for this? =D
Slobodan Mišković
@slobo
May 14 2015 19:04

Q2: I want to have a custom suffix for http: { domains:, say

    http: {
      domains: [ "#{system.name}.#{my_domain}" ]
    },

I tried putting on top of Azkfile.js something like

var my_domain = manifest.dir + '.' + azk.default_domain;

but that results in error: "Manifest not defined". Now, I solved my problem by doing

    http: {
      domains: [ "#{system.name}.#{manifest.dir}.#{azk.default_domain}" ]
    },

But am wondering in general how much JS is allowed / encouraged in Azkfile.js? What variables / functions are allowed in there?

Come to think of it, these values are not interpolated right away, but only later in execution, right?
Gullit Miranda
@gullitmiranda
May 14 2015 19:11
The Azkfile.js is based on JS, but is its own DSL. We discourage the use of javascript, precisely because it is not documented which can be used JS.
And yes, the value is interpolated later, so you must use the last form.
Slobodan Mišković
@slobo
May 14 2015 19:12
do you see any downside to doing this:
var http_template = {
  domains: [ "#{system.name}.#{manifest.dir}.#{azk.default_domain}" ]
};
systems({
  sys1: {
    http: http_template,
    // ...
  },
  sys2: {
    http: http_template,
    // ...
  },
  // ...
 });
There is lots of benefits to having full power of javascript in Azkfile.js, I found it usefull in say grunt. I like the DSL that you provide since it will let you change internals easier, but if you decide that JavaScript is a total no-no, i'd then rename the file to Azkfile, without .js to stop the temptation :)
Slobodan Mišković
@slobo
May 14 2015 19:19
btw, whats the reason to disallow the use of underscore in system names? something with internals?
Gullit Miranda
@gullitmiranda
May 14 2015 19:19

No, actually, in the Azkfile.js AZK we used that way. But there is a more elegant way to do this extension:

systems({
  sys1: {
    http: {
      domains: [ "#{system.name}.#{manifest.dir}.#{azk.default_domain}" ]
    },
    // ...
  },
  sys2: {
    extends: 'sys1'
    // ...
  },
  // ...
});

http://docs.azk.io/en/reference/azkfilejs/extends.html

Slobodan Mišković
@slobo
May 14 2015 19:20
hm, in my case the only similarity between the systems is in the domain scheme, everything else is different so feels dirty to have them extend each other.
Gullit Miranda
@gullitmiranda
May 14 2015 19:21
I do not remember exactly why. What I remember is that some browsers do not allow case-sensitive.
In this case use a var is more useful to you.
Slobodan Mišković
@slobo
May 14 2015 19:22
"indexWorker" is accepted, but "index_worker" is not as system name
Gullit Miranda
@gullitmiranda
May 14 2015 19:23
@saitodisse you remember the reason for not accepting "_" in the field?
Slobodan Mišković
@slobo
May 14 2015 19:23
"index-worker" is accepted too, but then I have to quote it in the file, hence i preferred to use underscore (not uppercase)
Gullit Miranda
@gullitmiranda
May 14 2015 19:24
:point_up: May 14 2015 4:23 PM cc: @fearenales
Felipe Arenales Santos
@fearenales
May 14 2015 19:27
hmm let's dig! 1 min @slobo !
here it is: https://github.com/azukiapp/azk/blob/master/src/manifest/index.js#L180-L183
I confess I don't know why we only support that pattern, but @nuxlli surely does
Slobodan Mišković
@slobo
May 14 2015 19:50
thanks
Gullit Miranda
@gullitmiranda
May 14 2015 19:51
@nuxlli said: "container name of limitation in docker"
@slobo ^
Slobodan Mišković
@slobo
May 14 2015 19:52
that makes sense, thanks for checking into it!
for azk agent on OSX, why does it remove virtual machine on start, and does that wipe out any of the existing containers / persistent data?
Gullit Miranda
@gullitmiranda
May 14 2015 19:53
no
The VM is removed, but the disk is maintained.
Slobodan Mišković
@slobo
May 14 2015 19:54
perfect!
Slobodan Mišković
@slobo
May 14 2015 20:34
last time you guys helped me setup a system that isn't expected to stay running, instead just used for running a set of provisioning commands that are not appropriate for any other system (such as testing database migrations). This was via wait: false and. However, because that system goes down azk start returns an error status code. Are there plans to add support for these "standby" systems so that azk start doesn't see them as failed and thus be more useful when scripting azk?
In the meantime I suppose I can keep the system running by setting command: "sleep forever" or similar...
Gullit Miranda
@gullitmiranda
May 14 2015 20:39
It is a system that you do not normally does not start, you can disable the start by default:
scalable: {default: 0}
and why it is returning an error?
Slobodan Mišković
@slobo
May 14 2015 20:40
i have that, but it still tries to start it
actually, i have scalable: {"default": 0, limit: 1},
Gullit Miranda
@gullitmiranda
May 14 2015 20:42
And to answer your question, yes, the next versions of azk you have the concept of contexts where you can set different types of systems, such as compilation and build.
if the scalable.default is to 0, it should only be started if u specify that you want it: azk start system
except you have defined this system as a dependency.
Slobodan Mišković
@slobo
May 14 2015 20:45
it's not a dependency, but still tries to start it
it does have depends of its own if that matters
Gullit Miranda
@gullitmiranda
May 14 2015 20:46
You could send me your Azkfile.js?
Slobodan Mišković
@slobo
May 14 2015 20:48
sure, PMd you
Gullit Miranda
@gullitmiranda
May 14 2015 20:50
ok
Slobodan Mišković
@slobo
May 14 2015 20:50
interesting, it did try the start, but this time status code was 0. i think it was returning 3 before because some systems were already running
Slobodan Mišković
@slobo
May 14 2015 20:56
in this case i would have expected "azk start" to be idempotent, i.e. to just ensure all systems running and return success if so. Or is there another command for that?
Gullit Miranda
@gullitmiranda
May 14 2015 21:02

I identified what is happening. There is a bug if the limit is not 0, it starts the system.

If I well understand your question, you like to have a way for the 'AZK start` not stop on error?

Slobodan Mišković
@slobo
May 14 2015 21:03
ok, i'll try adding limit: 0
i would like (azk start && azk start) to return status code 0 if all systems are going .
right now
azk start ; echo $?; azk start; echo $?
returns 0, then 3
since second command finds systems already running and i guess it thinks that's an error.
Gullit Miranda
@gullitmiranda
May 14 2015 21:07
In this case, the second command will even return an error because the system is already set up.
Slobodan Mišković
@slobo
May 14 2015 21:09
is there a command that would do what I expect? like azk ensure-all-started that I can put in a script and have it only return error code if something couldn't be started?
Gullit Miranda
@gullitmiranda
May 14 2015 21:13
yes
a moment, I will try, because we've done it a few times.
in this case it is made to see if the agent is launched, more can use the same principle to the start.
Gullit Miranda
@gullitmiranda
May 14 2015 21:28
you can open the issue on the bug scalable: {default: 0, limit: 1}?
Slobodan Mišković
@slobo
May 14 2015 21:50
#405, thanks
Gullit Miranda
@gullitmiranda
May 14 2015 21:51
I thank you.
Slobodan Mišković
@slobo
May 14 2015 21:59
btw, circleci is complaining on pull requests. it says: Please contact CircleCI support for iOS beta access. Does azk need iOS support?
Felipe Arenales Santos
@fearenales
May 14 2015 22:12
oh @slobo , don't worry about it. We used to use CircleCi and probably there's a webhook remaining in Github settings... :/ Should be fixed ASAP
Slobodan Mišković
@slobo
May 14 2015 22:14
what CI system are you switching to?
Felipe Arenales Santos
@fearenales
May 14 2015 22:14
Jenkins
not the best one, but we need to run it in a MacOS X box in order to test azk properly
Slobodan Mišković
@slobo
May 14 2015 22:15
hosting your own?
Felipe Arenales Santos
@fearenales
May 14 2015 22:15
yes
Slobodan Mišković
@slobo
May 14 2015 22:19
would travis-ci work, i think they do osx? (these days i try not to manage any systems i don't have to :) )
hm, i guess they already run inside a VM, so starting vbox would not work
gitlab multi runner works on OSX, so you could just register one OSX box as a runner and not worry about managing the CI server. But not sure how well GitLab CI integrates with hosting code and issues on GitHub
Slobodan Mišković
@slobo
May 14 2015 22:24
btw, have you considered OpenSUSE Build Service for libnssresolver packages?
Also, I tried building it under CentOS and had some issue with scons not finding downloaded files without symlinking build/build to build, but that might have been my env, not sure you ever saw it.