Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
55 changes: 55 additions & 0 deletions teradatalabs/mapr52-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
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>


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 blank line

#Add repo for mapr
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.

Please adopt a consistent comment style throughout this commit. Other Dockerfiles all have a '#' followed by a space, followed by a comment. The comment should start with a capital letter or be in all caps. The other Dockerfiles have mixed style in terms of small vs large cap.

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.

Also, please stylize mapr as MapR in all your comments.

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.

done

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
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.

If possible, combine all the software installation with this step and do this first.

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 if I agree. Keeping the packages close to where they are configured makes more sense to me. Maybe the line below about installing utility packages can be merged here but I think the MapR and Python installation blocks should remain where they are.


#install utility softwares
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.

Software is a non-countable noun so softwares is incorrect. Either say "Install utility software" or "Install utility packages"

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.

done

RUN yum install iputils vim openssh-server openssh-clients sudo -y
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 think it is more idiomatic for Linux commands to have options before the positional arguments so I think you should move the -y option to the front on all instances of yum install in this Dockerfile and other files.

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.

done


#configure sshh
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.

sshh is incorrect. Also stylize to SSH.

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.

done

RUN chkconfig sshd on
RUN service sshd start

#get maprgpg key
RUN rpm --import http://package.mapr.com/releases/pub/maprgpg.key

#add user and password
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 think this comment doesn't add much extra context as the commands themselves are self-explanatory. I would remove it.

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.

done

RUN adduser mapr
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.

Adding user and creating a home directory can be merged into one -d. Also looks like you can merge many of these commands. Try to combine them as far as possible

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 would add that commands should be grouped by user. First do all commands for one user, then all commands for the next one. That way it's easier to tell is something is missing for a user. Also separate each block with a newline, right now the block of text is hard to parse.

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.

done

RUN adduser hive-user
RUN usermod --password hive hive-user
RUN adduser hdfs-user
RUN usermod --password hdfs hdfs-user
RUN touch /home/hdfs-user
RUN touch /home/hive-user
RUN echo "cd /home/hive-user" >> /home/hive-user/.bashrc
RUN echo "cd /home/hdfs-user" >> /home/hdfs-user/.bashrc

#install mapr
RUN yum install mapr-fileserver mapr-nfs mapr-nodemanager mapr-cldb mapr-zookeeper mapr-resourcemanager mapr-historyserver mapr-webserver mapr-gateway -y

#necessary configuration for mapr
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 would re-phrase this as "Configure Zookeeper's data directory" followed by another block with a comment saying "Configure MapR's disks.txt"

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.

done

RUN rm -rf /opt/mapr/zkdata
RUN mkdir /opt/mapr/zkdata
RUN chmod 777 /opt/mapr/zkdata
RUN mkdir -p /mapr
RUN echo "/home/mapr/storagefile" > /root/disk.txt
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 is a line where a comment is definitely needed. Someone who isn't familiar with the setup won't know why this is being done. I think the following comment would be appropriate: "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"

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.

done



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.

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.

done

#install python
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 comment is incorrect, it looks like you copy pasted incorrectly, the comment should say "Install supervisord".

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.

done

RUN 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/*

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
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
42 changes: 42 additions & 0 deletions teradatalabs/mapr52-hive/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM teradatalabs/mapr52-base
MAINTAINER Teradata Docker Team <docker@teradata.com>

#add all required scripts to root
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/conf/supervisord.conf /etc/supervisord.conf
RUN chmod 777 /root/*.sh
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

RUN yum install openssh -y

#install mysql server and required software
RUN yum install -y mysql-server mysql-connector-java \
&& yum -y clean all && rm -rf /tmp/* /var/tmp/*

#install lsof
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.

Command is self explanatory, would remove the comment.

RUN yum install -y lsof

# RUN SETUP script
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.

Same, comment doesn't add much.

RUN /root/setup.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.

Remove all these extra lines from all the files.


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


# HDFS PORTS
EXPOSE 1004 1006 8020 50010 50020 50070 50075 50470
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.

Can you audit all these ports and determine if they're used by MapR? Here's the list http://maprdocs.mapr.com/home/ReferenceGuide/MapRPorts.html?hl=ports,used,mapr


# YARN PORTS
EXPOSE 8030 8031 8032 8033 8040 8041 8042 8088 10020 19888

# HIVE PORT
EXPOSE 9083 10000

# SOCKS PORT
EXPOSE 1180

#run startup script
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.

Comment doesn't add extra information, I would remove it.

CMD /root/startup.sh
41 changes: 41 additions & 0 deletions teradatalabs/mapr52-hive/files/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/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 disk for mapr
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

/opt/mapr/server/disksetup -M -F /root/disk.txt

#create proxy setup for hive users
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 think "Create Hive proxy users" is more accurate

chmod 755 /opt/mapr/conf/proxy
touch /opt/mapr/conf/proxy/hive-user
touch /opt/mapr/conf/proxy/hdfs-user

#start zookeeper
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.

Comment is unnecessary.

service mapr-zookeeper start

#start warden
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.

Comment is unnecessary.

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

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.

sh /root/wardenTracker.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.

Extra newline.

#run hdfs commands
hadoop fs -mkdir /user/hive-user
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.

Can you combine these commands
hadoop fs -mkdir /user/hive-user /user/hdfs-user

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.

+1

Also group them in some semantic way so they're easier to read.

hadoop fs -chmod 777 /user/hive-user
hadoop fs -mkdir /user/hdfs-user
hadoop fs -chmod 777 /user/hdfs-user
hadoop fs -mkdir /user/root
hadoop fs -mkdir /user/hive
hadoop fs -mkdir /user/hive/warehouse
hadoop fs -chmod 777 /user/hive
hadoop fs -chmod 777 /user/hive/warehouse

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.

Two extra newlines.


31 changes: 31 additions & 0 deletions teradatalabs/mapr52-hive/files/conf/core-site.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?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>

65 changes: 65 additions & 0 deletions teradatalabs/mapr52-hive/files/conf/hive-site.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?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>
9 changes: 9 additions & 0 deletions teradatalabs/mapr52-hive/files/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/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


mysql_install_db
/usr/bin/mysqld_safe &
sleep 20
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.

We should not be using sleeps. Can you see if you can use some other command in a loop to ensure that mysqld has correctly started?

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 sleeps are there in other setup code , i just copied from there to avoid any discrepancies

/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 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.

Same here

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 inline with the other container code

mkdir /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
22 changes: 22 additions & 0 deletions teradatalabs/mapr52-hive/files/supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[supervisord]
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.

Can't we use the configuration in the common subfolder of the project? I'm not too familiar how this work so maybe this is a question for @ArturGajowy.

logfile = /var/log/supervisord.log
logfile_maxbytes = 50MB
logfile_backups=10
loglevel = info
pidfile = /var/run/supervisord.pid
nodaemon = true
directory = /tmp
strip_ansi = false

[unix_http_server]
file = /tmp/supervisor.sock

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl = unix:///tmp/supervisor.sock
prompt = cdh-pseudo-distributed
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.

If we do end up keeping this config maybe we should update this to say something other than cdh-pseudo-distributed?


[include]
files = /etc/supervisord.d/*.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 JobHistoryServer |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.

You're grepping for JobHistoryServer but the comment says CLDB.

fi
done

#wait for NodeManager to 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 here and in the other code blocks.

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



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 extra lines