Skip to content
This repository was archived by the owner on May 6, 2020. It is now read-only.

fix(api): split command arguments by space if entrypoint is not /bin/bash -c #1264

Merged
merged 1 commit into from
Mar 15, 2017

Conversation

bacongobbler
Copy link
Member

@bacongobbler bacongobbler added this to the v2.13 milestone Mar 13, 2017
@bacongobbler bacongobbler self-assigned this Mar 13, 2017
@deis-bot
Copy link

@mboersma, @Joshua-Anderson and @krancour are potential reviewers of this pull request based on my analysis of git blame information. Thanks @bacongobbler!

@bacongobbler
Copy link
Member Author

bacongobbler commented Mar 13, 2017

since we already make it clear that bash should be present in deis pull apps, this should not affect anyone. Doubly so that it was broken in the first place.

@bacongobbler
Copy link
Member Author

On the contrary, this may not be the fix as this will override docker images that have an entrypoint defined. I think a separate fix is necessary here.

@cristiangraz
Copy link

@bacongobbler Will this only apply to entries in the Procfile named cmd? Just want to confirm that using a Docker image deployed via deis pull with a Procfile like this would still work:

cmd: yarn start-service
worker1: ./worker --name worker1
worker2: ./worker --name worker2

Since the other process types are still using the same docker image, we'd need to take into account multiple commands in each process type, not just the cmd one:

cmd: ["yarn", "start-service"]
worker1: ["./worker", "--name", "worker1"]
worker2: ["./worker", "--name", "worker2"]

I apologize in advance if this is already the case, I'm not familiar with the Deis internals or python, but saw a reference to a dockerfile and container_type == cmd in the diff so just wanted to clarify.

Also will the Dockerfile need to be present in the WORKDIR of the image for this to work (I have it in .dockerignore)

@bacongobbler
Copy link
Member Author

Yes, the bug in question only applies to cmd process types. If you rename cmd to web it should work for you just fine.

@bacongobbler bacongobbler force-pushed the 715-pull-with-cmd-proctype branch from 7a04c05 to cfa261e Compare March 13, 2017 17:45
@bacongobbler bacongobbler changed the title fix(api): give deis pull apps with a cmd process type an entrypoint fix(api): split deis pull cmd arguments by space Mar 13, 2017
@bacongobbler bacongobbler force-pushed the 715-pull-with-cmd-proctype branch 4 times, most recently from ba3790c to 8ecadc2 Compare March 13, 2017 18:24
@bacongobbler bacongobbler changed the title fix(api): split deis pull cmd arguments by space fix(api): split command arguments by space if entrypoint is not /bin/bash -c Mar 13, 2017
@bacongobbler
Copy link
Member Author

k, so the new proposed fix should do the following:

  1. respect the docker image's defined ENTRYPOINT
  2. supply the arguments as a list to the manifest

With this, I can successfully deploy example-dockerfile-procfile-http as expected:

><> cat Procfile
cmd: python -m SimpleHTTPServer 5000
><> deis pull deis/example-dockerfile-python

@bacongobbler bacongobbler force-pushed the 715-pull-with-cmd-proctype branch from 8ecadc2 to 3bd23c5 Compare March 13, 2017 18:26
@codecov-io
Copy link

codecov-io commented Mar 13, 2017

Codecov Report

Merging #1264 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #1264      +/-   ##
==========================================
+ Coverage   87.25%   87.26%   +<.01%     
==========================================
  Files          44       44              
  Lines        3884     3887       +3     
  Branches      674      675       +1     
==========================================
+ Hits         3389     3392       +3     
  Misses        327      327              
  Partials      168      168

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1156475...02206b7. Read the comment docs.

@bacongobbler bacongobbler force-pushed the 715-pull-with-cmd-proctype branch from ecfe76e to 02206b7 Compare March 15, 2017 18:02
@bacongobbler bacongobbler merged commit a8002a2 into deis:master Mar 15, 2017
@bacongobbler bacongobbler deleted the 715-pull-with-cmd-proctype branch March 15, 2017 20:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deploy docker image with Procfile
6 participants