This project is used to run scripts on distributed network with parallel execution
Basically workflow consists of several simple steps:
- Creating DigitalOcean droplets (
Server
class model in project code) with specified count. Count of servers depends of tasks. Some projects has a small number of rspec files, so 1-5 droplets is enough Some of them got 10000s of specs and requires 10s of droplets - Adding
rspec
files from project to test list with specified parameters (testing server url, language, browser, etc...) - Each of those
rspec
files are run on one of droplets, chosen from free one in queue - After each of
rspec
files are finished - servers can be turn-off manually or via non-active timeout (Default 1 hour)
-
Start docker container with disposable database:
docker run --rm \ --name wrata-debug-psql \ -e POSTGRES_HOST_AUTH_METHOD=trust \ -e POSTGRES_USER=postgres \ -e POSTGRES_DB=wrata_development \ -d \ -p 5432:5432 \ postgres
-
Run DB migrations:
ENV=develoment rake db:create db:migrate db:seed
-
Start Rails debug session in RubyMine. Set
RAILS_MASTER_KEY
env correctly. -
Open
http://localhost:3000
in browser and create new admin with username fromconfig/credentials.yml.enc
-
Do your debug
-
After debug is done stop DB. It automatically removed after stop:
docker stop wrata-debug-psql
This should be done after ~1 hour after merging PR to master
Because this task
will create docker hub image with name onlyoffice/wrata:latest
and this task is not very fast
git pull --prune
docker compose pull app
docker compose up -d
This config is stored in config/credentials.yml.enc
file, encrypted
To edit stored data you should create file config/master.key
with secret word
specified secure password storage
(search password file by config/master.key
)
And after that call bin/rails credentials:edit
to edit secret file,
to add or remove values
Example of file layout is:
secret_key_base: key # secret key
github_user: user # user of github to fetch projects
github_password: pass # password of user
ssh_user: user # username for node
ssh_pass: pass # password for node
admin_emails:
- email1@domain1.com
- email2@domain.com
By default this repo require SSL certificates to work.
./certs/tls.crt
and ./certs/tls.key
should
exists on your host, outside docker
You can disable it by changing nginx.conf
docker-compose stop
docker-compose rm web
docker-compose pull web
docker-compose up -d
docker-compose exec db pg_dumpall -c -U postgres | gzip > dump_$(date +"%Y-%m-%d_%H_%M_%S").gz
docker-compose stop app
zcat dump*.gz | docker exec -i testing-wrata_db_1 psql -U postgres
docker-compose start app
Admin account is account that have same name as email in admin_emails
list in secrets
Admin account is different in two ways:
- Admin can add new users to wrata via
https://wrata-url/clients
page - Admin email receive notifications about with some failure information which includes:
spec_no_tests_executed_email
- this mean some rspec do not output any result. Usually this mean something is not properly configure. For example spec contains not a singleit
spec_failed_email
- this mean spec failed mid-execution. Usually this is a networking error and simple restart ofspec
can help- All other failures - this is some bad code. Sometimes then creating Droplet in DigitalOcean - DO servers return 500 instead of creating ones. Usually fixed by restarting create process
- For
uninitialized constant HtmlWithPassedTime (NameError)
error in logs you should addrspec_passed_time_formatter
gem dependency in project file.
Since #857 - High SQL storage usage - this is normal, because we store all logs in database
and they are not deleted automatically.
You can delete them manually by logging as active user, going toProfile
->Run history
->Clear history
.
After that you should wait some time for postgres to delete all data or triggerVACUUM
manually - node is hangup on creation
Usually this happens when DigitalOcean return 500 error on server creation.
It's out of our control, you only can recover in this situation
First via DigitalOcean control panel check status of this server (is it created or not)
Usually it will be already created (if not - just change wrata status todestroyed
) Next open https://wrata-url/servers, find the node in question and change it's status to 'created'
After that usually self-destruction mechanism triggered due to known problem, and server will be destroyed automatically
After that recreate server as usual, via Create button or REST API
- Update
VERSION
file - Update
CHANGELOG.md
by adding version line aftermaster (unreleased)
- Create PR with those changes and merge to
master
- On
master
runrake add_repo_tag
- On
GitHub
create new release via web-browser and add info fromCHANGELOG.md