ansible / galaxy-issues

This repository exists solely for the tracking of user issues with Ansible Galaxy.
20 stars 3 forks source link

Trouble building Galaxy Server #271

Closed TemperingPick closed 6 years ago

TemperingPick commented 7 years ago

I've verified that I'm running the requirements and everything seems to be installed correctly but I'm running into issues. When I run make build everything seems to make correctly, I don't get an errors but when I do docker images it only shows a galaxy-develop-conductor. Here's the output when I run make run. Sorry, gist is blocked at my job.

https://gist.github.com/TemperingPick/1c78917e6f2d4391154feafc2fccebb6

Any help would be appreciated.

chouseknecht commented 7 years ago

Yep, it's busted. This is a known issue. I'm out today, and possibly tomorrow. Currently being a dutiful citizen, and performing my civil obligation. When I return, I shall make it a priority to fix this.

chouseknecht commented 7 years ago

@TemperingPick

This is now fixed. I upgraded the project to use Ansible Container 0.9, and got things working again. At least they work in my environment, and on Travis.

After cloning the project, or pulling the latest code, run the following to build images:

$ make build

Once the image build completes, start the application by running the following:

$ make run

The django service will take about 5 minutes before starting the web server. It performs database migrations, installs test data, and rebuilds the search indexes. Rebuilding the search indexes takes the bulk of the time. Once done, the web server will be reachable at http://localhost:8000.

For more details, see the Contributing doc

TemperingPick commented 7 years ago

So I've built Ansible Container from the source, and when I run build it gives me an error "ansible.errors.AnsibleUndefinedVariable: 'galaxy_postgres_password is undefined. Running docker image also still shows only one galaxy-develop-conductor image.

Is there something I need to do before I try to build the new code? Tried make clean but that didn't seem to help.

chouseknecht commented 7 years ago

Added --devel flag to the build and run targets. Since we're running from source, we probably need that.

From in your clone of Galaxy, run the following:

$ ansible-container --debug --devel build
TemperingPick commented 7 years ago

Still getting the same error even with adding --revel to both build and run.

On Mon, Jul 17, 2017 at 5:04 PM Chris Houseknecht notifications@github.com wrote:

Added --devel flag to the build and run targets. Since we're running from source, we probably need that.

From in your clone of Galaxy, run the following:

$ ansible-container --debug --devel build

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ansible/galaxy-issues/issues/271#issuecomment-315884064, or mute the thread https://github.com/notifications/unsubscribe-auth/AA5gNsk0u9uYB0UZU8CbPLC7OCg0aEUDks5sO8xsgaJpZM4OW6_E .

chouseknecht commented 7 years ago

Can you please share the log output.

TemperingPick commented 7 years ago

2017-07-18T10:45:17.324485 The default type is [container.config] caller_file=/home/USER/ansible-container-develop/container/config.py caller_func=_resolve_defaults caller_line= 160 config=<class 'ruamel.yaml.comments.CommentedMap'> defaults=<type '_ordereddict.ordereddict'> 2017-07-18T10:45:17.325490 Getting environment variables... [container.config] caller_file=/home/USER/ansible-container-develop/container/config.py caller_func=_get_environment_variables c aller_line=176 2017-07-18T10:45:17.326398 Read environment variables [container.config] caller_file=/home/USER/ansible-container-develop/container/config.py caller_func=_get_environment_variables cal ler_line=181 env_vars={} 2017-07-18T10:45:17.327269 Resolved template variables [container.config] caller_file=/home/USER/ansible-container-develop/container/config.py caller_func=_resolve_defaults caller_line= 165 template_vars={} 2017-07-18T10:45:17.328119 Parsed config [container.config] caller_file=/home/USER/ansible-container-develop/container/config.py caller_func=set_env caller_line=141 config ={"version": "2", "settings": {"save_conductor_container": false, "vars_files": ["develop.yml"], "pwd": "/home/USER/galaxy-develop"}, "services": {"django": {"from": "centos:7", "working_d ir": "/galaxy", "links": ["postgres", "elastic", "memcache", "rabbit"], "command": ["/usr/local/bin/dumb-init", "/setup/start-development.sh"], "user": "django", "ports": ["8000:8000"], "envi ronment": ["C_FORCE_ROOT=1"], "roles": ["django-role"]}, "postgres": {"from": "postgres:9.5.4", "environment": ["POSTGRES_PASSWORD={{ galaxy_postgres_password }}", "POSTGRES_USER={{ galaxy_po stgres_user }}", "POSTGRES_DB={{ galaxy_postgres_db }}"]}, "elastic": {"from": "elasticsearch:2.4.1"}, "memcache": {"from": "memcached:latest"}, "rabbit": {"from": "rabbitmq", "environment": ["RABBITMQ_DEFAULT_USER={{ galaxy_rabbitmq_user }}", "RABBITMQ_DEFAULT_PASS={{ galaxy_rabbitmq_pass }}", "RABBITMQ_DEFAULT_VHOST={{ galaxy_rabbitmq_vhost }}"]}, "gulp": {"from": "centos:7", " command": ["/bin/true"], "working_dir": "/galaxy", "roles": ["gulp-role"]}}, "registries": {}, "defaults": {}} 2017-07-18T10:45:17.328870 Loading engine capabilities [container.utils.loader] caller_file=/home/USER/ansible-container-develop/container/utils/loader.py caller_func=load_engine caller _line=14 capabilities=['BUILD', 'RUN'] engine=docker 2017-07-18T10:45:17.381256 Could not find container for conductor [container.docker.engine] all_containers=[] caller_file=/home/USER/ansible-container-develop/container/docker/engine.py ca ller_func=get_container_id_for_service caller_line=425 container=u'galaxy-develop_conductor' 2017-07-18T10:45:17.386931 Config settings [container.core] caller_file=/home/USER/ansible-container-develop/container/core.py caller_func=hostcmd_build caller_line=156 conf =<class 'container.docker.config.AnsibleContainerConfig'> config=<container.docker.config.AnsibleContainerConfig object at 0x27d8a90> rawsettings={"save_conductor_container": false, "vars_fil es": ["develop.yml"], "pwd": "/home/USER/galaxy-develop"} settings={"save_conductor_container": false, "vars_files": ["develop.yml"], "pwd": "/home/USER/galaxy-develop"} 2017-07-18T10:45:17.388190 Call: Engine.run_conductor [container.docker.engine] args=('build', {'services': ordereddict([('django', ordereddict([('from', 'centos:7'), ('working_dir', '/ga laxy'), ('links', ['postgres', 'elastic', 'memcache', 'rabbit']), ('command', ['/usr/local/bin/dumb-init', '/setup/start-development.sh']), ('user', 'django'), ('ports', ['8000:8000']), ('env ironment', ['C_FORCE_ROOT=1']), ('roles', ['django-role'])])), ('postgres', ordereddict([('from', 'postgres:9.5.4'), ('environment', ['POSTGRES_PASSWORD={{ galaxy_postgres_password }}', 'POST GRES_USER={{ galaxy_postgres_user }}', 'POSTGRES_DB={{ galaxy_postgres_db }}'])])), ('elastic', ordereddict([('from', 'elasticsearch:2.4.1')])), ('memcache', ordereddict([('from', 'memcached: latest')])), ('rabbit', ordereddict([('from', 'rabbitmq'), ('environment', ['RABBITMQ_DEFAULT_USER={{ galaxy_rabbitmq_user }}', 'RABBITMQ_DEFAULT_PASS={{ galaxy_rabbitmq_pass }}', 'RABBITMQ_D EFAULT_VHOST={{ galaxy_rabbitmq_vhost }}'])])), ('gulp', ordereddict([('from', 'centos:7'), ('command', ['/bin/true']), ('working_dir', '/galaxy'), ('roles', ['gulp-role'])]))]), 'version': ' 2', 'registries': ordereddict([]), 'defaults': ordereddict([]), 'settings': ordereddict([('save_conductor_container', False), ('vars_files', ['develop.yml']), ('pwd', '/home/USER/galaxy-de velop')])}, '/home/USER/galaxy-develop', {'with_volumes': [], 'cache': True, 'local_python': False, 'with_variables': [], 'selinux': True, 'purge_last': True, 'subcommand': 'build', 'devel ': True, 'config_vars': ordereddict([]), 'roles_path': None, 'conductor_cache': True, 'ansible_options': u'', 'flatten': False, 'container_cache': True, 'debug': True, 'services_to_build': No ne, 'save_conductor_container': False}) caller_file=/home/USER/ansible-container-develop/container/docker/engine.py caller_func=Engine.run_conductor caller_line=23 kwargs={} 2017-07-18T10:45:17.393475 Binding Ansible Container code at /home/USER/ansible-container-develop/container into conductor container [container.docker.engine] caller_file=/home/USER/ans ible-container-develop/container/docker/engine.py caller_func=run_conductor caller_line=297 2017-07-18T10:45:17.395072 Docker run: [container.docker.engine] caller_file=/home/USER/ansible-container-develop/container/docker/engine.py caller_func=run_conductor ca ller_line=329 image=u'sha256:cbb902a948303b9724cfd12c426a5d3fef8671d8b42115e867576caae4d485cf' params={'name': u'galaxy-develop_conductor', 'cap_add': ['SYS_ADMIN'], 'environment': {'DOCKER_H OST': 'unix:///var/run/docker.sock', 'ANSIBLE_ROLES_PATH': '/src/roles:/etc/ansible/roles'}, 'working_dir': '/src', 'command': ['conductor', 'build', '--project-name', 'galaxy-develop', '--en gine', 'docker', '--params', u'eyJ3aXRoX3ZvbHVtZXMiOiBbXSwgImNhY2hlIjogdHJ1ZSwgImxvY2FsX3B5dGhvbiI6IGZhbHNlLCAid2l0aF92YXJpYWJsZXMiOiBbXSwgInNlbGludXgiOiB0cnVlLCAicHVyZ2VfbGFzdCI6IHRydWUsICJz dWJjb21tYW5kIjogImJ1aWxkIiwgImRldmVsIjogdHJ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JhYmJpdCIsIHsiZ nJvbSI6ICJyYWJiaXRtcSIsICJlbnZpcm9ubWVudCI6IFsiUkFCQklUTVFfREVGQVVMVF9VU0VSPXt7IGdhbGF4eV9yYWJiaXRtcV91c2VyIH19IiwgIlJBQkJJVE1RX0RFRkFVTFRfUEFTUz17eyBnYWxheHlfcmFiYml0bXFfcGFzcyB9fSIsICJSQUJC SVRNUV9ERUZBVUxUX1ZIT1NUPXt7IGdhbGF4eV9yYWJiaXRtcV92aG9zdCB9fSJdfV0sIFsiZ3VscCIsIHsiZnJvbSI6ICJjZW50b3M6NyIsICJjb21tYW5kIjogWyIvYmluL3RydWUiXSwgIndvcmtpbmdfZGlyIjogIi9nYWxheHkiLCAicm9sZXMiOiB bImd1bHAtcm9sZSJdfV1dLCAic2V0dGluZ3MiOiBbWyJzYXZlX2NvbmR1Y3Rvcl9jb250YWluZXIiLCBmYWxzZV0sIFsidmFyc19maWxlcyIsIFsiZGV2ZWxvcC55bWwiXV0sIFsicHdkIiwgIi9ob21lL2E2MDIxMzcvZ2FsYXh5LWRldmVsb3AiXV0sIC J2ZXJzaW9uIjogIjIiLCAiZGVmYXVsdHMiOiBbXSwgInJlZ2lzdHJpZXMiOiBbXX0=', '--encoding', 'b64json'], 'user': 'root', 'volumes': {'/var/run/docker.sock': {'bind': '/var/run/docker.sock', 'mode': 'rw '}, '/home/USER/galaxy-develop': {'bind': '/src', 'mode': 'ro'}, '/home/USER/ansible-container-develop/container': {'bind': '/_ansible/container', 'mode': 'rw'}}, 'detach': True, 'privi leged': True} Parsing conductor CLI args. 2017-07-18T14:45:31.466513 Processing defaults section... [container.config] caller_file=/_ansible/container/config.py caller_func=_process_defaults caller_line=286 2017-07-18T14:45:31.468992 Processing section... [container.config] caller_file=/_ansible/container/config.py caller_func=_process_top_level_sections caller_line=295 section=volumes 2017-07-18T14:45:31.471552 Processing section... [container.config] caller_file=/_ansible/container/config.py caller_func=_process_top_level_sections caller_line=295 section=registri es 2017-07-18T14:45:31.474077 Processing service... [container.config] caller_file=/_ansible/container/config.py caller_func=_process_services callerline=301 service=u'django' service data={u'from': u'centos:7', u'roles': [u'django-role'], u'links': [u'postgres', u'elastic', u'memcache', u'rabbit'], u'environment': [u'C_FORCE_ROOT=1'], u'working_dir': u'/galaxy', u'command ': [u'/usr/local/bin/dumb-init', u'/setup/start-development.sh'], u'user': u'django', u'ports': [u'8000:8000']} 2017-07-18T14:45:31.482175 Rendering service keys from defaults [container.config] caller_file=/_ansible/container/config.py caller_func=_process_services caller_line=324 defaults={"django_py thon_modules": ["psycopg2", "flake8"]} service=u'django' 2017-07-18T14:45:31.492623 Processing service... [container.config] caller_file=/_ansible/container/config.py caller_func=_process_services caller_line=301 service=u'postgres' servic e_data={u'environment': [u'POSTGRES_PASSWORD={{ galaxy_postgres_password }}', u'POSTGRES_USER={{ galaxy_postgres_user }}', u'POSTGRES_DB={{ galaxy_postgres_db }}'], u'from': u'postgres:9.5.4' } 2017-07-18T14:45:31.496948 Rendering service keys from defaults [container.config] caller_file=/_ansible/container/config.py caller_func=_process_services caller_line=324 defaults={} service= u'postgres' Traceback (most recent call last): File "/usr/bin/conductor", line 11, in 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 369, in conductor_commandline conductor_config = AnsibleContainerConductorConfig(list_to_ordereddict(containers_config)) File "/_ansible/container/init.py", line 19, in wrapped return fn(args, **kwargs) File "/_ansible/container/config.py", line 258, in init self._process_services() File "/_ansible/container/config.py", line 327, in _process_services templar=Templar(loader=None, variables=service_defaults) File "/_ansible/container/config.py", line 276, in _process_section templar.template(buffer.getvalue()) File "/usr/lib/python2.7/site-packages/ansible/template/init.py", line 450, in template disable_lookups=disable_lookups, File "/usr/lib/python2.7/site-packages/ansible/template/init.py", line 703, in do_template raise AnsibleUndefinedVariable(e) ansible.errors.AnsibleUndefinedVariable: 'galaxy_postgres_password' is undefined

chouseknecht commented 7 years ago

Are you running the latest Ansible Container from source?

Commit 7914a7a1380c5c1a3091720644d928bba2ea64e2 is required for the settings.vars_files directive in container.yml to work. Please confirm that you have this code.

TemperingPick commented 6 years ago

Yep, that was my issue. Thanks! The versions were the same so I didn't download the latest version. I do have another issue but it's separate from this so I'll open up a new issue.