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

Update ruby to have onbuild triggers as a separate image #113

Merged
merged 1 commit into from
Jul 30, 2014

Conversation

yosifkit
Copy link
Member

This will break many users' current builds so we will need to update the hub long description.

@tianon
Copy link
Member

tianon commented Jul 17, 2014

I started building this to test it and ran into an error (so I Ctrl+C'd). It looks like the problem is that it builds "ruby" as "library/ruby", but then the later Dockerfiles "FROM ruby:..." which doesn't work (or if it did, wouldn't use the updated image). I suppose we've had this problem for quite some time, especially in "debian:experimental" and "debian:rc-buggy" but also in "ubuntu-upstart" and friends (and now it's magnified across several separate images that need some concept of build ordering).

root@db98b2865afd:/stackbrew/stackbrew# ./brew-cli --debug --targets ruby -b ruby-onbuild git://github.com/infosiftr/stackbrew
2014-07-17 19:33:23,948 DEBUG Cloning repo_url=git://github.com/infosiftr/stackbrew, ref=ruby-onbuild
2014-07-17 19:33:23,950 DEBUG folder = /tmp/tmpHUiU_0
2014-07-17 19:33:23,950 DEBUG Cloning git://github.com/infosiftr/stackbrew into /tmp/tmpHUiU_0
2014-07-17 19:33:23,950 DEBUG Executing "git clone git://github.com/infosiftr/stackbrew ." in /tmp/tmpHUiU_0
Cloning into '.'...
remote: Counting objects: 920, done.
remote: Compressing objects: 100% (412/412), done.
remote: Total 920 (delta 505), reused 902 (delta 497)
Receiving objects: 100% (920/920), 137.00 KiB | 117.00 KiB/s, done.
Resolving deltas: 100% (505/505), done.
Checking connectivity... done.
2014-07-17 19:33:25,651 DEBUG Checkout ref:ruby-onbuild in /tmp/tmpHUiU_0
2014-07-17 19:33:25,651 DEBUG Executing "git checkout ruby-onbuild" in /tmp/tmpHUiU_0
Branch ruby-onbuild set up to track remote branch ruby-onbuild from origin.
Switched to a new branch 'ruby-onbuild'
2014-07-17 19:33:25,657 DEBUG latest: git://github.com/docker-library/ruby@3c212166381cf64eb3a084dd9634a90955cc323f

2014-07-17 19:33:25,657 DEBUG 2: git://github.com/docker-library/ruby@3c212166381cf64eb3a084dd9634a90955cc323f

2014-07-17 19:33:25,657 DEBUG 2.1: git://github.com/docker-library/ruby@3c212166381cf64eb3a084dd9634a90955cc323f

2014-07-17 19:33:25,657 DEBUG 2.1.2: git://github.com/docker-library/ruby@3c212166381cf64eb3a084dd9634a90955cc323f

2014-07-17 19:33:25,657 DEBUG onbuild: git://github.com/docker-library/ruby@3c212166381cf64eb3a084dd9634a90955cc323f docker-onbuild

2014-07-17 19:33:25,657 DEBUG 2-onbuild: git://github.com/docker-library/ruby@3c212166381cf64eb3a084dd9634a90955cc323f docker-onbuild

2014-07-17 19:33:25,657 DEBUG 2.1-onbuild: git://github.com/docker-library/ruby@3c212166381cf64eb3a084dd9634a90955cc323f docker-onbuild

2014-07-17 19:33:25,657 DEBUG 2.1.2-onbuild: git://github.com/docker-library/ruby@3c212166381cf64eb3a084dd9634a90955cc323f docker-onbuild

2014-07-17 19:33:25,657 DEBUG ruby: onbuild,2-onbuild,2.1-onbuild,2.1.2-onbuild
2014-07-17 19:33:25,657 DEBUG ruby: latest,2,2.1,2.1.2
2014-07-17 19:33:25,657 DEBUG Cloning repo_url=git://github.com/docker-library/ruby, ref=3c212166381cf64eb3a084dd9634a90955cc323f
2014-07-17 19:33:25,658 DEBUG folder = /tmp/tmpcrLzlu
2014-07-17 19:33:25,658 DEBUG Cloning git://github.com/docker-library/ruby into /tmp/tmpcrLzlu
2014-07-17 19:33:25,658 DEBUG Executing "git clone git://github.com/docker-library/ruby ." in /tmp/tmpcrLzlu
Cloning into '.'...
remote: Counting objects: 210004, done.
remote: Compressing objects: 100% (46640/46640), done.
remote: Total 210004 (delta 161682), reused 210004 (delta 161682)
Receiving objects: 100% (210004/210004), 86.80 MiB | 1.46 MiB/s, done.
Resolving deltas: 100% (161682/161682), done.
Checking connectivity... done.
2014-07-17 19:35:24,243 DEBUG Checkout ref:3c212166381cf64eb3a084dd9634a90955cc323f in /tmp/tmpcrLzlu
2014-07-17 19:35:24,243 DEBUG Executing "git checkout 3c212166381cf64eb3a084dd9634a90955cc323f" in /tmp/tmpcrLzlu
Note: checking out '3c212166381cf64eb3a084dd9634a90955cc323f'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 3c21216... Merge pull request #3 from infosiftr/onbuild-migrate
2014-07-17 19:35:24,386 INFO Build start: ruby ('git://github.com/docker-library/ruby', '3c212166381cf64eb3a084dd9634a90955cc323f', 'docker-onbuild')
2014-07-17 19:35:25,951 ERROR Build failed for ruby (('git://github.com/docker-library/ruby', '3c212166381cf64eb3a084dd9634a90955cc323f', 'docker-onbuild'))
Traceback (most recent call last):
  File "/stackbrew/stackbrew/brew/brew.py", line 172, in build_repo
    self.build_version(repo, version, callback)
  File "/stackbrew/stackbrew/brew/brew.py", line 195, in build_version
    repo, version, dockerfile_location, callback
  File "/stackbrew/stackbrew/brew/brew.py", line 284, in do_build
    raise exc
StackbrewError: Build failed for ruby (('git://github.com/docker-library/ruby', '3c212166381cf64eb3a084dd9634a90955cc323f', 'docker-onbuild'))
2014-07-17 19:35:25,951 DEBUG Checkout ref:3c212166381cf64eb3a084dd9634a90955cc323f in /tmp/tmpcrLzlu
2014-07-17 19:35:25,951 DEBUG Executing "git checkout 3c212166381cf64eb3a084dd9634a90955cc323f" in /tmp/tmpcrLzlu
HEAD is now at 3c21216... Merge pull request #3 from infosiftr/onbuild-migrate
2014-07-17 19:35:26,092 INFO Build start: ruby ('git://github.com/docker-library/ruby', '3c212166381cf64eb3a084dd9634a90955cc323f', '.')
^CTraceback (most recent call last):
  File "./brew-cli", line 62, in <module>
    builder.build_all()
  File "/stackbrew/stackbrew/brew/brew.py", line 165, in build_all
    self.build_repo(repo, continue_on_error, callback)
  File "/stackbrew/stackbrew/brew/brew.py", line 172, in build_repo
    self.build_version(repo, version, callback)
  File "/stackbrew/stackbrew/brew/brew.py", line 195, in build_version
    repo, version, dockerfile_location, callback
  File "/stackbrew/stackbrew/brew/brew.py", line 277, in do_build
    img_id, logs = self._parse_result(build_result)
  File "/stackbrew/stackbrew/brew/brew.py", line 301, in _parse_result
    lines = [line for line in build_result]
  File "/usr/local/lib/python2.7/dist-packages/docker/client.py", line 242, in _stream_helper
    for line in response.iter_lines(chunk_size=32):
  File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 648, in iter_lines
    decode_unicode=decode_unicode):
  File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 616, in generate
    decode_content=True):
  File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/response.py", line 236, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/response.py", line 183, in read
    data = self._fp.read(amt)
  File "/usr/lib/python2.7/httplib.py", line 543, in read
    return self._read_chunked(amt)
  File "/usr/lib/python2.7/httplib.py", line 585, in _read_chunked
    line = self.fp.readline(_MAXLINE + 1)
  File "/usr/lib/python2.7/socket.py", line 476, in readline
    data = self._sock.recv(self._rbufsize)
KeyboardInterrupt
root@db98b2865afd:/stackbrew/stackbrew# 

@shin-
Copy link
Contributor

shin- commented Jul 21, 2014

@tianon We should be able to configure the stackbrew script to tag non-namespaced images too, which would solve this issue?

@tianon
Copy link
Member

tianon commented Jul 21, 2014

Yeah, I think that would solve it. Would you want that behind a flag, or just enabled by default? Also, do you want me to make the change and PR it? :)

I still think it'd be good if we had a way to control the order in which these build, since there are co-dependent builds here, but building them unprefixed would be a good start that would fix our immediate issue.

@shin-
Copy link
Contributor

shin- commented Jul 21, 2014

Sure, if you feel like doing it! Looks like an easy enough addition around those lines. And I think it's best that we put it behind a flag.

Also agree on the dependency/ordering issue, it's a bit more work though =)

@yosifkit yosifkit mentioned this pull request Jul 21, 2014
shin- added a commit that referenced this pull request Jul 30, 2014
Update ruby to have onbuild triggers as a separate image
@shin- shin- merged commit 7950041 into docker-library:master Jul 30, 2014
@tianon tianon deleted the ruby-onbuild branch July 30, 2014 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants