From 49d3be991d33fb40f555baac90f96b6826286789 Mon Sep 17 00:00:00 2001 From: Manuel Kiessling Date: Mon, 23 Nov 2015 21:11:19 +0100 Subject: [PATCH] README, new secure TravisCI token, analyze env --- .travis.yml | 2 +- README.md | 2 +- puppet/hieradata/env/prod.yaml | 11 +++++++---- puppet/modules/app-analyze/manifests/init.pp | 4 ++-- .../templates/etc/cron.d/journeymonitor-analyze.erb | 4 ++-- .../etc/journeymonitor/app-analyze-env.sh.erb | 4 ++++ 6 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index fe524d0..eb1ebe4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ env: global: - - secure: "C0WoPkDpXkb1fXXkawihKS4koFgbgQI3U0IwfKZ2AJsIPRN1yp4f2BzLGsIZpSF4yIPiFIbH6cJwS3K5xaWlSrTP+6ZXdMCl4K7LiGf5RwsZIOgwViYCqdmlJWHfT9kKbBb1nTZMSzK2Ss36QE8qJ+XMJLgQvRzHr70s9oW9MhwPmqWBwqr7lRuDopsbhJQr0Sm7nDT/JG4vng2Af0d8RIi1v4zGKlZIMC26TlPPAxDcJsFRvNBRJvlEGX3/zFQGY+QGW5v6IS3ueSP6IGA56C4LwcjWLQANmCjhXJctsfICQzOr2m0/rZ7OP1TUalgZZz+la2ZvVizYfSQWQLa0NucwzNYp8MH6kAfw+krBHaSQh3KTZwE01ZifIiUmWghxrIemIw/bi0zDpkLtsXvyIEslry0DY7hMynv5hnJPnFSmjKRyv0ubH2FyunUO0tdlnoe+M93vDawq2v1qViocWlll34xnYyL+10HP/KevL1kXsRdIPeG6GhJyGhT3okbMWBuTteLi5aLESBn6ARKY6UbBj87vk5okc/8BcaQO4Rt9z99EqtJVNGDjhXnC/qJotT8JZurXFoHPEoRNoaay8RNA6zoyOaAOPbgR7HpT4qp7V3RLRmrFVkuKd3kMQQrhClIwYLgqQlxGAX6FX4gMoKA83FKBKlM63eBAyL1m4js=" + - secure: "sEd5Lc6iZHvsDs8H+OWYF4wm08JHgtf5xdO4vhjUmHLMZQePFXBj0r739Zf7HtGESdepyYqtV+m4+ylwSGh36hIChgADh6gprtG8eLSjrnQfCbOSvTQpsJV+/4DNI6gF3Om9ELREavoll/Zi6SVbETKZWbgEmOGewQdU7jcgQ+lwhOnSSEoKgRTIihaotwCYM2bDXvW/0ErCANx3Vm+X2C2d47ChAMjPm18oBHvA2Dc78goWFN9DucXFWFfNiNZZqKeKwu6NuV+W8pUnfGr3qQSFqxdl4kfFkccNtWR99BZ/Xss+KAfM4NgH8lQAfS1m2Z8KJRUQq4tyNaqABqkW9wTswLSlS1oaGaUChC7+etliVNR4O+CJu67XWubAze99uKTHgcQk3zLbham4Od3i+oA7ShYSpi204jiYe4rLL+DSwfWplvD1/5TWWSchIFvLF5FapbAeKMyTsAPZAzM3aJS8DqER588Pni81FvpjnooBTDw4JJmJMdTO94fs8X56HLs4EcwIYwKkS1L0daEq8J7bBnwUv6vWxFA9oTlooWh798WwPu+NoV0K3KmQjy5r7dBzJ3qoicHFCuRRxbGpvqTixs/v/12uatmuu5XVCuo/tIhtqIl342nXYthjb4WZAhyhy7wkHUxjDpDeMLidbWxcZBGZb4oBkFGa3O4X4c0=" branches: only: - master diff --git a/README.md b/README.md index c334eae..f0554d2 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ systems at http://journeymonitor.com. - At https://github.com/settings/tokens, generate a new token with *public_repo* and *repo_deployment* rights - Copy the newly generated token to the clipboard - Install the *travis* gem via `sudo gem install travis` -- Go to the root folder of each repository clone (*infra*, *control*, and *monitor*), and run +- Go to the root folder of each repository clone (*infra*, *control*, *monitor*, and *analyze*), and run `travis encrypt GITHUB_TOKEN=` - Add the resulting *secure* line to the `.travis.yml` file of the according repository, like so: diff --git a/puppet/hieradata/env/prod.yaml b/puppet/hieradata/env/prod.yaml index eb8e46e..06c3214 100644 --- a/puppet/hieradata/env/prod.yaml +++ b/puppet/hieradata/env/prod.yaml @@ -1,11 +1,14 @@ --- +# The following are used in certain Puppet manifests, but never in app environments spark-slave::master_address: service-misc-experiments-1 cassandra::cluster_name: JourneyMonitorProd cassandra::seed_nodes: 10.31.32.82,10.31.32.83,10.31.32.84 -app-analyze::cassandra_address: 10.31.32.82 +app-analyze::cassandra_cqlsh_host: &cassandra_cqlsh_host 10.31.32.82 +app-monitor::api:allowed_ips: + - 80.69.33.177 # net-lab experiments systems come from this address +# The following are used in app environments (see env-mgmt module), but never in Puppet manifests +env::cassandra:cqlsh_host: *cassandra_cqlsh_host env::cassandra:uri:analyze_keyspace: cassandra://10.31.32.82:9042/analyze?host=10.31.32.83&host=10.31.32.84 +env::cassandra:uri:test_keyspace: cassandra://10.31.32.82:9042/analyze?host=10.31.32.83&host=10.31.32.84 env::endpoint:monitor_api: http://journeymonitor.com:8081/ - -app-monitor::api:allowed_ips: - - 80.69.33.177 # net-lab experiments systems come from this address diff --git a/puppet/modules/app-analyze/manifests/init.pp b/puppet/modules/app-analyze/manifests/init.pp index 6d5ebcc..0699fc4 100644 --- a/puppet/modules/app-analyze/manifests/init.pp +++ b/puppet/modules/app-analyze/manifests/init.pp @@ -1,7 +1,7 @@ # Additional stuff for satisfying the requirements # for running the ANALYZE applications -class app-analyze ($cassandra_address = "localhost") { +class app-analyze ($cassandra_cqlsh_host = "localhost") { require cassandra::packages @@ -15,7 +15,7 @@ # TODO: This will fail if applied before the C* cluster runs exec { "create analyze cassandra keyspace": - command => "/usr/bin/cqlsh ${cassandra_address} -e \"CREATE KEYSPACE IF NOT EXISTS analyze WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 3 };\"", + command => "/usr/bin/cqlsh ${cassandra_cqlsh_host} -e \"CREATE KEYSPACE IF NOT EXISTS analyze WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 3 };\"", require => Class["cassandra::packages"] } diff --git a/puppet/modules/cronjobs/templates/etc/cron.d/journeymonitor-analyze.erb b/puppet/modules/cronjobs/templates/etc/cron.d/journeymonitor-analyze.erb index 02bad83..904edce 100644 --- a/puppet/modules/cronjobs/templates/etc/cron.d/journeymonitor-analyze.erb +++ b/puppet/modules/cronjobs/templates/etc/cron.d/journeymonitor-analyze.erb @@ -2,7 +2,7 @@ MAILTO="" <% if @env == "prod" %> -# analyze prod entries +#* * * * * root /opt/simplecd/simplecd.sh tag travisci-build-master-* https://github.com/journeymonitor/analyze.git https://github.com/journeymonitor/analyze/commit/ | while IFS= read -r line;do echo "$(date) $line";done >> /var/tmp/simplecd/journeymonitor-analyze.log 2>&1 <% end %> -#* * * * * journeymonitor /usr/bin/curl <%= scope.function_hiera(['env::endpoint:monitor_api']) %> -o <%= scope.function_hiera(['app-analyze::testresults_cache_path']) %> && source /etc/journeymonitor/app-analyze-env.sh && /usr/bin/java -jar /opt/journey.. <%= scope.function_hiera(['app-analyze::testresults_cache_path']) %> +#*/5 * * * * journeymonitor /usr/bin/curl <%= scope.function_hiera(['env::endpoint:monitor_api']) %> -o <%= scope.function_hiera(['app-analyze::testresults_cache_path']) %> && source /etc/journeymonitor/app-analyze-env.sh && /usr/bin/java -jar /opt/journeymonitor/analyze/journeymonitor-analyze-importer-assembly.jar <%= scope.function_hiera(['app-analyze::testresults_cache_path']) %> diff --git a/puppet/modules/env-mgmt/templates/etc/journeymonitor/app-analyze-env.sh.erb b/puppet/modules/env-mgmt/templates/etc/journeymonitor/app-analyze-env.sh.erb index 553eb31..5986ce4 100644 --- a/puppet/modules/env-mgmt/templates/etc/journeymonitor/app-analyze-env.sh.erb +++ b/puppet/modules/env-mgmt/templates/etc/journeymonitor/app-analyze-env.sh.erb @@ -5,3 +5,7 @@ export JOURNEYMONITOR_ANALYZE_IMPORTER_CASSANDRAURI="<%= scope.function_hiera(['env::cassandra:uri:analyze_keyspace']) %>" export JOURNEYMONITOR_ANALYZE_SPARK_CASSANDRAURI="<%= scope.function_hiera(['env::cassandra:uri:analyze_keyspace']) %>" + +export JOURNEYMONITOR_ANALYZE_SPARK_CASSANDRAURI_TEST="<%= scope.function_hiera(['env::cassandra:uri:test_keyspace']) %>" + +export JOURNEYMONITOR_ANALYZE_SPARK_CASSANDRA_CQLSH_HOST="<%= scope.function_hiera(['env::cassandra:cqlsh_host']) %>"