dopr discontinued

This commit is contained in:
Kevin Fenzi 2016-03-30 18:05:52 +00:00
parent cdf5e610f4
commit 3a493b7da2
14 changed files with 0 additions and 333 deletions

View file

@ -124,8 +124,6 @@
- include: /srv/web/infra/ansible/playbooks/hosts/darkserver-dev.fedorainfracloud.org.yml
- include: /srv/web/infra/ansible/playbooks/hosts/data-analysis01.phx2.fedoraproject.org.yml
- include: /srv/web/infra/ansible/playbooks/hosts/developer.fedorainfracloud.org.yml
# currently doesn't complete
#- include: /srv/web/infra/ansible/playbooks/hosts/dopr-dev.cloud.fedoraproject.org.yml
- include: /srv/web/infra/ansible/playbooks/hosts/fas2-dev.fedorainfracloud.org.yml
- include: /srv/web/infra/ansible/playbooks/hosts/fas3-dev.fedorainfracloud.org.yml
# Temporarily disabled due to tests

View file

@ -1,36 +0,0 @@
#- name: clean known hosts
# hosts: dopr-stg
# remote_user: fedora
# sudo: True
# gather_facts: False
#
# tasks:
# - name: clean out old known_hosts for dopr-dev
# local_action: known_hosts path={{item}} host=dopr-dev.cloud.fedoraproject.org state=absent
# ignore_errors: True
# with_items:
# - /root/.ssh/known_hosts
# - /etc/ssh/ssh_known_hosts
# - name: clean out old known_hosts for dopr-dev ip
# local_action: known_hosts path={{item}} host=209.132.184.42 state=absent
# ignore_errors: True
# with_items:
# - /root/.ssh/known_hosts
# - /etc/ssh/ssh_known_hosts
- name: provision dopr dev instance
hosts: dopr-stg
gather_facts: True
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
roles:
- base
- dopr
handlers:
- include: "{{ handlers }}/restart_services.yml"

View file

@ -1,16 +0,0 @@
#!/usr/bin/bash
echo "befor"
cd ..
if [ -e /home/cdic/init_done ]; then
echo "db schema upgrade "
PYTHONPATH=cdic:$PYTHONPATH alembic upgrade head
else
echo "initiating db"
PYTHONPATH=.:$PYTHONPATH /usr/bin/python3 cdic/manage.py create_db -f alembic.ini
touch /home/cdic/init_done
fi
echo "after"
cd -

View file

@ -1,32 +0,0 @@
user nginx;
worker_processes 8;
error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type text/plain;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
gzip on;
include /etc/nginx/conf.d/*.conf;
}

View file

@ -1,17 +0,0 @@
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
location / {
# checks for static file, if not found proxy to app
try_files $uri @proxy_to_app;
}
location @proxy_to_app {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://127.0.0.1:8000;
}
}

View file

@ -1,13 +0,0 @@
local cdicdb cdic md5
host cdicdb cdic 127.0.0.1/8 md5
host cdicdb cdic ::1/128 md5
local cdicdb postgres ident
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 ident
# IPv6 local connections:
host all all ::1/128 ident

View file

@ -1,3 +0,0 @@
Host *
StrictHostKeyChecking no
UserKnownHostsFile /dev/null

View file

@ -1,21 +0,0 @@
[Unit]
Description=cdic async executor daemon
# Requires=postgresql.service # uncomment after added
# After=
# Requires=cdic_gunicorn.socket
After=network.target
[Service]
PIDFile=/var/run/cdic/pid_async
User=cdic
Group=cdic
WorkingDirectory=/home/cdic/server/cdic/src/cdic
Environment="PYTHONPATH=..:$PYTHONPATH"
# ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID
ExecStartPre=/usr/local/bin/cdic_update_db.sh
ExecStart=/usr/bin/python3 manage.py run_async_tasks
PrivateTmp=true
[Install]
WantedBy=multi-user.target

View file

@ -1,21 +0,0 @@
[Unit]
Description=gunicorn daemon
# Requires=postgresql.service # uncomment after added
# After=
Requires=cdic_async.service
After=cdic_async.service
After=network.target
[Service]
PIDFile=/var/run/cdic/pid
User=cdic
Group=cdic
WorkingDirectory=/home/cdic/server/cdic/src/cdic
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID
# ExecStartPre=/opt/cdic/_docker/first_run.sh
ExecStart=/usr/bin/python3-gunicorn --pid /run/cdic/pid app:app -b 0.0.0.0:8000
PrivateTmp=true
[Install]
WantedBy=multi-user.target

View file

@ -1 +0,0 @@
d /var/run/cdic 0755 cdic cdic -

View file

@ -1,5 +0,0 @@
---
- include: "{{ handlers }}/restart_services.yml"
- name: restart postgresql
service: name=postgresql state=restarted

View file

@ -1,100 +0,0 @@
# NB: dopr was initially called cdic
- name: install basic packages
dnf: state=present pkg={{ item }}
with_items:
- "tmux"
- "bash-completion"
- "dnf-plugins-core"
- "yum-utils"
- "libxslt-devel"
tags:
- packages
- name: enable our copr
command: "dnf copr enable -y msuchy/copr"
args:
creates: "/etc/yum.repos.d/_copr_msuchy-copr.repo"
- name: create cdic user
user: name="cdic"
- name: install dopr specific packages
dnf: state=present pkg={{ item }}
with_items:
- python3
- python3-pip
- python3-gunicorn
- git
- redis
- vim
- wget
- dnf-plugins-core
- python3-copr
- python3-psycopg2
- python-psycopg2 # for psql utils
- phantomjs
- nginx
- name: git clone casperjs
git: repo=git://github.com/n1k0/casperjs.git
dest=/opt/casperjs/
accept_hostkey=True
- name: install casperjs
file: src=/opt/casperjs/bin/casperjs
dest=/usr/bin/casperjs state=link mode=0755
- name: git clone cdic into the cdic home
git: repo=git://github.com/evilkost/cdic.git
dest=/home/cdic/server/cdic/
accept_hostkey=True
- name: install python requirements
pip: requirements=/home/cdic/server/cdic/requirements.txt executable=/usr/bin/pip3
- name: install systemd units
copy: src="systemd/{{ item }}" dest="/etc/systemd/system/"
with_items:
- "cdic_async.service"
- "cdic_gunicorn.service"
- command: "systemctl daemon-reload"
- name: install systemd tmpfiles
copy: src="tmpfiles.d/cdic_gunicorn.conf" dest="/etc/tmpfiles.d/"
# name: create working dirs
- file: path=/var/log/cdic state=directory mode=0755 owner=cdic group=cdic
- file: path=/var/lib/cdic state=directory mode=0755 owner=cdic group=cdic
- file: path=/var/lib/cdic/openid state=directory mode=0755 owner=cdic group=cdic
- file: path=/var/lib/cdic/wp state=directory mode=0755 owner=cdic group=cdic
- file: path=/var/run/cdic state=directory mode=0755 owner=cdic group=cdic
- file: path=/home/cdic/.config state=directory mode=0755 owner=cdic group=cdic
- name: copy cdic config
template: src="cdic.py" dest="/home/cdic/.config/cdic.py"
- copy: src="cdic_update_db.sh" dest="/usr/local/bin/" mode=0755
- file: path=/home/cdic/.ssh state=directory mode=0700 owner=cdic group=cdic
- name: copy ssh key for github
copy: src="{{private}}/files/dopr/github-testing" dest="/home/cdic/.ssh/id_rsa"
- copy: src="ssh_config" dest="/home/cdic/.ssh/config" owner=cdic group=cdic mode=0600
- include: "psql_setup.yml"
- name: Allow nginx to connect to upstream
seboolean: name=httpd_can_network_connect state=yes persistent=yes
# copy nginx config
- copy: src="nginx.conf" dest="/etc/nginx/nginx.conf"
- copy: src="nginx/cdic.conf" dest="/etc/nginx/conf.d/"
- name: enables services
service: state=running enabled=yes name={{ item }}
with_items:
- redis
- cdic_async
- cdic_gunicorn

View file

@ -1,46 +0,0 @@
- name: install postresql
yum: state=present pkg={{ item }}
with_items:
- "postgresql-server"
- "postgresql-contrib"
- name: mount up disk of postgres
mount: name=/srv/ src='LABEL=cdic-db' fstype=ext4 state=mounted
- name: mount up bind mount for postgres
mount: src=/srv/pgsqldb name=/var/lib/pgsql fstype=auto opts=bind state=mounted
- command: "ls -dZ /var/lib/pgsql"
register: pgsql_ls
- name: update selinux context for postgress db dir if it's wrong
command: "restorecon -vvRF /var/lib/pgsql"
when: pgsql_ls.stdout is defined and 'postgresql_db_t' not in pgsql_ls.stdout
- name: See if postgreSQL is installed
stat: path=/var/lib/pgsql/initdb.log
register: pgsql_installed
- name: init postgresql
shell: "postgresql-setup initdb"
when: not pgsql_installed.stat.exists
- name: copy pg_hba.conf
copy: src="pg_hba.conf" dest=/var/lib/pgsql/data/pg_hba.conf owner=postgres group=postgres mode=0600
notify:
- restart postgresql
tags:
- config
- name: enable Pg service
service: state=running enabled=yes name=postgresql
- name: Create db
postgresql_db: name="cdicdb" encoding='UTF-8'
become: yes
become_user: postgres
- name: Create db user
postgresql_user: db="cdicdb" name="cdic" password="{{ dopr_db_passwd }}" role_attr_flags=SUPERUSER,NOCREATEDB,NOCREATEROLE
become: yes
become_user: postgres

View file

@ -1,20 +0,0 @@
# coding: utf-8
DOCKERHUB_URL = 'https://hub.docker.com'
DOCKERREGISTRY_URL = 'https://registry.hub.docker.com'
DOCKERHUB_USERNAME = '{{ dopr_testing_dockerhub_username }}'
DOCKERHUB_PASSWORD = '{{ dopr_testing_dockerhub_password }}'
HUB_PROJECT_URL_TEMPLATE = 'http://registry.hub.docker.com/u/cdictest/{repo_name}'
GITHUB_TOKEN = '{{ dopr_testing_github_token }}'
GITHUB_USER = '{{ dopr_testing_github_username }}'
GITHUB_PASSWORD = '{{ dopr_testing_github_password }}'
GITHUB_API_ROOT = 'https://api.github.com'
SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://cdic:{{ dopr_db_passwd }}@localhost/cdicdb'
DATABASE_CONNECT_OPTIONS = {}
VAR_ROOT = '/var/lib/cdic'
OPENID_STORE = '/var/lib/cdic/openid'
CDIC_WORKPLACE = '/var/lib/cdic/wp'