Skip to content

Commit

Permalink
Tuning memory, env vars, and locale
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Waring committed Apr 3, 2024
1 parent f84e52f commit f898f07
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ COPY hadoop_config /usr/local/hadoop/etc/hadoop
COPY ssh_config/config /root/.ssh/
COPY ssh_config/sshd_root_login.conf /etc/ssh/sshd_config.d/
COPY root_password.exp /root_password.exp
COPY profile_config/02-hadoop-env-vars.sh /etc/profile.d/

RUN chmod 755 -R $HADOOP_HOME
RUN mkdir /code
Expand All @@ -60,6 +61,7 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update --yes && \
DEBIAN_FRONTEND="noninteractive" apt-get install --yes --no-install-recommends \
fonts-liberation \
locales \
# - pandoc is used to convert notebooks to html files
# it's not present in aarch64 ubuntu image, so we install it here
pandoc \
Expand All @@ -70,6 +72,13 @@ RUN apt-get update --yes && \
run-one && \
apt-get clean && rm -rf /var/lib/apt/lists/*

# Set the locale
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

USER ${NB_UID}

# Install Jupyter Notebook, Lab, and Hub
Expand Down
10 changes: 9 additions & 1 deletion hadoop_config/yarn-site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</property>
<property>
<name>yarn.nodemanager.elastic-memory-control.enabled</name>
<value>true</value>
<value>false</value>
</property>
<property>
<name>yarn.nodemanager.resource.memory.enforced</name>
Expand All @@ -16,4 +16,12 @@
<name>yarn.nodemanager.pmem-check-enabled</name>
<value>true</value>
</property>
<property>
<name>mapreduce.map.memory.mb</name>
<value>2048</value>
</property>
<property>
<name>mapreduce.reduce.memory.mb</name>
<value>4096</value>
</property>
</configuration>
7 changes: 7 additions & 0 deletions profile_config/02-hadoop-env-vars.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export HADOOP_HOME=/usr/local/hadoop
export HDFS_NAMENODE_USER=root
export HDFS_DATANODE_USER=root
export HDFS_SECONDARYNAMENODE_USER=root
export YARN_RESOURCEMANAGER_USER=root
export YARN_NODEMANAGER_USER=root
export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$SPARK_HOME/bin

0 comments on commit f898f07

Please sign in to comment.