Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
6559ed5
mapr52-code checkin
singhash Jan 31, 2017
4e58395
Add docker container for MapR
singhash Feb 14, 2017
9a9b813
Add review changes for MapR docker container
singhash Feb 14, 2017
2c4ab26
Rebasing the branch to master
singhash Feb 15, 2017
c09dafb
Add docker container for MapR without hive
singhash Feb 15, 2017
4093ab7
Add docker container for MapR with hive
singhash Feb 15, 2017
fceaa6e
Add Kerberize docker container for MapR with hive
singhash Mar 16, 2017
614519c
Add modification for docker-base
singhash Mar 20, 2017
7bdc127
Modification for kerberized MapR container
singhash Mar 21, 2017
586ebc7
Adding modifications to test cluster for mapr
singhash Mar 21, 2017
4426b3b
Revert "Adding modifications to test cluster for mapr"
singhash Mar 21, 2017
dfcb009
Adding test container changes for mapr
singhash Mar 21, 2017
63b3db4
Merge remote-tracking branch 'refs/remotes/origin/master' into mapr-52
singhash Mar 21, 2017
3ee5f1a
Adding ssh keys for mapr hadoop-master
singhash Mar 21, 2017
5c3e653
Changes to accomodate tests for mapr
singhash Mar 22, 2017
8061998
Adding Symlinks for the common files
singhash Mar 23, 2017
52ae1d5
Reverting links
singhash Mar 23, 2017
b4edeb9
Add symlinks to mapr52-hive
petroav Mar 23, 2017
3e15ca4
Fix links inside supervisord.d directory
petroav Mar 23, 2017
b7a3b58
Modification to include env.sh changes
singhash Mar 23, 2017
56c37e9
Adding commands to start httpfs services
singhash Mar 23, 2017
875f70d
Adding privileged in docker-compose for MapR
singhash Mar 23, 2017
86ae203
Changing Test container to accomodate mapr
singhash Mar 23, 2017
d4223b4
modification of tests to accomadate hive user
singhash Mar 24, 2017
3ebb748
Fixing kerberos container
singhash Mar 24, 2017
1f5f062
Start sshd and the socks-proxy from bootstrap.sh
petroav Mar 24, 2017
239e587
Changes for Debugging Bootsrap to know where its stuck
singhash Mar 27, 2017
2fb8915
Reverting changes for debugging bootstrap
singhash Mar 27, 2017
54221d4
Moving partition creation to mapr-base
singhash Mar 28, 2017
73461bb
decreasing allocation of space to 3 GB
singhash Mar 28, 2017
7cd2813
Increasing allocation of space back to 10 GB
singhash Mar 28, 2017
904a566
Pick user to execute Hadoop commands based on image name
petroav Mar 28, 2017
7259c45
makefile changes to debug images size
singhash Mar 28, 2017
f5b8ae0
Changes in travis to increase wait time during build
singhash Mar 28, 2017
c0fd0ea
Reverting the debugging changes
singhash Mar 29, 2017
0dfc673
Adding httpfs to MapR-base
singhash Mar 29, 2017
e4c5f91
Removing creation of partition from kerberized container
singhash Mar 29, 2017
c01bcd5
Adding SSHD AND THE SOCKS PROXY for kerberized mapr
singhash Mar 29, 2017
d15d552
Rearranging the code in MapR cluster to make it ready for review
singhash Mar 30, 2017
6458491
Adding missing sshd service start in base
singhash Mar 30, 2017
ad61f7a
Adding Logic to wait for MapR ticket in Warden
singhash Apr 6, 2017
96627fc
changes in travis
singhash Apr 20, 2017
6046f9f
Adding Review Changes for MapR
AS186170 Apr 21, 2017
ec74714
Travis yml changes
singhash Apr 24, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions teradatalabs/mapr52-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Copyright 2017 Teradata
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM teradatalabs/centos6-java8-oracle
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

License header missing. Add them to other files too

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sanjay990 License header added for the files

