Removed tcup files from repository
Change-Id: I51127b22c17bd748d38baa7dd46e371c707be04a
This commit is contained in:
parent
a11dcb8487
commit
0e9035ff80
@ -1,34 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2013 Piston Cloud Computing, Inc.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
"""Simple script for importing the vendor
|
||||
list csv file provided by the foundation"""
|
||||
from refstack.models import db, Vendor
|
||||
import csv
|
||||
|
||||
_file = 'members_sponsors_20131030.csv'
|
||||
|
||||
with open(_file, 'rb') as csvfile:
|
||||
parsed = csv.reader(csvfile, delimiter=',')
|
||||
for row in parsed:
|
||||
try:
|
||||
vendor = Vendor()
|
||||
vendor.vendor_name = row[1]
|
||||
vendor.contact_email = row[3]
|
||||
db.add(vendor)
|
||||
db.commit()
|
||||
except:
|
||||
print 'vendor skipped:' + row[1]
|
120
scripts/tcup.py
120
scripts/tcup.py
@ -1,120 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# Copyright (c) 2014 Dell Computer, Inc. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
# This file creates and runs Tempest in a Docker Container
|
||||
import commands
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
# Reference Information
|
||||
DOCKER_FILE_SOURCE = os.path.join("scripts", "tcup")
|
||||
DOCKER_FILE_URL = "https://raw.githubusercontent.com/stackforge/" \
|
||||
"refstack/master/scripts/tcup/Dockerfile"
|
||||
REFSTACK_API_ADDRESS = "http://refstack.org/replace_with_correct_url"
|
||||
IGNORED_ENV_VARS = {"LS_COLORS", "HOME", "PATH", "PWD", "OLDPWD",
|
||||
"LESSCLOSE", "SSH_CONNECTION"}
|
||||
REQUIRED_ENV_VARS = {'OS_PASSWORD', 'OS_USERNAME', 'OS_AUTH_URL'}
|
||||
|
||||
# debugging?
|
||||
debug = ((len(sys.argv) > 1 and sys.argv[1] == "--debug")
|
||||
or os.environ.get("DEBUG"))
|
||||
|
||||
# Setup the logger
|
||||
LOG_FORMAT = "%(asctime)s %(name)s %(levelname)s %(message)s"
|
||||
logger = logging.getLogger("TCUP")
|
||||
console_log_handle = logging.StreamHandler()
|
||||
console_log_handle.setFormatter(logging.Formatter(LOG_FORMAT))
|
||||
logger.addHandler(console_log_handle)
|
||||
if debug:
|
||||
logger.setLevel(logging.DEBUG)
|
||||
logger.info("Starting in DEBUG mode.")
|
||||
else:
|
||||
logger.setLevel(logging.INFO)
|
||||
|
||||
# Confirm you've sourced their openrc credentials already
|
||||
for env_var in REQUIRED_ENV_VARS:
|
||||
if not os.environ.get(env_var):
|
||||
exp = 'Env Variable "%s" Missing: ' \
|
||||
'You may need to "source openrc.sh".' % (env_var)
|
||||
raise Exception(exp)
|
||||
|
||||
# build the container
|
||||
logger.info("Downloading & Building TCUP Image...(may take a long time)")
|
||||
if os.path.isfile(DOCKER_FILE_SOURCE + "/Dockerfile"):
|
||||
docker_builder = DOCKER_FILE_SOURCE
|
||||
else:
|
||||
docker_builder = DOCKER_FILE_URL
|
||||
logger.info("Executing: `docker build %s`" % (docker_builder))
|
||||
build_output = commands.getoutput("docker build %s" % (docker_builder))
|
||||
|
||||
# provide friendly output progress message
|
||||
search_for = "Successfully built ([0-9a-f]{12})"
|
||||
try:
|
||||
image = re.search(search_for, build_output).group(1)
|
||||
except re.error:
|
||||
exp = "ERROR building TCUP container. Details: %s" % (build_output)
|
||||
raise Exception(exp)
|
||||
logger.info("TCUP Built Docker Image ID: %s" % (image))
|
||||
|
||||
# collect environment variables to pass, we don't want all of them
|
||||
user_env_vars = dict(os.environ)
|
||||
for env_var in IGNORED_ENV_VARS:
|
||||
user_env_vars.pop(env_var, None)
|
||||
|
||||
# test specific configuration
|
||||
if not os.environ.get('TEST_ID'):
|
||||
user_env_vars["test_id"] = "1000" # TODO: generated good value!
|
||||
|
||||
if not os.environ.get('API_SERVER_ADDRESS'):
|
||||
user_env_vars["api_addr"] = REFSTACK_API_ADDRESS
|
||||
|
||||
# create the docker run command line
|
||||
docker_run = "docker run -d -i"
|
||||
for env_var in user_env_vars:
|
||||
docker_run += ' -e "%s"' % (env_var,)
|
||||
if debug:
|
||||
docker_run += " -v `pwd`:/dev"
|
||||
docker_run += ' -t %s' % (image)
|
||||
if debug:
|
||||
docker_run += " /bin/bash"
|
||||
logger.info("Debug mode does not start tests! \
|
||||
You must run `refstack/refstack/tools/execute_test.py \
|
||||
--tempest-home /tempest` to complete processing")
|
||||
else:
|
||||
docker_run += " cd refstack; refstack/tools/execute_test.py" \
|
||||
" --tempest-home /tempest" \
|
||||
" --callback ${api_addr} ${test_id}"
|
||||
if debug:
|
||||
docker_run_log_output = docker_run
|
||||
else:
|
||||
# normally we redact the password
|
||||
clear_password = "OS_PASSWORD=%s" % user_env_vars['OS_PASSWORD']
|
||||
docker_run_log_output = docker_run.replace(clear_password,
|
||||
"OS_PASSWORD=!REDACTED!")
|
||||
logger.info("Executing: '%s'" % (docker_run_log_output))
|
||||
|
||||
# start the container and advise the user about how to attach
|
||||
docker_output = commands.getoutput(docker_run)
|
||||
logger.debug(docker_output)
|
||||
logger.info("""You can monitor the TCUP results using the command
|
||||
'docker attach %s'
|
||||
(hint: you may need to press [enter])"""
|
||||
% docker_output[0:12])
|
@ -1,54 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# Copyright (c) 2014 OpenStack Foundation, All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
# This file creates and runs Tempest in a Docker Container
|
||||
|
||||
FROM ubuntu:13.10
|
||||
MAINTAINER OpenStack RefStack Project
|
||||
|
||||
RUN apt-get update
|
||||
|
||||
# Install git, python and essential tools
|
||||
RUN apt-get install -y git python-setuptools curl ftp
|
||||
RUN easy_install pip
|
||||
|
||||
# Install dependencies (small bites are easier to troubleshoot)
|
||||
RUN apt-get install -y libxml2-dev libxslt-dev lib32z1-dev
|
||||
RUN apt-get install -y python2.7-dev python-dev libssl-dev
|
||||
RUN apt-get install -y python-libxml2 libxslt1-dev libsasl2-dev
|
||||
RUN apt-get install -y libsqlite3-dev libldap2-dev libffi-dev
|
||||
|
||||
# Setup Environment by Cloning refstack & tempest (choose right branch)
|
||||
RUN git clone https://github.com/stackforge/refstack.git
|
||||
RUN git clone https://github.com/openstack/tempest.git
|
||||
|
||||
# Version of TCUP
|
||||
# Changing REBUILDs the container from this point forward
|
||||
ENV TCUP 0.1.0
|
||||
|
||||
# Using refstack & tempest dependencies
|
||||
RUN pip install -r /refstack/requirements.txt
|
||||
RUN pip install -r /refstack/test-requirements.txt
|
||||
|
||||
# Running tempest setup
|
||||
RUN cd tempest && git checkout stable/havana
|
||||
RUN cd tempest && python setup.py install
|
||||
|
||||
# The tcup.py frontend must be used to run this Docker image
|
||||
# The following CMD statement will run and print the documentation
|
||||
# to inform the user of the proper way of running tcup. This
|
||||
# CMD statement is overriden by tcup.py
|
||||
CMD cat refstack/doc/tcup.md
|
Loading…
x
Reference in New Issue
Block a user