Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor buildout structure using profiles #71

Open
wants to merge 2 commits into
base: auctions
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
152 changes: 0 additions & 152 deletions base.cfg

This file was deleted.

4 changes: 3 additions & 1 deletion buildout.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[buildout]
index = https://pypi.python.org/simple
extends = development.cfg
extends =
profiles/development.cfg
profiles/templates.cfg
package-name +=
openprocurement.schemas.dgf
schematics-flexible
Expand Down
92 changes: 92 additions & 0 deletions profiles/base.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
[buildout]
extensions = mr.developer
package-name =
openprocurement.api
openprocurement.chronograph
openprocurement.concord
openprocurement.auctions.flash
openprocurement.auctions.core
openprocurement.auctions.dgf
openprocurement.auctions.insider
auto-checkout = ${:package-name}
parts =
scripts
couchpy
circus
circusd
circusctl
circus.ini
couchdb.ini
openprocurement.api.ini
chronograph.ini
openprocurement.concord
eggs =
chaussette
request_id_middleware
server_cookie_middleware
${:package-name}
find-links =
http://op:[email protected]/op/

index = https://pypi.python.org/simple

[config-from-template]
recipe = collective.recipe.template[genshi]:genshi
input = ${buildout:directory}/templates/${:_buildout_section_name_}
output = ${buildout:directory}/etc/${:_buildout_section_name_}

[scripts]
recipe = zc.recipe.egg
eggs = ${buildout:eggs}
interpreter = python
scripts = chaussette

[circus]
recipe = zc.recipe.egg
eggs =
circus
circus-web
interpreter =
scripts =
circusd-stats
circus-top
circus-plugin
circushttpd

[couchpy]
<=circus
eggs = CouchDB
scripts =
couchpy
couchdb-replicate

[circusd]
<=circus
initialization =
sys.argv[1:1] = ('${buildout:directory}/etc/circus.ini').split()
scripts = circusd

[circusctl]
<=circus
initialization =
sys.argv[1:1] = ('--endpoint ${circus.ini:endpoint}').split()
scripts = circusctl

[logrotate-hourly]
recipe = z3c.recipe.usercrontab
times = @hourly
command = /usr/sbin/logrotate --state ${buildout:directory}/var/logrotate.status ${logrotate.conf:output} >>${buildout:directory}/var/log/logrotate.log 2>&1

[awscli]
recipe = zc.recipe.egg
scripts = aws

[openprocurement.concord]
recipe = zc.recipe.egg
entry-points = concord=openprocurement.concord.daemon:main
arguments = '${openprocurement.api.ini:couchdb_url}', '${openprocurement.api.ini:couchdb_db}', '${buildout:directory}/var/${:_buildout_section_name_}.status', '${buildout:directory}/var/${:_buildout_section_name_}'

[autostart]
recipe = z3c.recipe.usercrontab
times = @reboot
command = ${buildout:directory}/bin/circusd --daemon --pidfile ${buildout:directory}/circus.pid
7 changes: 6 additions & 1 deletion development.cfg → profiles/development.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
[buildout]
extends = base.cfg versions.cfg
extends =
base.cfg
sources.cfg
versions.cfg
parts += docs

auto-checkout = ${:package-name}
show-picked-versions = true
update-versions-file = versions.cfg

Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 6 additions & 2 deletions preview.cfg → profiles/preview.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
[buildout]
extends = base.cfg journal.cfg versions.cfg
extends =
base.cfg
journal.cfg
sources.cfg
versions.cfg
parts +=
logrotate.conf
logrotate-hourly
Expand All @@ -9,7 +13,7 @@ parts +=
[circus.ini]
webapp = true
concord =
statsd = False
statsd =
# log_size = 134217728
# backup_count = 5

Expand Down
13 changes: 8 additions & 5 deletions production.cfg → profiles/production.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[buildout]
extends = base.cfg journal.cfg versions.cfg
extensions =
extends =
base.cfg
journal.cfg
sources.cfg
versions.cfg
parts +=
logrotate.conf
logrotate-hourly
Expand All @@ -9,13 +12,13 @@ parts +=

[circus.ini]
webapp = True
statsd = False
httpd = False
statsd =
httpd =
# httpd_host = localhost
# httpd_port = 8080
# log_size = 134217728
# backup_count = 5
concord = False
concord =

[logrotate.conf]
logs_bucket = openprocurement-logs
Expand Down
17 changes: 17 additions & 0 deletions profiles/sources.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[buildout]
auto-checkout = ${:package-name}


[remotes]
gh=https://github.com/
[email protected]:


[sources]
openprocurement.api = git ${remotes:gh}openprocurement/openprocurement.api.git pushurl=${remotes:gh_push}openprocurement/openprocurement.api.git branch=ea_master
openprocurement.auctions.core = git ${remotes:gh}openprocurement/openprocurement.auctions.core.git pushurl=${remotes:gh_push}openprocurement/openprocurement.auctions.core.git
openprocurement.auctions.flash = git ${remotes:gh}openprocurement/openprocurement.auctions.flash.git pushurl=${remotes:gh_push}openprocurement/openprocurement.auctions.flash.git
openprocurement.auctions.dgf = git ${remotes:gh}openprocurement/openprocurement.auctions.dgf.git pushurl=${remotes:gh_push}openprocurement/openprocurement.auctions.dgf.git
openprocurement.auctions.insider = git ${remotes:gh}openprocurement/openprocurement.auctions.insider.git pushurl=${remotes:gh_push}openprocurement/openprocurement.auctions.insider.git branch=premaster
openprocurement.chronograph = git ${remotes:gh}openprocurement/openprocurement.chronograph.git pushurl=${remotes:gh_push}openprocurement/openprocurement.chronograph.git branch=auctions_dev
openprocurement.concord = git ${remotes:gh}openprocurement/openprocurement.concord.git pushurl=${remotes:gh_push}openprocurement/openprocurement.concord.git
60 changes: 60 additions & 0 deletions profiles/templates.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[buildout]
parts +=
circus.ini
couchdb.ini
openprocurement.api.ini
chronograph.ini

[config-from-template]
recipe = collective.recipe.template[genshi]:genshi
input = ${buildout:directory}/templates/${:_buildout_section_name_}
output = ${buildout:directory}/etc/${:_buildout_section_name_}

[circus.ini]
<= config-from-template
couchdb = True
concord = True
penstock =
statsd = True
webapp = True
web_port = 6543
web_host = 0.0.0.0
chronograph = True
chronograph_port = 6544
chronograph_host = 0.0.0.0
endpoint = ipc://${buildout:directory}/var/circus_endpoint
pubsub_endpoint = ipc://${buildout:directory}/var/circus_pubsub
timezone = Europe/Kiev

[couchdb.ini]
<= config-from-template
port = 5984
host = 127.0.0.1

[openprocurement.api.ini]
<= config-from-template
couchdb_url = http://${couchdb.ini:host}:${couchdb.ini:port}/
couchdb_db = openprocurement
debug = false
auth_file = ${buildout:directory}/auth.ini
exc_logger = 1
plugins = flash
aws_access_key = access
aws_s3_bucket = bucker_s3
aws_secret_key = secret

[chronograph.ini]
<= config-from-template
couchdb_db = openprocurement_chronograph
debug = false
api_url = http://${circus.ini:web_host}:${circus.ini:web_port}/api/0.6/
callback_url = http://${circus.ini:chronograph_host}:${circus.ini:chronograph_port}/
jobstore_db = sqlite:///${buildout:directory}/var/jobs.sqlite
exc_logger = 1

[logrotate.conf]
<= config-from-template
logs_bucket =
logs_dir =
aws_access_key = ${openprocurement.api.ini:aws_access_key}
aws_secret_key = ${openprocurement.api.ini:aws_secret_key}
File renamed without changes.