Skip to content

Commit

Permalink
pause on #18 at 0.0.0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalextremist committed May 10, 2019
1 parent 26d2bb5 commit d65beb3
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 121 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.0.0.14 2019-05-09 19:30 ( 7Mf8 )

- Giving up on #18 for now

# 0.0.0.13 2019-05-09 18:40 ( 7Mf8 )

- Never Forget 5/9 // Mr. Robot
Expand Down
63 changes: 13 additions & 50 deletions Dockerfile.launcher
Original file line number Diff line number Diff line change
Expand Up @@ -3,66 +3,29 @@ FROM crystallang/crystal:0.28.0
ENV ZMQ_VERSION 4.1.4

RUN apt-get update && apt-get install -y --fix-missing \
curl wget \
libtool libtool-bin \
build-essential apt-utils libtool libtool-bin autoconf automake

RUN apt-get install -y --fix-missing \
curl wget crystal \
lxc pkg-config \
build-essential \
autoconf \
automake \
libzmq-dev \
&& mkdir -p /tmp/zeromq \
&& curl -SL http://download.zeromq.org/zeromq-$ZMQ_VERSION.tar.gz | tar zxC /tmp/zeromq \
&& cd /tmp/zeromq/zeromq-$ZMQ_VERSION/ \
&& ./configure --without-libsodium \
&& make \
&& make install \
&& ldconfig \
&& rm -rf /tmp/zeromq \
#de && apt-get purge -y \
curl \
libtool \
pkg-config \
build-essential \
autoconf \
automake #de \
&& apt-key adv –keyserver keys.gnupg.net –recv-keys 09617FD37CC06B54 \
&& add-apt-repository ‚deb https://dist.crystal-lang.org/apt crystal main‘ \
&& apt-get update \
&& apt-get install -y crystal \
&& apt-get clean && apt-get autoclean && apt-get -y autoremove
&& rm -rf /tmp/zeromq

ENV LOG_LEVEL ${ARTILLERY_LOG_LEVEL}
ADD . /src
WORKDIR /src
#de RUN shards install
RUN shards build --production
RUN ldd bin/artillery-launcher | tr -s '[:blank:]' '\n' | grep '^/' | \
xargs -I % sh -c 'mkdir -p $(dirname deps%); cp % deps%;'
RUN apt-get clean && apt-get autoclean && apt-get -y autoremove

FROM crystallang/crystal:0.28.0
ENV WORKDIR /artillery
RUN mkdir /$WORKDIR
WORKDIR /$WORKDIR
ENV LOG_LEVEL ${ARTILLERY_LOG_LEVEL}
ADD . /artillery
WORKDIR /artillery

RUN mkdir /system
RUN shards install
RUN crystal build --release /artillery/src/run/artillery-launcher.cr -o /artillery/bin/artillery-launcher

RUN mkdir -p /var/run/secrets /system/tmp &&\
chmod 700 /var/run/secrets &&\
chmod -R 700 /bin &&\
chmod -R 701 /system &&\
chmod -R 700 /sbin &&\
chmod -R 700 /usr/bin &&\
chmod -R 700 /usr/local/bin &&\
chmod -R 700 /var/run/secrets &&\
chmod 600 /etc/passwd &&\
chmod 600 /etc/group &&\
chmod 700 /var &&\
chmod 700 /usr/share &&\
chmod 700 /run &&\
chmod -R 700 /artillery &&\
chmod -R 733 /tmp &&\
chmod +t /tmp &&\
ls -1 /usr/local | grep -v bundle | while read line;do chown -R root /usr/local/$line; done
CMD [ "/artillery/bin/artillery-launcher" ]

COPY --from=0 /src/bin/artillery-launcher /system/artillery
RUN chmod 0100 /system/artillery
CMD ["capsh", "--drop=all", "--", "-c", "/system/artillery"]
65 changes: 15 additions & 50 deletions Dockerfile.mountpoint
Original file line number Diff line number Diff line change
Expand Up @@ -3,66 +3,31 @@ FROM crystallang/crystal:0.28.0
ENV ZMQ_VERSION 4.1.4

RUN apt-get update && apt-get install -y --fix-missing \
curl wget \
libtool libtool-bin \
build-essential apt-utils libtool libtool-bin autoconf automake

