ansible / ansible-container

DEPRECATED -- Ansible Container was a tool to build Docker images and orchestrate containers using only Ansible playbooks.
GNU Lesser General Public License v3.0
2.19k stars 392 forks source link

Fail after a long command #634

Closed remyleone closed 6 years ago

remyleone commented 7 years ago
ISSUE TYPE
container.yml
version: "2"
settings:
  # The deployment_output_path is mounted to the Conductor container, so
  # that the `run` and `deployment` commands can write generated Ansible
  # playbooks to it.
  # deployment_output_path: ~/ansible-deployment
  # The Conductor container does the heavy lifting, and provides a portable
  # Python runtime for building your target containers. It should be derived
  # from the same distribution as you're building your target containers with.
  conductor_base: debian

services:
  # Add your containers here, specifying the base image you want to build from
  testing_tool:
    name: testing_tool-conformance-6tisch
    from: debian:latest
    roles:
      - manager
      - dissector

  demo:
    from: debian:latest
    roles:
      - demo

registries:
  iminds:
    url: dev.so.f-interop.eu:5000
OS / ENVIRONMENT
Ansible Container, version 0.9.2rc0
Linux, sieben-inria, 4.4.0-83-generic, #106-Ubuntu SMP Mon Jun 26 17:54:43 UTC 2017, x86_64
3.5.2 (default, Nov 17 2016, 17:05:23) 
[GCC 5.4.0 20160609] /usr/bin/python3
{
  "MemoryLimit": true,
  "CpuCfsQuota": true,
  "OSType": "linux",
  "RuncCommit": {
    "ID": "9c2d8d184e5da67c95d601382adf14862e4f2228",
    "Expected": "9c2d8d184e5da67c95d601382adf14862e4f2228"
  },
  "IndexServerAddress": "https://index.docker.io/v1/",
  "DockerRootDir": "/var/lib/docker",
  "DefaultRuntime": "runc",
  "HttpProxy": "",
  "Labels": null,
  "CpuCfsPeriod": true,
  "BridgeNfIptables": true,
  "OperatingSystem": "Ubuntu 16.04.2 LTS",
  "CPUShares": true,
  "Runtimes": {
    "runc": {
      "path": "docker-runc"
    }
  },
  "SwapLimit": false,
  "Swarm": {
    "NodeID": "",
    "RemoteManagers": null,
    "ControlAvailable": false,
    "NodeAddr": "",
    "Error": "",
    "LocalNodeState": "inactive"
  },
  "OomKillDisable": true,
  "KernelVersion": "4.4.0-83-generic",
  "ContainerdCommit": {
    "ID": "9048e5e50717ea4497b757314bad98ea3763c145",
    "Expected": "9048e5e50717ea4497b757314bad98ea3763c145"
  },
  "SystemStatus": null,
  "KernelMemory": true,
  "Containers": 1,
  "Plugins": {
    "Network": [
      "bridge",
      "host",
      "macvlan",
      "null",
      "overlay"
    ],
    "Volume": [
      "local"
    ],
    "Authorization": []
  },
  "InitCommit": {
    "ID": "949e6fa",
    "Expected": "949e6fa"
  },
  "CPUSet": true,
  "ClusterAdvertise": "",
  "Debug": false,
  "ServerVersion": "17.05.0-ce",
  "NCPU": 4,
  "ExperimentalBuild": false,
  "BridgeNfIp6tables": true,
  "ContainersStopped": 0,
  "NEventsListener": 0,
  "NGoroutines": 27,
  "IPv4Forwarding": true,
  "ContainersRunning": 1,
  "Architecture": "x86_64",
  "Isolation": "",
  "DriverStatus": [
    [
      "Root Dir",
      "/var/lib/docker/aufs"
    ],
    [
      "Backing Filesystem",
      "extfs"
    ],
    [
      "Dirs",
      "15"
    ],
    [
      "Dirperm1 Supported",
      "true"
    ]
  ],
  "NFd": 22,
  "HttpsProxy": "",
  "Name": "sieben-inria",
  "Driver": "aufs",
  "MemTotal": 16695914496,
  "NoProxy": "",
  "SecurityOptions": [
    "name=apparmor",
    "name=seccomp,profile=default"
  ],
  "ContainersPaused": 0,
  "InitBinary": "docker-init",
  "Images": 13,
  "RegistryConfig": {
    "IndexConfigs": {
      "docker.io": {
        "Name": "docker.io",
        "Official": true,
        "Mirrors": [],
        "Secure": true
      }
    },
    "Mirrors": [],
    "InsecureRegistryCIDRs": [
      "127.0.0.0/8"
    ]
  },
  "LiveRestoreEnabled": false,
  "ID": "RVLU:5JQU:DJKY:KIAM:KYVI:55ZM:LECS:62NO:DC2O:4773:AMFC:CIN5",
  "SystemTime": "2017-07-04T11:32:05.429112025+02:00",
  "ClusterStore": "",
  "CgroupDriver": "cgroupfs",
  "LoggingDriver": "json-file"
}
{
  "Arch": "amd64",
  "MinAPIVersion": "1.12",
  "ApiVersion": "1.29",
  "KernelVersion": "4.4.0-83-generic",
  "GitCommit": "89658be",
  "GoVersion": "go1.7.5",
  "Version": "17.05.0-ce",
  "BuildTime": "2017-05-04T22:10:54.638119411+00:00",
  "Os": "linux"
}
SUMMARY

A step inside my playbook is failing. I don't have much information in the log about the reason why it failed. This step is basically launching a compilation that take some time to complete. There is nothing going wrong inside the compilation.

STEPS TO REPRODUCE
ansible-container --debug build --roles-path ansible/roles
EXPECTED RESULTS

I expect my container to be build

ACTUAL RESULTS

It fails after a while.

        "[ 46%] Building C object epan/dissectors/CMakeFiles/dissectors.dir/packet-quake.c.o",
        "[ 46%] Building C object epan/dissectors/CMakeFiles/dissectors.dir/packet-quake2.c.o",
        "[ 46%] Building C object epan/dissectors/CMakeFiles/dissectors.dir/packet-quake3.c.o",
        "[ 46%] Building C object epan/dissectors/CMakeFiles/dissectors.dir/packet-quakeworld.c.o",
        "[ 46%] Building C object epan/dissectors/CMakeFiles/dissectors.dir/packet-quic.c.o",
        "[ 46%] Building C object epan/dissectors/CMakeFiles/dissectors.dir/packet-radius.c.o",
        "[ 46%] Building C object epan/dissectors/CMakeFiles/dissectors.dir/packet-radius_packetcable.c.o",
2017-07-04T09:12:00.023692 Error applying role!           [container.core] caller_file=/_ansible/container/core.py caller_func=apply_role_to_container caller_line=627 engine=<container.docker.engine.Engine object at 0x7fb7c593e710> exit_code=2 playbook=[{'hosts': u'testing_tool', 'roles': ['dissector'], 'vars': {}}]
2017-07-04T09:12:00.026536 Playbook run finished.         [container.core] caller_file=/_ansible/container/core.py caller_func=conductorcmd_build caller_line=746 exit_code=2
Traceback (most recent call last):
  File "/usr/local/bin/conductor", line 11, in <module>
    load_entry_point('ansible-container', 'console_scripts', 'conductor')()
  File "/_ansible/container/__init__.py", line 19, in __wrapped__
    return fn(*args, **kwargs)
  File "/_ansible/container/cli.py", line 366, in conductor_commandline
    **params)
  File "/_ansible/container/__init__.py", line 19, in __wrapped__
    return fn(*args, **kwargs)
  File "/_ansible/container/core.py", line 748, in conductorcmd_build
    raise RuntimeError('Build failed.')
RuntimeError: Build failed.
2017-07-04T11:12:00.262595 Conductor terminated. Cleaning up. [container.docker.engine] caller_file=/home/sieben/Dropbox/workspace/finterop/ansible-container/container/docker/engine.py caller_func=await_conductor_command caller_line=353 command_rc=1 conductor_id=a919195a4e4e7f337e3097f29a866217d3aa0684547ca1353b74d50ed0cf335d save_container=False
2017-07-04T11:12:00.280076 Conductor exited with status 1 [container.cli] caller_file=/home/sieben/Dropbox/workspace/finterop/ansible-container/container/cli.py caller_func=__call__ caller_line=286
Makefile:7 : la recette pour la cible « build_image » a échouée
make: *** [build_image] Erreur 1
remyleone commented 7 years ago

Would an ansible command fail after a while if it doesn't complete after a given time? Would a specific error be raised in case of a too long command?

chouseknecht commented 7 years ago

@sieben

Thanks for using Ansible Container, and for taking the time to share your feedback.

Looks like the role it was attempting to run failed: 2017-07-04T09:12:00.023692 Error applying role! I suspect you're not getting the full output from the role. It might be interesting to run docker logs against the conductor container, to see if it reveals anything.

Can you share the role you're running, and perhaps I can duplicate the problem.

Thanks!