-
Notifications
You must be signed in to change notification settings - Fork 0
Swarm CloudWatch #447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swarm CloudWatch #447
Changes from all commits
b452cf8
515b490
ebe527d
f648ef1
e4ca230
d43e66e
7eabe34
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| --- | ||
| name: swarm-cloudwatch-reporter | ||
|
|
||
| repo: git@github.com:CodeNow/furry-cactus.git | ||
| container_image: registry.runnable.com/runnable/{{ name }} | ||
| container_tag: "{{ git_branch }}" | ||
| node_version: lts | ||
| npm_version: 3 | ||
| do_not_push: true | ||
|
|
||
| log_driver: json-file | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this works for you?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. of course it does. I don't have things going to loggly. I could send them to loggly. if I just pipe my random json-ish output to standard out, would it just show up in loggly under my application's name as a tag? /cc @und1sk0
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it should, yes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OOO my bad, I missed that you are not using the start* roles, LGTM |
||
|
|
||
| dockerfile_pre_install_commands: | ||
| - npm config set progress false | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this seems like we want it for everything, add it to the base dockerfile :)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
nope. others could be using a version of |
||
|
|
||
| container_run_opts: >- | ||
| --log-driver={{ log_driver }} | ||
| -e AWS_ACCESS_KEY={{ aws_access_key }} | ||
| -e AWS_SECRET_KEY={{ aws_secret_key }} | ||
| -e DOCKER_CERT_PATH=/opt/ssl/docker/swarm-manager | ||
| -e ENVIRONMENT={{ environment_name }} | ||
| -e SWARM_HOSTNAME={{ ansible_default_ipv4.address }} | ||
| -e SWARM_PORT={{ swarm_master_port }} | ||
| -v /opt/runnable/get-info.js:/get-info.js:ro | ||
| -v /opt/ssl/docker/swarm-manager:/opt/ssl/docker/swarm-manager:ro | ||
| -v /var/log:/var/log | ||
|
|
||
| container_run_args: npm start >> /var/log/{{ name }}.log 2>&1 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we don't do this anymore?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see other comment about logging... |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| --- | ||
| - hosts: swarm-manager | ||
| vars_files: | ||
| - group_vars/alpha-swarm-manager-metrics.yml | ||
| roles: | ||
| - role: builder | ||
| tags: [ build ] | ||
| tasks: | ||
| - name: run container | ||
| tags: test_swarm_stats | ||
| when: test_swarm_stats is defined | ||
| become: yes | ||
| shell: >- | ||
| docker run | ||
| -e DRY_RUN=true | ||
| {{ container_run_opts }} | ||
| {{ container_image }}:{{ container_tag }} | ||
| {{ container_run_args }} | ||
|
|
||
| - name: put script into cron | ||
| tags: [ deploy ] | ||
| become: yes | ||
| cron: | ||
| name: swarm-cloudwatch-reporter | ||
| cron_file: 10-swarm-cloudwatch | ||
| user: root | ||
| state: present | ||
| job: >- | ||
| docker run | ||
| --rm | ||
| {{ container_run_opts }} | ||
| {{ container_image }}:{{ container_tag }} | ||
| {{ container_run_args }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for containerization!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
containerization on a budget haha