These are chat archives for azukiapp/azk

30th
Jan 2016
Slobodan Mišković
@slobo
Jan 30 2016 00:03
@Bartekus, i don't know anything about socketclusters in particular, but maybe you can post relevant sections of your Azkfile and the pertaining error log and maybe something stands out...
Bartek Kus
@bartekus
Jan 30 2016 00:44
here is my azkfile:
/**
 * Documentation: http://docs.azk.io/Azkfile.js
 */
// Adds the systems that shape your system
systems({
  meatier: {
    // Dependent systems
    depends: ["rethinkdb"],
    // More images:  http://images.azk.io
    image: {"docker": "azukiapp/node"},
    // Steps to execute before running instances
    provision: [
      "npm install",
    ],
    workdir: "/azk/#{manifest.dir}",
    shell: "/bin/bash",
    command: ["npm", "run", "quickstart"],
    wait: {"retry": 20, "timeout": 1000},
    mounts: {
      '/azk/#{manifest.dir}': sync("."),
      '/azk/#{manifest.dir}/node_modules': persistent("./node_modules"),
    },
    scalable: {"default": 1},
    http: {
      domains: [ "#{system.name}.#{azk.default_domain}" ]
    },
    ports: {
      // exports global variables
      http: "3000/tcp",
    },
    envs: {
      // Make sure that the PORT value is the same as the one
      // in ports/http below, and that it's also the same
      // if you're setting it in a .env file
      NODE_ENV: "dev",
      PORT: "3000",
    },
  },
  rethinkdb: {
    image: { docker: "rethinkdb" },
    shell: '/bin/bash',
    scalable: false,
    command: "rethinkdb --bind all --directory ./rethinkdb",
    wait: {"retry": 20, "timeout": 1000},
    mounts: {
      '/rethinkdb': persistent('rethinkdb-#{manifest.dir}'),
    },
    ports: {
      http: "8080",
      data: "28015",
    },
    http: {
      domains: [ '#{system.name}.#{azk.default_domain}' ],
    },
    export_envs: {
      "DATABASE_URL": 'rethinkdb://#{net.host}:#{net.port.data}',
    }
}
});
I'm not 100% sure, but it's been in this state for quite a while now so it could very well hang, but I don't want to disrupt it this time, just cleaned my system as to do a clean setup:
azk start -o && azk logs --follow                   2 ↵  10365  16:57:50
azk: ↑ starting `rethinkdb` system, 1 new instances...
azk: ✓ checking `library/rethinkdb:latest` image...
azk: ◴ waiting for `rethinkdb` system to start, trying connection to port http/tcp...
azk: ↑ starting `meatier` system, 1 new instances...
azk: ✓ checking `azukiapp/node:latest` image...
azk: ↻ provisioning `meatier` system...
Slobodan Mišković
@slobo
Jan 30 2016 00:53
I usually do azk start -vv to have it spit out provisioning output as it happens :)
but yeah, if it comes up with EPERM again, let's see which files it's complaining about
I know that some docker images have USER set inside, so I have to add this to Azkfile (for a particular system)
    docker_extra: {
      User: 'root',
    }
