Closed brianthelion closed 7 years ago
The bug is not likely in docker-py since this
[DEBUG ] Attempting to run docker-py's "build" function with args=() and kwargs={'quiet': False, 'nocache': False, 'rm': True, 'fileobj': None, 'tag': 'myuser/myimage:mytag', 'path': '/home/bar/Dev/foo/build/foo.services.users', 'dockerfile': None}
presumably translates to this
>> from docker import Client
>>> client = Client("unix:///var/run/docker.sock")
>>> it = client.build(path="/home/bar/Dev/foo/build/foo.services.users")
>>> for line in it: print(line)
...
which runs fine
b'{"stream":"Step 1 : FROM ubuntu:16.04\\n"}\r\n'
b'{"stream":" ---\\u003e d355ed3537e9\\n"}\r\n'
b'{"stream":"Step 2 : RUN apt-get update -y \\u0026\\u0026 apt-get install -y python3-pip python3-dev git libssl-dev \\u0026\\u0026 pip3 install --upgrade pip setuptools\\n"}\r\n'
b'{"stream":" ---\\u003e Using cache\\n"}\r\n'
b'{"stream":" ---\\u003e fcab9c016144\\n"}\r\n'
b'{"stream":"Step 3 : COPY ./requirements.txt /app/requirements.txt\\n"}\r\n'
b'{"stream":" ---\\u003e Using cache\\n"}\r\n'
b'{"stream":" ---\\u003e cedeffd1d54e\\n"}\r\n'
b'{"stream":"Step 4 : WORKDIR /app\\n"}\r\n'
b'{"stream":" ---\\u003e Using cache\\n"}\r\n'
b'{"stream":" ---\\u003e 0069831017c1\\n"}\r\n'
b'{"stream":"Step 5 : RUN pip install -r requirements.txt\\n"}\r\n'
b'{"stream":" ---\\u003e Using cache\\n"}\r\n'
b'{"stream":" ---\\u003e 216da2304e23\\n"}\r\n'
b'{"stream":"Step 6 : COPY . /app\\n"}\r\n'
b'{"stream":" ---\\u003e Using cache\\n"}\r\n'
b'{"stream":" ---\\u003e 70b524b0d6e3\\n"}\r\n'
b'{"stream":"Step 7 : RUN git init\\n"}\r\n'
b'{"stream":" ---\\u003e Using cache\\n"}\r\n'
b'{"stream":" ---\\u003e 78396a3e4dd6\\n"}\r\n'
b'{"stream":"Step 8 : RUN pip3 install .\\n"}\r\n'
b'{"stream":" ---\\u003e Using cache\\n"}\r\n'
b'{"stream":" ---\\u003e eecc4a06806b\\n"}\r\n'
b'{"stream":"Step 9 : RUN mkdir db_data\\n"}\r\n'
b'{"stream":" ---\\u003e Using cache\\n"}\r\n'
b'{"stream":" ---\\u003e d8129b0f7f8e\\n"}\r\n'
b'{"stream":"Step 10 : RUN initialize_sample_db production.ini\\n"}\r\n'
b'{"stream":" ---\\u003e Using cache\\n"}\r\n'
b'{"stream":" ---\\u003e 3c7a1165cd48\\n"}\r\n'
b'{"stream":"Step 11 : ENTRYPOINT pserve\\n"}\r\n'
b'{"stream":" ---\\u003e Using cache\\n"}\r\n'
b'{"stream":" ---\\u003e b4c42b6540fc\\n"}\r\n'
b'{"stream":"Step 12 : CMD production.ini\\n"}\r\n'
b'{"stream":" ---\\u003e Using cache\\n"}\r\n'
b'{"stream":" ---\\u003e dc0966947e9c\\n"}\r\n'
b'{"stream":"Successfully built dc0966947e9c\\n"}\r\n'
but is indeed raw bytes.
Yup, we need to get this fixed.
@terminalmage you will be interested in this.
Thanks, Daniel
@brianthelion actually, dockerng is the module on 2016.11, which does not gaurantee support for python3.
We will be supporting python3 on 2017.7 which we are working on a release candidate for now, can you try the docker
module on 2017.7?
Thanks, Daniel
You should be able to use the same SLS in 2017.7, it's backward-compatible. You will however be warned that the correct state name is now docker_image.present
instead of dockerng.image_present
.
Thanks for the attention, all. Sorry to be a bother -- Salt noob here -- but is the best way to test the 2017.7 release candidate to git clone
and install from source? Cheers! ~br
@brianthelion you mentioned that you have installed Salt into a virtualenv. In this case, I recommend something like the following (assuming you are activated into your virtualenv):
pip uninstall salt
git clone https://github.com/saltstack/salt /path/to/clone
cd /path/to/clone
git checkout -b 2017.7 origin/2017.7
pip install -e /path/to/clone
This will install Salt from the git checkout into the virtualenv. You can also use this for future testing, however I would recommend doing a find /path/to/clone -type -f -name \*.pyc -delete
to remove the byte-compiled files whenever you change the current branch for the clone.
I would also recommend setting root_dir: /path/to/virtualenv
in both your master and minion config file, as it will keep the cache and everything within the virtualenv. However, you don't really need to do this.
@terminalmage Before I saw your message I went ahead and cloned and then pip install
ed master/HEAD
to a fresh pyvenv-3.5
. It looks as if there's a new bug in which my pillar=
gets ignored.
$ /home/bar/Dev/foo/env/5/bin/salt-call --local -l all state.sls foo-docker localconfig=/tmp/tmpm7k1ydjp pillar="{'package_dir': '/home/bar/Dev/foo/build/foo.services.users'}"
[DEBUG ] Reading configuration from /etc/salt/minion
[DEBUG ] Including configuration from '/etc/salt/minion.d/_schedule.conf'
[DEBUG ] Reading configuration from /etc/salt/minion.d/_schedule.conf
[DEBUG ] Using cached minion ID from /etc/salt/minion_id: dathon
[TRACE ] The required configuration section, 'fluent_handler', was not found the in the configuration. Not loading the fluent logging handlers module.
[TRACE ] None of the required configuration sections, 'logstash_udp_handler' and 'logstash_zmq_handler', were found in the configuration. Not loading the Logstash logging handlers module.
[DEBUG ] Configuration file path: /etc/salt/minion
[WARNING ] Failed to open log file, do you have permission to write to /var/log/salt/minion?
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
[DEBUG ] Grains refresh requested. Refreshing grains.
[DEBUG ] Reading configuration from /etc/salt/minion
[DEBUG ] Including configuration from '/etc/salt/minion.d/_schedule.conf'
[DEBUG ] Reading configuration from /etc/salt/minion.d/_schedule.conf
[TRACE ] 'esxcli' could not be found in the following search path: '['/home/bar/Dev/foo/env/salty/bin', '/usr/local/sbin', '/usr/local/bin', '/usr/sbin', '/usr/bin', '/sbin', '/bin', '/usr/games', '/usr/local/games', '/snap/bin']'
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Depends decorator instantiated with dep list of (False,)
[TRACE ] Error loading grains.napalm: "napalm"" (/home/bar/Dev/foo/build/saltstack/salt/grains/napalm.py) cannot be loaded: NAPALM is not installed or not running in a (proxy) minion
[TRACE ] Loading core.append_domain grain
[TRACE ] Loading core.dns grain
[TRACE ] Loading core.get_machine_id grain
[TRACE ] Loading core.get_master grain
[TRACE ] Loading core.get_server_id grain
[TRACE ] Loading core.hostname grain
[TRACE ] Loading core.hwaddr_interfaces grain
[TRACE ] Loading core.id_ grain
[TRACE ] Loading core.ip4_interfaces grain
[TRACE ] Loading core.ip6_interfaces grain
[TRACE ] Loading core.ip_fqdn grain
[TRACE ] Loading core.ip_interfaces grain
[TRACE ] Loading core.linux_distribution grain
[TRACE ] Loading core.locale_info grain
[TRACE ] Loading core.os_data grain
[TRACE ] 'zpool' could not be found in the following search path: '['/home/bar/Dev/foo/env/salty/bin', '/usr/local/sbin', '/usr/local/bin', '/usr/sbin', '/usr/bin', '/sbin', '/bin', '/usr/games', '/usr/local/games', '/snap/bin']'
[TRACE ] 'virt-what' could not be found in the following search path: '['/home/bar/Dev/foo/env/salty/bin', '/usr/local/sbin', '/usr/local/bin', '/usr/sbin', '/usr/bin', '/sbin', '/bin', '/usr/games', '/usr/local/games', '/snap/bin']'
[DEBUG ] Please install 'virt-what' to improve results of the 'virtual' grain.
[TRACE ] 'virt-what' could not be found in the following search path: '['/home/bar/Dev/foo/env/salty/bin', '/usr/local/sbin', '/usr/local/bin', '/usr/sbin', '/usr/bin', '/sbin', '/bin', '/usr/games', '/usr/local/games', '/snap/bin']'
[INFO ] Although 'dmidecode' was found in path, the current user cannot execute it. Grains output might not be accurate.
[TRACE ] Loading core.path grain
[TRACE ] Loading core.pythonexecutable grain
[TRACE ] Loading core.pythonpath grain
[TRACE ] Loading core.pythonversion grain
[TRACE ] Loading core.saltpath grain
[TRACE ] Loading core.saltversion grain
[TRACE ] Loading core.saltversioninfo grain
[TRACE ] Loading core.zmqversion grain
[TRACE ] Loading disks.disks grain
[TRACE ] Device loop1 reports itself as an HDD
[TRACE ] Device loop6 reports itself as an HDD
[TRACE ] Device loop4 reports itself as an HDD
[TRACE ] Device loop2 reports itself as an HDD
[TRACE ] Device loop0 reports itself as an HDD
[TRACE ] Device sda reports itself as an HDD
[TRACE ] Device loop7 reports itself as an HDD
[TRACE ] Device nvme0n1 reports itself as an SSD
[TRACE ] Device loop5 reports itself as an HDD
[TRACE ] Device loop3 reports itself as an HDD
[TRACE ] Loading extra.config grain
[TRACE ] Loading extra.shell grain
[TRACE ] Loading mdadm.mdadm grain
[TRACE ] Loading minion_process.grains grain
[TRACE ] Loading opts.opts grain
[DEBUG ] Determining pillar cache
[DEBUG ] LazyLoaded jinja.render
[DEBUG ] LazyLoaded yaml.render
[DEBUG ] LazyLoaded jinja.render
[DEBUG ] LazyLoaded yaml.render
[DEBUG ] LazyLoaded state.sls
Cannot write to process directory. Do you have permissions to write to /var/cache/salt/minion/proc/20170629123200543774 ?
[DEBUG ] LazyLoaded saltutil.is_running
[DEBUG ] LazyLoaded grains.get
[DEBUG ] Reading configuration from /tmp/tmpm7k1ydjp
[DEBUG ] LazyLoaded roots.envs
[DEBUG ] Could not LazyLoad roots.init: 'roots.init' is not available.
[DEBUG ] Updating roots fileserver cache
[TRACE ] Lockfile /home/bar/Dev/foo/build/salt/._cache/file_lists/roots/.base.w created
[TRACE ] roots: Processing /home/bar/Dev/foo/build/salt/root/states/foo-docker
[TRACE ] roots: /home/bar/Dev/foo/build/salt/root/states/foo-docker is not a link
[TRACE ] roots: /home/bar/Dev/foo/build/salt/root/states/foo-docker relative path is foo-docker
[TRACE ] roots: Processing /home/bar/Dev/foo/build/salt/root/states/foo
[TRACE ] roots: /home/bar/Dev/foo/build/salt/root/states/foo is not a link
[TRACE ] roots: /home/bar/Dev/foo/build/salt/root/states/foo relative path is foo
[TRACE ] roots: Processing /home/bar/Dev/foo/build/salt/root/states/pyramid
[TRACE ] roots: /home/bar/Dev/foo/build/salt/root/states/pyramid is not a link
[TRACE ] roots: /home/bar/Dev/foo/build/salt/root/states/pyramid relative path is pyramid
[TRACE ] roots: Processing /home/bar/Dev/foo/build/salt/root/states/top.sls
[TRACE ] roots: /home/bar/Dev/foo/build/salt/root/states/top.sls is not a link
[TRACE ] roots: /home/bar/Dev/foo/build/salt/root/states/top.sls relative path is top.sls
[TRACE ] roots: Processing /home/bar/Dev/foo/build/salt/root/states/foo.sls
[TRACE ] roots: /home/bar/Dev/foo/build/salt/root/states/foo.sls is not a link
[TRACE ] roots: /home/bar/Dev/foo/build/salt/root/states/foo.sls relative path is foo.sls
[TRACE ] roots: Processing /home/bar/Dev/foo/build/salt/root/states/foo-docker/build_template.sls
[TRACE ] roots: /home/bar/Dev/foo/build/salt/root/states/foo-docker/build_template.sls is not a link
[TRACE ] roots: /home/bar/Dev/foo/build/salt/root/states/foo-docker/build_template.sls relative path is foo-docker/build_template.sls
[TRACE ] roots: Processing /home/bar/Dev/foo/build/salt/root/states/foo-docker/global_vars.jinja
[TRACE ] roots: /home/bar/Dev/foo/build/salt/root/states/foo-docker/global_vars.jinja is not a link
[TRACE ] roots: /home/bar/Dev/foo/build/salt/root/states/foo-docker/global_vars.jinja relative path is foo-docker/global_vars.jinja
[TRACE ] roots: Processing /home/bar/Dev/foo/build/salt/root/states/foo-docker/build_template2.sls
[TRACE ] roots: /home/bar/Dev/foo/build/salt/root/states/foo-docker/build_template2.sls is not a link
[TRACE ] roots: /home/bar/Dev/foo/build/salt/root/states/foo-docker/build_template2.sls relative path is foo-docker/build_template2.sls
[TRACE ] roots: Processing /home/bar/Dev/foo/build/salt/root/states/foo-docker/init.sls
[TRACE ] roots: /home/bar/Dev/foo/build/salt/root/states/foo-docker/init.sls is not a link
[TRACE ] roots: /home/bar/Dev/foo/build/salt/root/states/foo-docker/init.sls relative path is foo-docker/init.sls
[TRACE ] roots: Processing /home/bar/Dev/foo/build/salt/root/states/foo-docker/init.bak
[TRACE ] roots: /home/bar/Dev/foo/build/salt/root/states/foo-docker/init.bak is not a link
[TRACE ] roots: /home/bar/Dev/foo/build/salt/root/states/foo-docker/init.bak relative path is foo-docker/init.bak
[TRACE ] roots: Processing /home/bar/Dev/foo/build/salt/root/states/foo/init.sls
[TRACE ] roots: /home/bar/Dev/foo/build/salt/root/states/foo/init.sls is not a link
[TRACE ] roots: /home/bar/Dev/foo/build/salt/root/states/foo/init.sls relative path is foo/init.sls
[TRACE ] roots: Processing /home/bar/Dev/foo/build/salt/root/states/pyramid/init.sls
[TRACE ] roots: /home/bar/Dev/foo/build/salt/root/states/pyramid/init.sls is not a link
[TRACE ] roots: /home/bar/Dev/foo/build/salt/root/states/pyramid/init.sls relative path is pyramid/init.sls
[TRACE ] Lockfile /home/bar/Dev/foo/build/salt/._cache/file_lists/roots/.base.w removed
[INFO ] Loading fresh modules for state activity
[DEBUG ] LazyLoaded jinja.render
[DEBUG ] LazyLoaded yaml.render
[DEBUG ] Could not find file 'salt://foo-docker.sls' in saltenv 'base'
[DEBUG ] In saltenv 'base', looking at rel_path 'foo-docker/init.sls' to resolve 'salt://foo-docker/init.sls'
[DEBUG ] In saltenv 'base', ** considering ** path '/home/bar/Dev/foo/build/salt/._cache/files/base/foo-docker/init.sls' to resolve 'salt://foo-docker/init.sls'
[DEBUG ] compile template: /home/bar/Dev/foo/build/salt/._cache/files/base/foo-docker/init.sls
[DEBUG ] Jinja search path: ['/home/bar/Dev/foo/build/salt/._cache/files/base']
[ERROR ] Rendering exception occurred: Jinja variable 'salt.pillar object' has no attribute 'package_dir'
[CRITICAL] Rendering SLS 'base:foo-docker' failed: Jinja variable 'salt.pillar object' has no attribute 'package_dir'
[DEBUG ] LazyLoaded highstate.output
[TRACE ] data = {'local': ["Rendering SLS 'base:foo-docker' failed: Jinja variable 'salt.pillar object' has no attribute 'package_dir'"]}
Is pillar access changed in the new version?
Can I see the SLS you're using now? Your original example set a pillar variable called dockerfile_dir
, but the error message refers to package_dir
.
Oh, nevermind, I see that you changed it in the command at the beginning of your example. I'd still like to see your SLS though, an AttributeError doesn't make sense here.
@terminalmage I updated the pillar access from pillar['package_dir']
to salt['pillar.get']('package_dir')
and everything ran down to the dockerng
calls. Updating that now.
Updated dockerng.image_present
to docker.image_present
and got:
local:
----------
ID: myuser/myimage:mytag
Function: docker.image_present
Result: False
Comment: State 'docker.image_present' was not found in SLS 'foo-docker'
Reason: 'docker' __virtual__ returned False: 'docker.version' is not available.
Changes:
Summary for local
------------
Succeeded: 0
Failed: 1
------------
Total states run: 1
Total run time: 0.000 ms
In previous versions I think this was followed by a helpful message telling me to install docker-py?
Do you have docker-py installed in your virtualenv?
Also, keep in mind docker-py
in PyPI is the legacy module, the actively-developed one is just called docker
Yeah, that's confusing. I wasn't sure which to go with, and the docs weren't helping.
Did pip install docker
and updated docker.image_present
to docker_image.present
and got the original error:
local:
----------
ID: myuser/myimage:mytag
Function: docker_image.present
Result: False
Comment: Encountered error pulling myuser/myimage:mytag: Unable to interpret API event: 'b'{"status":"Pulling repository docker.io/myuser/myimage"}\r\n''. Additional info follows:
Error:
the JSON object must be str, not 'bytes'
Started: 13:26:43.596839
Duration: 422.801 ms
Changes:
Summary for local
------------
Succeeded: 0
Failed: 1
------------
Total states run: 1
Total run time: 422.801 ms
The docs for the upcoming release make this more clear:
Also, I noticed that the newly-created modules where we've split container, volume, image, and network management into their own state modules were not part of the table of contents in the docs, I've corrected that oversight in https://github.com/saltstack/salt/pull/42020.
@terminalmage So it looks like we're still seeing the bug on 2017.7. Are we still "info needed?"
OK, I see the problem. When I was developing this, I was using 3.6, which apparently can now automagically load bytestrings:
Python 3.6.1 (default, Mar 27 2017, 00:27:06)
[GCC 6.3.1 20170306] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import json
>>> json.loads(b'{"foo": "bar"}')
{'foo': 'bar'}
>>>
But on 3.5 and earlier, this raises an exception:
Python 3.5.1 (default, Mar 4 2016, 15:21:15)
[GCC 6.0.0 20160302 (Red Hat 6.0.0-0.14)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import json
>>> json.loads(b'{"foo": "bar"}')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python3.5/json/__init__.py", line 312, in loads
s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'
>>>
This is fixed in #42022.
<digression>
@terminalmage Thanks! Are you developing on 3.6 by default these days?
@brianthelion Not by default. For docker I have been developing locally on my laptop using the dockerd running there, and I run Arch so I have 2.7 and 3.6. But I also use docker containers for CentOS, Ubuntu, etc. to test the code on those platforms, with my git checkout mounted into the container, so in those cases I'll get 3.4 or 3.5 from time to time if I'm testing Python 3.
@terminalmage Interesting that Arch has moved on to 3.6 already. I'm wondering if I should pull the trigger and make the switch using the PPA version for Ubuntu. Some nice things in 3.6! </digression>
Indeed! For portability though, 3.4 is going to be the standard for a little while longer, I fear.
@terminalmage This is a blocker for me. If you can point me to some source that I can modify to get it working, I will patch the code myself.
@brianthelion it is literally a one-line fix, so it should be easy for you to work around locally. You can see the diff here in the PR I opened: https://github.com/saltstack/salt/pull/42022/files
If I may recommend, you can copy the file (in this case dockerng.py
) from /usr/lib/python....
to within the salt fileserver under (salt://_modules/
), make that one-line edit, and then run salt '*' saltutil.sync_modules
. This will sync this module to your minions and override the one with the bug. Keep in mind that with this workaround you'll want to remove this file and re-run that sync when you upgrade, to keep this temporary workaround from remaining in place and potentially causing problems.
Also, as @gtmanfred mentioned earlier, we don't technically support Python 3 in the 2016.11 release cycle. The upcoming 2017.7.0 release will be the first with experimental Python 3 support. That said, I still very much appreciate you helping bring this to light as this fix will be very important for 2017.7.0.
@terminalmage Sorry to go out of band here, but I think I've hit a bug in 2017.7 while trying to resolve this issue. I'm seeing state.sls
(hence, state.apply
) not respecting the pillar=
argument.
This can be verified by calling salt-call --local state.sls baz pillar='{"host": "localhost"}'
where
#baz.sls
ping -c 2 {{ pillar['host'] }}:
cmd.run
If you can confirm that this is failing, I'll file a bug report.
If you open a bug report, we will confirm it before we tag it with labels.
Thanks, Daniel
On Tue, Jul 4, 2017 at 1:21 PM, brianthelion notifications@github.com wrote:
@terminalmage https://github.com/terminalmage Sorry to go out of band here, but I think I've hit a bug in 2017.7 while trying to resolve this issue. I'm seeing state.sls (hence, state.apply) not respecting the pillar= argument.
This can be verified by calling salt-call --local state.sls baz pillar='{"host": "localhost"}' where
baz.sls
ping -c 2 {{ pillar['host'] }}: cmd.run
If you can confirm that this is failing, I'll file a bug report.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/saltstack/salt/issues/41996#issuecomment-312937589, or mute the thread https://github.com/notifications/unsubscribe-auth/AAssoeu6ZOs9w4JybDKa0nlRLZuhc3oUks5sKpCkgaJpZM4OImzh .
@brianthelion I've confirmed it and submitted a fix in ~https://github.com/saltstack/salt/issues/42116~ https://github.com/saltstack/salt/issues/42119.
@brianthelion were you able to resolve this issue with #42119 and #42022 ?
Going to close the issue but please let us know if this does not resolve the issue for you and we can re-open
@Ch3LL Looks like the issue persists.
$ git log
commit 41ef5225e9f6495c017f41dda03dd4b592795dfd
Merge: 47ade9e91c e639be8b47
Author: garethgreenaway <gareth@wiked.org>
Date: Thu Jul 6 16:04:01 2017 -0700
Merge pull request #42184 from terminalmage/py3-tests
importlib: Use load_module() instead of exec_module() to initialize loaded mods
commit 47ade9e91c9720d554d53a8701bb4c131d6786b8
Merge: 2ae5517d36 fc27c1a948
Author: garethgreenaway <gareth@wiked.org>
Date: Thu Jul 6 15:03:42 2017 -0700
Merge pull request #42088 from terminalmage/update-mocking
Update mocking in network tests
commit e639be8b4742468b1acb79b8b4182e8737f0d4c1
Author: Erik Johnson <palehose@gmail.com>
Date: Thu Jul 6 15:02:44 2017 -0500
importlib: Use load_module() instead of exec_module() to initialize loaded mods
Using exec_module() results in some unexpected behavior in the LazyLoader,
so more investigation will need to be done before we can use it. In the
meantime, this commit uses load_module() instead. It also gets rid of
the now-unnecessary workarounds we had recently instituted in salt-ssh
to work around issues with the __opts__ dunder.
commit 2ae5517d360d4bda9108ce6417ee483e74b3d1a8
Merge: 778ed74103 19df3bf731
Author: Nicole Thomas <nicole@saltstack.com>
Date: Thu Jul 6 12:27:16 2017 -0600
Merge pull request #42022 from terminalmage/issue41996
salt.modules.dockermod: ensure that json.loads is fed a string
$ pip install --upgrade -e .
Obtaining file:///home/bar/Dev/foo/build/saltstack
Requirement already up-to-date: Jinja2 in /home/bar/Dev/foo/env/5/lib/python3.5/site-packages (from salt===2017.7.0rc1-10-g41ef522)
Requirement already up-to-date: msgpack-python>0.3 in /home/bar/Dev/foo/env/5/lib/python3.5/site-packages (from salt===2017.7.0rc1-10-g41ef522)
Requirement already up-to-date: PyYAML in /home/bar/Dev/foo/env/5/lib/python3.5/site-packages (from salt===2017.7.0rc1-10-g41ef522)
Requirement already up-to-date: MarkupSafe in /home/bar/Dev/foo/env/5/lib/python3.5/site-packages (from salt===2017.7.0rc1-10-g41ef522)
Requirement already up-to-date: requests>=1.0.0 in /home/bar/Dev/foo/env/5/lib/python3.5/site-packages (from salt===2017.7.0rc1-10-g41ef522)
Requirement already up-to-date: tornado>=4.2.1 in /home/bar/Dev/foo/env/5/lib/python3.5/site-packages (from salt===2017.7.0rc1-10-g41ef522)
Requirement already up-to-date: pycrypto>=2.6.1 in /home/bar/Dev/foo/env/5/lib/python3.5/site-packages (from salt===2017.7.0rc1-10-g41ef522)
Requirement already up-to-date: pyzmq>=2.2.0 in /home/bar/Dev/foo/env/5/lib/python3.5/site-packages (from salt===2017.7.0rc1-10-g41ef522)
Requirement already up-to-date: chardet<3.1.0,>=3.0.2 in /home/bar/Dev/foo/env/5/lib/python3.5/site-packages (from requests>=1.0.0->salt===2017.7.0rc1-10-g41ef522)
Requirement already up-to-date: idna<2.6,>=2.5 in /home/bar/Dev/foo/env/5/lib/python3.5/site-packages (from requests>=1.0.0->salt===2017.7.0rc1-10-g41ef522)
Requirement already up-to-date: urllib3<1.22,>=1.21.1 in /home/bar/Dev/foo/env/5/lib/python3.5/site-packages (from requests>=1.0.0->salt===2017.7.0rc1-10-g41ef522)
Requirement already up-to-date: certifi>=2017.4.17 in /home/bar/Dev/foo/env/5/lib/python3.5/site-packages (from requests>=1.0.0->salt===2017.7.0rc1-10-g41ef522)
Installing collected packages: salt
Found existing installation: salt 2017.7.0rc1-10-g41ef522
Uninstalling salt-2017.7.0rc1-10-g41ef522:
Successfully uninstalled salt-2017.7.0rc1-10-g41ef522
Running setup.py develop for salt
Successfully installed salt
[DEBUG ] Attempting to run docker-py's "images" function with args=() and kwargs={'all': False}
[DEBUG ] Attempting to run docker-py's "build" function with args=() and kwargs={'nocache': False, 'buildargs': None, 'rm': True, 'path': '/home/bar/Dev/foo/build/salt/._cache/venv-jglf6sfo/tmp', 'fileobj': None, 'dockerfile': None, 'quiet': False, 'tag': 'foo:latest'}
[DEBUG ] Looking for auth config
[DEBUG ] No auth config in memory - loading from filesystem
[DEBUG ] Trying paths: ['/home/bar/.docker/config.json', '/home/bar/.dockercfg']
[DEBUG ] No config file found
[DEBUG ] No auth config found
[ERROR ] Encountered error building /home/bar/Dev/foo/build/salt/._cache/venv-jglf6sfo/tmp as foo:latest: the JSON object must be str, not 'bytes'
[INFO ] Completed state [foo:latest] at time 20:50:37.422752 duration_in_ms=87.28
@terminalmage see above ^
@terminalmage @Ch3LL I unblocked myself by moving from docker_image.present: -build:
to docker_image.present: -sls:
and implementing support for #42202.
This issue is still open.
@brianthelion can you give https://github.com/saltstack/salt/pull/42208 a try?
@Ch3LL Pulled and will report back shortly....
@Ch3LL Looks good! I'll call to reopen if I hit anything else.
@brianthelion Thanks a lot for helping with getting this tested and verified. I'll go ahead and close this.
Description of Issue/Question
I am running Docker on my local machine. I am in the 'docker' group and can run the standard Docker 'hello world' from the command line. I am attempting to use dockerng to build/run an image given a Dockerfile sitting in a local directory. The Dockerfile in question is vanilla and runs just fine from the Docker CLI. I am not root, so I'm using
salt-call --local state.sls <mystate> localconfig=<myconfig>
. This fails with:Setup
(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).)
salt
anddocker-py
installed frompip
.docker.io
installed fromapt-get
on vanilla Ubuntu.mystate
myconfig
Steps to Reproduce Issue
(Include debug logs if possible and relevant.)
Versions Report
(Provided by running
salt --versions-report
. Please also mention any differences in master/minion versions.)