Mirror images from RDO server

Mirror promoted images from RDO server to RH1 cloud
Rename all ipa_images.tar to ironic-python-agent.tar
Remove old promotion code from mirror-server

Change-Id: I44a170cfa23e568d31726f55cea8906ad2c8e146
This commit is contained in:
Sagi Shnaidman 2017-10-08 21:23:09 +03:00
parent 063217a051
commit b56e22a835
4 changed files with 62 additions and 48 deletions

View File

@ -150,7 +150,7 @@ function canusecache(){
${UNDERCLOUD_VM_NAME}.qcow2)
[[ "$PROJ" =~ instack-undercloud|diskimage-builder|tripleo-image-elements|tripleo-puppet-elements ]] && return 1
;;
ipa_images.tar)
ironic-python-agent.tar)
[[ "$PROJ" =~ diskimage-builder|python-tripleoclient|tripleo-common|tripleo-image-elements ]] && return 1
;;
overcloud-full.tar)
@ -399,26 +399,6 @@ function sanitize_ip_address {
fi
}
function get_image {
local img="$1"
http_proxy= wget -T 60 --tries=3 --progress=dot:mega http://$MIRRORSERVER/builds/current-tripleo/$img -O $img || {
wget -T 60 --tries=3 --progress=dot:mega http://66.187.229.139/builds/current-tripleo/$img -O $img
}
}
function prepare_images_oooq {
get_image ipa_images.tar
get_image overcloud-full.tar
tar -xvf overcloud-full.tar
tar -xvf ipa_images.tar
update_image $PWD/ironic-python-agent.initramfs
update_image $PWD/overcloud-full.qcow2
cp ironic-python-agent.* ~/
cp overcloud-full.qcow2 overcloud-full.initrd overcloud-full.vmlinuz ~/
rm -f overcloud-full.tar ipa_images.tar
}
function subnodes_scp_deploy_env {
for ip in $(cat /etc/nodepool/sub_nodes_private); do
sanitized_address=$(sanitize_ip_address $ip)

View File

@ -0,0 +1,40 @@
#!/bin/bash
RELEASE=$1
BUILDS="/var/www/html/builds-${RELEASE}/current-tripleo"
MIRRORURL="https://images.rdoproject.org/${RELEASE}/delorean/current-tripleo"
IMAGES="overcloud-full.tar ironic-python-agent.tar"
function check_new_image {
local img=$1
wget ${MIRRORURL}/${img}.md5 -O test_md5 -o /dev/null || {
echo "File ${MIRRORURL}/${img}.md5 doesn't present, can NOT continue"
exit 1
}
diff -q test_md5 ${img}.md5 >/dev/null
}
function update_images {
for img in $IMAGES; do
wget ${MIRRORURL}/${img} -O ${img}-${RELEASE}
wget ${MIRRORURL}/${img}.md5 -O ${img}-${RELEASE}.md5
down_md5="$(cat ${img}-${RELEASE}.md5 | awk {'print $1'})"
real_md5="$(md5sum ${img}-${RELEASE} | awk {'print $1'})"
if [[ "$down_md5" == "$real_md5" ]]; then
mv -f ${img}-${RELEASE} ${img}
mv -f ${img}-${RELEASE}.md5 ${img}.md5
else
echo "md5 doesn't match, image download was broken!"
echo "Calculated md5 is $real_md5 and downloaded is $down_md5"
rm -f "${img}-${RELEASE}"
rm -f "${img}-${RELEASE}.md5"
fi
done
wget ${MIRRORURL}/delorean_hash.txt -O delorean_hash.txt -o /dev/null
}
mkdir -p $BUILDS
pushd $BUILDS
check_new_image overcloud-full.tar && echo "${RELEASE} images are up to date" || update_images
rm -f test_md5
popd

View File

@ -50,33 +50,27 @@ file {"/var/www/html/builds-mitaka":
ensure => "directory",
owner => "apache",
}
cron {"refresh-server":
command => "timeout 20m puppet apply /opt/stack/tripleo-ci/scripts/mirror-server/mirror-server.pp",
minute => "*/30"
}
cron {"parse-periodic-multinode":
command => "timeout 10m /opt/stack/tripleo-ci/scripts/mirror-server/multinode_status.py &>/var/log/last_multinode_jobs_status.log",
minute => "30"
cron {"mirror-images-master":
command => "timeout 60m /opt/stack/tripleo-ci/scripts/mirror-server/mirror-images.sh master | tee /var/log/images_update-master.log",
hour => "2",
minute => "0"
}
cron {"promote-master":
command => "timeout 10m /opt/stack/tripleo-ci/scripts/mirror-server/promote.sh master current-tripleo tripleo-dlrn-promote periodic-tripleo-ci-centos-7-ovb-ha-oooq periodic-tripleo-ci-centos-7-ovb-1ctlr_1comp_1ceph-featureset024 periodic-tripleo-ci-centos-7-scenario001-multinode-oooq periodic-tripleo-ci-centos-7-scenario002-multinode-oooq periodic-tripleo-ci-centos-7-scenario003-multinode-oooq periodic-tripleo-ci-centos-7-scenario004-multinode-oooq &>/var/log/last_master_promotion.log",
minute => "40"
cron {"mirror-images-pike":
command => "timeout 60m /opt/stack/tripleo-ci/scripts/mirror-server/mirror-images.sh pike | tee /var/log/images_update-pike.log",
hour => "2",
minute => "0"
}
cron {"promote-pike":
command => "timeout 10m /opt/stack/tripleo-ci/scripts/mirror-server/promote.sh pike current-tripleo-pike tripleo-dlrn-promote-pike periodic-tripleo-ci-centos-7-ovb-ha-pike-oooq &>/var/log/last_pike_promotion.log",
minute => "40"
cron {"mirror-images-ocata":
command => "timeout 60m /opt/stack/tripleo-ci/scripts/mirror-server/mirror-images.sh ocata | tee /var/log/images_update-ocata.log",
hour => "2",
minute => "0"
}
cron {"promote-ocata":
command => "timeout 10m /opt/stack/tripleo-ci/scripts/mirror-server/promote.sh ocata current-tripleo-ocata tripleo-dlrn-promote-ocata periodic-tripleo-ci-centos-7-ovb-ha-ocata-oooq &>/var/log/last_ocata_promotion.log",
minute => "40"
}
cron {"promote-newton":
command => "timeout 10m /opt/stack/tripleo-ci/scripts/mirror-server/promote.sh newton current-tripleo-newton tripleo-dlrn-promote-newton periodic-tripleo-ci-centos-7-ovb-ha-newton-oooq &>/var/log/last_newton_promotion.log",
minute => "40"
cron {"mirror-images-newton":
command => "timeout 60m /opt/stack/tripleo-ci/scripts/mirror-server/mirror-images.sh newton | tee /var/log/images_update-newton.log",
hour => "2",
minute => "0"
}

View File

@ -87,13 +87,13 @@ sudo update-ca-trust extract
# Don't get a file from cache if CACHEUPLOAD=1 (periodic job)
# If this 404's it wont error just continue without a file created
if canusecache ipa_images.tar ; then
wget --progress=dot:mega http://$MIRRORSERVER/builds-${STABLE_RELEASE:-master}/current-tripleo${STABLE_RELEASE:+-$STABLE_RELEASE}/ipa_images.tar || true
if [ -f ipa_images.tar ] ; then
tar -xf ipa_images.tar
if canusecache ironic-python-agent.tar ; then
wget --progress=dot:mega http://$MIRRORSERVER/builds-${STABLE_RELEASE:-master}/current-tripleo${STABLE_RELEASE:+-$STABLE_RELEASE}/ironic-python-agent.tar || true
if [ -f ironic-python-agent.tar ] ; then
tar -xf ironic-python-agent.tar
update_image $PWD/ironic-python-agent.initramfs
rm ironic-python-agent.tar
mv ironic-python-agent.* ~
rm ipa_images.tar
fi
fi