From 4894e0b18d410b4638ec06b1be40b832ab350e95 Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Wed, 30 Mar 2022 22:02:43 -0700 Subject: [PATCH 1/8] add debug --- .circleci/config.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 847e9be05..07e2ee20e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -696,7 +696,7 @@ jobs: at: "." - packer/build: template: tools/packer/lotus.pkr.hcl - args: "-var ci_workspace_bins=./linux -var lotus_network=mainnet -var git_tag=$CIRCLE_TAG" + args: "-debug -var ci_workspace_bins=./linux -var lotus_network=mainnet -var git_tag=$CIRCLE_TAG" publish-packer-calibrationnet: description: build and push AWS IAM and DigitalOcean droplet. executor: @@ -708,7 +708,7 @@ jobs: at: "." - packer/build: template: tools/packer/lotus.pkr.hcl - args: "-var ci_workspace_bins=./linux-calibrationnet -var lotus_network=calibrationnet -var git_tag=$CIRCLE_TAG" + args: "-debug -var ci_workspace_bins=./linux-calibrationnet -var lotus_network=calibrationnet -var git_tag=$CIRCLE_TAG" publish-packer-butterflynet: description: build and push AWS IAM and DigitalOcean droplet. executor: @@ -720,7 +720,7 @@ jobs: at: "." - packer/build: template: tools/packer/lotus.pkr.hcl - args: "-var ci_workspace_bins=./linux-butterflynet -var lotus_network=butterflynet -var git_tag=$CIRCLE_TAG" + args: "-debug -var ci_workspace_bins=./linux-butterflynet -var lotus_network=butterflynet -var git_tag=$CIRCLE_TAG" publish-packer-snap: description: build packer image with snap. mainnet only. executor: @@ -732,6 +732,7 @@ jobs: at: "." - packer/build: template: tools/packer/lotus-snap.pkr.hcl + args: "-debug" publish-dockerhub: description: publish to dockerhub machine: From 73468e706e83b9d556455c75c213047e9b5cf593 Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Wed, 30 Mar 2022 22:03:41 -0700 Subject: [PATCH 2/8] tmp: remove filters --- .circleci/config.yml | 56 ++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 07e2ee20e..1e1979480 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1074,43 +1074,43 @@ workflows: - publish-packer-mainnet: requires: - build-all - filters: - branches: - ignore: - - /.*/ - tags: - only: - - /^v\d+\.\d+\.\d+(-rc\d+)?$/ + # filters: + # branches: + # ignore: + # - /.*/ + # tags: + # only: + # - /^v\d+\.\d+\.\d+(-rc\d+)?$/ - publish-packer-calibrationnet: requires: - build-ntwk-calibration - filters: - branches: - ignore: - - /.*/ - tags: - only: - - /^v\d+\.\d+\.\d+(-rc\d+)?$/ + # filters: + # branches: + # ignore: + # - /.*/ + # tags: + # only: + # - /^v\d+\.\d+\.\d+(-rc\d+)?$/ - publish-packer-butterflynet: requires: - build-ntwk-butterfly - filters: - branches: - ignore: - - /.*/ - tags: - only: - - /^v\d+\.\d+\.\d+(-rc\d+)?$/ + # filters: + # branches: + # ignore: + # - /.*/ + # tags: + # only: + # - /^v\d+\.\d+\.\d+(-rc\d+)?$/ - publish-snapcraft: name: publish-snapcraft-stable channel: stable - filters: - branches: - ignore: - - /.*/ - tags: - only: - - /^v\d+\.\d+\.\d+(-rc\d+)?$/ + # filters: + # branches: + # ignore: + # - /.*/ + # tags: + # only: + # - /^v\d+\.\d+\.\d+(-rc\d+)?$/ - publish-dockerhub: name: publish-dockerhub tag: stable From 1da3e2c71151a94c2d516aaf6fb385cbbcf14564 Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Wed, 30 Mar 2022 22:27:18 -0700 Subject: [PATCH 3/8] copy packer_build source --- .circleci/config.yml | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1e1979480..e441227bc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,6 @@ version: 2.1 orbs: go: gotest/tools@0.0.13 aws-cli: circleci/aws-cli@1.3.2 - packer: salaxander/packer@0.0.3 executors: golang: @@ -75,6 +74,26 @@ commands: command: | git fetch --all + packer_build: + description: "Run a packer build" + parameters: + template: + description: | + The name of the packer template file + type: string + default: packer.json + args: + description: | + Arguments to pass to the packer build command + type: string + default: "" + + steps: + - run: + name: "Run a packer build" + command: packer build << parameters.args >> << parameters.template >> + no_output_timeout: 30m + jobs: mod-tidy-check: executor: golang @@ -694,9 +713,9 @@ jobs: - checkout - attach_workspace: at: "." - - packer/build: + - packer_build: template: tools/packer/lotus.pkr.hcl - args: "-debug -var ci_workspace_bins=./linux -var lotus_network=mainnet -var git_tag=$CIRCLE_TAG" + args: "-var ci_workspace_bins=./linux -var lotus_network=mainnet -var git_tag=$CIRCLE_TAG" publish-packer-calibrationnet: description: build and push AWS IAM and DigitalOcean droplet. executor: @@ -706,9 +725,9 @@ jobs: - checkout - attach_workspace: at: "." - - packer/build: + - packer_build: template: tools/packer/lotus.pkr.hcl - args: "-debug -var ci_workspace_bins=./linux-calibrationnet -var lotus_network=calibrationnet -var git_tag=$CIRCLE_TAG" + args: "-var ci_workspace_bins=./linux-calibrationnet -var lotus_network=calibrationnet -var git_tag=$CIRCLE_TAG" publish-packer-butterflynet: description: build and push AWS IAM and DigitalOcean droplet. executor: @@ -718,9 +737,9 @@ jobs: - checkout - attach_workspace: at: "." - - packer/build: + - packer_build: template: tools/packer/lotus.pkr.hcl - args: "-debug -var ci_workspace_bins=./linux-butterflynet -var lotus_network=butterflynet -var git_tag=$CIRCLE_TAG" + args: "-var ci_workspace_bins=./linux-butterflynet -var lotus_network=butterflynet -var git_tag=$CIRCLE_TAG" publish-packer-snap: description: build packer image with snap. mainnet only. executor: @@ -730,9 +749,8 @@ jobs: - checkout - attach_workspace: at: "." - - packer/build: + - packer_build: template: tools/packer/lotus-snap.pkr.hcl - args: "-debug" publish-dockerhub: description: publish to dockerhub machine: From 0095d9368614ff4311a62014aac88bb0ec108d6d Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Wed, 30 Mar 2022 22:30:17 -0700 Subject: [PATCH 4/8] add packer executor --- .circleci/config.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e441227bc..4a542805f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,6 +11,16 @@ executors: ubuntu: docker: - image: ubuntu:20.04 + packer: + description: | + The HashiCorp provided Packer container + parameters: + packer-version: + type: string + default: 1.8.1 + docker: + - image: hashicorp/packer:<< parameters.packer-version >> + commands: install-deps: @@ -707,8 +717,7 @@ jobs: publish-packer-mainnet: description: build and push AWS IAM and DigitalOcean droplet. executor: - name: packer/default - packer-version: 1.6.6 + name: packer steps: - checkout - attach_workspace: @@ -719,8 +728,7 @@ jobs: publish-packer-calibrationnet: description: build and push AWS IAM and DigitalOcean droplet. executor: - name: packer/default - packer-version: 1.6.6 + name: packer steps: - checkout - attach_workspace: @@ -731,8 +739,7 @@ jobs: publish-packer-butterflynet: description: build and push AWS IAM and DigitalOcean droplet. executor: - name: packer/default - packer-version: 1.6.6 + name: packer steps: - checkout - attach_workspace: @@ -743,8 +750,7 @@ jobs: publish-packer-snap: description: build packer image with snap. mainnet only. executor: - name: packer/default - packer-version: 1.6.6 + name: packer steps: - checkout - attach_workspace: From cc5e96b23fad1491008beb0d9d4ed133ce7e686d Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Wed, 30 Mar 2022 22:35:20 -0700 Subject: [PATCH 5/8] use 1.8 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4a542805f..21f53f4cf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,7 +17,7 @@ executors: parameters: packer-version: type: string - default: 1.8.1 + default: "1.8" docker: - image: hashicorp/packer:<< parameters.packer-version >> From 9c25aea327b24d27593116a7269cd28b0e46f553 Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Wed, 30 Mar 2022 22:53:57 -0700 Subject: [PATCH 6/8] restore filters --- .circleci/config.yml | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 21f53f4cf..c854f4b55 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1108,33 +1108,33 @@ workflows: - publish-packer-calibrationnet: requires: - build-ntwk-calibration - # filters: - # branches: - # ignore: - # - /.*/ - # tags: - # only: - # - /^v\d+\.\d+\.\d+(-rc\d+)?$/ + filters: + branches: + ignore: + - /.*/ + tags: + only: + - /^v\d+\.\d+\.\d+(-rc\d+)?$/ - publish-packer-butterflynet: requires: - build-ntwk-butterfly - # filters: - # branches: - # ignore: - # - /.*/ - # tags: - # only: - # - /^v\d+\.\d+\.\d+(-rc\d+)?$/ + filters: + branches: + ignore: + - /.*/ + tags: + only: + - /^v\d+\.\d+\.\d+(-rc\d+)?$/ - publish-snapcraft: name: publish-snapcraft-stable channel: stable - # filters: - # branches: - # ignore: - # - /.*/ - # tags: - # only: - # - /^v\d+\.\d+\.\d+(-rc\d+)?$/ + filters: + branches: + ignore: + - /.*/ + tags: + only: + - /^v\d+\.\d+\.\d+(-rc\d+)?$/ - publish-dockerhub: name: publish-dockerhub tag: stable From 4bb8865e2f6bc5236f4cca46ce353a980c6f2905 Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Wed, 30 Mar 2022 22:57:02 -0700 Subject: [PATCH 7/8] fix template --- .circleci/template.yml | 50 ++++++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/.circleci/template.yml b/.circleci/template.yml index dc3b37f2d..a73cac4d6 100644 --- a/.circleci/template.yml +++ b/.circleci/template.yml @@ -12,6 +12,16 @@ executors: ubuntu: docker: - image: ubuntu:20.04 + packer: + description: | + The HashiCorp provided Packer container + parameters: + packer-version: + type: string + default: "1.8" + docker: + - image: hashicorp/packer:<< parameters.packer-version >> + commands: install-deps: @@ -75,6 +85,26 @@ commands: command: | git fetch --all + packer_build: + description: "Run a packer build" + parameters: + template: + description: | + The name of the packer template file + type: string + default: packer.json + args: + description: | + Arguments to pass to the packer build command + type: string + default: "" + + steps: + - run: + name: "Run a packer build" + command: packer build << parameters.args >> << parameters.template >> + no_output_timeout: 30m + jobs: mod-tidy-check: executor: golang @@ -688,49 +718,45 @@ jobs: publish-packer-mainnet: description: build and push AWS IAM and DigitalOcean droplet. executor: - name: packer/default - packer-version: 1.6.6 + name: packer steps: - checkout - attach_workspace: at: "." - - packer/build: + - packer_build: template: tools/packer/lotus.pkr.hcl args: "-var ci_workspace_bins=./linux -var lotus_network=mainnet -var git_tag=$CIRCLE_TAG" publish-packer-calibrationnet: description: build and push AWS IAM and DigitalOcean droplet. executor: - name: packer/default - packer-version: 1.6.6 + name: packer steps: - checkout - attach_workspace: at: "." - - packer/build: + - packer_build: template: tools/packer/lotus.pkr.hcl args: "-var ci_workspace_bins=./linux-calibrationnet -var lotus_network=calibrationnet -var git_tag=$CIRCLE_TAG" publish-packer-butterflynet: description: build and push AWS IAM and DigitalOcean droplet. executor: - name: packer/default - packer-version: 1.6.6 + name: packer steps: - checkout - attach_workspace: at: "." - - packer/build: + - packer_build: template: tools/packer/lotus.pkr.hcl args: "-var ci_workspace_bins=./linux-butterflynet -var lotus_network=butterflynet -var git_tag=$CIRCLE_TAG" publish-packer-snap: description: build packer image with snap. mainnet only. executor: - name: packer/default - packer-version: 1.6.6 + name: packer steps: - checkout - attach_workspace: at: "." - - packer/build: + - packer_build: template: tools/packer/lotus-snap.pkr.hcl publish-dockerhub: description: publish to dockerhub From b4938551953d9576c51f105cd0871227ba4f28c2 Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Wed, 30 Mar 2022 23:10:17 -0700 Subject: [PATCH 8/8] fix template --- .circleci/config.yml | 14 +++++++------- .circleci/template.yml | 1 - 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c854f4b55..35fc6fa5e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1098,13 +1098,13 @@ workflows: - publish-packer-mainnet: requires: - build-all - # filters: - # branches: - # ignore: - # - /.*/ - # tags: - # only: - # - /^v\d+\.\d+\.\d+(-rc\d+)?$/ + filters: + branches: + ignore: + - /.*/ + tags: + only: + - /^v\d+\.\d+\.\d+(-rc\d+)?$/ - publish-packer-calibrationnet: requires: - build-ntwk-calibration diff --git a/.circleci/template.yml b/.circleci/template.yml index a73cac4d6..6f73d85ac 100644 --- a/.circleci/template.yml +++ b/.circleci/template.yml @@ -2,7 +2,6 @@ version: 2.1 orbs: go: gotest/tools@0.0.13 aws-cli: circleci/aws-cli@1.3.2 - packer: salaxander/packer@0.0.3 executors: golang: