Skip to content

Commit

Permalink
feat: upgrade aws client (#2)
Browse files Browse the repository at this point in the history
* Updated exhibitor to 1.5.6 to get a newer AWS client that supports TLSv1.2
* CircleCI build

PLAT-997
  • Loading branch information
dagvl authored Apr 20, 2023
1 parent 4748512 commit c4db1a3
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 27 deletions.
31 changes: 31 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: 2.1

orbs:
utils: vimond/utils@volatile

jobs:
build:
docker:
- image: cimg/aws:2023.04
environment:
IMAGE_NAME: zk-exhibitor
steps:
- checkout
- setup_remote_docker:
docker_layer_caching: true
- utils/docker-login
- utils/docker-build:
platforms: "linux/amd64"
image-name: "IMAGE_NAME"
push: true
- utils/prisma-cloud-scan-image:
pull-from-registry: true
prisma-cloud-install-cli: true
image-name: "$IMAGE_NAME"

workflows:
build:
jobs:
- build:
context:
- vimond-global
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.idea/
/tmp/
46 changes: 19 additions & 27 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,37 +1,29 @@
FROM debian:7.8
FROM debian:9.13
MAINTAINER Mike Babineau [email protected]

ENV \
ZK_RELEASE="http://www.apache.org/dist/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz" \
EXHIBITOR_POM="https://raw.githubusercontent.com/Netflix/exhibitor/d911a16d704bbe790d84bbacc655ef050c1f5806/exhibitor-standalone/src/main/resources/buildscripts/standalone/maven/pom.xml" \
EXHIBITOR_POM="https://raw.githubusercontent.com/soabase/exhibitor/v1.5.6/exhibitor-standalone/src/main/resources/buildscripts/standalone/maven/pom.xml" \
# Append "+" to ensure the package doesn't get purged
BUILD_DEPS="curl maven openjdk-7-jdk+" \
BUILD_DEPS="curl maven openjdk-8-jdk+" \
DEBIAN_FRONTEND="noninteractive"

# Use one step so we can remove intermediate dependencies and minimize size
RUN \
# Install dependencies
apt-get update \
&& apt-get install -y --allow-unauthenticated --no-install-recommends $BUILD_DEPS \

# Default DNS cache TTL is -1. DNS records, like, change, man.
&& grep '^networkaddress.cache.ttl=' /etc/java-7-openjdk/security/java.security || echo 'networkaddress.cache.ttl=60' >> /etc/java-7-openjdk/security/java.security \

# Install ZK
&& curl -Lo /tmp/zookeeper.tgz $ZK_RELEASE \
&& mkdir -p /opt/zookeeper/transactions /opt/zookeeper/snapshots \
&& tar -xzf /tmp/zookeeper.tgz -C /opt/zookeeper --strip=1 \
&& rm /tmp/zookeeper.tgz \

# Install Exhibitor
&& mkdir -p /opt/exhibitor \
&& curl -Lo /opt/exhibitor/pom.xml $EXHIBITOR_POM \
&& mvn -f /opt/exhibitor/pom.xml package \
&& ln -s /opt/exhibitor/target/exhibitor*jar /opt/exhibitor/exhibitor.jar \

# Remove build-time dependencies
&& apt-get purge -y --auto-remove $BUILD_DEPS \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update \
&& apt-get install -y --allow-unauthenticated --no-install-recommends procps \
&& apt-get install -y --allow-unauthenticated --no-install-recommends $BUILD_DEPS \
# Default DNS cache TTL is -1. DNS records, like, change, man. && \
&& grep '^networkaddress.cache.ttl=' /etc/java-8-openjdk/security/java.security || echo 'networkaddress.cache.ttl=60' >> /etc/java-8-openjdk/security/java.security \
# Install Exhibitor \
&& mkdir -p /opt/exhibitor \
&& curl -Lo /opt/exhibitor/pom.xml $EXHIBITOR_POM \
&& mvn -f /opt/exhibitor/pom.xml package \
&& ln -s /opt/exhibitor/target/exhibitor*jar /opt/exhibitor/exhibitor.jar \
# Remove build-time dependencies \
&& apt-get purge -y --auto-remove $BUILD_DEPS \
&& rm -rf /var/lib/apt/lists/*

# Copy in our vended version of zk
ADD zk-dist/zookeeper-3.4.6.tar.gz /opt/

# Add the wrapper script that sets up configs without using AWS
ADD include/vimond-wrapper.sh /opt/exhibitor/wrapper.sh
Expand Down
7 changes: 7 additions & 0 deletions build_run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -x

docker build . -t local/zk
docker compose down
docker compose rm --force
docker compose up
35 changes: 35 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: "3.9"
services:
zk1:
cap_add:
- NET_ADMIN
- NET_RAW
image: local/zk
ports:
- "8181:8181"
environment:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_REGION
- S3_PREFIX=dvltest-zk-test
- S3_BUCKET=dvl-zk-exhibitor-testing
zk2:
environment:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_REGION
- S3_PREFIX=dvltest-zk-test
- S3_BUCKET=dvl-zk-exhibitor-testing
image: local/zk
ports:
- "8182:8181"
zk3:
environment:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_REGION
- S3_PREFIX=dvltest-zk-test
- S3_BUCKET=dvl-zk-exhibitor-testing
image: local/zk
ports:
- "8183:8181"
Binary file added zk-dist/zookeeper-3.4.6.tar.gz
Binary file not shown.

0 comments on commit c4db1a3

Please sign in to comment.