From e155e3ddd5ca72c32c839d7e0282baf85d6af817 Mon Sep 17 00:00:00 2001 From: nitram Date: Wed, 20 Feb 2019 10:57:02 -0800 Subject: [PATCH] update dockerfiles and lightningd + speed up image build --- .gitlab-ci.yml | 17 ++++++++++------- Dockerfile | 2 +- Dockerfile.ci | 2 +- Dockerfile.sse | 2 +- terraform/modules/blc/data.tf | 2 +- terraform/variables.tf | 2 +- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f29f936..677bcef 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,7 @@ variables: GIT_SUBMODULE_STRATEGY: none CI_DISPOSABLE_ENVIRONMENT: "true" -image: blockstream/gcloud-docker@sha256:31c1a01d143558f0ba5677d121891a958fa600195679fe325980ec72e5264f2a +image: blockstream/gcloud-docker@sha256:78e68a98c5d6aa36eca45099bae38a1544a1688fd16b506fb914a29fdf6e4afa stages: - build - plan @@ -19,22 +19,25 @@ before_script: # Run tests and build docker images build: stage: build - image: blockstream/satapi-builder@sha256:4f96415f1216c5b6bdb266b1db48558328a497f02da38ce2991ab65b25b7590f + image: blockstream/satapi-builder@sha256:a3a137b80a08325bdd50a7c59ae0429b933e7a36db0d74f6ae34af067dfdee2d only: - master@satellite/ionosphere before_script: - - "" + - export CHARGE_ROOT=$CHARGE_ROOT_CI script: + - bundle exec ruby tests/tests.rb || echo "Tests failed.." && exit 1 - echo $DOCKERHUB_PW | docker login -u $DOCKERHUB_USER --password-stdin - - docker build -f Dockerfile -t blockstream/satellite-api:latest -t blockstream/satellite-api:$CI_COMMIT_SHA . + - docker pull blockstream/satellite-api:latest + - docker pull blockstream/satellite-api-sse:latest + - docker build --cache-from blockstream/satellite-api:latest -f Dockerfile -t blockstream/satellite-api:latest -t blockstream/satellite-api:$CI_COMMIT_SHA . - docker push blockstream/satellite-api:latest - docker push blockstream/satellite-api:$CI_COMMIT_SHA - - echo "Building Ionosphere SSE image" - - docker build -f Dockerfile.sse -t blockstream/satellite-api-sse:latest -t blockstream/satellite-api-sse:$CI_COMMIT_SHA sse/ + - echo "Building Satellite API SSE image" + - docker build --cache-from blockstream/satellite-api-sse:latest -f Dockerfile.sse -t blockstream/satellite-api-sse:latest -t blockstream/satellite-api-sse:$CI_COMMIT_SHA sse/ - docker push blockstream/satellite-api-sse:$CI_COMMIT_SHA - docker push blockstream/satellite-api-sse:latest -# Any newly-pushed, WIP branch will be ran through plan (keep in mind docker images are using the latest tag, which may be an older one since the current commit doesn't match an available image) +# Any newly-pushed, WIP branch will be ran through plan (keep in mind docker images are using the latest tag, which may be an older one since the current commit may not match an available image) plan_satapi: stage: plan only: diff --git a/Dockerfile b/Dockerfile index 661180b..0600288 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:latest +FROM alpine@sha256:b3dbf31b77fd99d9c08f780ce6f5282aba076d70a513a8be859d8d3a4d0c92b8 ENV RUBY_PACKAGES ruby ruby-io-console ruby-irb ruby-rake ruby-bundler ruby-bigdecimal ruby-json ENV RUBY_DEPS libstdc++ tzdata bash ca-certificates openssl sqlite sqlite-dev diff --git a/Dockerfile.ci b/Dockerfile.ci index 85957a3..abe3ed4 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -1,4 +1,4 @@ -FROM docker@sha256:f7211e1779c82e3a50d0d6f165e83f3e2be217a234b0181d5e8bee411d8fcc5f AS docker +FROM docker@sha256:453c52a7a7200677f9effa3acc8498a2f71af77c2951ac5e1ac1391053573374 AS docker FROM alpine:latest COPY --from=docker /usr/local/bin/docker /usr/local/bin/docker diff --git a/Dockerfile.sse b/Dockerfile.sse index e6b545a..00f6c6a 100644 --- a/Dockerfile.sse +++ b/Dockerfile.sse @@ -1,4 +1,4 @@ -FROM node:8 +FROM node:8-slim # Create app directory WORKDIR /usr/src/app diff --git a/terraform/modules/blc/data.tf b/terraform/modules/blc/data.tf index c7587f1..8235ded 100644 --- a/terraform/modules/blc/data.tf +++ b/terraform/modules/blc/data.tf @@ -17,7 +17,7 @@ data "template_file" "blc" { rpcpass = "${var.rpcpass}" rpcport = "${var.net == "testnet" ? "18332" : "8332"}" bitcoin_cmd = "bitcoind ${var.net == "testnet" ? "-testnet" : ""} -printtoconsole" - lightning_cmd = "lightningd ${var.net == "testnet" ? "--testnet" : "--mainnet"} --conf=/root/.lightning/lightning.conf" + lightning_cmd = "lightningd ${var.net == "testnet" ? "--testnet" : "--mainnet"} --conf=/root/.lightning/lightning.conf --plugin-dir=/usr/local/bin/plugins" charge_cmd = "charged -d /data/charge.db -l /root/.lightning" announce_addr = "${google_compute_address.blc.address}" lightning_port = 9735 diff --git a/terraform/variables.tf b/terraform/variables.tf index f1cd75d..9002138 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -129,7 +129,7 @@ variable "bitcoin_docker" { variable "lightning_docker" { type = "string" - default = "blockstream/lightningd@sha256:361aa1705304825b05625fc4f520458740e0630e55e7eb9c99d0eaef1a8b3c02" + default = "blockstream/lightningd@sha256:97f5e8e7a6574b05dcfd88debb2e7b1c6b40ff6d6ebfe911cf3134a2b47c5c26" } variable "charge_docker" {