Skip to content

Conversation

@AS186170
Copy link

mapr52-code checkin for docker container

mapr52-code checkin for docker  container
@sanjay990
Copy link
Member

Rewrite the commit message. Something like Add docker container for MapR

@sanjay990 sanjay990 self-requested a review January 31, 2017 19:17
@@ -0,0 +1,55 @@
FROM teradatalabs/centos6-java8-oracle
Copy link
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
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

FROM teradatalabs/centos6-java8-oracle
MAINTAINER Teradata Docker Team <[email protected]>


Copy link
Member

Choose a reason for hiding this comment

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

Remove blank line

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

#add user and password
RUN adduser mapr
Copy link
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


#Add repo for mapr
ADD files/maprtech.repo /etc/yum.repos.d/maprtech.repo
RUN yum update -y
Copy link
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
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.


# RUN SETUP script
RUN /root/setup.sh

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

@@ -0,0 +1 @@
../../../commons/socks-proxy.sh No newline at end of file
Copy link
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
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

@@ -0,0 +1 @@
../../../../commons/supervisord.d/bootstrap.conf No newline at end of file
Copy link
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
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
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

@@ -0,0 +1 @@
../../../../commons/supervisord.d/mysql-metastore.conf No newline at end of file
Copy link
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
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
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.

@@ -0,0 +1 @@
../../../../commons/supervisord.d/socks-proxy.conf No newline at end of file
Copy link
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
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

done



Copy link
Member

Choose a reason for hiding this comment

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

Remove extra lines

@ArturGajowy
Copy link
Contributor

Please split the commit in two parts, one for the base image and another one for the -hive one

@ArturGajowy
Copy link
Contributor

Please add a capabilities.txt file so that the tests are run for the -hive image. See any ohter -hive image.

Copy link
Contributor

@ArturGajowy ArturGajowy left a comment

Choose a reason for hiding this comment

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

just a skim and two comments for now, please ping me when those are addressed

Copy link
Contributor

@petroav petroav left a comment

Choose a reason for hiding this comment

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

As Sanjay pointed out, please re-write your commit message. In general, if you are committing for any Presto related project follow this guideline: http://chris.beams.io/posts/git-commit/.

A lot of my comments relate to style, which is just as important as content. In future pay attention to the style around you in the project and try emulate it as much as possible.

MAINTAINER Teradata Docker Team <[email protected]>


#Add repo for mapr
Copy link
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
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
Author

Choose a reason for hiding this comment

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

done


#Add repo for mapr
ADD files/maprtech.repo /etc/yum.repos.d/maprtech.repo
RUN yum update -y
Copy link
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.

ADD files/maprtech.repo /etc/yum.repos.d/maprtech.repo
RUN yum update -y

#install utility softwares
Copy link
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
Author

Choose a reason for hiding this comment

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

done

RUN yum update -y

#install utility softwares
RUN yum install iputils vim openssh-server openssh-clients sudo -y
Copy link
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
Author

Choose a reason for hiding this comment

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

done

#install utility softwares
RUN yum install iputils vim openssh-server openssh-clients sudo -y

#configure sshh
Copy link
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
Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1,22 @@
[supervisord]
Copy link
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.


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

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

done

#wait for NodeManager to start

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

@@ -0,0 +1,54 @@
#!/bin/bash
Copy link
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.

@ArturGajowy
Copy link
Contributor

Guys, any updates on this? Please ping me when the (actionable) comments made so far are applied

cc @petroav @AS186170

@AS186170 AS186170 changed the title mapr52-code checkin Add docker container for MapR Feb 13, 2017
@AS186170
Copy link
Author

@ArturGajowy i have started working on modification for the review comments today.Will let you know once completed.

Add docker container for MapR
Add review changes for MapR docker container
Rebasing the branch to master for splitting mapr commits into two
Add docker container code for MapR-Base
Add docker container code for MapR-Hive
@AS186170
Copy link
Author

@sanjay990 @petroav @ArturGajowy Review comments are now complete for the branch

Copy link
Contributor

@petroav petroav left a comment

Choose a reason for hiding this comment

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

Couple small comments.

# mapr52-base


Docker image with Hive installed from MapR repositories.
Copy link
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
Contributor

