Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Slobodan Mišković
    @slobo
    ok, good, i was dreading having to ensure different persistent names :)
    Gullit Miranda
    @gullitmiranda
    it allows sharing between of the same project applications (Azkfile.js).
    it is not necessary =D
    Slobodan Mišković
    @slobo
    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
    You could open an issue for this? =D
    Slobodan Mišković
    @slobo

    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
    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
    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
    btw, whats the reason to disallow the use of underscore in system names? something with internals?
    Gullit Miranda
    @gullitmiranda

    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
    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
    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
    "indexWorker" is accepted, but "index_worker" is not as system name
    Gullit Miranda
    @gullitmiranda
    @saitodisse you remember the reason for not accepting "_" in the field?
    Slobodan Mišković
    @slobo
    "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
    :point_up: May 14 2015 4:23 PM cc: @fearenales
    Felipe Arenales Santos
    @fearenales
    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
    thanks
    Gullit Miranda
    @gullitmiranda
    @nuxlli said: "container name of limitation in docker"
    @slobo ^
    Slobodan Mišković
    @slobo
    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
    no
    The VM is removed, but the disk is maintained.
    Slobodan Mišković
    @slobo
    perfect!
    Slobodan Mišković
    @slobo
    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
    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
    i have that, but it still tries to start it
    actually, i have scalable: {"default": 0, limit: 1},
    Gullit Miranda
    @gullitmiranda
    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
    it's not a dependency, but still tries to start it
    it does have depends of its own if that matters
    Gullit Miranda
    @gullitmiranda
    You could send me your Azkfile.js?
    Slobodan Mišković
    @slobo
    sure, PMd you
    Gullit Miranda
    @gullitmiranda
    ok
    Slobodan Mišković
    @slobo
    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
    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

    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
    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
    In this case, the second command will even return an error because the system is already set up.
    Slobodan Mišković
    @slobo
    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
    yes