-
Notifications
You must be signed in to change notification settings - Fork 116
Allow for users to specify Golang and Docker versions and RPM repos #459
Allow for users to specify Golang and Docker versions and RPM repos #459
Conversation
}) | ||
@options[:reponames] << "dockerextra" | ||
|
||
File.open("/etc/yum.repos.d/origin-deps-rhel7.repo", "w").write(%{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a good reason to be fetching this file from the web each time, but we can keep that. I like this approach as it's closer to the other hard-coded repo and because converting the wget
to Ruby would mean we require 'open-uri'
above and I'm not sure if that is totally ok (will that dep always be present?).
0d29d7a
to
876da65
Compare
fi | ||
}, :timeout=>60*10, :verbose => false) | ||
# Install base dependencies that we cannot continue without | ||
sudo(@env[:machine], "~/install_dependencies.s", :timeout=>60*30, :verbose => false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.s?
a78c558
to
cce7a26
Compare
I changed the behavior slightly. The flags are now:
The behavior is to use the 'default' repos (which we only have for RHEL7) if no repofiles or reponames are given, or to use only the names of repos given in repofiles if they're given, or to use only the names given in reponames if they are given and no repofiles are given. Giving repofiles and reponames is fobidden. We install latest from specified repos unless version is given. To test we want to see:
@danmcp thoughts? |
Without any flags, I've had the default setting (which is the same as what we had before) go until flake in e2e somewhere, so I'm fairly confident the resource file refactor is solid. Now just to test the logic. |
If you specify a golang and docker repo (or repofile) that are the same, will you dedup or add 2 of them?
We should change this case to pull in nothing extra. These should really be special cases already. |
I'm not particularly interested in adding deduping logic -- what's the long-term support going to be like for this plugin? Once we move away from it as an organization, who's going to be using it? Do they need good UX?
I like it. Makes the logic simpler. |
79ae3e2
to
47caf67
Compare
For posterity, now that default is special-case, previous default is achieved with:
|
84603bf
to
58b9c3f
Compare
==== Configuring Docker and Golang versions for tests | ||
|
||
If the version of OpenShift that is being tested requires a version | ||
of Golang or Docker that is not default in the RPM streams for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't reference AMI here or below.
58b9c3f
to
e07bc0c
Compare
@@ -58,6 +58,7 @@ def call(env) | |||
ADD vars/* /etc/yum/vars/ | |||
ADD repos/* /etc/yum.repos.d/ | |||
ADD certs/* /var/lib/yum/ | |||
ADD keys/* /etc/pki/rpm-gpg/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually exactly what I was talking about on the call - we're pulling later from repos that use these public keys for GPG package checks... but didn't have the keys
e07bc0c
to
1165086
Compare
@danmcp testing looks good: origin/master
ose/master
ose/enterprise-3.0
ose/enterprise-3.1
ose/enterprise-3.2
|
8f7a349
to
d2b19e0
Compare
[test] me |
d9ce05a
to
94db4ce
Compare
20c9304
to
96a625d
Compare
@danmcp I've taken the Docker and Golang installation completely out of |
Evaluated for vagrant openshift test up to 96a625d |
Vagrant OpenShift Test Results: SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_vagrant_openshift/83/) (Base Commit: f06be13) |
Green tests, I'll squash and merge. @danmcp FYI |
In order to allow each job building an AMI to be able to declare the Docker and Golang versions that should be present, the Docker and Golang install paths are separated out so that they live alone and are not called in the `build-origin-base` command but instead in specific `install-docker` and `install-golang` commands that can be run by a user to configfure the version of Docker or Golang installed on the system. These new commands have the following flags: --{golang,docker}.version to specify the version to install The following flags determine what repos are enabled during the installation process: --repourl to specify the URL of an RPM repo --repo to specify the name of an installed repo Any repositories installed from URLs provided with the above flags will be enabled *only* for the installation of Golang or Docker, and will be disabled thereafter. The `--{golang,docker}.version` flags are used to construct package names for the core package as well as for peripheral packages, for instance `golang` and `golang-src`. No leading dash is necessary to specify the version. For instance, a user would specify that they want `golang-1.6.2` by passing `--golang.version=1.6.2`. Repositories installed from URLs will have a .repo file created for them automatically. The name of the repository will be the given URL with all non-alphanumeric characters (/[^a-zA-Z0-9]/) stripped out. Then, the URL and name will be inserted into the following definition: ``` [#{reponame}] name=#{reponame} baseurl=#{url} enabled=1 gpgcheck=0 sslverify=0 sslclientcert=/var/lib/yum/client-cert.pem sslclientkey=/var/lib/yum/client-key.pem ``` As the sslclient{cert,key} are not used unless the RPM repository responds to a request with auth headers, these fields are ignored unless the repository needs them and therefore repositories that do not need them are not broken and it is safe to append them always. Signed-off-by: Steve Kuznetsov <[email protected]>
96a625d
to
7ab8d5f
Compare
In order to allow for better configuration of our AMI builds, four
new flags are added to the
vagrant build-origin-base
command:--repofile: to specify repo files to install
--repo: to specify repositories to enable for Golang/Docker
--golang-version: to specify Golang version
--docker-version: to specify Docker version
Any repositories installed from files provided with
--repofile
will be enabled only for the installation of Golang and Docker,
and will be enabled for those installs by default, unless the user
provides repositories with
--repo
to override the default.The
--{golang,docker}-version
flags are used to construct packagenames for the core package as well as for peripheral packages, for
instance
golang
andgolang-src
. Provide these versions with thisbehavior in mind.
Signed-off-by: Steve Kuznetsov [email protected]
@danmcp PTAL impl, will test when we agree on it