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

Sandbox 2.4 #56

Open
wants to merge 14 commits into
base: production
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
1 change: 0 additions & 1 deletion aws_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,3 @@

with open(api_ini_file_path, 'wb') as configfile:
config.write(configfile)

183 changes: 0 additions & 183 deletions base.cfg
Original file line number Diff line number Diff line change
@@ -1,183 +0,0 @@
[buildout]
extensions = mr.developer
package-name =
openprocurement.api
openprocurement.concord
openprocurement.planning.api
openprocurement.tender.limited
openprocurement.tender.openua
openprocurement.tender.openeu
openprocurement.contracting.api
openprocurement.tender.openuadefense
openprocurement.tender.competitivedialogue
openprocurement.circus.plugins
openprocurement.subscribers.serverid

auto-checkout = ${:package-name}
parts =
scripts
couchpy
circus
circusd
circusctl
circus.ini
couchdb.ini
openprocurement.api.ini
openprocurement.concord
shredder
eggs =
chaussette
request_id_middleware
server_cookie_middleware
${:package-name}
find-links =
http://op:x9W3jZ@dist.quintagroup.com/op/

[remotes]
gh = https://github.com/
gh_push = git@github.com:
opgh = ${remotes:gh}openprocurement/openprocurement
opgh_push = ${remotes:gh_push}openprocurement/openprocurement

[sources]
openprocurement.api = git ${remotes:opgh}.api.git pushurl=${remotes:opgh_push}.api.git branch=scale_2_0
openprocurement.concord = git ${remotes:opgh}.concord.git pushurl=${remotes:opgh_push}.concord.git
openprocurement.planning.api = git ${remotes:opgh}.planning.api.git pushurl=${remotes:opgh_push}.planning.api.git
openprocurement.tender.limited = git ${remotes:opgh}.tender.limited.git pushurl=${remotes:opgh_push}.tender.limited.git
openprocurement.tender.openua = git ${remotes:opgh}.tender.openua.git pushurl=${remotes:opgh_push}.tender.openua.git
openprocurement.tender.openeu = git ${remotes:opgh}.tender.openeu.git pushurl=${remotes:opgh_push}.tender.openeu.git
openprocurement.contracting.api = git ${remotes:opgh}.contracting.api.git pushurl=${remotes:opgh_push}.contracting.api.git
openprocurement.tender.openuadefense = git ${remotes:opgh}.tender.openuadefense.git pushurl=${remotes:opgh_push}.tender.openuadefense.git
openprocurement.tender.competitivedialogue = git ${remotes:opgh}.tender.competitivedialogue.git pushurl=${remotes:opgh_push}.tender.competitivedialogue.git
openprocurement.circus.plugins = git ${remotes:opgh}.circus.plugins.git pushurl=${remotes:opgh_push}.circus.plugins.git
openprocurement.subscribers.serverid = git ${remotes:opgh}.subscribers.serverid.git pushurl=${remotes:opgh_push}.subscribers.serverid.git

[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

[contracting_data_bridge]
recipe = zc.recipe.egg
eggs =
openprocurement.contracting.api [databridge]
scripts = contracting_data_bridge

[competitive_dialogue_data_bridge]
recipe = zc.recipe.egg
eggs =
openprocurement.tender.competitivedialogue [databridge]
scripts = competitive_dialogue_data_bridge

[circus]
recipe = zc.recipe.egg
eggs =
circus
circus-web
openprocurement.circus.plugins
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

[circus.ini]
<= config-from-template
couchdb = True
concord = True
penstock =
vaurien =
statsd = True
webapp = True
web_port = 6543
web_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

[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}

[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

[shredder]
recipe = collective.recipe.template
inline =
#!${buildout:bin-directory}/python
from couchdb import Server
from couchdb.design import ViewDefinition
from openprocurement.api.models import get_now
from datetime import timedelta
aserver = Server('http://${couchdb.ini:username}:${couchdb.ini:password}@${couchdb.ini:host}:${couchdb.ini:port}/')
adb = aserver['${openprocurement.api.ini:couchdb_db}']
server = Server('${openprocurement.api.ini:couchdb_url}')
db = server['${openprocurement.api.ini:couchdb_db}']
shredder_view = ViewDefinition('shredder', 'tenders', "function(doc){if(doc.doc_type=='Tender' && doc.status=='draft'){emit(doc.dateModified, doc._rev)}}")
ViewDefinition.sync_many(adb, [shredder_view])
date = (get_now() - timedelta(7)).isoformat()
tenders = []
for i in shredder_view(db, endkey=date):
tenders.append({'_id': i.id, '_rev': i.value, '_deleted': True})
print db.update(tenders)
output = ${buildout:bin-directory}/${:_buildout_section_name_}
mode = 755
3 changes: 3 additions & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
virtualenv --clear .
./bin/pip install -r requirements.txt
30 changes: 6 additions & 24 deletions buildout.cfg.example
Original file line number Diff line number Diff line change
@@ -1,26 +1,8 @@
[buildout]
extends = development.cfg


[openprocurement.api.ini]
couchdb_db = test




[couchdb.ini]
username =
password =
reader_username = reader_username
reader_password = reader_username

[circus.ini]
couchdb = True
webapp = True
chronograph = True
concord =
circusd-stats =
competitive_dialogue_data_bridge =
contracting_data_bridge =

extends =
profiles/devel.cfg
profiles/docs.cfg

[versions]
cffi = 1.4.1
cryptography = 1.2.3
34 changes: 0 additions & 34 deletions development.cfg

This file was deleted.

42 changes: 0 additions & 42 deletions production.cfg
Original file line number Diff line number Diff line change
@@ -1,42 +0,0 @@
[buildout]
extends = base.cfg journal.cfg versions.cfg
extensions =
parts +=
logrotate.conf
logrotate-hourly
awscli

[circus.ini]
webapp = True
statsd = False
contracting_data_bridge =
competitive_dialogue_data_bridge =
# log_size = 134217728
# backup_count = 5

[contracting_data_bridge.yaml]
tenders_api_server = https://lb.api.openprocurement.org
tenders_api_version = 2.3
contracting_api_server = https://lb.api.openprocurement.org
contracting_api_version = 2.3

[competitive_dialogue_data_bridge.yaml]
tenders_api_server = https://lb.api.openprocurement.org
tenders_api_version = 2.3

[logrotate.conf]
logs_bucket = openprocurement-logs

[versions]
openprocurement.api = 2.3.47
openprocurement.chronograph = 0.6.5
openprocurement.concord = 0.4
openprocurement.planning.api = 2.3.8
openprocurement.tender.limited = 2.3.24
openprocurement.tender.openeu = 2.3.30
openprocurement.tender.openua = 2.3.24
openprocurement.tender.openuadefense = 2.3.24
openprocurement.tender.competitivedialogue = 1.0.13
openprocurement.contracting.api = 2.3.20
openprocurement-client = 1.0b2
penstock = 0.2.0
Loading