RUN apt-get install -y --fix-missing \
curl wget crystal \
lxc pkg-config \
build-essential \
autoconf \
automake \
libzmq-dev \
&& mkdir -p /tmp/zeromq \
&& curl -SL http://download.zeromq.org/zeromq-$ZMQ_VERSION.tar.gz | tar zxC /tmp/zeromq \
&& cd /tmp/zeromq/zeromq-$ZMQ_VERSION/ \
&& ./configure --without-libsodium \
&& make \
&& make install \
&& ldconfig \
&& rm -rf /tmp/zeromq \
#de && apt-get purge -y \
curl \
libtool \
pkg-config \
build-essential \
autoconf \
automake #de \
&& apt-key adv –keyserver keys.gnupg.net –recv-keys 09617FD37CC06B54 \
&& add-apt-repository ‚deb https://dist.crystal-lang.org/apt crystal main‘ \
&& apt-get update \
&& apt-get install -y crystal \
&& apt-get clean && apt-get autoclean && apt-get -y autoremove
&& rm -rf /tmp/zeromq

ENV LOG_LEVEL ${ARTILLERY_LOG_LEVEL}
ADD . /src
WORKDIR /src
#de RUN shards install
RUN shards build --production
RUN ldd bin/artillery-mountpoint | tr -s '[:blank:]' '\n' | grep '^/' | \
xargs -I % sh -c 'mkdir -p $(dirname deps%); cp % deps%;'
RUN apt-get clean && apt-get autoclean && apt-get -y autoremove

FROM crystallang/crystal:0.28.0
ENV WORKDIR /artillery
RUN mkdir /$WORKDIR
WORKDIR /$WORKDIR
EXPOSE 3000
EXPOSE 5000

RUN mkdir /system
ENV LOG_LEVEL ${ARTILLERY_LOG_LEVEL}
ADD . /artillery
WORKDIR /artillery

RUN mkdir -p /var/run/secrets /system/tmp &&\
chmod 700 /var/run/secrets &&\
chmod -R 700 /bin &&\
chmod -R 701 /system &&\
chmod -R 700 /sbin &&\
chmod -R 700 /usr/bin &&\
chmod -R 700 /usr/local/bin &&\
chmod -R 700 /var/run/secrets &&\
chmod 600 /etc/passwd &&\
chmod 600 /etc/group &&\
chmod 700 /var &&\
chmod 700 /usr/share &&\
chmod 700 /run &&\
chmod -R 700 /artillery &&\
chmod -R 733 /tmp &&\
chmod +t /tmp &&\
ls -1 /usr/local | grep -v bundle | while read line;do chown -R root /usr/local/$line; done
RUN shards install
RUN crystal build --release /artillery/src/run/artillery-mountpoint.cr -o /artillery/bin/artillery-mountpoint

COPY --from=0 /src/bin/artillery-mountpoint /system/artillery
RUN chmod 0100 /system/artillery
CMD ["capsh", "--drop=all", "--", "-c", "/system/artillery"]
CMD [ "/artillery/bin/artillery-mountpoint" ]
17 changes: 5 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
dockerfile: Dockerfile.mountpoint
image: artillery-mountpoint:latest
volumes:
- ./src:/src
- ./:/artillery
- ./config/nginx.conf:/etc/nginx/nginx.conf:ro
environment:
ENVIRONMENT: development
Expand All @@ -20,21 +20,14 @@ services:
- target: 3000
published: 3000
mode: host
- target: 5000
published: 5000
mode: host

launcher:
restart: unless-stopped
volumes:
- ./src:/src
- type: tmpfs
target: /tmp
tmpfs:
size: 5242880
mode: 0733
- type: tmpfs
target: /system/tmp
tmpfs:
size: 5242880
mode: 0700
- ./:/artillery
build:
context: .
dockerfile: Dockerfile.launcher
Expand Down
2 changes: 1 addition & 1 deletion scripts/debug.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

export LOG_LEVEL='debug'
export ARTILLERY_LOG_LEVEL='debug'
./scripts/start.sh
2 changes: 1 addition & 1 deletion scripts/recreate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ else
docker-compose up --force-recreate -d
./scripts/scale.sh
fi
./console.sh
./scripts/console.sh
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: artillery
version: 0.0.0.13
version: 0.0.0.14

description: Serverfree object-oriented microservice architecture.

Expand Down
3 changes: 0 additions & 3 deletions src/artillery/run/launcher.cr

This file was deleted.

3 changes: 0 additions & 3 deletions src/artillery/run/mountpoint.cr

This file was deleted.

3 changes: 3 additions & 0 deletions src/run/artillery-launcher.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require "../artillery/launcher"

Artillery::Launcher.run
3 changes: 3 additions & 0 deletions src/run/artillery-mountpoint.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require "../artillery/mountpoint"

Artillery::Mountpoint.run

0 comments on commit d65beb3

Please sign in to comment.