Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
configuration
Commits
aa74a8a5
Commit
aa74a8a5
authored
Jul 22, 2016
by
Jesse Zoldak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DO NOT MERGE: hard code the ansible timing log file name
parent
96e0320f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
playbooks/callback_plugins/local_task_timing.py
+9
-2
util/packer/jenkins_worker_simple.json
+2
-1
No files found.
playbooks/callback_plugins/local_task_timing.py
View file @
aa74a8a5
...
...
@@ -9,7 +9,7 @@ Originally written by 'Jharrod LaFon'
"""
ANSIBLE_TIMER_LOG
=
os
.
environ
.
get
(
'ANSIBLE_TIMER_LOG'
)
ANSIBLE_TIMER_LOG
=
os
.
environ
.
get
(
'ANSIBLE_TIMER_LOG'
,
'ansible_timing.log'
)
class
Timestamp
(
object
):
...
...
@@ -83,8 +83,9 @@ class CallbackModule(object):
# python logging infrastructure.
if
ANSIBLE_TIMER_LOG
is
not
None
:
log_path
=
self
.
playbook_start
.
strftime
(
ANSIBLE_TIMER_LOG
)
print
(
'log_path for timing: {}'
.
format
(
log_path
))
if
not
exists
(
dirname
(
log_path
)):
print
(
'creating directories: {}'
.
format
(
dirname
(
log_path
)))
os
.
makedirs
(
dirname
(
log_path
))
with
open
(
log_path
,
'a'
)
as
outfile
:
...
...
@@ -119,3 +120,9 @@ class CallbackModule(object):
sort_keys
=
True
,
)
outfile
.
write
(
'
\n
'
)
print
(
'full path to log file: {}'
.
format
(
os
.
path
.
abspath
(
log_path
)))
print
(
"contents of log file are: "
)
with
open
(
log_path
,
'r'
)
as
log_file
:
print
log_file
.
read
()
print
(
"end contents of log file."
)
util/packer/jenkins_worker_simple.json
View file @
aa74a8a5
...
...
@@ -2,6 +2,7 @@
"variables"
:
{
"aws_access_key"
:
"{{env `AWS_ACCESS_KEY_ID`}}"
,
"aws_secret_key"
:
"{{env `AWS_SECRET_ACCESS_KEY`}}"
,
"ansible_timer_log"
:
"{{env `ANSIBLE_TIMER_LOG`}}"
,
"playbook_remote_dir"
:
"/tmp/packer-edx-playbooks"
,
"ami"
:
"{{env `JENKINS_WORKER_AMI`}}"
,
"test_platform_version"
:
"{{env `TEST_PLATFORM_VERSION`}}"
...
...
@@ -61,7 +62,7 @@
"type"
:
"ansible-local"
,
"playbook_file"
:
"../../playbooks/edx-east/jenkins_worker.yml"
,
"playbook_dir"
:
"../../playbooks"
,
"command"
:
"source {{user `playbook_remote_dir`}}/packer-venv/bin/activate && ANSIBLE_TIMER_LOG='
log/ansible_timing.log
' ansible-playbook"
,
"command"
:
"source {{user `playbook_remote_dir`}}/packer-venv/bin/activate && ANSIBLE_TIMER_LOG='
{{user `ansible_timer_log`}}
' ansible-playbook"
,
"inventory_groups"
:
"jenkins_worker"
,
"extra_arguments"
:
[
"-vvv"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment