提交 c5fb8a72 编写于 作者: K Kris Macoskey 提交者: Toolsmiths Team

CI: Remove no longer necessary package installs

Installation of packages on every execution of a test suffers from any
upstream flakiness. Therefore installation of generic packages is being
moved to the underlying OS, in this case the AMI being used for the CCP
job.

In place of outright removing the package installation, it is a much
better pattern to instead replace installation with a validation of the
assumptions made for packages installed on the underlying OS the test
will run within.

The call `yum --cacheonly list installed [List of Packages]` does a number of things:

  1. For the given list of packages, if installed the command will
     return 0, and if any are not installed will return 1

  2. The `--cacheonly` prevents the call from issuing an upstream
     repository metadata refresh. This is not a requirement, but is an easy
     optimization that avoids upstream flakiness even further.

Note: `--cacheonly` assumes that the repostiroy metadata cache has
been refresh atleast once. If not, the flag will cause the command to
fail. We are assuming that it has been performed at least once in the
underlying OS in order to install the packages in the first place.
Signed-off-by: NAlexandra Wang <lewang@pivotal.io>
Signed-off-by: NDivya Bhargov <dbhargov@pivotal.io>
上级 2e301044
......@@ -2100,7 +2100,7 @@ jobs:
params:
TINC_TARGET: mpp_interconnect
PRE_TEST_SCRIPT_USER: centos
PRE_TEST_SCRIPT: sudo bash -c 'yum -y install "kernel-devel-uname-r == $(uname -r)"'
PRE_TEST_SCRIPT: sudo bash -c 'yum --cacheonly list installed kernel-devel-$(uname -r)'
ensure:
<<: *ccp_destroy
......
......@@ -6,7 +6,7 @@ set -eox pipefail
CLUSTER_NAME=$(cat ./cluster_env_files/terraform/name)
prepare_env() {
validate_env() {
local gpdb_host_alias=$1
local pkgs='bzip2-devel'
......@@ -14,7 +14,7 @@ prepare_env() {
pkgs+=' perl-Env perl-Data-Dumper'
fi
ssh -t $gpdb_host_alias sudo yum install -d1 -y $pkgs
ssh -t $gpdb_host_alias sudo yum --cacheonly list installed $pkgs
}
mount_cgroups() {
......@@ -89,8 +89,8 @@ EOF1
EOF
}
prepare_env ccp-${CLUSTER_NAME}-0
prepare_env ccp-${CLUSTER_NAME}-1
validate_env ccp-${CLUSTER_NAME}-0
validate_env ccp-${CLUSTER_NAME}-1
mount_cgroups ccp-${CLUSTER_NAME}-0
mount_cgroups ccp-${CLUSTER_NAME}-1
make_cgroups_dir ccp-${CLUSTER_NAME}-0
......
......@@ -9,5 +9,5 @@ run:
- |
set -ex
ccp_src/aws/setup_ssh_to_cluster.sh
ssh centos@mdw "sudo bash -c \"yum install -y valgrind mailx\""
ssh centos@mdw "sudo bash -c \"yum --cacheonly list installed mailx valgrind\""
ssh -t mdw "$CUSTOM_ENV bash /home/gpadmin/gpdb_src/concourse/scripts/run_behave_test.sh \"$BEHAVE_FLAGS\""
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册