MAINTAINER Teradata Docker Team <docker@teradata.com>

# ADD REPO FOR MapR
ADD files/maprtech.repo /etc/yum.repos.d/maprtech.repo
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Download the repo file on startup as is done in other containers. This way the source code contains information on where to get the .repo file, which can help future devs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do it in the dwonload in RUN below section

RUN yum update -y \
# ... GET MapRGPG KEY
&& rpm --import http://package.mapr.com/releases/pub/maprgpg.key \

# INSTALL UTILITY SOFTWARE
&& yum install -y iputils vim openssh-server openssh-clients sudo \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all of this is not needed, remove (or prove that it's needed and not present in parent images anyway)


# CONFIGURE SSH
&& chkconfig sshd on \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this to the -hive image, as is done in iop images (see iop-hive):



# SETUP SOCKS PROXY
RUN yum install -y openssh openssh-clients openssh-server
RUN ssh-keygen -t rsa -b 4096 -C "automation@teradata.com" -N "" -f /root/.ssh/id_rsa
RUN cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys
ADD files/socks-proxy.sh /root/socks-proxy.sh

This will ease pulling this up to a distro-agnostic base image (like centos6-...)

&& service sshd start \

# INSTALL MapR
&& yum install -y mapr-fileserver mapr-nfs mapr-nodemanager mapr-cldb \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do it in a single yum install command

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try to have just one yum install at all

&& yum install -y mapr-zookeeper mapr-resourcemanager mapr-historyserver \
&& yum install -y mapr-webserver mapr-gateway \

# CONFIGURE ZOOKEEPER'S DATA DIRECTORY
&& rm -rf /opt/mapr/zkdata \
&& mkdir /opt/mapr/zkdata \
&& chmod 777 /opt/mapr/zkdata \
&& mkdir -p /mapr \
# THE /root/disk.txt IS READ BY MapR TO DETERMINE WHICH DISKS IT CAN USE AND THE /home/mapr/storagefile IS A FLAT FILE THAT ACTS AS A DISK
&& echo "/home/mapr/storagefile" > /root/disk.txt \

# INSTALL PYTHON AND SUPERVISORD
&& yum install -y python-setuptools \
&& easy_install pip \
&& pip install supervisor \
&& mkdir /etc/supervisord.d/ \
# ... AND ITS MISSING DEPENDENCY
&& wget http://dl.fedoraproject.org/pub/epel/6/x86_64/python-meld3-0.6.7-1.el6.x86_64.rpm \
&& rpm -ihv python-meld3-0.6.7-1.el6.x86_64.rpm \
&& rm python-meld3-0.6.7-1.el6.x86_64.rpm \

# CLEANUP
&& yum -y clean all && rm -rf /tmp/* /var/tmp/* \
&& ssh-keygen -t rsa -b 4096 -C "automation@teradata.com" -N "" -f /root/.ssh/id_rsa \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the following two lines. This should be in the 'setup socks proxy' section

&& cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys \

&& adduser mapr \
&& touch /home/mapr \
&& echo "cd /home/mapr" >> /home/mapr/.bashrc \
9 changes: 9 additions & 0 deletions teradatalabs/mapr52-base/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# mapr52-base
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add the badges, as it is done for any other image. Just copy + paste then search & replace the image name



Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra newline.

Docker image with Hive installed from MapR repositories.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is correct. This README is in the mapr52-base folder so this image shouldn't have Hive installed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


## Oracle license

By using this image, you accept the Oracle Binary Code License Agreement for Java SE available here:
[http://www.oracle.com/technetwork/java/javase/terms/license/index.html](http://www.oracle.com/technetwork/java/javase/terms/license/index.html)
13 changes: 13 additions & 0 deletions teradatalabs/mapr52-base/files/maprtech.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[maprtech]
name=MapR Technologies
baseurl=http://package.mapr.com/releases/v5.2.0/redhat/
enabled=1
gpgcheck=0
protect=1

[maprecosystem]
name=MapR Technologies
baseurl=http://package.mapr.com/releases/MEP/MEP-1.0/redhat
enabled=1
gpgcheck=0
protect=1
52 changes: 52 additions & 0 deletions teradatalabs/mapr52-hive/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright 2017 Teradata
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM teradatalabs/mapr52-base
MAINTAINER Teradata Docker Team <docker@teradata.com>

# ADD ALL REQUIRED SCRIPTS AND FILES TO ROOT DIRECTORY
ADD files/*.sh /root/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add each file verbatim, don't use *. It's better if we keep this explicit

ADD files/conf/hive-site.xml /opt/mapr/hive/hive-1.2/conf/hive-site.xml
ADD files/conf/core-site.xml /opt/mapr/hadoop/hadoop-2.7.0/etc/hadoop/core-site.xml
ADD files/supervisord.conf /etc/supervisord.conf
COPY files/supervisord.d/* /etc/supervisord.d/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be done in the base image, see

# Copy supervisord startup script and base configs
COPY files/startup.sh /root/startup.sh
COPY files/supervisord.conf /etc/supervisord.conf
COPY files/supervisord.d/bootstrap.conf /etc/supervisord.d/bootstrap.conf

# Add supervisord configs in child images
ONBUILD COPY files/supervisord.d/* /etc/supervisord.d/

in any other base image


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove all these extra lines from all the files.

RUN chmod 777 /root/*.sh \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is that neeeded? Try to remove that or add a comment why it's needed

# INSTALL UTILITY SOFTWARE
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't install utility software, unless it's in a centos6-* image and we've all agreed it's needed

&& yum install -y openssh \
&& yum install -y lsof \

# INSTALL MYSQL SERVER
&& yum install -y mysql-server mysql-connector-java \
&& yum -y clean all && rm -rf /tmp/* /var/tmp/* \

&& /root/setup.sh \

# INSTALL HIVE
&& yum install -y mapr-hive mapr-hiveserver2 mapr-hivemetastore \
&& yum -y clean all && rm -rf /tmp/* /var/tmp/* \

# HDFS PORTS
EXPOSE 5660 6660 5692 5724 5756 6692 6724 6756

# YARN PORTS
EXPOSE 8030 8020 7222 8088 7220 7221 8443 8031 8032 8033 8040 8041 8042 8088 10020 19888

# HIVE PORT
EXPOSE 9083 10000

# SOCKS PORT
EXPOSE 1180

CMD /root/startup.sh
17 changes: 17 additions & 0 deletions teradatalabs/mapr52-hive/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# mapr52-hive
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto badges


Docker image with HDFS, YARN and HIVE installed. Please note that running services have lower memory heap size set.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no HDFS in this image, only MapR FS.

For more details please check the [hadoop-env.sh](files/conf/hadoop-env.sh) configuration file.
If you want to work on larger datasets please tune those settings accordingly, the current settings should be optimal
for general correctness testing.

## Run

```
$ docker run --privileged -d --name hadoop-master -h hadoop-master teradatalabs/mapr52-hive
```

## Oracle license

By using this image, you accept the Oracle Binary Code License Agreement for Java SE available here:
[http://www.oracle.com/technetwork/java/javase/terms/license/index.html](http://www.oracle.com/technetwork/java/javase/terms/license/index.html)
4 changes: 4 additions & 0 deletions teradatalabs/mapr52-hive/capabilities.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
exposes_hive
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this file for?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allows_creating_a_table_in_hive
allows_selecting_from_the_table
exposes_socks_proxy
27 changes: 27 additions & 0 deletions teradatalabs/mapr52-hive/files/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh

# CONFIGURE MapR
/opt/mapr/server/configure.sh -N mycluster -Z localhost -C localhost -HS localhost -no-autostart
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double space before -N


# SETUP FLAT FILE /home/mapr/storagefile
dd if=/dev/zero of=/home/mapr/storagefile bs=1G count=10
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this should be done here or in a setup.sh script. Probably depends on image size and the container startup time


# SETUP DISK FOR MAPR BY RUNNING disksetup
/opt/mapr/server/disksetup -M -F /root/disk.txt

# CREATE HIVE PROXY USERS
chmod 755 /opt/mapr/conf/proxy

# START SERVICES
service mapr-zookeeper start
service mapr-warden start

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra newline.

# CONFIGURE HIVE
/opt/mapr/server/configure.sh -R

# WAIT FOR WARDEN TO START ALL THE SERVICES
sh /root/wardenTracker.sh

# RUN HDFS COMMANDS
hadoop fs -mkdir /user/root /user/hive /user/hive/warehouse
hadoop fs -chmod 777 /user/hive /user/hive/warehouse
33 changes: 33 additions & 0 deletions teradatalabs/mapr52-hive/files/conf/core-site.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
-->

<!-- Put site-specific property overrides in this file. -->

<configuration>
<property>
<name>hadoop.proxyuser.mapr.groups</name>
<value>*</value>
<description>Allow the superuser mapr to impersonate any member of any group</description>
</property>

<property>
<name>hadoop.proxyuser.mapr.hosts</name>
<value>*</value>
<description>The superuser can connect from any host to impersonate a user</description>
</property>

</configuration>

67 changes: 67 additions & 0 deletions teradatalabs/mapr52-hive/files/conf/hive-site.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<configuration>
<property>
<name>datanucleus.schema.autoCreateAll</name>
<value>true</value>
<description>creates necessary schema on a startup if one doesn't exist. set
this to false, after creating it once</description>
</property>

<property>
<name>hive.server2.enable.doAs</name>
<value>true</value>
<description>Set this property to enable impersonation in Hive Server 2</description>
</property>

<property>
<name>hive.metastore.execute.setugi</name>
<value>true</value>
<description>Set this property to enable Hive Metastore service impersonation in unsecure mode. In unsecure mode, setting this property to true will cause the metastore to execute DFS operations using the client's reported user and group permissions. Note that this property must be set on both the client and server sides. If the client sets it to true and the server sets it to false, the client setting will be ignored.</description>
</property>

<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</value>
<description>JDBC connect string for a JDBC metastore</description>
</property>

<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
<description>Driver class name for a JDBC metastore</description>
</property>

<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>root</value>
<description>username to use against metastore database</description>
</property>

<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>root</value>
<description>password to use against metastore database</description>
</property>

<property>
<name>hive.metastore.uris</name>
<value>thrift://localhost:9083</value>
</property>

</configuration>
16 changes: 16 additions & 0 deletions teradatalabs/mapr52-hive/files/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should rename this file to something more descriptive than "setup.sh". I suggest "configure_mysql.sh"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@petroav this filename is similar to the other images code

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, yea but for example setup.sh for cdh5-hive-master does a bunch of things, so it's OK to name it something generic like setup.sh whereas here all we're doing is configuring MySQL so I think we should rename it. Don't feel strongly about it though. I can also see the argument for being consistent with other image files. Up to you.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's leave it named setup.sh


# SETUP METASTORE
mysql_install_db

/usr/bin/mysqld_safe &
sleep 10s

echo "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES;" | mysql
echo "CREATE DATABASE metastore; USE metastore; SOURCE /usr/lib/hive/scripts/metastore/upgrade/mysql/hive-schema-0.13.0.mysql.sql;" | mysql
/usr/bin/mysqladmin -u root password 'root'

killall mysqld
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you killing mysqld?

Copy link
Copy Markdown
Author

@AS186170 AS186170 Feb 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@petroav mysqld is being killed because it will be restarted by supervisord.d
all the other docker containers are also doing same.
This part of code is only for setup of mysql password after which it will be started again by supervisord.d

sleep 10s
mkdir /var/log/mysql/
chown mysql:mysql /var/log/mysql/
1 change: 1 addition & 0 deletions teradatalabs/mapr52-hive/files/socks-proxy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
../../../commons/socks-proxy.sh
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add new line

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sanjay990 new line is not required as per artur , its same in other containers also

3 changes: 3 additions & 0 deletions teradatalabs/mapr52-hive/files/startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

exec supervisord -c /etc/supervisord.conf
1 change: 1 addition & 0 deletions teradatalabs/mapr52-hive/files/supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
../../../commons/supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
../../../../commons/supervisord.d/bootstrap.conf
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add new line

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are symlinks, so there's no control over it / doesn't matter

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sanjay990 new line is not required as per artur , its same in other containers also

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
../../../../commons/supervisord.d/mysql-metastore.conf
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add new line

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sanjay990 new line is not required as per artur , its same in other containers also

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The symlinks got messed up somehow. Please replace all the files with similar content with symlinks to the files pointed by the paths in those files.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
../../../../commons/supervisord.d/socks-proxy.conf
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add new line

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sanjay990 new line is not required as per artur , its same in other containers also

54 changes: 54 additions & 0 deletions teradatalabs/mapr52-hive/files/wardenTracker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know enough bash to say if this is idiomatic so I'll leave the review here to @ArturGajowy.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add -e

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use lowercase_underscore filenames for bash scripts


hname=$(hostname)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use CAPITAL_UNDERSCORE variable names, as is the de-facto standard for bash files

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't use abbreviations for variable names. This should be HOSTNAME, not hname


Services=0

maprcliReady=$(maprcli service list -node $hname | grep 'ERROR (10009)' | wc -l)

# WAIT FOR CLDB TO START
while [ $Services -ne 2 ]
do
if [ $maprcliReady == 1 ]
then
maprcliReady=$(maprcli service list -node $hname | grep 'ERROR (10009)' | wc -l)
Services=0
else
Services=$(maprcli service list -node $hname | grep CLDB |awk '{$1=$1};1' | tr ' ' '\n' | tail -1f)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use spaces around both sides of operators |, grep CLDB |awk in this case.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extract a function for checking if the service started

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do those services listen on ports? I think most of them do. Then use dockerize for each of the services

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once you extract the function for waiting for services, the reocurring 'WAIT FOR $FOO TO START' comments will not be needed anymore - remove them

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, the 6 lines containing the dockerize calls waiting for the services should just go to bootstrap.sh, this file should be deleted

Copy link
Copy Markdown
Author

@AS186170 AS186170 Apr 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dockerize will not work in this case , in MapR ports open very late and there is no finite time to open port @ArturGajowy , similar issue we faced in the test container also and i was forced to remove expose_hive and create new function expose_mapr

fi
done

# WAIT FOR NODEMANAGER TO START
Services=0
while [ $Services -ne 2 ]
do
Services=$(maprcli service list -node $hname | grep NodeManager |awk '{$1=$1};1' | tr ' ' '\n' | tail -1f)
done

# WAIT FOR RESOURCEMANAGER TO START
Services=0
while [ $Services -ne 2 ]
do
Services=$(maprcli service list -node $hname | grep ResourceManager |awk '{$1=$1};1' | tr ' ' '\n' | tail -1f)
done

# WAIT FOR HIVE METASTORE TO START
Services=0
while [ $Services -ne 2 ]
do
Services=$(maprcli service list -node $hname | grep HiveMetastore |awk '{$1=$1};1' | tr ' ' '\n' | tail -1f)
done

# WAIT FOR HIVESERVER2 TO START
Services=0
while [ $Services -ne 2 ]
do
Services=$(maprcli service list -node $hname | grep HiveServer2 |awk '{$1=$1};1' | tr ' ' '\n' | tail -1f)
done

# WAIT FOR JOBHISTORYSERVER TO START
Services=0
while [ $Services -ne 2 ]
do
Services=$(maprcli service list -node $hname | grep JobHistoryServer |awk '{$1=$1};1' | tr ' ' '\n' | tail -1f)
done