Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker build instructions do not work #573

Open
prestonvanloon opened this issue Mar 27, 2020 · 8 comments
Open

Docker build instructions do not work #573

prestonvanloon opened this issue Mar 27, 2020 · 8 comments

Comments

@prestonvanloon
Copy link

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.

@lukdz
Copy link

lukdz commented Dec 7, 2020

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

@adszm
Copy link

adszm commented Dec 7, 2020

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

@baryluk
Copy link
Contributor

baryluk commented Sep 10, 2021

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
Copy link
Contributor

baryluk commented Nov 3, 2021

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.

@mighq
Copy link
Contributor

mighq commented Nov 4, 2021

@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, #649.

I guess we can consolidate, split the changes afterwards.

@mighq
Copy link
Contributor

mighq commented Nov 4, 2021

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
Copy link
Contributor

mighq commented Nov 4, 2021

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
Copy link
Contributor

mighq commented Nov 4, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants