Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

Remove git shared repos and unused unbundle_hg #233

Merged
merged 3 commits into from Jul 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
39 changes: 0 additions & 39 deletions cloudtools/aws/instance.py
Expand Up @@ -5,12 +5,10 @@
import random
import StringIO
import pipes
import redo
from boto.ec2.blockdevicemapping import BlockDeviceMapping, BlockDeviceType
from boto.ec2.networkinterface import NetworkInterfaceSpecification, \
NetworkInterfaceCollection
from fabric.api import run, sudo, put
from fabric.context_managers import cd
from ..fabric import setup_fabric_env
from ..dns import get_ip
from . import wait_for_status, AMI_CONFIGS_DIR, get_aws_connection, \
Expand Down Expand Up @@ -178,10 +176,6 @@ def run_chroot(cmd, *args, **kwargs):
run_chroot("sudo -u cltbld /tools/buildbot/bin/buildslave create-slave "
"/builds/slave {buildbot_master} {name} "
"{buildslave_password}".format(**instance_data))
if instance_data.get("hg_bundles"):
unbundle_hg(instance_data['hg_bundles'])
if instance_data.get("s3_tarballs"):
unpack_tarballs(instance_data["s3_tarballs"])

run("sync")
run("sync")
Expand All @@ -201,39 +195,6 @@ def assimilate_windows(instance, config, instance_data):
wait_for_status(instance, 'state', 'running', 'update')


@redo.retriable(sleeptime=0, jitter=0, attempts=3)
def unbundle_hg(hg_bundles):
log.info("Cloning HG bundles")
hg = "/tools/python27-mercurial/bin/hg"
for share, bundle in hg_bundles.iteritems():
target_dir = '/builds/hg-shared/%s' % share
sudo('rm -rf {d} && mkdir -p {d}'.format(d=target_dir),
user="cltbld")
sudo('{hg} init {d}'.format(hg=hg, d=target_dir), user="cltbld")
hgrc = "[paths]\n"
hgrc += "default = https://hg.mozilla.org/%s\n" % share
put(StringIO.StringIO(hgrc), '%s/.hg/hgrc' % target_dir)
run("chown cltbld: %s/.hg/hgrc" % target_dir)
sudo('{hg} -R {d} unbundle {b}'.format(hg=hg, d=target_dir,
b=bundle), user="cltbld")
log.info("Unbundling HG repos finished")


@redo.retriable(sleeptime=0, jitter=0, attempts=3)
def unpack_tarballs(tarballs):
log.info("Unpacking tarballs")
put("%s/s3-get" % AMI_CONFIGS_DIR, "/tmp/s3-get")
for dest_dir, info in tarballs.iteritems():
bucket, key = info["bucket"], info["key"]
sudo("mkdir -p {d}".format(d=dest_dir), user="cltbld")
with cd(dest_dir):
sudo("python /tmp/s3-get -b {bucket} -k {key} -o - | "
"tar xf - --touch".format(bucket=bucket, key=key),
user="cltbld")
run("rm -f /tmp/s3-get")
log.info("Unpacking tarballs finished")


def make_instance_interfaces(region, hostname, ignore_subnet_check,
avail_subnets, security_groups, use_public_ip):
vpc = get_vpc(region)
Expand Down
5 changes: 1 addition & 4 deletions instance_data/us-east-1.instance_data_prod.json
@@ -1,7 +1,4 @@
{
"dev_puppet_masters": ["releng-puppet2.srv.releng.scl3.mozilla.com"],
"puppet_masters": ["releng-puppet1.srv.releng.scl3.mozilla.com", "releng-puppet2.srv.releng.scl3.mozilla.com", "releng-puppet1.srv.releng.use1.mozilla.com", "releng-puppet1.srv.releng.usw2.mozilla.com"],
"s3_tarballs": {
"/builds/git-shared/repo": {"bucket": "mozilla-releng-tarballs-use1", "key": "git-shared-repo.tar"}
}
"puppet_masters": ["releng-puppet1.srv.releng.scl3.mozilla.com", "releng-puppet2.srv.releng.scl3.mozilla.com", "releng-puppet1.srv.releng.use1.mozilla.com", "releng-puppet1.srv.releng.usw2.mozilla.com"]
}
5 changes: 1 addition & 4 deletions instance_data/us-east-1.instance_data_try.json
@@ -1,7 +1,4 @@
{
"dev_puppet_masters": ["releng-puppet2.srv.releng.scl3.mozilla.com"],
"puppet_masters": ["releng-puppet1.srv.releng.scl3.mozilla.com", "releng-puppet2.srv.releng.scl3.mozilla.com", "releng-puppet1.srv.releng.use1.mozilla.com", "releng-puppet1.srv.releng.usw2.mozilla.com"],
"s3_tarballs": {
"/builds/git-shared/repo": {"bucket": "mozilla-releng-tarballs-use1", "key": "git-shared-repo-try.tar"}
}
"puppet_masters": ["releng-puppet1.srv.releng.scl3.mozilla.com", "releng-puppet2.srv.releng.scl3.mozilla.com", "releng-puppet1.srv.releng.use1.mozilla.com", "releng-puppet1.srv.releng.usw2.mozilla.com"]
}