From d65beb3b2b4a7616d994faada5b061e9c866bfce Mon Sep 17 00:00:00 2001 From: digitalextremist Date: Thu, 9 May 2019 20:00:04 -0700 Subject: [PATCH] pause on #18 at 0.0.0.14 --- CHANGES.md | 4 ++ Dockerfile.launcher | 63 +++++++------------------------- Dockerfile.mountpoint | 65 ++++++++------------------------- docker-compose.yml | 17 +++------ scripts/debug.sh | 2 +- scripts/recreate.sh | 2 +- shard.yml | 2 +- src/artillery/run/launcher.cr | 3 -- src/artillery/run/mountpoint.cr | 3 -- src/run/artillery-launcher.cr | 3 ++ src/run/artillery-mountpoint.cr | 3 ++ 11 files changed, 46 insertions(+), 121 deletions(-) delete mode 100644 src/artillery/run/launcher.cr delete mode 100644 src/artillery/run/mountpoint.cr create mode 100644 src/run/artillery-launcher.cr create mode 100644 src/run/artillery-mountpoint.cr diff --git a/CHANGES.md b/CHANGES.md index d5f5a19..d5b4a07 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 diff --git a/Dockerfile.launcher b/Dockerfile.launcher index ccad689..f434cb2 100644 --- a/Dockerfile.launcher +++ b/Dockerfile.launcher @@ -3,12 +3,12 @@ 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/ \ @@ -16,53 +16,16 @@ RUN apt-get update && apt-get install -y --fix-missing \ && 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"] diff --git a/Dockerfile.mountpoint b/Dockerfile.mountpoint index 6c64b65..b680670 100644 --- a/Dockerfile.mountpoint +++ b/Dockerfile.mountpoint @@ -3,12 +3,12 @@ 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/ \ @@ -16,53 +16,18 @@ RUN apt-get update && apt-get install -y --fix-missing \ && 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" ] diff --git a/docker-compose.yml b/docker-compose.yml index 4039a30..54abfa5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 @@ -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 diff --git a/scripts/debug.sh b/scripts/debug.sh index a02fa25..5c08ebc 100755 --- a/scripts/debug.sh +++ b/scripts/debug.sh @@ -1,4 +1,4 @@ #!/bin/bash -export LOG_LEVEL='debug' +export ARTILLERY_LOG_LEVEL='debug' ./scripts/start.sh \ No newline at end of file diff --git a/scripts/recreate.sh b/scripts/recreate.sh index bfaa2b0..b0a4233 100755 --- a/scripts/recreate.sh +++ b/scripts/recreate.sh @@ -7,4 +7,4 @@ else docker-compose up --force-recreate -d ./scripts/scale.sh fi -./console.sh \ No newline at end of file +./scripts/console.sh \ No newline at end of file diff --git a/shard.yml b/shard.yml index b6307e8..562c4f4 100644 --- a/shard.yml +++ b/shard.yml @@ -1,5 +1,5 @@ name: artillery -version: 0.0.0.13 +version: 0.0.0.14 description: Serverfree object-oriented microservice architecture. diff --git a/src/artillery/run/launcher.cr b/src/artillery/run/launcher.cr deleted file mode 100644 index 2ad6af2..0000000 --- a/src/artillery/run/launcher.cr +++ /dev/null @@ -1,3 +0,0 @@ -require "../launcher" - -Artillery::Launcher.run \ No newline at end of file diff --git a/src/artillery/run/mountpoint.cr b/src/artillery/run/mountpoint.cr deleted file mode 100644 index e954774..0000000 --- a/src/artillery/run/mountpoint.cr +++ /dev/null @@ -1,3 +0,0 @@ -require "../mountpoint" - -Artillery::Mountpoint.run \ No newline at end of file diff --git a/src/run/artillery-launcher.cr b/src/run/artillery-launcher.cr new file mode 100644 index 0000000..cd9ed9a --- /dev/null +++ b/src/run/artillery-launcher.cr @@ -0,0 +1,3 @@ +require "../artillery/launcher" + +Artillery::Launcher.run \ No newline at end of file diff --git a/src/run/artillery-mountpoint.cr b/src/run/artillery-mountpoint.cr new file mode 100644 index 0000000..d49b429 --- /dev/null +++ b/src/run/artillery-mountpoint.cr @@ -0,0 +1,3 @@ +require "../artillery/mountpoint" + +Artillery::Mountpoint.run \ No newline at end of file