Choose a reason for hiding this comment

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

@@ -0,0 +1,9 @@
# mapr52-base


Copy link
Contributor

Choose a reason for hiding this comment

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

Extra newline.

@@ -0,0 +1,17 @@
# mapr52-hive

Docker image with HDFS, YARN and HIVE installed. Please note that running services have lower memory heap size set.
Copy link
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.

@@ -0,0 +1,4 @@
exposes_hive
Copy link
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
Contributor

Choose a reason for hiding this comment

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

@@ -0,0 +1,9 @@
#!/bin/bash
Copy link
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
Contributor

@ArturGajowy ArturGajowy left a comment

Choose a reason for hiding this comment

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

The tests fail (see travis log). Seems like hive is not reachable on hadoop-master:10000. Please fix it and then we can proceed.

@ArturGajowy
Copy link
Contributor

ArturGajowy commented Feb 22, 2017

Please make the PR only contain two commits, with the respective messages:
Add mapr-base image
Add mapr-hive image
both containing only the changes relevant accordting to their messages

@ArturGajowy
Copy link
Contributor

Please drop '52' from the image & directories names, we're not going to have two versions of the mapr container (say mapr-52 and mapr-53), so there's no point.

@@ -0,0 +1,9 @@
# mapr52-base
Copy link
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
Contributor

@ArturGajowy ArturGajowy left a comment

Choose a reason for hiding this comment

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

First round done. Let me know when that's fixed and the tests pass on travis.

@@ -0,0 +1,17 @@
# mapr52-hive
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto badges

# mapr52-base


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

Choose a reason for hiding this comment

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

@@ -0,0 +1,4 @@
exposes_hive
Copy link
Contributor

Choose a reason for hiding this comment

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

#!/bin/sh

# CONFIGURE MapR
/opt/mapr/server/configure.sh -N mycluster -Z localhost -C localhost -HS localhost -no-autostart
Copy link
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

@@ -0,0 +1,54 @@
#!/bin/bash

hname=$(hostname)
Copy link
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

MAINTAINER Teradata Docker Team <[email protected]>

# ADD ALL REQUIRED SCRIPTS AND FILES TO ROOT DIRECTORY
ADD files/*.sh /root/
Copy link
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
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 files/supervisord.d/* /etc/supervisord.d/

RUN chmod 777 /root/*.sh \
# INSTALL UTILITY SOFTWARE
Copy link
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

ADD files/supervisord.conf /etc/supervisord.conf
COPY files/supervisord.d/* /etc/supervisord.d/

RUN chmod 777 /root/*.sh \
Copy link
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

/opt/mapr/server/configure.sh -N mycluster -Z localhost -C localhost -HS localhost -no-autostart

# SETUP FLAT FILE /home/mapr/storagefile
dd if=/dev/zero of=/home/mapr/storagefile bs=1G count=10
Copy link
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

Add Kerberize docker container for MapR with hive
Add modification for docker-base
Modification for kerberized MapR container
Adding modifications to test cluster for mapr
Adding test container changes to accomodate mapr
singhash and others added 29 commits March 23, 2017 13:34
Adding Symlinks for the common files
Reverting links
Modification to include env.sh changes in Kerberized MapR cluster
Adding commands to start httpfs services
Adding privileged in docker-compose for MapR
Changing Test container to accomodate mapr
modification of tests to accomadate hive user
Fixing kerberos container
Debugging Bootsrap to know where its stuck
Reverting changes for debugging bootstrap
Moving partition creation to mapr-base and changes in capabilities
decreasing allocation of space to 3 GB
Increasing allocation of space back to 10 GB
makefile changes to debug images size
Changes in travis to increase wait time during build
Reverting the debugging changes
Adding httpfs to MapR-base and moving storagefile partition creation to
hive
Removing creation of partition from bootstrap of kerberized container
and removing chown
Adding SSHD AND THE SOCKS PROXY for kerberized mapr
Rearranging the code in MapR cluster to make it ready for review
This changes will make maprcli wait for MapR ticket in wardenTracker
changes in travis
Travis yml changes
@AS186170
Copy link
Author

@petroav @ArturGajowy All the review comments are incorporated and all the tests are passing .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants