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

use apt-ftparchive and reprepro to enable apt-pinning; #16001

Merged
merged 1 commit into from
Sep 3, 2015

Conversation

jessfraz
Copy link
Contributor

@jessfraz jessfraz commented Sep 2, 2015

fix #13191
ping @tianon pinng @paultag

this is the hackiest thing of my life but it works

I cloned our repo to new.dockerproject.org if you want to test before we make live ;)

@jessfraz
Copy link
Contributor Author

jessfraz commented Sep 2, 2015

 docker run --rm -it debian:stretch bash
root@f8c90c889e26:/# apt-get update
Get:1 http://httpredir.debian.org sid InRelease [239 kB]
Get:2 http://httpredir.debian.org sid/main amd64 Packages [10.1 MB]
Fetched 10.3 MB in 2s (3896 kB/s)   
Reading package lists... Done
root@f8c90c889e26:/# apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.XiQ6pI4Ln0 --no-auto-check-trustdb --trust-model always --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-jessie-automatic.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-jessie-security-automatic.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-jessie-stable.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-squeeze-automatic.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-squeeze-stable.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-wheezy-automatic.gpg --keyring /etc/apt/trusted.gpg.d/debian-archive-wheezy-stable.gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
gpg: requesting key 2C52609D from hkp server p80.pool.sks-keyservers.net

gpg: key 2C52609D: public key "Docker Release Tool (releasedocker) <docker@docker.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
root@f8c90c889e26:/# echo deb http://new.dockerproject.org/repo debian-stretch main> /etc/apt/sources.list.d/docker.list
root@f8c90c889e26:/# apt-get update
Ign http://new.dockerproject.org debian-stretch InRelease
Hit http://httpredir.debian.org sid InRelease               
Get:1 http://new.dockerproject.org debian-stretch Release.gpg [819 B]
Get:2 http://new.dockerproject.org debian-stretch Release [14.2 kB]
Get:3 http://httpredir.debian.org sid/main amd64 Packages [10.1 MB]
Get:4 http://new.dockerproject.org debian-stretch/main amd64 Packages [1587 B]
Fetched 10.1 MB in 2s (3938 kB/s)                                
Reading package lists... Done
root@f8c90c889e26:/# apt-cache madison docker-engine
docker-engine | 1.8.1-0~stretch | http://new.dockerproject.org/repo/ debian-stretch/main amd64 Packages
docker-engine | 1.8.0-0~stretch | http://new.dockerproject.org/repo/ debian-stretch/main amd64 Packages
docker-engine | 1.7.1-0~stretch | http://new.dockerproject.org/repo/ debian-stretch/main amd64 Packages
docker-engine | 1.7.0-0~stretch | http://new.dockerproject.org/repo/ debian-stretch/main amd64 Packages

yayyyy

@jessfraz
Copy link
Contributor Author

jessfraz commented Sep 2, 2015

also new feature:

root@3acce655f5e7:/# apt-file update
Downloading complete file http://httpredir.debian.org/debian/dists/sid/main/Contents-amd64.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 29.5M  100 29.5M    0     0  6360k      0  0:00:04  0:00:04 --:--:-- 7536k
Downloading complete file http://new.dockerproject.org/repo/dists/debian-stretch/main/Contents-amd64.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   678  100   678    0     0   3746      0 --:--:-- --:--:-- --:--:--  3766
Downloading complete file http://new.dockerproject.org/repo/dists/debian-stretch/testing/Contents-amd64.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   687  100   687    0     0   3404      0 --:--:-- --:--:-- --:--:--  3417
Downloading complete file http://new.dockerproject.org/repo/dists/debian-stretch/experimental/Contents-amd64.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   719  100   719    0     0   3594      0 --:--:-- --:--:-- --:--:--  3613
root@3acce655f5e7:/# apt-file search /usr/bin/docker
docker-compose: /usr/bin/docker-compose
docker-engine: /usr/bin/docker
docker.io: /usr/bin/docker
root@3acce655f5e7:/# 

@@ -35,6 +35,51 @@ if [[ ! -f "$APTDIR/conf/distributions" ]]; then
done > "$APTDIR/conf/distributions"
fi

# create/update distributions file
if [[ ! -f "$APTDIR/conf/apt-ftparchive.conf" ]]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just going to nitpick to see if @tianon corrects me:)

I think this only needs a single bracket

@cpuguy83
Copy link
Member

cpuguy83 commented Sep 2, 2015

Pretty!

@jessfraz
Copy link
Contributor Author

jessfraz commented Sep 2, 2015

we could probably remove reprepro all together and just use apt-ftparchive but this is good for now,, then we can have maybe followup PR

cat <<-EOF
Tree "dists/${suite}" {
Sections "main testing experimental";
Architectures "i386 amd64";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we should put these fields into an array at the top of the file since they're used multiple places? Then we could use for arch in "${arches[@]}"; do ... for iterating and ${arches[*]} for printing space-separated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the sections also?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we don't use the sections explicitly in nearly as many places as the arches.



# run the apt-ftparchive commands so we can have pinning
apt-ftparchive generate $APTDIR/conf/apt-ftparchive.conf
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moar quotes 😄

@paultag
Copy link

paultag commented Sep 2, 2015

Can't wait to check this out! I'll pull this down in a sec later today :D
On Sep 1, 2015 9:29 PM, "Jessie Frazelle" notifications@github.com wrote:

ping @tianon https://github.com/tianon pinng @paultag
https://github.com/paultag

this is the hackiest thing of my life but it works

I cloned our repo to new.dockerproject.org if you want to test before we

make live ;)

You can view, comment on, or merge this pull request online at:

#16001
Commit Summary

  • use apt-ftparchive and reprepro to enable apt-pinning;

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#16001.

@tianon
Copy link
Member

tianon commented Sep 2, 2015

Yeah, it definitely feels a little bit like we're abusing reprepro, but it solves the problem well enough without having to tweak dak, so I'm +1 (especially since @paultag pointed out that launchpad and sbuild both use apt-ftparchive, so it's not like it's way out there on the esoteric tools scale).

The logic seems sane enough to me, although I think @paultag will probably have more direct feedback he'll be able to give. ❤️

Signed-off-by: Jessica Frazelle <acidburn@docker.com>
@jessfraz
Copy link
Contributor Author

jessfraz commented Sep 2, 2015

updated! and yayyyy! yeah it feel like we are just using reprepro to put
the deb into the pool, (because we are) hehe but we can remove it completely

On Wed, Sep 2, 2015 at 9:29 AM, Tianon Gravi notifications@github.com
wrote:

Yeah, it definitely feels a little bit like we're abusing reprepro, but
it solves the problem well enough without having to tweak dak, so I'm +1
(especially since @paultag https://github.com/paultag pointed out that
launchpad and sbuild both use apt-ftparchive, so it's not like it's way
out there on the esoteric tools scale).

The logic seems sane enough to me, although I think @paultag
https://github.com/paultag will probably have more direct feedback
he'll be able to give. [image: ❤️]


Reply to this email directly or view it on GitHub
#16001 (comment).

@jessfraz
Copy link
Contributor Author

jessfraz commented Sep 2, 2015

also yeah I wanted something without having to add another tool or
something large like dak and we already had apt-ftparchive in the container
;) from apt-utils

On Wed, Sep 2, 2015 at 9:35 AM, Jessie Frazelle jess@docker.com wrote:

updated! and yayyyy! yeah it feel like we are just using reprepro to put
the deb into the pool, (because we are) hehe but we can remove it completely

On Wed, Sep 2, 2015 at 9:29 AM, Tianon Gravi notifications@github.com
wrote:

Yeah, it definitely feels a little bit like we're abusing reprepro, but
it solves the problem well enough without having to tweak dak, so I'm +1
(especially since @paultag https://github.com/paultag pointed out that
launchpad and sbuild both use apt-ftparchive, so it's not like it's way
out there on the esoteric tools scale).

The logic seems sane enough to me, although I think @paultag
https://github.com/paultag will probably have more direct feedback
he'll be able to give. [image: ❤️]


Reply to this email directly or view it on GitHub
#16001 (comment).

@phobologic
Copy link

This would make my life a lot easier - thanks for doing this @jfrazelle, can't wait to see it go live.

@paultag
Copy link

paultag commented Sep 2, 2015

This seems like a totally sensible changeset -- apt-ftparchive is a totally supported and rockin' tool. The changes made look totally sensible enough, and I think @jfrazelle 's gut that y'all can remove the reprepro dep seem entirely well founded to me.

Seems like a great set of changes. Nice! 🎊 👍 here.

@jessfraz
Copy link
Contributor Author

jessfraz commented Sep 2, 2015

woo hoo we should get this in for 1.8.2, ping @calavera @icecrime 😇

@jessfraz jessfraz added this to the 1.8.2 milestone Sep 2, 2015
@calavera
Copy link
Contributor

calavera commented Sep 3, 2015

LGTM. Merging and cherry picking into #15809

calavera added a commit that referenced this pull request Sep 3, 2015
use apt-ftparchive and reprepro to enable apt-pinning;
@calavera calavera merged commit d9065fc into moby:master Sep 3, 2015
@jessfraz jessfraz deleted the apt-repo-pinning branch September 3, 2015 15:16
phobologic added a commit to remind101/empire_ami that referenced this pull request Oct 11, 2015
After docker 1.7.0 we (Remind) have seen this issue pop up:

moby/moby#13914

Now that this is closed:

moby/moby#16001

We can use the new docker-engine packages, but with an old version. I'm
moving the empire_ami back to docker 1.7.0 till 13914 above is fixed.

As well, this should fix ECS stats - we just needed a bunch of volumes,
per:

aws/amazon-ecs-agent#174

Doing this internally @ Remind fixed this.
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.

Please don't remove old packages from apt repo
7 participants