diff --git a/README.md b/README.md index a2112a9..15b31e9 100644 --- a/README.md +++ b/README.md @@ -1,175 +1,175 @@ c4science.ch ========= * 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 python-novaclient ``` * Repo ``` git clone repourl c4science.ch cd c4science.ch 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.ch-jump01 User centos StrictHostKeyChecking no UserKnownHostsFile=/dev/null Host 10.0.* User centos ProxyCommand ssh c4science.ch-jump01 nc %h %p StrictHostKeyChecking no UserKnownHostsFile=/dev/null ``` ``` echo '86.119.28.215 c4science.ch-jump01' >> /etc/hosts ``` * You must create floating IPs * One on region_main and put it in external_ip in vars/main.yml * One on region_back and put it in backup_ip in vars/main.yml * 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.ch-app01:/etc/ssh/ssh_host_*_key /tmp/ rsync -av /tmp/ssh_host_*_key c4science.ch-app0X:/etc/ssh/ ssh c4science.ch-app0X 'service sshd_phabricator restart' ``` Build the Jenkins slave docker image ------------------------------------ * On a slave ``` docker pull evarga/jenkins-slave docker run -i -t evarga/jenkins-slave /bin/bash ``` * On the docker image ``` apt-get update -apt-get install bash-completion build-essential git subversion mercurial +apt-get install bash-completion build-essential cmake git subversion mercurial apt-get clean mkdir /home/jenkins/workspace chown jenkins.jenkins /home/jenkins/workspace exit ``` * On a slave ``` docker images docker commit IMAGEID jenkins-1 docker rm $(docker ps -a -q) ``` TODO ---- * Shibboleth auth * Integrate jenkins with Phabricator OAuth server (see the bitbucket implementation) * 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?) * Use coreos, https://coreos.com/os/docs/latest/customizing-docker.html TEST ---- * Replication information ``` mysql -e "SHOW STATUS LIKE 'wsrep_cluster%';" ``` * Some benchmarking examples, ``` ## GIT Read cd /tmp parallel -j 10 git clone ssh://git@c4science.ch:2222/diffusion/TEST/test.git \ -- $(for i in $(seq 20); do echo test$i; done) 1> /dev/null ``` ## GIT Write sequential ``` cd /tmp git clone ssh://git@c4science.ch:2222/diffusion/TEST/test.git for i in {1..10}; do time sh -c "echo 'test' >> README.md; git commit -am 'test'; git push" &>/dev/null done ``` ``` ## 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@c4science.ch:2222/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 5 sh -c 'cd test{}; git pull --no-edit; git commit -am "merge conflicts"; echo "* TEST" >> README.md; git commit -am "test"; git push || git pull --no-edit; git push' -- $(seq 50) ``` ``` ## HTTP ab -C phsid:cz27psxxn2zjxtkw4v2tokhbjy4ix2lrifj6exm3 -C phusr:admin -n 1000 \ -c 10 http://86.119.28.215/diffusion/TEST/repository/master/ ```