Skip to content

Commit

Permalink
Implementation of manta-monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
Sachin Gupta committed Dec 27, 2018
0 parents commit b59c60f
Show file tree
Hide file tree
Showing 77 changed files with 5,874 additions and 0 deletions.
103 changes: 103 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Created by https://www.gitignore.io

### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm

*.iml

## Directory-based project format:
.idea/
# if you remove the above rule, at least ignore the following:

# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# .idea/dictionaries

# Sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
# .idea/uiDesigner.xml

# Gradle:
# .idea/gradle.xml
# .idea/libraries

# Mongo Explorer plugin:
# .idea/mongoSettings.xml

## File-based project format:
*.ipr
*.iws

## Plugin-specific files:

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties


### Eclipse ###
*.pydevproject
.metadata
.gradle
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.project
.classpath
.checkstyle
workbench.xmi

### Netbeans ###
nbactions.xml

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# PDT-specific
.buildpath

# sbteclipse plugin
.target

# TeXlipse plugin
.texlipse


### Maven ###
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml

**/test-output

### macOS ###
.DS_Store
78 changes: 78 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
FROM ubuntu:xenial

MAINTAINER Elijah Zupancic <elijah@zupancic.name>

# Metadata for Docker containers: http://label-schema.org/
LABEL org.label-schema.name="Manta Monitor" \
org.label-schema.description="Monitors the Manta Object Store for Quality of Service" \
org.label-schema.url="https://github.com/joyent/manta-monitor" \
org.label-schema.vcs-url="org.label-schema.vcs-ref" \
org.label-schema.vendor="Joyent" \
org.label-schema.schema-version="1.0"

WORKDIR /opt/manta-monitor

ENV MANTA_MONITOR_VERSION=1.0.0-SNAPSHOT
ENV ZULE_JCE_POLICY_CHECKSUM ebe83e1bf25de382ce093cf89e93a944
ENV JAVA_HOME /usr/lib/jvm/zulu-8-amd64
ENV INSTANCE_METADATA_PROPS_FILE /opt/manta-monitor/tmp/instance.properties

# Installed tools:
# ==============================================================================
# openssh-client: for ssh-keygen to generate key fingerprints
# sudo: for dropping from root to a lower permission user
# curl: for downloading binaries
# ca-certifiactes: for downloading via https
# zulu-8 OpenJDK certified by Azul
# libnss3 Native crypto tools for improving JVM crypo performance
# unzip: for installing binaries
# dc: for calculating performance settings
# ==============================================================================

# Adds Azul Zulu OpenJDK repository
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0x219BD9C9 && \
echo 'deb http://repos.azulsystems.com/ubuntu stable main' > /etc/apt/sources.list.d/zulu.list

RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get -qy upgrade && \
apt-get install --no-install-recommends -qy \
sudo openssh-client curl ca-certificates zulu-8 libjna-java unzip libnss3 dc && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* \
/tmp/* \
/var/tmp/* && \
echo "JAVA_HOME=$JAVA_HOME" >> /etc/environment

# Install Java Cryptography Extension Kit
RUN curl --retry 6 -Ls "https://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip" > /tmp/ZuluJCEPolicies.zip && \
echo "${ZULE_JCE_POLICY_CHECKSUM} /tmp/ZuluJCEPolicies.zip" && \
unzip -o -j /tmp/ZuluJCEPolicies.zip -d $JAVA_HOME/jre/lib/security ZuluJCEPolicies/US_export_policy.jar ZuluJCEPolicies/local_policy.jar && \
rm /tmp/ZuluJCEPolicies.zip

# Install CPU spoofing library
RUN mkdir -p /usr/local/numcpus/ && \
curl --retry 6 -Ls "https://github.com/dekobon/libnumcpus/releases/download/1.0/libnumcpus-linux-x86_64.so" > /usr/local/numcpus/libnumcpus.so && \
echo '6bc838db493d70a83dba9bd3d34c013d368339f288efc4629830fdcb25fa08f7 /usr/local/numcpus/libnumcpus.so' | sha256sum -c

# Add Native cryptography support via libnss and PKCS11
COPY docker_root/etc /etc
# Add supplemental system files
COPY docker_root/usr /usr
# Add application directory
COPY docker_root/opt /opt
COPY target/manta-monitor-1.0.0-SNAPSHOT-jar-with-dependencies.jar /opt/manta-monitor/lib/manta-monitor.jar

# Configure runtime user and permissions
RUN groupadd -g 1244 manta-monitor && \
useradd -g 1244 -G sudo -u 1244 -c 'Manta Monitor User' -d /opt/manta-monitor -r -s /bin/false manta-monitor && \
mkdir -p /opt/manta-monitor/.ssh && \
chown -R manta-monitor:manta-monitor /opt/manta-monitor && \
chmod og-rwx /opt/manta-monitor/.ssh && \
chmod +x /usr/local/bin/proclimit && \
mkdir -p /opt/manta-monitor/tmp && \
find /opt/manta-monitor/bin -type f -exec chmod +x '{}' \;

EXPOSE 8090 8090

CMD /opt/manta-monitor/bin/run
Loading

0 comments on commit b59c60f

Please sign in to comment.