iris icon indicating copy to clipboard operation
iris copied to clipboard

Docker build instructions do not work

Open prestonvanloon opened this issue 4 years ago • 8 comments

Followed instructions here https://github.com/linkedin/iris/tree/master/ops/packer

packer build -only=docker ./output/iris.json

<lots of logs>

    docker: mv: cannot stat '/home/iris/source/ops/config/systemd/uwsgi-iris.service': No such file or directory
==> docker: Killing the container: 3ae3090eb6e4e524f7d3e71decf92642267086b7b28aebcc2e23baad6115eb85
Build 'docker' errored: Script exited with non-zero exit status: 1

==> Some builds didn't complete successfully and had errors:
--> docker: Script exited with non-zero exit status: 1

==> Builds finished but no artifacts were created.

prestonvanloon avatar Mar 27 '20 21:03 prestonvanloon

I have different problem during building of docker image using Packer:

    docker: Processing /home/iris/source
    docker:     ERROR: Command errored out with exit status 1:
    docker:      command: /home/iris/env/bin/python2 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-L6LXo8/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-L6LXo8/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-J0m82F
    docker:          cwd: /tmp/pip-req-build-L6LXo8/
    docker:     Complete output (5 lines):
    docker:     Traceback (most recent call last):
    docker:       File "<string>", line 1, in <module>
    docker:       File "/tmp/pip-req-build-L6LXo8/setup.py", line 10, in <module>
    docker:         with open('README.md', 'r') as fd:
    docker:     IOError: [Errno 2] No such file or directory: 'README.md'
    docker:     ----------------------------------------
    docker: ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
==> docker: Killing the container: ce1375cbb71563ff4f9b170ea9c1049f9729f139db571dfa0ff2d27310bfe3e7
Build 'docker' errored: Script exited with non-zero exit status: 1

==> Some builds didn't complete successfully and had errors:
--> docker: Script exited with non-zero exit status: 1

==> Builds finished but no artifacts were created.

Steps to reproduce:

git clone https://github.com/linkedin/iris.git 
cd iris/ops/packer
mkdir output
python3 gen_packer_cfg.py ./iris.yaml | tail -n +2 > ./output/iris.json
packer build -only=docker ./output/iris.json 

Problem start at commit 65c45891976ecaf61773d2e695a86524ed7b8e2e

lukdz avatar Dec 07 '20 11:12 lukdz

I was able to fix problem above by hard coding long_description. Also I had to downgrade setuptools to 44.1.1.

In my case image is built but container fails with /bin/sh: 0: Can't open sudo. However, I can log into, run sudo -EHu iris bash -c "source /home/iris/env/bin/activate && python /home/iris/entrypoint.py" and it seems to work.

I followed instructions from here https://github.com/linkedin/iris/tree/master/ops/packer

adszm avatar Dec 07 '20 12:12 adszm

Same problem here. The packer configs use very old Ubuntu too, 16:04, and most of the python scripts use #!/usr/bin/env python instead of #!/usr/bin/env python3, which causes a lot of issues.

baryluk avatar Sep 10 '21 11:09 baryluk

I have a bunch of enhancements to documentation and Dockerfile and packer setup, that should resolve this. This also updates to python3 , newer ubuntu, and improves the entrypoint mechanism.

I will send it in coming days.

baryluk avatar Nov 03 '21 20:11 baryluk

@baryluk I haven't seen your work in your fork so far and had to move on with the Docker image myself. Sent a PR for it, https://github.com/linkedin/iris/pull/649.

I guess we can consolidate, split the changes afterwards.

mighq avatar Nov 04 '21 10:11 mighq

I was able to fix problem above by hard coding long_description. Also I had to downgrade setuptools to 44.1.1.

In my case image is built but container fails with /bin/sh: 0: Can't open sudo. However, I can log into, run sudo -EHu iris bash -c "source /home/iris/env/bin/activate && python /home/iris/entrypoint.py" and it seems to work.

I followed instructions from here https://github.com/linkedin/iris/tree/master/ops/packer

This is solved by clearing ENTRYPOINT directive for the image. See my PR.

mighq avatar Nov 04 '21 10:11 mighq

Same problem here. The packer configs use very old Ubuntu too, 16:04, and most of the python scripts use #!/usr/bin/env python instead of #!/usr/bin/env python3, which causes a lot of issues.

It depends on what is your preferred distribution channel and wider context of deployments you want to support. If you limit yourself to Docker and fill the image/OS with just python v3, you don't need to explicitly say python3 in hash-bang declarations. I did that in my PR.

mighq avatar Nov 04 '21 12:11 mighq

I also found that lot of work has been done in https://github.com/allwyn-pradip/iris/tree/fw-iris.

mighq avatar Nov 04 '21 14:11 mighq