Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Add setup-mirrors command #497

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mfojtik
Copy link
Contributor

@mfojtik mfojtik commented Oct 13, 2016

@stevekuznetsov @danmcp

This will add vagrant setup-openshift-mirrors command that will setup the EPEL7 openshift mirror repo next to EPEL (I believe that when we fail to fetch from official EPEL, yum will fallback to our repo). It also exports the OS_BUILD_IMAGE_ARGS which should cause all images built using oc ex dockerbuild to have the mirror repo as well.

Maybe fixes openshift/origin#8571

@mfojtik
Copy link
Contributor Author

mfojtik commented Oct 13, 2016

(i still testing this ;-)

@mfojtik mfojtik force-pushed the setup-mirrors branch 4 times, most recently from b205367 to c6133bb Compare October 13, 2016 09:47
@stevekuznetsov
Copy link
Contributor

I think we should make this part of the Origin dependencies, not a separate command -- this is something we want always and isn't something we want to do as a one-off.

do_execute(env[:machine], %{
echo "Setting up 'mirror.openshift.com' for EPEL ..."
set -e
rm -f /tmp/epel-mirror.repo /tmp/set-build-image-args.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

Both curl and your > redirect later will clobber these files anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stevekuznetsov yeah, but sudo does not allow redirection.. iow. "sudo foo > /etc/foo" will fail with permissions denied, but maybe that is just my lack of bash ;)

echo 'export OS_BUILD_IMAGE_ARGS="--mount /etc/yum.repos.d/epel-mirror.repo:/etc/yum.repos.d/epel-mirror.repo"' > /tmp/set-build-image-args.sh

sudo mv /tmp/epel-mirror.repo /etc/yum.repos.d/epel-mirror.repo
sudo mv /tmp/set-build-image-args.sh /etc/profile.d/set-build-image-args.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

Lots of caveats with /etc/profile.d -- place global environment in /etc/environment

sudo mv /tmp/epel-mirror.repo /etc/yum.repos.d/epel-mirror.repo
sudo mv /tmp/set-build-image-args.sh /etc/profile.d/set-build-image-args.sh
},
{ :timeout => 60*60*2, :verbose => false })
Copy link
Contributor

Choose a reason for hiding this comment

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

Two hours seems like a long timeout for this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right, copy&paste..

@mfojtik
Copy link
Contributor Author

mfojtik commented Oct 13, 2016

@stevekuznetsov actually I think this should be done when we build AMI, agree? if we do that and set the environment, then it should be available in any job.

@stevekuznetsov
Copy link
Contributor

@mfojtik yes, Origin deps step is run to build AMI, that would be a good place to put it. @danmcp really wish #481 were in

@danmcp
Copy link

danmcp commented Oct 13, 2016

@stevekuznetsov I thought you had abandoned that work.

@stevekuznetsov
Copy link
Contributor

@danmcp the PR is finished and ready (as are the others) but we were not sure about how much traffic the file would get and therefore unsure about the maintenance risk of merging it

@danmcp
Copy link

danmcp commented Oct 13, 2016

@stevekuznetsov That still sounds like abandoned. Are you saying you want to bring it back to life and get it merged?

@mfojtik
Copy link
Contributor Author

mfojtik commented Oct 13, 2016

@stevekuznetsov reworked.

@stevekuznetsov
Copy link
Contributor

@danmcp yes, both #480 and #481 could go in

@openshift-bot
Copy link

openshift-bot commented Nov 13, 2016

Vagrant OpenShift Action Required: Pull request cannot be automatically merged, please rebase your branch from latest HEAD and push again

@openshift-bot
Copy link

Vagrant Openshift Action Required: Pull request cannot be automatically merged, please rebase your branch from latest HEAD and push again

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants