Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Andreas Schmelas
    @m9dfukc
    By the way I'm using the latest AZK version 0.18.0
    My azkfile looks like this:
    /**
     * Documentation: http://docs.azk.io/Azkfile.js
     */
    // Adds the systems that shape your system
    systems({
      'azk-craft2': {
        // Dependent systems
        depends: ["mariadb"],
        // More images:  http://images.azk.io
        image: {"docker": "azukiapp/php-fpm:5.6"},
        // Steps to execute before running instances
        provision: [
          "composer install"
        ],
        workdir: "/azk/#{manifest.dir}",
        shell: "/bin/bash",
        wait: 45,
        mounts: {
          '/azk/#{manifest.dir}': sync("."),
          '/azk/#{manifest.dir}/craft/storage': persistent("./craft/storage"),
          '/azk/#{manifest.dir}/public/uploads': persistent("./public/uploads"),
          '/azk/#{manifest.dir}/vendor': persistent("./vendor"),
          '/azk/#{manifest.dir}/composer.lock': path("./composer.lock"),
          '/etc/nginx/sites-enabled/default': path('./craft.conf')
          /*,
          '/etc/nginx/sites-available/craft.conf': path("./craft.conf")*/
        },
        scalable: {"default": 1},
        http: {
          domains: [
            "#{system.name}.#{azk.default_domain}",
            "#{env.HOST_DOMAIN}",
            "xxx.eu-central-1.compute.amazonaws.com"
          ]
        },
        ports: {
          // exports global variables
          http: "80/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
          APP_DIR: "/azk/#{manifest.dir}",
        },
      },
      'mariadb': {
        image: { 'docker': 'mariadb:10.1.10' },
        shell: '/bin/bash',
        wait: 25,
        mounts: {
          '/var/lib/mysql': persistent('mariadb_data'),
        },
        ports: {
          data: '3306:3306/tcp',
        },
        envs: {
          MYSQL_USER         : 'xxx',
          MYSQL_PASSWORD     : 'xxx',
          MYSQL_ROOT_PASSWORD: 'xxx',
          MYSQL_DATABASE     : 'xxx'
        },
        export_envs: {
          DATABASE_URL: 'mysql2://#{envs.MYSQL_USER}:#{envs.MYSQL_PASSWORD}@#{net.host}:#{net.port.data}/#{envs.MYSQL_DATABASE}',
          DB_HOST: '#{net.host}',
          DB_PORT: '#{net.port.data}',
          DB_NAME: '#{envs.MYSQL_DATABASE}',
          DB_USER: '#{envs.MYSQL_USER}',
          DB_PASS: '#{envs.MYSQL_PASSWORD}'
        }
      },
      deploy: {
        image: {"docker": "azukiapp/deploy"},
        mounts: {
          "/azk/deploy/src":          path("."),
          "/azk/deploy/.ssh":         path("#{env.HOME}/.ssh"),
          "/azk/deploy/.config":      persistent("deploy-config")
        },
        scalable: {"default": 0, "limit": 0},
        envs: {
          HOST_DOMAIN:                "xxx.eu-central-1.compute.amazonaws.com",
          REMOTE_HOST:                "xx.xx.xx.xxx",
          REMOTE_ROOT_USER:           "ubuntu",
          SSH_PRIVATE_KEY_FILE:       "aws"
        }
      }
    });
    
    setDefault("azk-craft2");
    Connecting to the remote EC2 instance via ssh – either in the azk deploy shell or from my osx terminal - works just fine!
    Andreas Schmelas
    @m9dfukc
    But trying to deploy via azk deploy -vvvv results in:
    PLAY ***************************************************************************
    
    TASK [setup] *******************************************************************
    fatal: [default]: UNREACHABLE! => {"changed": false, "msg": "ERROR! SSH encountered an unknown error during the connection. We recommend you re-run the command using -vvvv, which will enable SSH debugging output to help diagnose the issue", "unreachable": true}
    
    PLAY RECAP *********************************************************************
    default                    : ok=0    changed=0    unreachable=1    failed=0
    Booth the "working" EC2 instance and the production EC2 instance running "ubuntu-trusty-14.04-amd64-server".
    Andreas Schmelas
    @m9dfukc
    Hmm, looks like this is a buck in AZK when using a different SSH_PRIVATE_KEY_FILE then the default one (id_rsa). I just added my ssh credentials to my .ssh/config file, restarted the AZK agent and now it works. And now I vaguely remember that I did similar things last time for my test project - strange thing is, I later removed the credentials again it it kept working!
    can anybody confirm that this is a actual bug and not just some weird hickup with of setup - if so I'll file a bugreport
    Saito
    @saitodisse

    And now I vaguely remember that I did similar things last time for my test project - strange thing is, I later removed the credentials again it it kept working!

    Hi @m9dfukc, that happens because azk just copy your ssh keys to its persistent folder. As you are using 0.18 version (this is cool) you can use the new azk info --filter=mounts. I've not tested yet, but you may see the deploy-configpersistent folder. Please check files inside this folder.

    Slobodan Mišković
    @slobo

    hey folks, I'm experiencing a different behaviour of azk restart -vv --rebuild --reprovision based on whether i supply a system name or not. It seems that some systems don't get rebuilt/reprovisioned unless mentioned by name, perhaps if they are started as dependencies of other systems. Eg:

    $ azk restart -vv --rebuild --reprovision
    ...
    azk: ↑ starting `aws-s3` system, 1 new instances...
    azk: ✓ checking `azkbuild/566092ff42-proxy:98aa82643a7c835e23bcce9f2926544a83839e21` image...
    azk: ◴ waiting for `aws-s3` system to start, trying connection to port http/tcp...
    ...

    vs

    $ azk restart -vv --rebuild --reprovision aws-s3
    azk: ↓ stopping `aws-s3` system, 1 instances...
    azk: ↑ starting `aws-s3` system, 1 new instances...
    azk: ✓ checking `jbergknoff/s3rver:latest` image...
    azk: ⇲ downloading `jbergknoff/s3rver:latest` image...
    azk: ⇲ comparing registry layers and local layers...
    azk: ⇲ pulling 6/6 layers.
         [=======                                          ] 17% 1/6
    azk: ✓ completed download of `jbergknoff/s3rver:latest`
    
    azk: ↻ provisioning `aws-s3` system...
    azk: ◴ waiting for `aws-s3` system to start, trying connection to port http/tcp...
    Slobodan Mišković
    @slobo
    now, it makes sense to me to not reprovision/rebuild system dependencies when I supply a system name (say, i don't want to have to reprovision the dependent database when rebuilding webserver image), but when not specifying a system name I expect -RB to apply to all the systems. I think I started noticing the 'wrong' behaviour with 0.17 and it's also on 0.18
    Saito
    @saitodisse
    you are absolute right: azukiapp/azk#530
    @slobo
    Slobodan Mišković
    @slobo
    @saitodisse, ah, thanks, should have looked through the issue queue :) So, azk stop followed by azk start -R should do the correct behaviour if I understand until the bug is fixed - i'll try that.
    Saito
    @saitodisse
    Yes, that correct. To reprovision all systems we have to call each one separately. That is a complex bug. Sorry.
    Slobodan Mišković
    @slobo
    no worries. I'd suggest next release to error out or output a warning message when -R is used without system name if the bug can't be addressed
    Gullit Miranda
    @gullitmiranda
    good suggestion @slobo
    Slobodan Mišković
    @slobo
    not knowing any of the azk start/stop internals, but curious to find of what is the reason that restart isn't basically just an alias for stop + start, especially if no system is specified?
    Everton Ribeiro
    @nuxlli

    Imagine a scenario with three systems: A, B and C, where A depends on B and C is "free".
    Then, when I run azk start A, A and B systems are up. Now, if I enter azk restart without specifying any system and the restart would be just an alias for start and stop, the system C would be started without being previously started.

    We've chosen for an approach where restart first verifies which systems are up, stop the specified system, and try to return to the same state it was before.

    If this is the best approach, I don't really know, but this is the path we chose.

    Thoughts?

    Everton Ribeiro
    @nuxlli
    @slobo, I'm sorry... I forgot to mention you in the previous message. As you can see, the azk restart command is, in fact, a little complex and there are trade-offs involved.
    Slobodan Mišković
    @slobo
    ah, thanks for the explanation, @nuxlli. I wasn't aware that restart without [system-name] only acts on running systems, I just assumed it's meant to do stop (all) then start (all). I think current behaviour (esp when #530 is fixed) is good as it gives flexibility - I can do stop/start myself when needed :)
    Marcus Gadbem
    @marcusgadbem
    still such a nice info to better describe restart behavior at the docs anyway, @slobo. Thanks for pointing out :)
    Vytenis
    @FDiskas
    hi, what if port :53 already used? The agent could not be started
    Vytenis
    @FDiskas
    This message was deleted
    This message was deleted
    Vytenis
    @FDiskas

    Azkfile.js

    systems({
        FrontKit: {
            // Make sure that not root user is used
            docker_extra: {
                "User": "1000"
            },
            // Dependent systems
            depends: [],
            // More images:  http://images.azk.io
            image: {
                dockerfile: "./.docker"
            },
            // Steps to execute before running instances
            provision: [
                "npm install"
            ],
            workdir: "/azk/#{manifest.dir}",
            shell: "/bin/bash",
            command: ["./node_modules/.bin/gulp"],
            wait: 20,
            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"
            }
        }
    });

    ./.docker/Dockerfile

    FROM node
    RUN npm install -g gulp
    COPY entrypoint.sh /usr/local/bin/entrypoint.sh
    RUN chmod +x /usr/local/bin/entrypoint.sh
    RUN useradd -ms /bin/bash cli
    RUN usermod -u 1000 cli
    RUN mkdir -p /data
    RUN chown 1000:1000 /data
    RUN chown -R 1000:1000 /data
    WORKDIR /data
    CMD ["bash"]
    ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

    ./.docker/entrypoint.sh

    #!/bin/bash
    
    # Keep docker container alive
    while true; do sleep 1000; done
    And I got uknown error
    azk: ✓ checking `azkbuild/763fda3e93-FrontKit:cb77571123c3f8d0370ba5a4a01c240af8321b7a` image...
    azk: ⇲ building `azkbuild/763fda3e93-FrontKit:cb77571123c3f8d0370ba5a4a01c240af8321b7a` image...
    azk: An error occurred. It will stop all instances already running. See details below.
    nothing more
    Docker file working if its runned with docker-compose up
    Vytenis
    @FDiskas
    azk logs shows nothing
    Version   : azk version 0.18.0, build 8b9f66c, date 2016-04-06
    OS        : Linux 4.4 (x64), Memory: 15772MB
    Agent     : Running
    Docker    : 1.11.0
    Uses VM   : No
    VirtualBox: N/A
    Found some logs in home dir: hope it helps
    2016-04-27T17:40:46.603Z - warn: [promise] Error: [sprintf] property 'error' does not exist
        at sprintf.format (/usr/lib/azk/node_modules/i18n-cli/node_modules/sprintf-js/src/sprintf.js:37:35)
        at sprintf (/usr/lib/azk/node_modules/i18n-cli/node_modules/sprintf-js/src/sprintf.js:21:31)
        at I18n._format (i18n-cli-0.0.3 - src/index.js:2:17)
        at I18n.translate (i18n-cli-0.0.3 - src/index.js:63:32)
        at I18n.t (i18n-cli-0.0.3 - src/index.js:35:28)
        at DockerBuildError.AzkError.toString (workspace-0.18.0 - src/utils/errors.js:1:14)
        at Object._status (workspace-0.18.0 - src/cli/ui.js:80:26)
        at Object.fail (workspace-0.18.0 - src/cli/ui.js:71:36)
        at AskSendErrorView.UIProxy.(anonymous function) [as fail] (workspace-0.18.0 - src/cli/ui.js:240:37)
        at GeneratorFunction._callee$ (workspace-0.18.0 - src/cli/error_handler.js:49:10)
        at tryCatch (/usr/lib/azk/node_modules/babel-polyfill/node_modules/babel-regenerator-runtime/runtime.js:61:40)
        at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/lib/azk/node_modules/babel-polyfill/node_modules/babel-regenerator-runtime/runtime.js:329:22)
        at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/lib/azk/node_modules/babel-polyfill/node_modules/babel-regenerator-runtime/runtime.js:94:21)
        at GeneratorFunctionPrototype.tryCatcher (/usr/lib/azk/node_modules/bluebird/js/release/util.js:11:23)
        at PromiseSpawn._promiseFulfilled (/usr/lib/azk/node_modules/bluebird/js/release/generators.js:90:49)
        at GeneratorFunction.<anonymous> (/usr/lib/azk/node_modules/bluebird/js/release/generators.js:182:15)
    Gullit Miranda
    @gullitmiranda
    @FDiskas I believe that the error returned is empty, so this message in the log.
    Vytenis
    @FDiskas
    So the error is in the azk dependencies?
    Gullit Miranda
    @gullitmiranda
    have you ever tried to run by turning on the verbose mode (azk start -Bvvvv)? it may be that he is a most valuable information.
    Vytenis
    @FDiskas
    yes shure - but the same
    Gullit Miranda
    @gullitmiranda
    I believe that an error is not being passed when it should.
    Vytenis
    @FDiskas
    No mater what I do I got the same all the time http://i.imgur.com/xmCW0kG.png
    Gullit Miranda
    @gullitmiranda
    very strange this. is happening is some error in the build.
    Vytenis
    @FDiskas
    How to remove all builds?
    Is it posible to you to try this docker with azk?
    I need to verify which version of docker is being tested in the CI.
    I can climb a machine with docker 1.11 and try to make some tests, only that later.
    if you run adocker build -t image-name .docker, the build works?
    Vytenis
    @FDiskas
    yes Successfully built
    Gullit Miranda
    @gullitmiranda
    I think I know what may be happening. try comment the docker_extra properti in Azkfile and make the build again
    build using azk start -Bvv
    Vytenis
    @FDiskas
    the same
    Its display error very quick
    looks like nothing is done