Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
295044e
fixed lack of init
dlenwell Nov 2, 2013
eb6680c
move bootstrap css local
dlenwell Nov 2, 2013
2105912
random changes
dlenwell Nov 4, 2013
4dda20a
whitespace
dlenwell Nov 4, 2013
ffb4b2e
Merge branch 'master' of git://github.com/dlenwell/refstack
termie Nov 20, 2013
8469db4
get rid of some unused bits and whitespace
termie Nov 20, 2013
7d795d2
more cleaning
termie Nov 20, 2013
2df2b47
Merge pull request #1 from termie/cleanup
dlenwell Nov 20, 2013
1800193
update deployment
termie Nov 21, 2013
ce60f96
Merge pull request #2 from termie/flask_config
dlenwell Nov 25, 2013
ca4b818
use local dir for config by default
termie Nov 26, 2013
b267be8
move db back to flask-sqlalchemy
termie Nov 26, 2013
e6b26ba
Merge pull request #3 from termie/first_run
dlenwell Nov 26, 2013
8e4a5b2
update flask-admin and move it to a module
termie Nov 26, 2013
822272b
update db calls to use session
termie Nov 26, 2013
c8284b2
add a basic api based on flask-restless
termie Nov 27, 2013
bd3585f
add admin for apikey and migration
termie Nov 27, 2013
ea9473c
get rid of this useless fabfile
termie Nov 27, 2013
3779166
Merge pull request #5 from termie/api
dlenwell Nov 27, 2013
81a563b
Merge pull request #6 from termie/deploy
dlenwell Nov 27, 2013
587d15e
remove meta so alembic doesn't require refstack
termie Dec 6, 2013
613e4a9
Adding a todo
joshuamckenty Dec 9, 2013
12c2639
Merge branch 'master' of https://github.com/dlenwell/refstack
joshuamckenty Dec 9, 2013
9c1d90f
Fixin syntax in ==
Dec 9, 2013
e506e14
Merge pull request #7 from termie/no_meta
dlenwell Dec 13, 2013
1e51e84
scorecard template
dlenwell Feb 21, 2014
51a49e1
added lic header
dlenwell Feb 21, 2014
14b0810
pep8 fixes
dlenwell Feb 21, 2014
0bd1399
pep8 cleanup
dlenwell Feb 22, 2014
ee8ec28
house keeping
dlenwell Feb 22, 2014
cd09757
Cleaned up a basic tcup dockerfile
joshuamckenty Feb 22, 2014
ea51cb9
Merge
joshuamckenty Feb 22, 2014
2a55fd8
Merge pull request #8 from joshuamckenty/master
dlenwell Feb 22, 2014
28ded21
Dockerfile from @d_qoi working to build container
Feb 23, 2014
c49cb82
Merge pull request #9 from cloudedge/dockerfile
dlenwell Feb 24, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ refstack/client/.smbdeleteAAA06c94.4
scripts/members_sponsors_20131030.csv

refstack/client/.smbdeleteAAA9ef44.4

db.sqlite
1 change: 0 additions & 1 deletion Procfile

This file was deleted.

8 changes: 0 additions & 8 deletions README.md

This file was deleted.

59 changes: 59 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
RefStack
========

Vendor-facing API for registration of interop-compliance endpoints and credentials for on-demand testing.

Running at http://refstack.org
See (living) documentation at https://etherpad.openstack.org/RefStackBlueprint


Okay, I'm Sold, How Do I Run This Myself?
-----------------------------------------

This is our documentation for how we get this set up::

# Git you clonin'
git clone http://github.com/openstack-ops/refstack

cd refstack

# Setup or update the database
# NOTE: you are going to have to modify the db connection string in
# `alembic.ini` to get this working
# PROTIP: if you just want to test this out, use `-n alembic_sqlite` to
# make a local sqlite db
# $ alembic -n alembic_sqlite update head
alembic update head

# Plug this bad boy into your server infrastructure.
# We use nginx and gunicorn, you may use something else if you are smarter
# than we are.
# For the most basic setup that you can try right now, just kick off
# gunicorn:
gunicorn refstack.web:app

# To actually configure this winner, check out the config section and
# crack open refstack.cfg in vim.
# `vim refstack.cfg`

# Now browse to http://localhost:8000


Configuration
-------------

Coming soon!

TODO:
=====

Metadata gathering:
- Number of nodes
- vCPUs
- Distro
- Deployment approach
- RAM

Plugins:
- Cinder
- Neutron
7 changes: 7 additions & 0 deletions alembic.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ script_location = alembic
sqlalchemy.url = driver://user:pass@localhost/dbname


[alembic_sqlite]
# path to migration scripts
script_location = alembic

sqlalchemy.url = sqlite:///db.sqlite


# Logging configuration
[loggers]
keys = root,sqlalchemy,alembic
Expand Down
39 changes: 16 additions & 23 deletions alembic/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,30 @@
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import with_statement

import os
import sys
sys.path.append("./")


from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
from refstack import app

# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
cur_db_uri = config.get_section_option('alembic', 'sqlalchemy.url')
my_db_uri = 'sqlite:////tmp/refstack.db' # app.config.get('SQLALCHEMY_DATABASE_URI', cur_db_uri)
config.set_section_option('alembic', 'sqlalchemy.url', my_db_uri)

# Interpret the config file for Python logging.
# This line sets up loggers basically.
fileConfig(config.config_file_name)

# add your model's MetaData object here
# for 'autogenerate' support
# from myapp import mymodel
# target_metadata = mymodel.Base.metadata
# target_metadata = None
from refstack.models import *
target_metadata = Base.metadata
# from refstack.models import db
# target_metadata = db.metadata
target_metadata = None

# other values from the config, defined by the needs of env.py,
# can be acquired:
# my_important_option = config.get_main_option("my_important_option")
# ... etc.


def run_migrations_offline():
Expand All @@ -64,32 +59,30 @@ def run_migrations_offline():
with context.begin_transaction():
context.run_migrations()


def run_migrations_online():
"""Run migrations in 'online' mode.

In this scenario we need to create an Engine
and associate a connection with the context.

"""
and associate a connection with the context."""
engine = engine_from_config(
config.get_section(config.config_ini_section),
prefix='sqlalchemy.',
poolclass=pool.NullPool)
config.get_section(config.config_ini_section),
prefix='sqlalchemy.',
poolclass=pool.NullPool)

connection = engine.connect()
context.configure(
connection=connection,
target_metadata=target_metadata
)
connection=connection,
target_metadata=target_metadata)

try:
with context.begin_transaction():
context.run_migrations()
finally:
connection.close()


if context.is_offline_mode():
run_migrations_offline()
else:
run_migrations_online()

4 changes: 3 additions & 1 deletion alembic/versions/1d6540fc6279_added_vendor_contact.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@

def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.add_column('vendor', sa.Column('contact_name', sa.String(length=120), nullable=True))
op.add_column(
'vendor',
sa.Column('contact_name', sa.String(length=120), nullable=True))
### end Alembic commands ###


Expand Down
110 changes: 58 additions & 52 deletions alembic/versions/3790aed42558_from_scratch.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -16,63 +16,69 @@

def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.create_table('cloud',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('label', sa.String(length=60), nullable=True),
sa.Column('endpoint', sa.String(length=120), nullable=True),
sa.Column('test_user', sa.String(length=80), nullable=True),
sa.Column('test_key', sa.String(length=80), nullable=True),
sa.Column('admin_endpoint', sa.String(length=120), nullable=True),
sa.Column('admin_user', sa.String(length=80), nullable=True),
sa.Column('admin_key', sa.String(length=80), nullable=True),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('endpoint')
op.create_table(
'cloud',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('label', sa.String(length=60), nullable=True),
sa.Column('endpoint', sa.String(length=120), nullable=True),
sa.Column('test_user', sa.String(length=80), nullable=True),
sa.Column('test_key', sa.String(length=80), nullable=True),
sa.Column('admin_endpoint', sa.String(length=120), nullable=True),
sa.Column('admin_user', sa.String(length=80), nullable=True),
sa.Column('admin_key', sa.String(length=80), nullable=True),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('endpoint')
)
op.create_table('vendor',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('vendor_name', sa.String(length=80), nullable=True),
sa.Column('contact_email', sa.String(length=120), nullable=True),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('contact_email'),
sa.UniqueConstraint('vendor_name')
op.create_table(
'vendor',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('vendor_name', sa.String(length=80), nullable=True),
sa.Column('contact_email', sa.String(length=120), nullable=True),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('contact_email'),
sa.UniqueConstraint('vendor_name')
)
op.create_table('user',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('vendor_id', sa.Integer(), nullable=True),
sa.Column('name', sa.String(length=60), nullable=True),
sa.Column('email', sa.String(length=200), nullable=True),
sa.Column('email_verified', sa.Boolean(), nullable=True),
sa.Column('openid', sa.String(length=200), nullable=True),
sa.Column('authorized', sa.Boolean(), nullable=True),
sa.Column('su', sa.Boolean(), nullable=True),
sa.ForeignKeyConstraint(['vendor_id'], ['vendor.id'], ),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('email'),
sa.UniqueConstraint('openid')
op.create_table(
'user',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('vendor_id', sa.Integer(), nullable=True),
sa.Column('name', sa.String(length=60), nullable=True),
sa.Column('email', sa.String(length=200), nullable=True),
sa.Column('email_verified', sa.Boolean(), nullable=True),
sa.Column('openid', sa.String(length=200), nullable=True),
sa.Column('authorized', sa.Boolean(), nullable=True),
sa.Column('su', sa.Boolean(), nullable=True),
sa.ForeignKeyConstraint(['vendor_id'], ['vendor.id'], ),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('email'),
sa.UniqueConstraint('openid')
)
op.create_table('test',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('cloud_id', sa.Integer(), nullable=True),
sa.Column('config', sa.String(length=4096), nullable=True),
sa.ForeignKeyConstraint(['cloud_id'], ['cloud.id'], ),
sa.PrimaryKeyConstraint('id')
op.create_table(
'test',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('cloud_id', sa.Integer(), nullable=True),
sa.Column('config', sa.String(length=4096), nullable=True),
sa.ForeignKeyConstraint(['cloud_id'], ['cloud.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_table('test_results',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('test_id', sa.Integer(), nullable=True),
sa.Column('timestamp', sa.DateTime(), nullable=True),
sa.Column('blob', sa.Binary(), nullable=True),
sa.ForeignKeyConstraint(['test_id'], ['test.id'], ),
sa.PrimaryKeyConstraint('id')
op.create_table(
'test_results',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('test_id', sa.Integer(), nullable=True),
sa.Column('timestamp', sa.DateTime(), nullable=True),
sa.Column('blob', sa.Binary(), nullable=True),
sa.ForeignKeyConstraint(['test_id'], ['test.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_table('test_status',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('test_id', sa.Integer(), nullable=True),
sa.Column('message', sa.String(length=1024), nullable=True),
sa.Column('finished', sa.Boolean(), nullable=True),
sa.Column('timestamp', sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(['test_id'], ['test.id'], ),
sa.PrimaryKeyConstraint('id')
op.create_table(
'test_status',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('test_id', sa.Integer(), nullable=True),
sa.Column('message', sa.String(length=1024), nullable=True),
sa.Column('finished', sa.Boolean(), nullable=True),
sa.Column('timestamp', sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(['test_id'], ['test.id'], ),
sa.PrimaryKeyConstraint('id')
)
### end Alembic commands ###

Expand Down
3 changes: 0 additions & 3 deletions alembic/versions/4288db006e5_added_user_cloud_rel.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
revision = '4288db006e5'
down_revision = '1d6540fc6279'

from alembic import op
import sqlalchemy as sa


def upgrade():
### commands auto generated by Alembic - please adjust! ###
Expand Down
32 changes: 32 additions & 0 deletions alembic/versions/449461dbc725_add_apikey.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""empty message

Revision ID: 449461dbc725
Revises: 59e15d864941
Create Date: 2013-11-26 16:57:16.062788

"""

# revision identifiers, used by Alembic.
revision = '449461dbc725'
down_revision = '59e15d864941'

from alembic import op
import sqlalchemy as sa


def upgrade():
op.create_table(
'apikey',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=60), nullable=True),
sa.Column('key', sa.String(length=200), nullable=True),
sa.Column('openid', sa.String(length=200), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('timestamp', sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
sa.PrimaryKeyConstraint('id'),
)


def downgrade():
op.drop_Table('apikey')
29 changes: 29 additions & 0 deletions alembic/versions/59e15d864941_added_subunit_output.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""added subunit output field

Revision ID: 59e15d864941
Revises: 4f6f77184d45
Create Date: 2013-11-02 04:41:58.431516

"""

# revision identifiers, used by Alembic.
revision = '59e15d864941'
down_revision = '4f6f77184d45'

from alembic import op
import sqlalchemy as sa


def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.add_column(
'test_results',
sa.Column('subunit', sa.String(length=8192), nullable=True)
)
### end Alembic commands ###


def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.drop_column('test_results', 'subunit')
### end Alembic commands ###
Loading