add calibrationnet

This commit is contained in:
Cory Schwartz 2021-02-17 00:49:07 -08:00
parent de80b1e433
commit cec0a6e790
6 changed files with 68 additions and 21 deletions

View File

@ -278,6 +278,11 @@ jobs:
- install-deps
- prepare
- run: make calibnet
- run: mkdir linux-calibnet && mv lotus lotus-miner lotus-worker linux-calibnet
- persist_to_workspace:
root: "."
paths:
- linux-calibnet
build-lotus-soup:
description: |
Compile `lotus-soup` Testground test plan
@ -595,6 +600,10 @@ 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"
- packer/build:
template: tools/packer/lotus.pkr.hcl
args: "-var ci_workspace_bins=./linux-calibnet -var lotus_network=calibrationnet -var git_tag=$CIRCLE_TAG"
workflows:
version: 2.1
@ -699,10 +708,12 @@ workflows:
- publish-packer:
requires:
- build-all
filters:
branches:
ignore:
- /.*/
tags:
only:
- /^v\d+\.\d+\.\d+$/
- build-ntwk-calibration
filters:
branches:
ignore:
- /.*/
tags:
only:
- /^v\d+\.\d+\.\d+$/

View File

@ -1,7 +1,24 @@
locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") }
variable "ci_workspace_bins" {
type = string
default = "./linux"
}
source "amazon-ebs" "lotus-mainnet" {
ami_name = "lotus-mainnet-${local.timestamp}"
variable "lotus_network" {
type = string
default = "mainnet"
}
variable "git_tag" {
type = string
default = ""
}
locals {
timestamp = regex_replace(timestamp(), "[- TZ:]", "")
}
source "amazon-ebs" "lotus" {
ami_name = "lotus-${var.lotus_network}-${var.git_tag}-${local.timestamp}"
ami_regions = [
"us-east-1",
"us-west-2",
@ -21,33 +38,33 @@ source "amazon-ebs" "lotus-mainnet" {
ssh_username = "ubuntu"
}
source "digitalocean" "lotus-mainnet" {
droplet_name = "lotus-mainnet"
source "digitalocean" "lotus" {
droplet_name = "lotus-${var.lotus_network}"
size = "s-1vcpu-1gb"
region = "nyc3"
image = "ubuntu-20-04-x64"
snapshot_name = "lotus-mainnet-${local.timestamp}"
snapshot_name = "lotus-${var.lotus_network}-${local.timestamp}"
ssh_username = "root"
}
build {
sources = [
"source.amazon-ebs.lotus-mainnet",
"source.digitalocean.lotus-mainnet",
"source.amazon-ebs.lotus",
"source.digitalocean.lotus",
]
# Lotus software (from CI workspace)
provisioner "file" {
source = "./linux/lotus"
source = "${var.ci_workspace_bins}/lotus"
destination = "lotus"
}
provisioner "file" {
source = "./linux/lotus-miner"
source = "${var.ci_workspace_bins}/lotus-miner"
destination = "lotus-miner"
}
# First run script
provisioner "file" {
source = "./tools/packer/scripts/lotus-init.sh"
source = "./tools/packer/scripts/${var.lotus_network}/lotus-init.sh"
destination = "lotus-init.sh"
}
# Systemd service units.
@ -64,16 +81,15 @@ build {
destination = "lotus-init.service"
}
provisioner "file" {
source = "./tools/packer/LOTUS.txt"
source = "./tools/packer/homedir/LOTUS.txt"
destination = "LOTUS.txt"
}
provisioner "file" {
source = "./tools/packer/bashrc"
source = "./tools/packer/homedir/bashrc"
destination = ".bashrc"
}
# build it.
provisioner "shell" {
script = "./tools/packer/setup.sh"
}
}

View File

@ -0,0 +1,20 @@
#!/usr/bin/env bash
# This script sets up an initial configuraiton for the lotus daemon and miner
# It will only run once.
GATE="$LOTUS_PATH"/date_initialized
# Don't init if already initialized.
if [ -f "GATE" ]; then
echo lotus already initialized.
exit 0
fi
# Not importing snapshot on calibrationnet.
#
# echo importing minimal snapshot
# lotus daemon --import-snapshot https://fil-chain-snapshots-fallback.s3.amazonaws.com/mainnet/minimal_finality_stateroots_latest.car --halt-after-import
# Block future inits
date > "$GATE"