digitalocean pass test (#5721)

* force packer build

* disable ami temporarially

* apt and ufw

* initial lotus config

* rename correctly

* apt-get instead of apt

* undo temporary edits

* install before upgrade

* tmp - force digitalocean

* reenable filters

* uncomment ebs

* tmp, remove filter for digitalocean build

* doc

* install ufw (for iams where it isn't installed)

* more amazon regions

* missing comma

* missing comma

* remove unavailable regions

* switch to ubuntu, not minimal

* pro server

* change owner

* change image

* uncomment circleci filters

* remove api from firewall

* tmp: remove circleci filter

* dpkg options

* confold

* try export

* re-add filter
This commit is contained in:
Cory Schwartz 2021-03-25 05:25:11 -07:00 committed by GitHub
parent 4d01f8f30b
commit 01202c5276
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 84 additions and 4 deletions

View File

@ -52,6 +52,13 @@ You only need to do this once, after which, you can enable and start the miner.
Do you want to access your lotus daemon remotely? Learn how to setup token authentication
and use client libraries from lotus docs.
https://docs.filecoin.io/build/lotus/enable-remote-api-access/
For more information, see https://docs.filecoin.io/
Found a bug? let us know! https://github.com/filecoin-project/lotus
Chat with us on slack! https://filecoinproject.slack.com/archives/CEGN061C5

View File

@ -1,5 +1,12 @@
PS1="[\h \w] ⨎ "
export PROMT_DIRTRIM=1
# Where to find the lotus repo
export LOTUS_PATH=/var/lib/lotus
export LOTUS_MINER_PATH=/var/lib/lotus-miner
# The miner is not running in this image by default.
# export LOTUS_MINER_PATH=/var/lib/lotus-miner
# To access the lotus node remotely, the following environment variable may be used.
# export FULLNODE_API_INFO=<token>:/ip4/<public-ip>/tcp/1234/http

View File

@ -20,7 +20,23 @@ locals {
source "amazon-ebs" "lotus" {
ami_name = "lotus-${var.lotus_network}-${var.git_tag}-${local.timestamp}"
ami_regions = [
"ap-east-1",
"ap-northeast-1",
"ap-northeast-2",
"ap-northeast-3",
"ap-south-1",
"ap-southeast-1",
"ap-southeast-2",
"ca-central-1",
"eu-central-1",
"eu-north-1",
"eu-west-1",
"eu-west-2",
"eu-west-3",
"sa-east-1",
"us-east-1",
"us-east-2",
"us-west-1",
"us-west-2",
]
ami_groups = [
@ -37,7 +53,7 @@ source "amazon-ebs" "lotus" {
instance_type = "t2.micro"
source_ami_filter {
filters = {
name = "ubuntu-minimal/images/*ubuntu-focal-20.04-amd64-minimal*"
name = "ubuntu/images/*ubuntu-focal-20.04-amd64-server-*"
root-device-type = "ebs"
virtualization-type = "hvm"
}
@ -85,6 +101,10 @@ build {
source = "./tools/packer/systemd/lotus-miner.service"
destination = "lotus-miner.service"
}
provisioner "file" {
source = "./tools/packer/repo/config.toml"
destination = "config.toml"
}
provisioner "file" {
source = "./tools/packer/etc/motd"
destination = "motd"

View File

@ -0,0 +1,36 @@
[API]
ListenAddress = "/ip4/0.0.0.0/tcp/1234/http"
# RemoteListenAddress = ""
# Timeout = "30s"
#
[Libp2p]
ListenAddresses = ["/ip4/0.0.0.0/tcp/5678", "/ip6/::/tcp/5678"]
# AnnounceAddresses = []
# NoAnnounceAddresses = []
# ConnMgrLow = 150
# ConnMgrHigh = 180
# ConnMgrGrace = "20s"
#
[Pubsub]
# Bootstrapper = false
# RemoteTracer = "/dns4/pubsub-tracer.filecoin.io/tcp/4001/p2p/QmTd6UvR47vUidRNZ1ZKXHrAFhqTJAD27rKL9XYghEKgKX"
#
[Client]
# UseIpfs = false
# IpfsOnlineMode = false
# IpfsMAddr = ""
# IpfsUseForRetrieval = false
# SimultaneousTransfers = 20
#
[Metrics]
# Nickname = ""
# HeadNotifs = false
#
[Wallet]
# RemoteBackend = ""
# EnableLedger = false
# DisableLocal = false
#
[Fees]
# DefaultMaxFee = "0.007 FIL"
#

View File

@ -22,11 +22,14 @@ MANAGED_FILES=(
/lib/systemd/system/lotus-daemon.service
/lib/systemd/system/lotus-miner.service
/etc/motd
/var/lib/lotus/config.toml
)
# install libs.
apt update
apt -y install libhwloc15 ocl-icd-libopencl1
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get -y install libhwloc15 ocl-icd-libopencl1 ufw
apt-get -y upgrade -q -y -u -o Dpkg::Options::="--force-confold"
ln -s /usr/lib/x86_64-linux-gnu/libhwloc.so.15 /usr/lib/x86_64-linux-gnu/libhwloc.so.5
# Create lotus user
@ -55,3 +58,10 @@ done
# Enable services
systemctl daemon-reload
systemctl enable lotus-daemon
# Setup firewall
ufw enable
ufw default deny incoming
ufw default allow outgoing
ufw allow ssh
ufw allow 5678 #libp2p