vagrant-openshift 3.0.8 → 3.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +6 -1
  3. data/Gemfile +5 -1
  4. data/README.asciidoc +65 -78
  5. data/hack/test.sh +135 -0
  6. data/hack/update.sh +32 -0
  7. data/lib/vagrant-openshift.rb +1 -0
  8. data/lib/vagrant-openshift/action.rb +83 -12
  9. data/lib/vagrant-openshift/action/build_origin_images.rb +2 -2
  10. data/lib/vagrant-openshift/action/create_yum_repositories.rb +1 -1
  11. data/lib/vagrant-openshift/action/download_artifacts_origin_console.rb +2 -2
  12. data/lib/vagrant-openshift/action/download_artifacts_origin_metrics.rb +67 -0
  13. data/lib/vagrant-openshift/action/install_docker.rb +54 -0
  14. data/lib/vagrant-openshift/action/install_golang.rb +52 -0
  15. data/lib/vagrant-openshift/action/install_origin_asset_dependencies.rb +6 -3
  16. data/lib/vagrant-openshift/action/install_origin_base_dependencies.rb +22 -237
  17. data/lib/vagrant-openshift/action/install_origin_rhel7.rb +29 -6
  18. data/lib/vagrant-openshift/action/push_openshift_images.rb +26 -37
  19. data/lib/vagrant-openshift/action/run_customer_diagnostics_tests.rb +79 -0
  20. data/lib/vagrant-openshift/action/run_origin_asset_tests.rb +1 -3
  21. data/lib/vagrant-openshift/action/run_origin_metrics_tests.rb +83 -0
  22. data/lib/vagrant-openshift/action/run_origin_tests.rb +9 -4
  23. data/lib/vagrant-openshift/command/checkout_repositories.rb +1 -3
  24. data/lib/vagrant-openshift/command/create_local_yum_repo.rb +2 -2
  25. data/lib/vagrant-openshift/command/download_artifacts_origin_metrics.rb +49 -0
  26. data/lib/vagrant-openshift/command/install_docker.rb +68 -0
  27. data/lib/vagrant-openshift/command/install_golang.rb +68 -0
  28. data/lib/vagrant-openshift/command/repo_sync_customer_diagnostics.rb +71 -0
  29. data/lib/vagrant-openshift/command/repo_sync_origin_metrics.rb +71 -0
  30. data/lib/vagrant-openshift/command/test_customer_diagnostics.rb +69 -0
  31. data/lib/vagrant-openshift/command/test_origin_image.rb +1 -1
  32. data/lib/vagrant-openshift/command/test_origin_metrics.rb +67 -0
  33. data/lib/vagrant-openshift/constants.rb +8 -2
  34. data/lib/vagrant-openshift/helper/command_helper.rb +63 -39
  35. data/lib/vagrant-openshift/helper/install_helper.rb +139 -0
  36. data/lib/vagrant-openshift/plugin.rb +37 -2
  37. data/lib/vagrant-openshift/resources/configure_docker.sh +53 -0
  38. data/lib/vagrant-openshift/resources/configure_system.sh +23 -0
  39. data/lib/vagrant-openshift/resources/install_chrome.sh +22 -0
  40. data/lib/vagrant-openshift/resources/install_dependencies.sh +58 -0
  41. data/lib/vagrant-openshift/resources/install_nonessential.sh +6 -0
  42. data/lib/vagrant-openshift/resources/install_rhaos_repos.sh +11 -0
  43. data/lib/vagrant-openshift/resources/reconfigure_network_fedora.sh +13 -0
  44. data/lib/vagrant-openshift/resources/rhaos31.repo +13 -0
  45. data/lib/vagrant-openshift/resources/rhaos32.repo +13 -0
  46. data/lib/vagrant-openshift/resources/rhaos33.repo +13 -0
  47. data/lib/vagrant-openshift/resources/rhaos34.repo +13 -0
  48. data/lib/vagrant-openshift/version.rb +1 -1
  49. metadata +29 -3
@@ -41,7 +41,7 @@ sudo cp /etc/yum.repos.d/origin_local.repo .
41
41
  docker build -t openshift/origin-base -f Dockerfile.rpm .
42
42
  popd
43
43
  })
44
-
44
+
45
45
  images = @options[:images].split(",")
46
46
  images.each do |image|
47
47
  sudo(env[:machine], %{
@@ -51,7 +51,7 @@ popd
51
51
  })
52
52
  end
53
53
 
54
-
54
+
55
55
  @app.call(env)
56
56
  end
57
57
  end
@@ -55,7 +55,7 @@ module Vagrant
55
55
 
56
56
  unless is_fedora
57
57
  unless env[:machine].communicate.test("rpm -q epel-release")
58
- sudo(env[:machine], "yum install -y http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-6.noarch.rpm")
58
+ sudo(env[:machine], "yum install -y http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm")
59
59
 
60
60
  #Workaround broken RHEL image which does not recover after restart.
61
61
  if "VagrantPlugins::AWS::Provider" == env[:machine].provider.class.to_s
@@ -35,10 +35,10 @@ module Vagrant
35
35
  artifacts_dir = Pathname.new(File.expand_path(machine.env.root_path + "artifacts"))
36
36
 
37
37
  _,_,exit_code = do_execute machine, "mkdir -p /tmp/openshift && journalctl -u openshift --no-pager > /tmp/openshift/openshift.log", :fail_on_error => false
38
- if exit_code != 0
38
+ if exit_code != 0
39
39
  machine.ui.warn "Unable to dump openshift log from journalctl"
40
40
  end
41
-
41
+
42
42
  download_map = {
43
43
  "/var/log/yum.log" => artifacts_dir + "yum.log",
44
44
  "/var/log/secure" => artifacts_dir + "secure",
@@ -0,0 +1,67 @@
1
+ #--
2
+ # Copyright 2016 Red Hat, Inc.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #++
16
+ require 'pathname'
17
+
18
+ module Vagrant
19
+ module Openshift
20
+ module Action
21
+ class DownloadArtifactsOriginMetrics
22
+ include CommandHelper
23
+
24
+ def initialize(app, env)
25
+ @app = app
26
+ @env = env
27
+ end
28
+
29
+ def call(env)
30
+ machine = @env[:machine]
31
+ machine.ui.info "Downloading logs"
32
+ ssh_info = machine.ssh_info
33
+ private_key_path = ssh_info[:private_key_path].kind_of?(Array) ? ssh_info[:private_key_path][0] : ssh_info[:private_key_path]
34
+
35
+ artifacts_dir = Pathname.new(File.expand_path(machine.env.root_path + "artifacts"))
36
+ download_map = {
37
+ "/var/log/yum.log" => artifacts_dir + "yum.log",
38
+ "/var/log/secure" => artifacts_dir + "secure",
39
+ "/var/log/audit/audit.log" => artifacts_dir + "audit.log",
40
+ "/tmp/origin-metrics/" => artifacts_dir,
41
+ }
42
+
43
+ download_map.each do |source,target|
44
+ if ! machine.communicate.test("sudo ls #{source}")
45
+ machine.ui.info "#{source} did not exist on the remote system. This is often the case for tests that were not run."
46
+ next
47
+ end
48
+
49
+ machine.ui.info "Downloading artifacts from '#{source}' to '#{target}'"
50
+ if target.to_s.end_with? '/'
51
+ FileUtils.mkdir_p target.to_s
52
+ else
53
+ FileUtils.mkdir_p File.dirname(target.to_s)
54
+ end
55
+
56
+ command = "/usr/bin/rsync -az -e 'ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i #{private_key_path}' --rsync-path='sudo rsync' --exclude='volumes/*' --exclude='volumes/' #{ssh_info[:username]}@#{ssh_info[:host]}:#{source} #{target}"
57
+
58
+ if not system(command)
59
+ machine.ui.warn "Unable to download artifacts"
60
+ end
61
+ end
62
+ @app.call(env)
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,54 @@
1
+ #--
2
+ # Copyright 2016 Red Hat, Inc.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #++
16
+
17
+ module Vagrant
18
+ module Openshift
19
+ module Action
20
+ class InstallDocker
21
+ include CommandHelper
22
+ include InstallHelper
23
+
24
+ def initialize(app, env, options)
25
+ @app = app
26
+ @env = env
27
+ @options = options.clone
28
+ end
29
+
30
+ def call(env)
31
+ # Migrate our install script to the host machine
32
+ ssh_user = @env[:machine].ssh_info[:username]
33
+ destination="/home/#{ssh_user}/"
34
+ @env[:machine].communicate.upload(File.join(__dir__,"/../resources/configure_docker.sh"), destination)
35
+ home="#{destination}/resources"
36
+
37
+ isolated_install(
38
+ @env[:machine],
39
+ 'docker',
40
+ @options[:"docker.version"],
41
+ @options[:"docker.repourls"],
42
+ @options[:"docker.reponames"],
43
+ @options[:force]
44
+ )
45
+
46
+ # Configure the Docker daemon
47
+ sudo(@env[:machine], "SSH_USER='#{ssh_user}' #{home}/configure_docker.sh", :timeout=>60*30)
48
+
49
+ @app.call(@env)
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,52 @@
1
+ #--
2
+ # Copyright 2016 Red Hat, Inc.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #++
16
+
17
+ module Vagrant
18
+ module Openshift
19
+ module Action
20
+ class InstallGolang
21
+ include CommandHelper
22
+ include InstallHelper
23
+
24
+ def initialize(app, env, options)
25
+ @app = app
26
+ @env = env
27
+ @options = options.clone
28
+ end
29
+
30
+ def call(env)
31
+ isolated_install(
32
+ @env[:machine],
33
+ 'golang',
34
+ @options[:"golang.version"],
35
+ @options[:"golang.repourls"],
36
+ @options[:"golang.reponames"],
37
+ @options[:force]
38
+ )
39
+
40
+ if @options[:"golang.version"] =~ %r"^1\.4.*" && ! env[:machine].communicate.test("test -e /etc/fedora-release")
41
+ # Prior to go1.5, the cgo symbol tables were not provided in the base golang
42
+ # package on RHEL and CentOS, so if we've installed go1.4.x and we're not on
43
+ # Fedora, we need to also install `golang-pkg-linux-amd64'
44
+ sudo(@env[:machine], "yum install -y #{format_versioned_package("golang-pkg-linux-amd64", @options[:"golang.version"])}", :timeout=>60*5)
45
+ end
46
+
47
+ @app.call(@env)
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -35,8 +35,11 @@ ASSET_BACKUP_DIR=/data/asset_dependencies
35
35
 
36
36
  if ! which npm > /dev/null 2>&1 ; then
37
37
  sudo yum -y install npm
38
- # Update npm, we need a newer version than is installed by yum
39
- sudo npm install npm@3.7.3 -g
38
+ if $(test -e /etc/fedora-release)
39
+ then
40
+ # Update npm, we need a newer version than is installed by yum
41
+ sudo npm install npm@3.7.3 -g
42
+ fi
40
43
  fi
41
44
 
42
45
  }
@@ -63,7 +66,7 @@ popd
63
66
  cmd += %{
64
67
  # Make sure tests pass before backing up this asset install
65
68
  pushd $ORIGIN_CONSOLE_PATH
66
- grunt test
69
+ hack/test-headless.sh test
67
70
  popd
68
71
  mkdir -p $ASSET_BACKUP_DIR
69
72
  cp -rf $ORIGIN_CONSOLE_PATH/node_modules $ASSET_BACKUP_DIR/node_modules
@@ -26,253 +26,38 @@ module Vagrant
26
26
  end
27
27
 
28
28
  def call(env)
29
- # Workaround to vagrant inability to guess interface naming sequence
30
- # Tell system to abandon the new naming scheme and use eth* instead
31
- is_fedora = env[:machine].communicate.test("test -e /etc/fedora-release")
32
- if is_fedora
33
- sudo(env[:machine], %{
34
- if ! [[ -L /etc/udev/rules.d/80-net-setup-link.rules ]]; then
35
- ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules
36
- rm -f /etc/sysconfig/network-scripts/ifcfg-enp0s3
37
- fi
38
- }, :verbose => false)
39
- end
40
-
41
-
42
- sudo(env[:machine], %{
43
- if [[ -e /etc/redhat-release && ! -e /etc/fedora-release && ! -e /etc/centos-release ]]; then
44
-
45
- cat <<EOF > /etc/yum.repos.d/dockerextra.repo
46
- [dockerextra]
47
- name=RHEL Docker Extra
48
- baseurl=https://mirror.openshift.com/enterprise/rhel/dockerextra/x86_64/os/
49
- enabled=1
50
- gpgcheck=0
51
- failovermethod=priority
52
- sslverify=False
53
- sslclientcert=/var/lib/yum/client-cert.pem
54
- sslclientkey=/var/lib/yum/client-key.pem
55
-
56
- EOF
29
+ # Migrate all of our scripts to the host machine
30
+ ssh_user = @env[:machine].ssh_info[:username]
31
+ destination="/home/#{ssh_user}/"
32
+ @env[:machine].communicate.upload(File.join(__dir__,"/../resources"), destination)
33
+ home="#{destination}/resources"
57
34
 
58
- fi
59
- }, :timeout=>60*10, :verbose => false)
35
+ # Workaround to vagrant inability to guess interface naming sequence:
36
+ # Tell system to abandon the new naming scheme and use eth* instead if
37
+ # we're communicating with a Fedora machine
38
+ sudo(@env[:machine], "#{home}/reconfigure_network_fedora.sh")
60
39
 
61
- ssh_user = env[:machine].ssh_info[:username]
62
- sudo(env[:machine], "yum install -y \
63
- augeas \
64
- bzr \
65
- bridge-utils \
66
- bzip2 \
67
- bind \
68
- btrfs-progs-devel \
69
- bind-utils \
70
- ctags \
71
- device-mapper-devel \
72
- docker-io \
73
- ethtool \
74
- e2fsprogs \
75
- fontconfig \
76
- git \
77
- gcc \
78
- gcc-c++ \
79
- glibc-static \
80
- gnuplot \
81
- httpie \
82
- hg \
83
- iscsi-initiator-utils \
84
- jq \
85
- java-1.?.0-openjdk \
86
- kernel-devel \
87
- libselinux-devel \
88
- libnetfilter_queue-devel \
89
- make \
90
- mlocate \
91
- ntp \
92
- openldap-clients \
93
- openvswitch \
94
- rubygems \
95
- screen \
96
- ShellCheck \
97
- socat \
98
- sqlite-devel \
99
- sysstat \
100
- tig \
101
- tmux \
102
- unzip \
103
- vim \
104
- wget \
105
- xfsprogs \
106
- Xvfb \
107
- yum-utils",:timeout=>60*30, :verbose => false)
40
+ # Install base dependencies that we cannot continue without
41
+ sudo(@env[:machine], "#{home}/install_dependencies.sh", :timeout=>60*30)
108
42
 
109
- sudo(env[:machine], "yum install -y facter", fail_on_error: false, :timeout=>60*20, :verbose => false)
43
+ # Install dependencies that are nice to have but we can live without
44
+ sudo(@env[:machine], "#{home}/install_nonessential.sh", :timeout=>60*20, fail_on_error: false)
110
45
 
111
46
  # Install Chrome and chromedriver for headless UI testing
112
- sudo(env[:machine], %{
113
- set -ex
114
- cd /tmp
115
-
116
- # Add signing key for Chrome repo
117
- wget https://dl.google.com/linux/linux_signing_key.pub
118
- rpm --import linux_signing_key.pub
119
-
120
- # Add Chrome yum repo
121
- yum-config-manager --add-repo=http://dl.google.com/linux/chrome/rpm/stable/x86_64
122
-
123
- # Install chrome
124
- yum install -y google-chrome-stable
125
-
126
- # Install chromedriver
127
- wget https://chromedriver.storage.googleapis.com/2.16/chromedriver_linux64.zip
128
- unzip chromedriver_linux64.zip
129
- mv chromedriver /usr/bin/chromedriver
130
- chown root /usr/bin/chromedriver
131
- chmod 755 /usr/bin/chromedriver
132
- }, :timeout=>60*60, :verbose => false)
47
+ sudo(@env[:machine], "#{home}/install_chrome.sh", :timeout=>60*60)
133
48
 
134
- sudo(env[:machine], "wget -O /etc/yum.repos.d/openshift-rhel7-dependencies.repo https://mirror.openshift.com/pub/openshift-origin/nightly/rhel-7/dependencies/openshift-rhel7-dependencies.repo", fail_on_error: true, :timeout=>60*20, :verbose => true)
135
-
136
- #
137
- # FIXME: Need to install golang packages 'after' the 'gcc' is
138
- # installed. See BZ#1101508
139
- #
140
- sudo(env[:machine], "yum install -y golang golang-src", :timeout=>60*20, :verbose => false)
141
- #
142
-
143
- unless is_fedora
144
- sudo(env[:machine], "yum install -y golang-pkg-linux-amd64", :timeout=>60*20, :verbose => false)
49
+ # If we're on RHEL, install the OSE RPM repositories
50
+ is_rhel = @env[:machine].communicate.test("test -e /etc/redhat-release && ! test -e /etc/fedora-release && ! test -e /etc/centos-release")
51
+ if is_rhel
52
+ sudo(@env[:machine], "#{home}/install_rhaos_repos.sh")
145
53
  end
146
54
 
147
- sudo(env[:machine], %{
148
- set -ex
149
-
150
- if [[ -e /etc/redhat-release && ! -e /etc/fedora-release && ! -e /etc/centos-release ]]; then
151
-
152
- # create rhaos3.1 and 3.2 repos
153
- cat <<EOF > /etc/yum.repos.d/rhaos31.repo
154
- [rhel-7-server-ose-3.1-rpms]
155
- name=RHEL7 Red Hat Atomic OpenShift 3.1
156
- baseurl=https://mirror.ops.rhcloud.com/enterprise/enterprise-3.1/RH7-RHAOS-3.1/x86_64/os/
157
- https://use-mirror1.ops.rhcloud.com/enterprise/enterprise-3.1/RH7-RHAOS-3.1/x86_64/os/
158
- https://use-mirror2.ops.rhcloud.com/enterprise/enterprise-3.1/RH7-RHAOS-3.1/x86_64/os/
159
- https://euw-mirror1.ops.rhcloud.com/enterprise/enterprise-3.1/RH7-RHAOS-3.1/x86_64/os/
160
- enabled=1
161
- gpgcheck=0
162
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,https://mirror.ops.rhcloud.com/libra/keys/RPM-GPG-KEY-redhat-openshifthosted
163
- failovermethod=priority
164
- sslverify=0
165
- sslclientcert=/var/lib/yum/client-cert.pem
166
- sslclientkey=/var/lib/yum/client-key.pem
167
-
168
- EOF
169
-
170
- cat <<EOF > /etc/yum.repos.d/rhaos32.repo
171
- [rhel-7-server-ose-3.2-rpms]
172
- name=RHEL7 Red Hat Atomic OpenShift 3.2
173
- baseurl=https://mirror.ops.rhcloud.com/enterprise/enterprise-3.2/latest/RH7-RHAOS-3.2/x86_64/os/
174
- https://use-mirror1.ops.rhcloud.com/enterprise/enterprise-3.2/latest/RH7-RHAOS-3.2/x86_64/os/
175
- https://use-mirror2.ops.rhcloud.com/enterprise/enterprise-3.2/latest/RH7-RHAOS-3.2/x86_64/os/
176
- https://euw-mirror1.ops.rhcloud.com/enterprise/enterprise-3.2/latest/RH7-RHAOS-3.2/x86_64/os/
177
- enabled=1
178
- gpgcheck=0
179
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,https://mirror.ops.rhcloud.com/libra/keys/RPM-GPG-KEY-redhat-openshifthosted
180
- failovermethod=priority
181
- sslverify=0
182
- sslclientcert=/var/lib/yum/client-cert.pem
183
- sslclientkey=/var/lib/yum/client-key.pem
184
-
185
- EOF
186
-
187
- fi
188
-
189
- if ! test -e /etc/fedora-release; then
190
- sed -i 's,^SELINUX=.*,SELINUX=permissive,' /etc/selinux/config
191
- setenforce 0
192
- fi
193
-
194
- systemctl enable ntpd
195
-
196
- groupadd -f docker
197
- usermod -a -G docker #{ssh_user}
198
-
199
- ADDITIONAL_OPTIONS='--insecure-registry=172.30.0.0/16 --insecure-registry=ci.dev.openshift.redhat.com:5000'
200
- sed -i "s,^OPTIONS='\\(.*\\)',OPTIONS='${ADDITIONAL_OPTIONS} \\1'," /etc/sysconfig/docker
201
- sed -i "s,^OPTIONS=-\\(.*\\),OPTIONS='${ADDITIONAL_OPTIONS} -\\1'," /etc/sysconfig/docker
202
- sed -i "s,^ADD_REGISTRY='\\(.*\\)',#ADD_REGISTRY='--add-registry=docker.io \\1'," /etc/sysconfig/docker
203
-
204
- cat /etc/sysconfig/docker
205
-
206
-
207
- if sudo lvdisplay docker-vg 2>&1>/dev/null
208
- then
209
- VG="docker-vg"
210
- elif sudo lvdisplay vg_vagrant 2>&1>/dev/null
211
- then
212
- VG="vg_vagrant"
213
- elif sudo lvdisplay centos 2>&1>/dev/null
214
- then
215
- VG="centos"
216
- fi
217
- if [ -n "${VG}" ]
218
- then
219
- sudo lvcreate -n docker-data -l 90%FREE /dev/${VG}
220
- sudo lvcreate -n docker-metadata -l 50%FREE /dev/${VG}
221
- sudo sed -i "s,^DOCKER_STORAGE_OPTIONS=.*,DOCKER_STORAGE_OPTIONS='-s devicemapper --storage-opt dm.datadev=/dev/${VG}/docker-data --storage-opt dm.metadatadev=/dev/${VG}/docker-metadata'," /etc/sysconfig/docker-storage
222
-
223
- sudo lvcreate -n openshift-xfs-vol-dir -l 100%FREE /dev/${VG}
224
- sudo mkfs.xfs /dev/${VG}/openshift-xfs-vol-dir
225
- sudo mkdir -p /mnt/openshift-xfs-vol-dir
226
- sudo sh -c "echo /dev/${VG}/openshift-xfs-vol-dir /mnt/openshift-xfs-vol-dir xfs gquota 1 1 >> /etc/fstab"
227
- sudo mount /mnt/openshift-xfs-vol-dir
228
- sudo chown -R #{ssh_user}:#{ssh_user} /mnt/openshift-xfs-vol-dir
229
- fi
230
-
231
- # Force socket reuse
232
- echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse
233
-
234
- mkdir -p /data/src
235
- mkdir -p /data/pkg
236
- mkdir -p /data/bin
237
-
238
- GO_VERSION=($(go version))
239
- echo "Detected go version: $(go version)"
240
-
241
- # TODO: Remove for go1.5, go vet and go cover will be internal
242
- if [[ ${GO_VERSION[2]} == "go1.4"* ]]; then
243
- GOPATH=/data go get golang.org/x/tools/cmd/cover
244
-
245
- # https://groups.google.com/forum/#!topic/golang-nuts/nZLhcbaa3wQ
246
- set +e
247
- GOPATH=/data go get golang.org/x/tools/cmd/vet
248
- set -e
249
-
250
- # Check out a stable commit for go vet in order to version lock it to something we can work with
251
- pushd /data/src/golang.org/x/tools >/dev/null
252
- if git checkout 108746816ddf01ad0c2dbea08a1baef08bc47313
253
- then
254
- # Re-install using this version of the tool
255
- GOPATH=/data go install golang.org/x/tools/cmd/vet
256
- fi
257
- popd >/dev/null
258
- fi
259
-
260
- chown -R #{ssh_user}:#{ssh_user} /data
261
-
262
- sed -i "s,^#DefaultTimeoutStartSec=.*,DefaultTimeoutStartSec=240s," /etc/systemd/system.conf
263
-
264
- # Docker 1.8.2 now sets a TimeoutStartSec of 1 minute. Unfortunately, for some
265
- # reason the initial docker start up is now taking > 5 minutes. Until that is fixed need this.
266
- sed -i 's,TimeoutStartSec=.*,TimeoutStartSec=10min,' /usr/lib/systemd/system/docker.service
55
+ # Configure the machine system
56
+ sudo(@env[:machine], "SSH_USER='#{ssh_user}' #{home}/configure_system.sh", :timeout=>60*30)
267
57
 
268
- systemctl daemon-reexec
269
- systemctl daemon-reload
270
- systemctl enable docker
271
- time systemctl start docker
272
- }, :timeout=>60*30, :verbose => false)
273
- @app.call(env)
58
+ @app.call(@env)
274
59
  end
275
60
  end
276
61
  end
277
62
  end
278
- end
63
+ end