Skip to content

Commit

Permalink
Use RAMDISK for etcd storage in Ansible install jobs
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
  • Loading branch information
stevekuznetsov committed Apr 26, 2017
1 parent 0533f26 commit e6b036b
Show file tree
Hide file tree
Showing 34 changed files with 282 additions and 99 deletions.
13 changes: 9 additions & 4 deletions sjb/config/common/test_cases/origin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ actions:
- type: "script"
title: "use a ramdisk for etcd"
script: |-
sudo mkdir -p /tmp
sudo mount -t tmpfs -o size=2048m tmpfs /tmp
sudo restorecon -R /tmp
sudo su root <<SUDO
mkdir -p /tmp
mount -t tmpfs -o size=2048m tmpfs /tmp
mkdir -p /tmp/etcd
chmod a+rwx /tmp/etcd
restorecon -R /tmp
echo "ETCD_DATA_DIR=/tmp/etcd" >> /etc/environment
SUDO
post_actions: []
artifacts:
- "/tmp/openshift"
Expand All @@ -23,4 +28,4 @@ generated_artifacts:
docker.info: 'sudo docker version && sudo docker info && sudo docker images && sudo docker ps -a'
pid1.journal: 'sudo journalctl _PID=1 --no-pager --all --lines=all'
system_journals:
- docker.service
- docker.service
11 changes: 8 additions & 3 deletions sjb/config/test_cases/ami_build_origin_int_rhel_base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,14 @@ actions:
- type: "script"
title: "use a ramdisk for etcd"
script: |-
sudo mkdir -p /tmp
sudo mount -t tmpfs -o size=2048m tmpfs /tmp
sudo restorecon -R /tmp
sudo su root <<SUDO
mkdir -p /tmp
mount -t tmpfs -o size=2048m tmpfs /tmp
mkdir -p /tmp/etcd
chmod a+rwx /tmp/etcd
restorecon -R /tmp
echo "ETCD_DATA_DIR=/tmp/etcd" >> /etc/environment
SUDO
- type: "script"
title: "build an origin release"
repository: "origin"
Expand Down
11 changes: 8 additions & 3 deletions sjb/config/test_cases/ami_build_origin_int_rhel_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,14 @@ actions:
- type: "script"
title: "use a ramdisk for etcd"
script: |-
sudo mkdir -p /tmp
sudo mount -t tmpfs -o size=2048m tmpfs /tmp
sudo restorecon -R /tmp
sudo su root <<SUDO
mkdir -p /tmp
mount -t tmpfs -o size=2048m tmpfs /tmp
mkdir -p /tmp/etcd
chmod a+rwx /tmp/etcd
restorecon -R /tmp
echo "ETCD_DATA_DIR=/tmp/etcd" >> /etc/environment
SUDO
- type: "host_script"
title: "release the AMI"
script: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ extensions:
--connection local \
--inventory sjb/inventory/ \
-e deployment_type=origin \
-e etcd_data_dir="${ETCD_DATA_DIR}" \
-e openshift_pkg_version="$( cat ./ORIGIN_PKG_VERSION )" \
-e oreg_url='openshift/origin-${component}:'"$( cat ./ORIGIN_COMMIT )" \
/usr/share/ansible/openshift-ansible/playbooks/byo/config.yml
Expand All @@ -90,4 +91,6 @@ extensions:
- openvswitch.service
- ovs-vswitchd.service
- ovsdb-server.service
- etcd.service
- etcd.service
generated_artifacts:
etcd.conf: 'sudo cat /etc/etcd/etcd.conf'
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ extensions:
--inventory sjb/inventory/ \
/usr/share/ansible/openshift-ansible/playbooks/byo/config.yml \
-e openshift_pkg_version="-${ORIGIN_INSTALL_VERSION}" \
-e etcd_data_dir="${ETCD_DATA_DIR}" \
-e deployment_type=$( cat ./DEPLOYMENT_TYPE)
if [[ -v ORIGIN_UPGRADE_VERSION && -v ATOMIC_OPENSHIFT_UTILS_UPGRADE_VERSION ]]
then
Expand All @@ -117,6 +118,7 @@ extensions:
--connection local \
--inventory sjb/inventory/ \
"${upgrade_playbook}" \
-e etcd_data_dir="${ETCD_DATA_DIR}" \
-e openshift_pkg_version="-${ORIGIN_UPGRADE_VERSION}" \
-e deployment_type=$( cat ./DEPLOYMENT_TYPE) \
-e oreg_url='openshift/origin-${component}:'"${ORIGIN_UPGRADE_VERSION_PKG_VERSION}"
Expand Down Expand Up @@ -157,6 +159,7 @@ extensions:
--connection local \
--inventory sjb/inventory/ \
"${upgrade_playbook}" \
-e etcd_data_dir="${ETCD_DATA_DIR}" \
-e openshift_pkg_version="-${ORIGIN_UPGRADE_RELEASE_VERSION}" \
-e deployment_type=$( cat ./DEPLOYMENT_TYPE) \
-e oreg_url='openshift/origin-${component}:'"$( cat ./ORIGIN_COMMIT )"
Expand All @@ -179,4 +182,4 @@ extensions:
- openvswitch.service
- ovs-vswitchd.service
- ovsdb-server.service
- etcd.service
- etcd.service
11 changes: 8 additions & 3 deletions sjb/generated/ami_build_origin_int_rhel_base.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,14 @@ cat &lt;&lt;SCRIPT &gt;&#34;${script}&#34;
#!/bin/bash
set -o errexit -o nounset -o pipefail -o xtrace
cd &#34;\${HOME}&#34;
sudo mkdir -p /tmp
sudo mount -t tmpfs -o size=2048m tmpfs /tmp
sudo restorecon -R /tmp
sudo su root &lt;&lt;SUDO
mkdir -p /tmp
mount -t tmpfs -o size=2048m tmpfs /tmp
mkdir -p /tmp/etcd
chmod a+rwx /tmp/etcd
restorecon -R /tmp
echo &#34;ETCD_DATA_DIR=/tmp/etcd&#34; &gt;&gt; /etc/environment
SUDO
SCRIPT
chmod +x &#34;${script}&#34;
scp -F ./.config/origin-ci-tool/inventory/.ssh_config &#34;${script}&#34; openshiftdevel:&#34;${script}&#34;
Expand Down
11 changes: 8 additions & 3 deletions sjb/generated/ami_build_origin_int_rhel_build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,14 @@ cat &lt;&lt;SCRIPT &gt;&#34;${script}&#34;
#!/bin/bash
set -o errexit -o nounset -o pipefail -o xtrace
cd &#34;\${HOME}&#34;
sudo mkdir -p /tmp
sudo mount -t tmpfs -o size=2048m tmpfs /tmp
sudo restorecon -R /tmp
sudo su root &lt;&lt;SUDO
mkdir -p /tmp
mount -t tmpfs -o size=2048m tmpfs /tmp
mkdir -p /tmp/etcd
chmod a+rwx /tmp/etcd
restorecon -R /tmp
echo &#34;ETCD_DATA_DIR=/tmp/etcd&#34; &gt;&gt; /etc/environment
SUDO
SCRIPT
chmod +x &#34;${script}&#34;
scp -F ./.config/origin-ci-tool/inventory/.ssh_config &#34;${script}&#34; openshiftdevel:&#34;${script}&#34;
Expand Down
11 changes: 8 additions & 3 deletions sjb/generated/push_origin_release.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,14 @@ cat &lt;&lt;SCRIPT &gt;&#34;${script}&#34;
#!/bin/bash
set -o errexit -o nounset -o pipefail -o xtrace
cd &#34;\${HOME}&#34;
sudo mkdir -p /tmp
sudo mount -t tmpfs -o size=2048m tmpfs /tmp
sudo restorecon -R /tmp
sudo su root &lt;&lt;SUDO
mkdir -p /tmp
mount -t tmpfs -o size=2048m tmpfs /tmp
mkdir -p /tmp/etcd
chmod a+rwx /tmp/etcd
restorecon -R /tmp
echo &#34;ETCD_DATA_DIR=/tmp/etcd&#34; &gt;&gt; /etc/environment
SUDO
SCRIPT
chmod +x &#34;${script}&#34;
scp -F ./.config/origin-ci-tool/inventory/.ssh_config &#34;${script}&#34; openshiftdevel:&#34;${script}&#34;
Expand Down
11 changes: 8 additions & 3 deletions sjb/generated/test_branch_origin_check.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,14 @@ cat &lt;&lt;SCRIPT &gt;&#34;${script}&#34;
#!/bin/bash
set -o errexit -o nounset -o pipefail -o xtrace
cd &#34;\${HOME}&#34;
sudo mkdir -p /tmp
sudo mount -t tmpfs -o size=2048m tmpfs /tmp
sudo restorecon -R /tmp
sudo su root &lt;&lt;SUDO
mkdir -p /tmp
mount -t tmpfs -o size=2048m tmpfs /tmp
mkdir -p /tmp/etcd
chmod a+rwx /tmp/etcd
restorecon -R /tmp
echo &#34;ETCD_DATA_DIR=/tmp/etcd&#34; &gt;&gt; /etc/environment
SUDO
SCRIPT
chmod +x &#34;${script}&#34;
scp -F ./.config/origin-ci-tool/inventory/.ssh_config &#34;${script}&#34; openshiftdevel:&#34;${script}&#34;
Expand Down
11 changes: 8 additions & 3 deletions sjb/generated/test_branch_origin_extended.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,14 @@ cat &lt;&lt;SCRIPT &gt;&#34;${script}&#34;
#!/bin/bash
set -o errexit -o nounset -o pipefail -o xtrace
cd &#34;\${HOME}&#34;
sudo mkdir -p /tmp
sudo mount -t tmpfs -o size=2048m tmpfs /tmp
sudo restorecon -R /tmp
sudo su root &lt;&lt;SUDO
mkdir -p /tmp
mount -t tmpfs -o size=2048m tmpfs /tmp
mkdir -p /tmp/etcd
chmod a+rwx /tmp/etcd
restorecon -R /tmp
echo &#34;ETCD_DATA_DIR=/tmp/etcd&#34; &gt;&gt; /etc/environment
SUDO
SCRIPT
chmod +x &#34;${script}&#34;
scp -F ./.config/origin-ci-tool/inventory/.ssh_config &#34;${script}&#34; openshiftdevel:&#34;${script}&#34;
Expand Down
11 changes: 8 additions & 3 deletions sjb/generated/test_branch_origin_extended_builds.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,14 @@ cat &lt;&lt;SCRIPT &gt;&#34;${script}&#34;
#!/bin/bash
set -o errexit -o nounset -o pipefail -o xtrace
cd &#34;\${HOME}&#34;
sudo mkdir -p /tmp
sudo mount -t tmpfs -o size=2048m tmpfs /tmp
sudo restorecon -R /tmp
sudo su root &lt;&lt;SUDO
mkdir -p /tmp
mount -t tmpfs -o size=2048m tmpfs /tmp
mkdir -p /tmp/etcd
chmod a+rwx /tmp/etcd
restorecon -R /tmp
echo &#34;ETCD_DATA_DIR=/tmp/etcd&#34; &gt;&gt; /etc/environment
SUDO
SCRIPT
chmod +x &#34;${script}&#34;
scp -F ./.config/origin-ci-tool/inventory/.ssh_config &#34;${script}&#34; openshiftdevel:&#34;${script}&#34;
Expand Down
11 changes: 8 additions & 3 deletions sjb/generated/test_branch_origin_extended_conformance.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,14 @@ cat &lt;&lt;SCRIPT &gt;&#34;${script}&#34;
#!/bin/bash
set -o errexit -o nounset -o pipefail -o xtrace
cd &#34;\${HOME}&#34;
sudo mkdir -p /tmp
sudo mount -t tmpfs -o size=2048m tmpfs /tmp
sudo restorecon -R /tmp
sudo su root &lt;&lt;SUDO
mkdir -p /tmp
mount -t tmpfs -o size=2048m tmpfs /tmp
mkdir -p /tmp/etcd
chmod a+rwx /tmp/etcd
restorecon -R /tmp
echo &#34;ETCD_DATA_DIR=/tmp/etcd&#34; &gt;&gt; /etc/environment
SUDO
SCRIPT
chmod +x &#34;${script}&#34;
scp -F ./.config/origin-ci-tool/inventory/.ssh_config &#34;${script}&#34; openshiftdevel:&#34;${script}&#34;
Expand Down
11 changes: 8 additions & 3 deletions sjb/generated/test_branch_origin_extended_conformance_gce.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,14 @@ cat &lt;&lt;SCRIPT &gt;&#34;${script}&#34;
#!/bin/bash
set -o errexit -o nounset -o pipefail -o xtrace
cd &#34;\${HOME}&#34;
sudo mkdir -p /tmp
sudo mount -t tmpfs -o size=2048m tmpfs /tmp
sudo restorecon -R /tmp
sudo su root &lt;&lt;SUDO
mkdir -p /tmp
mount -t tmpfs -o size=2048m tmpfs /tmp
mkdir -p /tmp/etcd
chmod a+rwx /tmp/etcd
restorecon -R /tmp
echo &#34;ETCD_DATA_DIR=/tmp/etcd&#34; &gt;&gt; /etc/environment
SUDO
SCRIPT
chmod +x &#34;${script}&#34;
scp -F ./.config/origin-ci-tool/inventory/.ssh_config &#34;${script}&#34; openshiftdevel:&#34;${script}&#34;
Expand Down
13 changes: 10 additions & 3 deletions sjb/generated/test_branch_origin_extended_conformance_install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,14 @@ cat &lt;&lt;SCRIPT &gt;&#34;${script}&#34;
#!/bin/bash
set -o errexit -o nounset -o pipefail -o xtrace
cd &#34;\${HOME}&#34;
sudo mkdir -p /tmp
sudo mount -t tmpfs -o size=2048m tmpfs /tmp
sudo restorecon -R /tmp
sudo su root &lt;&lt;SUDO
mkdir -p /tmp
mount -t tmpfs -o size=2048m tmpfs /tmp
mkdir -p /tmp/etcd
chmod a+rwx /tmp/etcd
restorecon -R /tmp
echo &#34;ETCD_DATA_DIR=/tmp/etcd&#34; &gt;&gt; /etc/environment
SUDO
SCRIPT
chmod +x &#34;${script}&#34;
scp -F ./.config/origin-ci-tool/inventory/.ssh_config &#34;${script}&#34; openshiftdevel:&#34;${script}&#34;
Expand Down Expand Up @@ -231,6 +236,7 @@ ansible-playbook -vv --become \
--connection local \
--inventory sjb/inventory/ \
-e deployment_type=origin \
-e etcd_data_dir=&#34;\${ETCD_DATA_DIR}&#34; \
-e openshift_pkg_version=&#34;\$( cat ./ORIGIN_PKG_VERSION )&#34; \
-e oreg_url=&#39;openshift/origin-\${component}:&#39;&#34;\$( cat ./ORIGIN_COMMIT )&#34; \
/usr/share/ansible/openshift-ansible/playbooks/byo/config.yml
Expand Down Expand Up @@ -295,6 +301,7 @@ ARTIFACT_DIR=&#34;$( pwd )/artifacts/generated&#34;
rm -rf &#34;${ARTIFACT_DIR}&#34;
mkdir &#34;${ARTIFACT_DIR}&#34;
ssh -F ./.config/origin-ci-tool/inventory/.ssh_config openshiftdevel &#34;sudo docker version &amp;&amp; sudo docker info &amp;&amp; sudo docker images &amp;&amp; sudo docker ps -a 2&gt;&amp;1&#34; &gt;&gt; &#34;${ARTIFACT_DIR}/docker.info&#34; || true
ssh -F ./.config/origin-ci-tool/inventory/.ssh_config openshiftdevel &#34;sudo cat /etc/etcd/etcd.conf 2&gt;&amp;1&#34; &gt;&gt; &#34;${ARTIFACT_DIR}/etcd.conf&#34; || true
ssh -F ./.config/origin-ci-tool/inventory/.ssh_config openshiftdevel &#34;sudo yum list installed 2&gt;&amp;1&#34; &gt;&gt; &#34;${ARTIFACT_DIR}/installed_packages.log&#34; || true
ssh -F ./.config/origin-ci-tool/inventory/.ssh_config openshiftdevel &#34;sudo ausearch -m avc 2&gt;&amp;1&#34; &gt;&gt; &#34;${ARTIFACT_DIR}/avc_denials.log&#34; || true
ssh -F ./.config/origin-ci-tool/inventory/.ssh_config openshiftdevel &#34;sudo journalctl _PID=1 --no-pager --all --lines=all 2&gt;&amp;1&#34; &gt;&gt; &#34;${ARTIFACT_DIR}/pid1.journal&#34; || true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,14 @@ cat &lt;&lt;SCRIPT &gt;&#34;${script}&#34;
#!/bin/bash
set -o errexit -o nounset -o pipefail -o xtrace
cd &#34;\${HOME}&#34;
sudo mkdir -p /tmp
sudo mount -t tmpfs -o size=2048m tmpfs /tmp
sudo restorecon -R /tmp
sudo su root &lt;&lt;SUDO
mkdir -p /tmp
mount -t tmpfs -o size=2048m tmpfs /tmp
mkdir -p /tmp/etcd
chmod a+rwx /tmp/etcd
restorecon -R /tmp
echo &#34;ETCD_DATA_DIR=/tmp/etcd&#34; &gt;&gt; /etc/environment
SUDO
SCRIPT
chmod +x &#34;${script}&#34;
scp -F ./.config/origin-ci-tool/inventory/.ssh_config &#34;${script}&#34; openshiftdevel:&#34;${script}&#34;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,14 @@ cat &lt;&lt;SCRIPT &gt;&#34;${script}&#34;
#!/bin/bash
set -o errexit -o nounset -o pipefail -o xtrace
cd &#34;\${HOME}&#34;
sudo mkdir -p /tmp
sudo mount -t tmpfs -o size=2048m tmpfs /tmp
sudo restorecon -R /tmp
sudo su root &lt;&lt;SUDO
mkdir -p /tmp
mount -t tmpfs -o size=2048m tmpfs /tmp
mkdir -p /tmp/etcd
chmod a+rwx /tmp/etcd
restorecon -R /tmp
echo &#34;ETCD_DATA_DIR=/tmp/etcd&#34; &gt;&gt; /etc/environment
SUDO
SCRIPT
chmod +x &#34;${script}&#34;
scp -F ./.config/origin-ci-tool/inventory/.ssh_config &#34;${script}&#34; openshiftdevel:&#34;${script}&#34;
Expand Down Expand Up @@ -248,6 +253,7 @@ ansible-playbook -vv \
--inventory sjb/inventory/ \
/usr/share/ansible/openshift-ansible/playbooks/byo/config.yml \
-e openshift_pkg_version=&#34;-\${ORIGIN_INSTALL_VERSION}&#34; \
-e etcd_data_dir=&#34;\${ETCD_DATA_DIR}&#34; \
-e deployment_type=\$( cat ./DEPLOYMENT_TYPE)
if [[ -v ORIGIN_UPGRADE_VERSION &amp;&amp; -v ATOMIC_OPENSHIFT_UTILS_UPGRADE_VERSION ]]
then
Expand All @@ -267,6 +273,7 @@ then
--connection local \
--inventory sjb/inventory/ \
&#34;\${upgrade_playbook}&#34; \
-e etcd_data_dir=&#34;\${ETCD_DATA_DIR}&#34; \
-e openshift_pkg_version=&#34;-\${ORIGIN_UPGRADE_VERSION}&#34; \
-e deployment_type=\$( cat ./DEPLOYMENT_TYPE) \
-e oreg_url=&#39;openshift/origin-\${component}:&#39;&#34;\${ORIGIN_UPGRADE_VERSION_PKG_VERSION}&#34;
Expand Down Expand Up @@ -334,6 +341,7 @@ ansible-playbook -vv \
--connection local \
--inventory sjb/inventory/ \
&#34;\${upgrade_playbook}&#34; \
-e etcd_data_dir=&#34;\${ETCD_DATA_DIR}&#34; \
-e openshift_pkg_version=&#34;-\${ORIGIN_UPGRADE_RELEASE_VERSION}&#34; \
-e deployment_type=\$( cat ./DEPLOYMENT_TYPE) \
-e oreg_url=&#39;openshift/origin-\${component}:&#39;&#34;\$( cat ./ORIGIN_COMMIT )&#34;
Expand Down
11 changes: 8 additions & 3 deletions sjb/generated/test_branch_origin_extended_gssapi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,14 @@ cat &lt;&lt;SCRIPT &gt;&#34;${script}&#34;
#!/bin/bash
set -o errexit -o nounset -o pipefail -o xtrace
cd &#34;\${HOME}&#34;
sudo mkdir -p /tmp
sudo mount -t tmpfs -o size=2048m tmpfs /tmp
sudo restorecon -R /tmp
sudo su root &lt;&lt;SUDO
mkdir -p /tmp
mount -t tmpfs -o size=2048m tmpfs /tmp
mkdir -p /tmp/etcd
chmod a+rwx /tmp/etcd
restorecon -R /tmp
echo &#34;ETCD_DATA_DIR=/tmp/etcd&#34; &gt;&gt; /etc/environment
SUDO
SCRIPT
chmod +x &#34;${script}&#34;
scp -F ./.config/origin-ci-tool/inventory/.ssh_config &#34;${script}&#34; openshiftdevel:&#34;${script}&#34;
Expand Down
11 changes: 8 additions & 3 deletions sjb/generated/test_branch_origin_extended_image_ecosystem.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,14 @@ cat &lt;&lt;SCRIPT &gt;&#34;${script}&#34;
#!/bin/bash
set -o errexit -o nounset -o pipefail -o xtrace
cd &#34;\${HOME}&#34;
sudo mkdir -p /tmp
sudo mount -t tmpfs -o size=2048m tmpfs /tmp
sudo restorecon -R /tmp
sudo su root &lt;&lt;SUDO
mkdir -p /tmp
mount -t tmpfs -o size=2048m tmpfs /tmp
mkdir -p /tmp/etcd
chmod a+rwx /tmp/etcd
restorecon -R /tmp
echo &#34;ETCD_DATA_DIR=/tmp/etcd&#34; &gt;&gt; /etc/environment
SUDO
SCRIPT
chmod +x &#34;${script}&#34;
scp -F ./.config/origin-ci-tool/inventory/.ssh_config &#34;${script}&#34; openshiftdevel:&#34;${script}&#34;
Expand Down
Loading

0 comments on commit e6b036b

Please sign in to comment.