C4SCIENCE ========= * Ansible playbook for git infrastructure on openstack INSTALL ------- * Dependencies. You need ansible >= 2.0 ``` cd ~ git clone https://github.com/ansible/ansible.git cd ansible git submodule update --init --recursive sudo python setup.py install sudo pip install shade sudo apt-get install python-nova ``` * Repo ``` git clone repourl c4science cd c4science git submodule update --init --recursive ``` USAGE ----- * How to use, ``` make status #list instances make up #create instances make clean #destroy instances ``` * You must configure SSH so the connections go trough the jump server ~/.ssh/config ``` Host 86.119.28.215 HostName c4science-jump01 User centos StrictHostKeyChecking no UserKnownHostsFile=/dev/null Host 10.0.* User centos ProxyCommand ssh c4science-jump01 nc %h %p StrictHostKeyChecking no UserKnownHostsFile=/dev/null ``` ``` echo '86.119.28.215 c4science-jump01' >> /etc/hosts ``` * You must first create a floating IP and put in external_ip * You must create a Switch Engines bucket * see https://help.switch.ch/engines/documentation/s3-like-object-storage/ ``` ./s3cmd mb s3://phabricator ``` * You have to copy ssh hostkeys for app servers, so they are all the same ``` rsync -av c4science-app01:/etc/ssh/ssh_host_*_key /tmp/ rsync -av /tmp/ssh_host_*_key c4science-app0X:/etc/ssh/ ssh c4science-app0X 'service sshd_phabricator restart' ``` TODO ---- * Backup * Shibboleth auth * Integrate jenkins with Phabricator OAuth server (see the bitbucket implementation) * Service monitoring * Haproxy redundancy using keepalived https://raymii.org/s/articles/Building_HA_Clusters_With_Ansible_and_Openstack.html * Run tests on jenkins slave not on the master (use Swarm plugin?) TEST ---- * Replication information ``` mysql -e "SHOW STATUS LIKE 'wsrep_cluster%';" ``` * Some benchmarking examples, ``` ## GIT Read cd /tmp parallel -j 10 git clone ssh://git@86.119.28.215:1234/diffusion/TESTA/test.git \ -- $(for i in $(seq 20); do echo test$i; done) 1> /dev/null ``` ``` ## Conduit API (create repo from remote) REPO=$(echo {A..Z}) # Create some repositories for i in $REPO; do echo "{\"name\":\"test\", \"callsign\": \"TEST$i\", \"vcs\": \"git\", \"uri\": \"https://git.epfl.ch/repo/repo-test.git\"}" \ | arc call-conduit repository.create done # Clone them (doesnt work) #cd /tmp #for i in $REPO; do # git clone ssh://git@86.119.28.215:1234/diffusion/TEST$i/test.git test$i #done # Test commit and push #parallel -i -j 10 sh -c 'cd test{}; echo "TEST" > README.md; git commit -am "test"; git push' -- $(echo $REPO) ``` ``` ## GIT test lock parallel -i -j 2 sh -c 'cd test{}; git pull; echo "* TEST" >> README.md; git commit -am "test"; git push' -- $(seq 50) ``` ``` ## HTTP ab -C phsid:cz27psxxn2zjxtkw4v2tokhbjy4ix2lrifj6exm3 -C phusr:admin -n 1000 \ -c 10 http://86.119.28.215/diffusion/TESTA/repository/master/ ```