Bartek Kus
@bartekus
Jan 30 2016 01:23
good to know, this was taking long enough, it's frozen for sure, I'll apply the setting that you sugest and try again
Bartek Kus
@bartekus
Jan 30 2016 02:33
@slobo much obliged to you good sir, being able to see what's going on allowed me to respond appropriately and along with the proper user setting/accessing I've completed the deployment! Awesome, thank you again and thank you azk.io for being damn near perfect.... makes me very happy
Slobodan Mišković
@slobo
Jan 30 2016 06:20
@Bartekus, glad I could help! I fell in love with azk too - it allowed us for the first time to have entire production stack on each developer machine - prior to that certain changes were only testable in production, yeah, don't ever want to go back to that again :)
Gullit Miranda
@gullitmiranda
Jan 30 2016 11:44
@slobo IO event is one thing missing in nfs, but has some other issues (I'm not remember at the moment).
I have not worked much in azk itself lately. I have worked in more azk API.
Gullit Miranda
@gullitmiranda
Jan 30 2016 11:54
Thank @slobo.
to debug these problems always recommend using the azk shell.
eg:
azk start rethinkdb
azk shell
npm install
npm run quickstart
Bartek Kus
@bartekus
Jan 30 2016 22:52

@gullitmiranda indeed that's true, but it was a benefit to me as I was not aware of this command (my own ignorance here being at fault, but none the less). However what did solve the problem was using:

docker_extra: {
      User: 'root',
    }

Installing or running an that was dependent on socketcluster proved to be otherwise impossible in docker environment. So while ordinarily a proper root-like user should be created for use by socketcluster, I went with the next best-worst-thing (depending on how you look at it) and used the root credentials already present in the docker container. However if you guys provide a way to setup such user in a form that can easily be added to the starting script I certainly would like to know it. As per issue ticket that you have assisted me with @gullitmiranda the problem really wasn't azk's per say, but rather with the container, or the docker not allowing certain functions to be accessible in the normal user mode used by the azk. At the time of the issue-resolving process my awareness of that potential was not at all realized. Only after deeper inquiry into the nature of the 'EPERM' problem was I able to postulate that it's file-access problem and as @slobo rightly suggested, the problem has been resolved immediately, in both the installation and the operation aspect of the whole application.

Bartek Kus
@bartekus
Jan 30 2016 23:02

Since my team and I are working on a whole application stack, we want the initial aspect of the installation as easy and straight forward as possible, with advance set of commands available to advance users who wish to get more acquitted with the inner-functioning of the stack. Think of it as rails application, where generating something is easy, while understanding what has been generated, why, how and everything else, while available, is not necessarily required of the end user. I for one certainly appreciate and benefit from both the <code>azk shell</code> and <code>azk start -vv</code>. I think normal installation command for an end user will look somewhat like this:

azk start -vv && azk logs --follow

But I'm still technically needing to start the db first to figure out whats the port that it's gonna end up using, then I need to modify the db config file to reflect that change, as otherwise both db and the application gonna boot up, but the functionality within app will not be present as it's not able to connect and hydrate the basic databse structure for its proper use.

is there a way to dynamically link the two from within the azk config file?
Djamy
@Djamy
Jan 30 2016 23:05
You could fix the port to avoid to get a generated one, I suppose
Bartek Kus
@bartekus
Jan 30 2016 23:05
I do have the data port specified, the config is posted above
tho now that I look at it, I see my mistake.... gotcha in envs I still need to specify it
it makes sens, doh me again lol
sense*
Djamy
@Djamy
Jan 30 2016 23:09
:smile:
Bartek Kus
@bartekus
Jan 30 2016 23:09
thank you for the push in right direction, clearly I'm blind lol
Gullit Miranda
@gullitmiranda
Jan 30 2016 23:10
rsrsrsrs
Djamy
@Djamy
Jan 30 2016 23:10
It happens.. :)
Someone knows why the "syncing files" step doesn't end after an azk start ?
Gullit Miranda
@gullitmiranda
Jan 30 2016 23:13
@Bartekus unfortunately when we are working with applications on the host machine do not give importance to dynamic settings. put an application in a container does identify a number of problems that can be found in production. Do not use ENVs is one.
@Bartekus you know the 12 factor?
--
@Djamy after the initial sync only new changes are synchronized.
Bartek Kus
@bartekus
Jan 30 2016 23:15
not as well as I perhaps should :/ but then perhaps I should
however if ones is not to use the azk's envs.... oh indeed, use the .env .... but for learning, should I have .env already added to the structure or can it be left in the azk config?
Djamy
@Djamy
Jan 30 2016 23:18
@gullitmiranda Okay but I'm stuck to this step and it doesn't launch my container. I waited for more than 15 minutes. Do you have an idea ?
Bartek Kus
@bartekus
Jan 30 2016 23:18
down the road the deployment of this stack will be the goal, but obviously by then, all the security aspects will need to be addressed, for now I would simply highlight that it's not production ready/safe so that the end user is aware that additional steps need to be addressed in case of production-deployment
Gullit Miranda
@gullitmiranda
Jan 30 2016 23:20
It is recommended to place sensitive data in the .env.
already settings, it is recommended to be in Azkfile since it is versioned.
@Djamy usually it happens when something that should not being synchronized.
like as builded files
By default, azk ignores the following elements when syncing: .syncignore, .gitignore, Azkfile.js, .azk/ and .git/.
Djamy
@Djamy
Jan 30 2016 23:23
Thank you @gullitmiranda
Gullit Miranda
@gullitmiranda
Jan 30 2016 23:30
you're welcome :blush: