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
edx
configuration
Commits
0f45b4da
Unverified
Commit
0f45b4da
authored
Jul 12, 2016
by
arbabnazar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
using YAML syntax for rewriting the tasks
parent
54e89f13
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
71 deletions
+78
-71
playbooks/roles/analytics_pipeline/tasks/main.yml
+78
-71
No files found.
playbooks/roles/analytics_pipeline/tasks/main.yml
View file @
0f45b4da
...
...
@@ -37,159 +37,166 @@
# ansible-playbook -i 'localhost,' ./analytics_pipeline.yml -e@/ansible/vars/deployment.yml -e@/ansible/vars/env-deployment.yml
#
-
name
:
create config directory
file
:
>
path="{{ ANALYTICS_PIPELINE_CONFIG_DIR }}"
mode=0755 owner={{ hadoop_common_user }} group={{ hadoop_common_group }}
state=directory
-
name
:
Create config directory
file
:
path
:
"
{{
ANALYTICS_PIPELINE_CONFIG_DIR
}}"
state
:
directory
owner
:
"
{{
hadoop_common_user
}}"
group
:
"
{{
hadoop_common_group
}}"
mode
:
"
0755"
tags
:
-
install
-
install:configuration
-
name
:
store output database credentials for analytics pipeline
copy
:
>
content="{{ ANALYTICS_PIPELINE_OUTPUT_DATABASE | to_json }}"
dest={{ COMMON_CFG_DIR }}/edx-analytics-pipeline/output.json
mode=0644 owner={{ hadoop_common_user }} group={{ hadoop_common_group }}
-
name
:
Store output database credentials for analytics pipeline
copy
:
content
:
"
{{
ANALYTICS_PIPELINE_OUTPUT_DATABASE
|
to_json
}}"
dest
:
"
{{
COMMON_CFG_DIR
}}/edx-analytics-pipeline/output.json"
owner
:
"
{{
hadoop_common_user
}}"
group
:
"
{{
hadoop_common_group
}}"
mode
:
"
0644"
tags
:
-
install
-
install:configuration
-
name
:
store input database credentials for analytics pipeline
copy
:
>
content="{{ ANALYTICS_PIPELINE_INPUT_DATABASE | to_json }}"
dest={{ COMMON_CFG_DIR }}/edx-analytics-pipeline/input.json
mode=0644 owner={{ hadoop_common_user }} group={{ hadoop_common_group }}
-
name
:
Store input database credentials for analytics pipeline
copy
:
content
:
"
{{
ANALYTICS_PIPELINE_INPUT_DATABASE
|
to_json
}}"
dest
:
"
{{
COMMON_CFG_DIR
}}/edx-analytics-pipeline/input.json"
owner
:
"
{{
hadoop_common_user
}}"
group
:
"
{{
hadoop_common_group
}}"
mode
:
"
0644"
tags
:
-
install
-
install:configuration
-
name
:
luigi configuration directory created
file
:
>
path
=
/etc/luigi
state
=
directory
mode
=755
file
:
path
:
/etc/luigi
state
:
directory
mode
:
"
0755"
tags
:
-
install
-
install:configuration
-
name
:
luigi configuration file written
template
:
>
src
=
client.cfg.j2
dest
=
/etc/luigi/client.cfg
mode
=644
template
:
src
:
client.cfg.j2
dest
:
/etc/luigi/client.cfg
mode
:
"
0644"
tags
:
-
install
-
install:configuration
-
name
:
util library source checked out
git_2_0_1
:
>
dest={{ analytics_pipeline_util_library.path }} repo={{ analytics_pipeline_util_library.repo }}
version={{ analytics_pipeline_util_library.version }}
-
name
:
Util library source checked out
git_2_0_1
:
repo
:
"
{{
analytics_pipeline_util_library.repo
}}"
dest
:
"
{{
analytics_pipeline_util_library.path
}}"
version
:
"
{{
analytics_pipeline_util_library.version
}}"
tags
:
-
install
-
install:code
-
name
:
lib directory created
file
:
>
path={{ HADOOP_COMMON_USER_HOME }}/lib
owner={{ hadoop_common_user }} group={{ hadoop_common_group }} state=directory
file
:
path
:
"
{{
HADOOP_COMMON_USER_HOME
}}/lib"
owner
:
"
{{
hadoop_common_user
}}"
group
:
"
{{
hadoop_common_group
}}"
state
:
directory
tags
:
-
install
-
install:app-requirements
-
name
:
c
heck if the util library needs to be built
stat
:
>
path
={{ HADOOP_COMMON_USER_HOME }}/lib/edx-analytics-hadoop-util.jar
-
name
:
C
heck if the util library needs to be built
stat
:
path
:
"
{{
HADOOP_COMMON_USER_HOME
}}/lib/edx-analytics-hadoop-util.jar"
register
:
util_lib_built
tags
:
-
install
-
install:app-requirements
-
name
:
u
til library built
-
name
:
U
til library built
shell
:
>
chdir={{ analytics_pipeline_util_library.path }}
{{ hadoop_common_java_home }}/bin/javac -cp `{{ HADOOP_COMMON_HOME }}/bin/hadoop classpath` org/edx/hadoop/input/ManifestTextInputFormat.java &&
{{ hadoop_common_java_home }}/bin/jar cf {{ HADOOP_COMMON_USER_HOME }}/lib/edx-analytics-hadoop-util.jar org/edx/hadoop/input/ManifestTextInputFormat.class &&
chown {{ hadoop_common_user }}:{{ hadoop_common_group }} {{ HADOOP_COMMON_USER_HOME }}/lib/edx-analytics-hadoop-util.jar
args
:
chdir
:
"
{{
analytics_pipeline_util_library.path
}}"
when
:
not util_lib_built.stat.exists
tags
:
-
install
-
install:app-requirements
-
name
:
e
nsure hdfs services are started
service
:
>
name
=
hdfs
state
=
started
-
name
:
E
nsure hdfs services are started
service
:
name
:
hdfs
state
:
started
tags
:
-
manage
-
manage:start
-
name
:
e
nsure map reduce services are started
service
:
>
name
=
yarn
state
=
started
-
name
:
E
nsure map reduce services are started
service
:
name
:
yarn
state
:
started
tags
:
-
manage
-
manage:start
-
name
:
ensure package dir exists in HDFS
shell
:
>
. {{ HADOOP_COMMON_CONF_DIR }}/hadoop-env.sh && hdfs dfs -mkdir -p /edx-analytics-pipeline/packages/
-
name
:
Ensure package dir exists in HDFS
shell
:
"
.
{{
HADOOP_COMMON_CONF_DIR
}}/hadoop-env.sh
&&
hdfs
dfs
-mkdir
-p
/edx-analytics-pipeline/packages/"
become_user
:
"
{{
hadoop_common_user
}}"
tags
:
-
install
-
install:app-requirements
-
name
:
ensure util library is in HDFS
shell
:
>
. {{ HADOOP_COMMON_CONF_DIR }}/hadoop-env.sh && hdfs dfs -put -f {{ HADOOP_COMMON_USER_HOME }}/lib/edx-analytics-hadoop-util.jar /edx-analytics-pipeline/packages/
-
name
:
Ensure util library is in HDFS
shell
:
"
.
{{
HADOOP_COMMON_CONF_DIR
}}/hadoop-env.sh
&&
hdfs
dfs
-put
-f
{{
HADOOP_COMMON_USER_HOME
}}/lib/edx-analytics-hadoop-util.jar
/edx-analytics-pipeline/packages/"
become_user
:
"
{{
hadoop_common_user
}}"
tags
:
-
install
-
install:app-requirements
-
name
:
ensure the data directory exists
shell
:
>
. {{ HADOOP_COMMON_CONF_DIR }}/hadoop-env.sh && hdfs dfs -mkdir -p {{ ANALYTICS_PIPELINE_HDFS_DATA_DIR }}
-
name
:
Ensure the data directory exists
shell
:
"
.
{{
HADOOP_COMMON_CONF_DIR
}}/hadoop-env.sh
&&
hdfs
dfs
-mkdir
-p
{{
ANALYTICS_PIPELINE_HDFS_DATA_DIR
}}"
become_user
:
"
{{
hadoop_common_user
}}"
tags
:
-
install
-
install:base
-
name
:
e
nsure tracking log file can be read
file
:
>
path
={{ COMMON_LOG_DIR }}/tracking/tracking.log
mode
=0644
-
name
:
E
nsure tracking log file can be read
file
:
path
:
"
{{
COMMON_LOG_DIR
}}/tracking/tracking.log"
mode
:
"
0644"
ignore_errors
:
yes
tags
:
-
install
-
install:configuration
-
name
:
c
ron job syncs tracking log file to hdfs
cron
:
>
user
={{ hadoop_common_user }}
name
=
"Sync tracking log to HDFS"
job
=
"{{ HADOOP_COMMON_HOME }}/bin/hdfs dfs -put -f {{ COMMON_LOG_DIR }}/tracking/tracking.log {{ ANALYTICS_PIPELINE_HDFS_DATA_DIR }}/tracking.log"
-
name
:
C
ron job syncs tracking log file to hdfs
cron
:
user
:
"
{{
hadoop_common_user
}}"
name
:
"
Sync
tracking
log
to
HDFS"
job
:
"
{{
HADOOP_COMMON_HOME
}}/bin/hdfs
dfs
-put
-f
{{
COMMON_LOG_DIR
}}/tracking/tracking.log
{{
ANALYTICS_PIPELINE_HDFS_DATA_DIR
}}/tracking.log"
tags
:
-
install
-
install:configuration
-
name
:
store configuration for acceptance tests
copy
:
>
src
=
acceptance.json
dest
=
/var/tmp/acceptance.json
mode
=644
copy
:
src
:
acceptance.json
dest
:
/var/tmp/acceptance.json
mode
:
"
0644"
tags
:
-
install
-
install:configuration
-
name
:
g
rant access to table storing test data in output database
mysql_user
:
>
user
={{ ANALYTICS_PIPELINE_OUTPUT_DATABASE.username }}
password
={{ ANALYTICS_PIPELINE_OUTPUT_DATABASE.password }}
priv
=acceptance%.*:ALL
append_privs
=
yes
-
name
:
G
rant access to table storing test data in output database
mysql_user
:
user
:
"
{{
ANALYTICS_PIPELINE_OUTPUT_DATABASE.username
}}"
password
:
"
{{
ANALYTICS_PIPELINE_OUTPUT_DATABASE.password
}}"
priv
:
'
acceptance%.*:ALL'
append_privs
:
yes
tags
:
-
install
-
install:configuration
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