Skip to content

Commit

Permalink
Rename iris-api -> iris (now that iris-fe is merged in)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrgp authored and houqp committed Apr 3, 2017
1 parent 3636a37 commit f2c3752
Show file tree
Hide file tree
Showing 108 changed files with 118 additions and 117 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
.coverage
htmlcov
venv
/src/iris_api/ui/static/.webassets-cache
/src/iris_api/ui/static/bundles
/src/iris/ui/static/.webassets-cache
/src/iris/ui/static/bundles
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ all: serve
serve:
gunicorn --reload --access-logfile=- -b '0.0.0.0:16649' --worker-class gevent \
-e CONFIG=./configs/config.dev.yaml \
iris_api.wrappers.gunicorn:application
iris.wrappers.gunicorn:application

sender:
iris-sender configs/config.dev.yaml
Expand All @@ -23,7 +23,7 @@ check:
make test

unit-cov:
py.test --cov-report term-missing --cov=iris_api test
py.test --cov-report term-missing --cov=iris test

e2e-cov:
./test/e2etest_coverage.sh
Expand Down
12 changes: 6 additions & 6 deletions README-Docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ Iris-API (and iris-sender) under Docker

### Get started

Build container. This installs all dependencies as well as copies all iris-api source code.
Build container. This installs all dependencies as well as copies all iris source code.

docker build -t iris-api .
docker build -t iris .

Edit iris-api's config file as needed (MySQL and vendor settings and so on):
Edit iris's config file as needed (MySQL and vendor settings and so on):

vim docker/config/config.yaml

Run it, with bind mounts to give access to iris api config file

docker run -p 16649:16649 -v `pwd`/docker/config:/home/iris/config -t iris-api
docker run -p 16649:16649 -v `pwd`/docker/config:/home/iris/config -t iris

You can optionally bind mount log directories for uwsgi/nginx:

mkdir -p docker/logs/{uwsgi,nginx}
docker run -p 16649:16649 -v `pwd`/docker/config:/home/iris/config \
-v `pwd`/docker/logs/nginx:/home/iris/var/log/nginx \
-v `pwd`/docker/logs/uwsgi:/home/iris/var/log/uwsgi -t iris-api
-v `pwd`/docker/logs/uwsgi:/home/iris/var/log/uwsgi -t iris

You can then hit `http://localhost:16649 ` to access iris-api running within the docker.
You can then hit `http://localhost:16649 ` to access iris running within the docker.

### Quick commands

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ make unit-cov
Adding new plugins
------------------

1. create the plugin file under `src/iris_api/plugis` dir
1. edit `src/iris_api/plugins/__init__.py` to add plugin module to `__all__` list
1. create the plugin file under `src/iris/plugis` dir
1. edit `src/iris/plugins/__init__.py` to add plugin module to `__all__` list
2 changes: 1 addition & 1 deletion configs/config.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ sender:
port: 2321
is_master: True

# Sender that iris-api's notifications endpoint sends to
# Sender that iris's notifications endpoint sends to
master_sender:
host: 127.0.0.1
port: 2321
Expand Down
2 changes: 1 addition & 1 deletion docker/daemons/uwsgi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ prod:
touch-reload: /home/iris/var/run/uwsgi_touch_reload
stats: /home/iris/var/run/uwsgi_stats.sock
pidfile: /home/iris/var/run/uwsgi.pid
module: iris_api.api:get_api_app()
module: iris.api:get_api_app()
virtualenv: /home/iris/env
pyargv: /home/iris/config/config.yaml
buffer-size: 32768
Expand Down
2 changes: 1 addition & 1 deletion docker/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def main():
print 'Confg file missing keys: %s' % e
sys.exit(1)

# It often takes several seconds for MySQL to start up. iris-api dies upon start
# It often takes several seconds for MySQL to start up. iris dies upon start
# if it can't immediately connect to MySQL, so we have to wait for it.
wait_for_mysql(config)

Expand Down
4 changes: 2 additions & 2 deletions docs/source/nagios.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Code::
from __future__ import absolute_import
import logging

from iris_api.plugins.core import register_plugin, IrisPlugin
from iris.plugins.core import register_plugin, IrisPlugin


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -121,4 +121,4 @@ Nagios Service Defininition

If the example Nagios application plugin is being used, it will be
required to remove notification intervals (set to 0) so multiple
Iris events are not generated.
Iris events are not generated.
2 changes: 1 addition & 1 deletion docs/source/relay.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ Iris relay
==========

iris-relay receives responses from gmail, sms replies, and phone call keypad
presses. It passes these events over to iris-api to acknowledge incident
presses. It passes these events over to iris to acknowledge incident
claiming. It is designed to sit on the edge of your network, so it can receive
payloads from public APIs.
13 changes: 7 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import setuptools

setuptools.setup(
name='iris-api',
name='iris',
version='0.14.0',
package_dir={'': 'src'},
packages=setuptools.find_packages('src'),
Expand Down Expand Up @@ -40,11 +40,12 @@
],
entry_points={
'console_scripts': [
'iris-api = iris_api.bin.run_server:main',
'iris-sender = iris_api.bin.sender:main',
'iris-sync-targets = iris_api.bin.sync_targets:main',
'iris_ctl = iris_api.bin.iris_ctl:main',
'build_assets = iris_api.bin.ui_build_assets:main',
'iris-api = iris.bin.run_server:main',
'iris = iris.bin.run_server:main',
'iris-sender = iris.bin.sender:main',
'iris-sync-targets = iris.bin.sync_targets:main',
'iris_ctl = iris.bin.iris_ctl:main',
'build_assets = iris.bin.ui_build_assets:main',
]
}
)
File renamed without changes.
2 changes: 1 addition & 1 deletion src/iris_api/__main__.py → src/iris/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See LICENSE in the project root for license information.

from gevent.pywsgi import WSGIServer
from iris_api.api import API
from iris.api import API
import sys
import logging
import yaml
Expand Down
6 changes: 3 additions & 3 deletions src/iris_api/api.py → src/iris/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
from . import utils
from . import cache
from . import ui
from iris_api.sender import auditlog
from iris_api.sender.quota import (get_application_quotas_query, insert_application_quota_query,
required_quota_keys, quota_int_keys)
from iris.sender import auditlog
from iris.sender.quota import (get_application_quotas_query, insert_application_quota_query,
required_quota_keys, quota_int_keys)

from gevent import spawn, sleep

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def main():

signal.signal(signal.SIGINT, sigint_handler)

from iris_api.api import get_api, load_config_file
from iris.api import get_api, load_config_file

config = load_config_file(sys.argv[1])
app = get_api(config)
Expand Down
26 changes: 13 additions & 13 deletions src/iris_api/bin/sender.py → src/iris/bin/sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
import ujson

from collections import defaultdict
from iris_api.plugins import init_plugins
from iris_api.vendors import init_vendors, send_message
from iris_api.sender import auditlog
from iris_api import metrics
from iris.plugins import init_plugins
from iris.vendors import init_vendors, send_message
from iris.sender import auditlog
from iris import metrics
from uuid import uuid4
from iris_api.gmail import Gmail
from iris_api import db
from iris_api.api import load_config_file
from iris_api.sender import rpc, cache
from iris_api.sender.message import update_message_mode
from iris_api.sender.oneclick import oneclick_email_markup, generate_oneclick_url
from iris_api import cache as api_cache
from iris_api.sender.quota import ApplicationQuota
from iris.gmail import Gmail
from iris import db
from iris.api import load_config_file
from iris.sender import rpc, cache
from iris.sender.message import update_message_mode
from iris.sender.oneclick import oneclick_email_markup, generate_oneclick_url
from iris import cache as api_cache
from iris.sender.quota import ApplicationQuota
from pymysql import DataError, IntegrityError
# queue for sending messages
from iris_api.sender.shared import send_queue, add_mode_stat
from iris.sender.shared import send_queue, add_mode_stat

# sql

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
from phonenumbers import format_number, parse, PhoneNumberFormat
from phonenumbers.phonenumberutil import NumberParseException

from iris_api.api import load_config_file
from iris_api import metrics
from iris.api import load_config_file
from iris import metrics

from requests.packages.urllib3.exceptions import (
InsecureRequestWarning, SNIMissingWarning, InsecurePlatformWarning
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from webassets import script
import sys

from iris_api.ui import assets_env
from iris.ui import assets_env


def main():
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license.
# See LICENSE in the project root for license information.

from iris_api.custom_import import import_custom_module
from iris.custom_import import import_custom_module
from gevent import sleep
import logging
logger = logging.getLogger(__name__)
Expand All @@ -13,7 +13,7 @@


def get_metrics_provider(config, app_name):
return import_custom_module('iris_api.metrics', config['metrics'])(config, app_name)
return import_custom_module('iris.metrics', config['metrics'])(config, app_name)


def emit():
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Copyright (c) LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license.
# See LICENSE in the project root for license information.

from iris_api.custom_import import import_custom_module
from iris.custom_import import import_custom_module


def get_role_lookup(config):
return import_custom_module('iris_api.role_lookup', config['role_lookup'])(config)
return import_custom_module('iris.role_lookup', config['role_lookup'])(config)
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
import requests
from requests.exceptions import RequestException
import logging
from iris_api.metrics import stats
from iris.metrics import stats

logger = logging.getLogger(__name__)


class oncall(object):
def __init__(self, config):
headers = requests.utils.default_headers()
headers['User-Agent'] = 'iris-api role lookup (%s)' % headers.get('User-Agent')
headers['User-Agent'] = 'iris role lookup (%s)' % headers.get('User-Agent')
self.requests = requests.session()
self.requests.headers = headers
self.requests.verify = False
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/iris_api/sender/quota.py → src/iris/sender/quota.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from gevent import spawn, sleep
from collections import deque
from datetime import datetime
from iris_api.sender.shared import send_queue
from iris_api.cache import priorities, applications
from iris_api import metrics
from iris.sender.shared import send_queue
from iris.cache import priorities, applications
from iris import metrics
import logging
import ujson

Expand Down
2 changes: 1 addition & 1 deletion src/iris_api/sender/rpc.py → src/iris/sender/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from ..utils import msgpack_unpack_msg_from_socket
from . import cache
from .shared import send_queue, add_mode_stat
from iris_api import metrics
from iris import metrics

import logging
logger = logging.getLogger(__name__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See LICENSE in the project root for license information.

from gevent import queue
from iris_api.metrics import stats
from iris.metrics import stats
import logging

logger = logging.getLogger(__name__)
Expand Down
6 changes: 3 additions & 3 deletions src/iris_api/ui/__init__.py → src/iris/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import requests
import importlib
import logging
from iris_api.ui import auth
from iris.ui import auth
from beaker.middleware import SessionMiddleware

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -354,7 +354,7 @@ def on_post(self, req, resp):

def init(config, app):
logger.info('Web asset root: "%s"', ui_root)
auth_module = config.get('auth', {'module': 'iris_api.ui.auth.noauth'})['module']
auth_module = config.get('auth', {'module': 'iris.ui.auth.noauth'})['module']
auth = importlib.import_module(auth_module)
auth_manager = getattr(auth, 'Authenticator')(config)

Expand All @@ -379,7 +379,7 @@ def init(config, app):
app.add_route('/validate/jinja', JinjaValidate())

# Configuring the beaker middleware mutilates the app object, so do it
# at the end, after we've added all routes/sinks for the entire iris-api
# at the end, after we've added all routes/sinks for the entire iris
# app.
session_opts = {
'session.type': 'cookie',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Copyright (c) LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license.
# See LICENSE in the project root for license information.

from iris_api.custom_import import import_custom_module
from iris.custom_import import import_custom_module

_registered_validators = []


def init_validators(validators):
for module in validators:
_registered_validators.append(import_custom_module('iris_api.validators', module)())
_registered_validators.append(import_custom_module('iris.validators', module)())


class IrisValidationException(Exception):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license.
# See LICENSE in the project root for license information.

from iris_api.custom_import import import_custom_module
from iris.custom_import import import_custom_module
from collections import defaultdict
import logging
import itertools
Expand All @@ -19,12 +19,12 @@ class IrisVendorException(Exception):


def init_vendors(vendors, application_vendors):
applications = {application_cls.name: application_cls for application_cls in (import_custom_module('iris_api.applications', application) for application in application_vendors)}
applications = {application_cls.name: application_cls for application_cls in (import_custom_module('iris.applications', application) for application in application_vendors)}

vendor_instances = defaultdict(list)
app_vendor_instances = defaultdict(lambda: defaultdict(list))
for vendor_config in vendors:
vendor_cls = import_custom_module('iris_api.vendors', vendor_config['type'])
vendor_cls = import_custom_module('iris.vendors', vendor_config['type'])
for mode in vendor_cls.supports:
vendor_instances[mode].append(vendor_cls(copy.deepcopy(vendor_config)))
for application_name, application_cls in applications.iteritems():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See LICENSE in the project root for license information.

import logging
from iris_api.constants import EMAIL_SUPPORT, IM_SUPPORT, CALL_SUPPORT, SMS_SUPPORT, SLACK_SUPPORT
from iris.constants import EMAIL_SUPPORT, IM_SUPPORT, CALL_SUPPORT, SMS_SUPPORT, SLACK_SUPPORT

logger = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import logging
import requests
import time
from iris_api.constants import SLACK_SUPPORT
from iris.constants import SLACK_SUPPORT

logger = logging.getLogger(__name__)

Expand Down
Loading

0 comments on commit f2c3752

Please sign in to comment.