Skip to content
Snippets Groups Projects
Commit a39cb284 authored by Bartek Wrona's avatar Bartek Wrona
Browse files

Separated hive sync process from hive server - splitted into 2 separate jobs...

Separated hive sync process from hive server - splitted into 2 separate jobs to make possible running them independently (i.e. just restart rebuilt server without sync)
parent 6db0e76c
No related branches found
No related tags found
4 merge requests!456Release candidate v1 24,!230Setup monitoring with pghero,!135Enable postgres monitoring on CI server,!38Hivemind ci separate sync
......@@ -12,6 +12,16 @@ variables:
GIT_STRATEGY: clone
GIT_SUBMODULE_STRATEGY: recursive
HIVEMIND_SOURCE_HIVED_URL: $HIVEMIND_SOURCE_HIVED_URL
HIVEMIND_DB_NAME: "${hive_$CI_COMMIT_REF_SLUG/-/_}"
HIVEMIND_HTTP_PORT: $HIVEMIND_HTTP_PORT
# Configured at gitlab repository settings side
POSTGRES_USER: $HIVEMIND_POSTGRES_USER
POSTGRES_PASSWORD: $HIVEMIND_POSTGRES_PASSWORD
POSTGRES_HOST_AUTH_METHOD: trust
# official way to provide password to psql: http://www.postgresql.org/docs/9.3/static/libpq-envars.html
PGPASSWORD: $HIVEMIND_POSTGRES_PASSWORD
DB_URL: "$HIVEMIND_POSTGRESQL_CONNECTION_STRING/$HIVEMIND_DB_NAME"
PYTHONUSERBASE: ./local-site
before_script:
......@@ -38,7 +48,7 @@ hivemind_build:
tags:
- hivemind
hivemind_deploy:
hivemind_sync:
stage: deploy
environment: hive-4.pl.syncad.com
needs:
......@@ -46,17 +56,8 @@ hivemind_deploy:
artifacts: true
variables:
GIT_STRATEGY: none
HIVEMIND_DB_NAME: "hive_$CI_JOB_ID"
HIVEMIND_HTTP_PORT: $HIVEMIND_HTTP_PORT
# Configured at gitlab repository settings side
POSTGRES_USER: $HIVEMIND_POSTGRES_USER
POSTGRES_PASSWORD: $HIVEMIND_POSTGRES_PASSWORD
POSTGRES_HOST_AUTH_METHOD: trust
# official way to provide password to psql: http://www.postgresql.org/docs/9.3/static/libpq-envars.html
PGPASSWORD: $HIVEMIND_POSTGRES_PASSWORD
DB_URL: "$HIVEMIND_POSTGRESQL_CONNECTION_STRING/hive_$CI_JOB_ID"
PYTHONUSERBASE: ./local-site
HIVEMIND_MAX_BLOCK: 50000
script:
- ls -l dist/*
......@@ -70,13 +71,34 @@ hivemind_deploy:
- "echo Attempting to starting hive sync using hived node: $HIVEMIND_SOURCE_HIVED_URL . Max sync block is: $HIVEMIND_MAX_BLOCK"
- echo Attempting to access database $DB_URL
- ./local-site/bin/hive sync --test-max-block=$HIVEMIND_MAX_BLOCK --exit-after-sync --test-profile=False --steemd-url "$HIVEMIND_SOURCE_HIVED_URL" --database-url $DB_URL 2>&1 | tee -i hivemind-sync.log
artifacts:
paths:
- hivemind-sync.log
- hive_server.pid
expire_in: 1 week
tags:
- hivemind
hivemind_start_server:
stage: deploy
environment: hive-4.pl.syncad.com
needs:
- job: hivemind_build
artifacts: true
variables:
GIT_STRATEGY: none
script:
- echo Attempting to start hive server listening on $HIVEMIND_HTTP_PORT port...
- if [ -f hive_server.pid ]; then kill -SIGINT `cat hive_server.pid` fi;
- rm -f hive_server.pid
- screen -L -Logfile hive_server.log -dmS hive_server_$CI_JOB_ID ./local-site/bin/hive server --pid-file hive_server.pid --http-server-port $HIVEMIND_HTTP_PORT --steemd-url "$HIVEMIND_SOURCE_HIVED_URL" --database-url $DB_URL
- for i in `seq 1 10`; do if [ -f hive_server.pid ]; then break; else sleep 1; fi; done
- cat hive_server.pid
artifacts:
paths:
- hivemind-sync.log
- hive_server.log
- hive_server.pid
expire_in: 1 week
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment