Skip to content

Commit

Permalink
Merge branch 'develop' into refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-moser committed Sep 15, 2021
2 parents 430c8e2 + 6359b7b commit 32b92c4
Show file tree
Hide file tree
Showing 23 changed files with 410 additions and 100 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/docker-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on: workflow_dispatch
jobs:

docker:
environment: pre-devnet
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: 1
Expand All @@ -16,7 +15,7 @@ jobs:
- name: Publish to Docker Hub
uses: docker/build-push-action@92e71463491f2d026a477188b8ad3a0fdd9d672c
with:
repository: iotaledger/goshimmer
username: '${{ secrets.IOTALEDGER_HUB_DOCKER_LOGIN }}'
password: '${{ secrets.IOTALEDGER_HUB_DOCKER_PASSWORD }}'
repository: iotafoundationtesting/goshimmer
username: '${{ secrets.IOTAFOUNDATIONTESTING_HUB_DOCKER_LOGIN }}'
password: '${{ secrets.IOTAFOUNDATIONTESTING_HUB_DOCKER_PASSWORD }}'
tags: testing
3 changes: 2 additions & 1 deletion .github/workflows/pre-devnet-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ jobs:
ELK_ELASTIC_USER: '${{ secrets.ELK_ELASTIC_USER }}'
DRANDS_SECRET: '${{ secrets.DRANDS_SECRET }}'
COMMIT_SHA: '${{ github.sha }}'
GOSHIMMER_DOCKER_TAG: 'develop'
run: |
export NETWORK_VERSION=$((16#$(git rev-parse --short "$COMMIT_SHA")%1000000000+1000))
./deploy/ansible/run.sh
./deploy/ansible/run.sh pre-devnet.yml
74 changes: 66 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,32 @@
name: Release
'on':
release:
types:
- published
on:
workflow_dispatch:
inputs:
tagName:
description: 'Tag name'
required: true
releaseDescription:
description: 'Release description'
required: true

jobs:
createTag:
environment: devnet
name: Create Git tag
runs-on:
- ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Create Git tag
run: |
git tag ${{ github.event.inputs.tagName }}
git push origin ${{ github.event.inputs.tagName }}
goreleaser:
environment: devnet
needs: createTag
name: GoReleaser
runs-on:
- ubuntu-latest
Expand All @@ -15,33 +36,70 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: "refs/tags/${{github.event.inputs.tagName}}"
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16.3

- name: Copy config.default.json to config.json
run: cp config.default.json config.json

- name: Download latest snapshot file
run: wget -O snapshot.bin https://dbfiles-goshimmer.s3.eu-central-1.amazonaws.com/snapshots/nectar/snapshot-latest.bin

- name: Run GoReleaser
run: goreleaser --rm-dist
run: goreleaser --rm-dist --release-notes <(echo "${{ github.event.inputs.releaseDescription }}")
shell: bash
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

docker:
environment: devnet
name: Docker
needs: createTag
name: Docker build and deploy
runs-on:
- ubuntu-latest
env:
DOCKER_BUILDKIT: 1
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: "refs/tags/${{github.event.inputs.tagName}}"
- name: Publish to Docker Hub
uses: docker/build-push-action@92e71463491f2d026a477188b8ad3a0fdd9d672c
env:
DOCKER_BUILDKIT: 1
with:
repository: iotaledger/goshimmer
username: '${{ secrets.IOTALEDGER_HUB_DOCKER_LOGIN }}'
password: '${{ secrets.IOTALEDGER_HUB_DOCKER_PASSWORD }}'
tags: latest
tag_with_ref: true

- name: Install SSH Key
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
run: |
mkdir -p ~/.ssh/
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
sudo chmod 600 ~/.ssh/id_ed25519
echo '
Host *
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
' > ~/.ssh/config
- name: Ansible deploy
env:
GOSHIMMER_SEEDS: '${{ secrets.GOSHIMMER_SEEDS }}'
MONGODB_USER: '${{ secrets.MONGODB_USER }}'
MONGODB_PASSWORD: '${{ secrets.MONGODB_PASSWORD }}'
GRAFANA_ADMIN_PASSWORD: '${{ secrets.GRAFANA_ADMIN_PASSWORD }}'
ELK_ELASTIC_PASSWORD: '${{ secrets.ELK_ELASTIC_PASSWORD }}'
ELK_ELASTIC_USER: '${{ secrets.ELK_ELASTIC_USER }}'
DRANDS_SECRET: '${{ secrets.DRANDS_SECRET }}'
DRNG_XTEAM_01_SEED: '${{ secrets.DRNG_XTEAM_01_SEED }}'
GOSHIMMER_DOCKER_TAG: 'latest'
run: |
./deploy/ansible/run.sh devnet.yml
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ RUN --mount=target=. \

# Enable building the image without downloading the snapshot.
# If built with dummy snapshot then a snapshot needs to be mounted into the resulting image.
RUN if (( $DOWNLOAD_SNAPSHOT == 1 )); then \
RUN if [ $DOWNLOAD_SNAPSHOT -gt 0 ]; then \
wget -O /tmp/snapshot.bin https://dbfiles-goshimmer.s3.eu-central-1.amazonaws.com/snapshots/nectar/snapshot-latest.bin ; \
else \
touch /tmp/snapshot.bin ; \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<h2 align="center">Prototype node software for an IOTA network without the Coordinator</h2>

<p align="center">
<a href="https://goshimmer.docs.iota.org/goshimmer.html" style="text-decoration:none;">
<a href="https://goshimmer.docs.iota.org" style="text-decoration:none;">
<img src="https://img.shields.io/badge/Documentation%20portal-blue.svg?style=for-the-badge" alt="Developer documentation portal">
</p>
<p align="center">
Expand Down
10 changes: 8 additions & 2 deletions deploy/ansible/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@
- role: goshimmer-node
nodeType: analysis-server

- hosts: goshimmers
- hosts: goshimmers:&internal_nodes
vars:
nodeType: goshimmer
roles:
- goshimmer-node
- goshimmer-node

- hosts: goshimmers:&public_nodes
vars:
nodeType: public-node
roles:
- goshimmer-node
34 changes: 0 additions & 34 deletions deploy/ansible/hosts.yml

This file was deleted.

58 changes: 58 additions & 0 deletions deploy/ansible/hosts/devnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
metrics:
hosts:
metrics-01.devnet.shimmer.iota.cafe:

supports:
hosts:
analysisentry-01.devnet.shimmer.iota.cafe:
entryNodeSeed: "{{ ANALYSISSENTRY_01_ENTRYNODE_SEED }}"
mongoDBHost: "metrics-01.devnet.shimmer.iota.cafe"
manaDashboardHost: "bootstrap-01.devnet.shimmer.iota.cafe"

goshimmers:
children:
internal_nodes:
hosts:
bootstrap-01.devnet.shimmer.iota.cafe:
seed: "{{ BOOTSTRAP_01_SEED }}"
bootstrap: true
vanilla-01.devnet.shimmer.iota.cafe:
seed: "{{ VANILLA_01_SEED }}"
drng-01.devnet.shimmer.iota.cafe:
seed: "{{ DRNG_01_SEED }}"
drng-02.devnet.shimmer.iota.cafe:
seed: "{{ DRNG_02_SEED }}"
drng-03.devnet.shimmer.iota.cafe:
seed: "{{ DRNG_03_SEED }}"
drng-04.devnet.shimmer.iota.cafe:
seed: "{{ DRNG_04_SEED }}"
drng-05.devnet.shimmer.iota.cafe:
seed: "{{ DRNG_05_SEED }}"
drng-xteam-01.devnet.shimmer.iota.cafe:
seed: "{{ DRNG_XTEAM_01_SEED }}"
faucet-01.devnet.shimmer.iota.cafe:
seed: "{{ FAUCET_01_SEED }}"
faucet: true
faucetSeed: "{{ FAUCET_01_FAUCET_SEED }}"
public_nodes:
hosts:
public-node-01.devnet.shimmer.iota.cafe:
public-node-02.devnet.shimmer.iota.cafe:
public-node-03.devnet.shimmer.iota.cafe:

vars:
analysisServerHost: "analysisentry-01.devnet.shimmer.iota.cafe"
entryNodeHost: "analysisentry-01.devnet.shimmer.iota.cafe"
remoteLoggerHost: "metrics-01.devnet.shimmer.iota.cafe"
communityEntryNode: "5EDH4uY78EA6wrBkHHAVBWBMDt7EcksRq6pjzipoW15B@entryshimmer.tanglebay.com:14646"
xteamDRNG: true

drands:
hosts:
drand-01.devnet.shimmer.iota.cafe:
vars:
drngHostTemplate: "drng-0{drandNumber}.devnet.shimmer.iota.cafe"

asset_registries:
hosts:
asset-registry-01.devnet.shimmer.iota.cafe:
44 changes: 44 additions & 0 deletions deploy/ansible/hosts/pre-devnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
metrics:
hosts:
metrics-01.pre-devnet.shimmer.iota.cafe:

supports:
hosts:
analysisentry-01.pre-devnet.shimmer.iota.cafe:
entryNodeSeed: "{{ ANALYSISSENTRY_01_ENTRYNODE_SEED }}"
mongoDBHost: "metrics-01.pre-devnet.shimmer.iota.cafe"
manaDashboardHost: "bootstrap-01.pre-devnet.shimmer.iota.cafe"

goshimmers:
children:
internal_nodes:
hosts:
bootstrap-01.pre-devnet.shimmer.iota.cafe:
seed: "{{ BOOTSTRAP_01_SEED }}"
bootstrap: true
vanilla-01.pre-devnet.shimmer.iota.cafe:
seed: "{{ VANILLA_01_SEED }}"
drng-01.pre-devnet.shimmer.iota.cafe:
seed: "{{ DRNG_01_SEED }}"
drng-02.pre-devnet.shimmer.iota.cafe:
seed: "{{ DRNG_02_SEED }}"
drng-03.pre-devnet.shimmer.iota.cafe:
seed: "{{ DRNG_03_SEED }}"
drng-04.pre-devnet.shimmer.iota.cafe:
seed: "{{ DRNG_04_SEED }}"
drng-05.pre-devnet.shimmer.iota.cafe:
seed: "{{ DRNG_05_SEED }}"
faucet-01.pre-devnet.shimmer.iota.cafe:
seed: "{{ FAUCET_01_SEED }}"
faucet: true
faucetSeed: "{{ FAUCET_01_FAUCET_SEED }}"
vars:
analysisServerHost: "analysisentry-01.pre-devnet.shimmer.iota.cafe"
entryNodeHost: "analysisentry-01.pre-devnet.shimmer.iota.cafe"
remoteLoggerHost: "metrics-01.pre-devnet.shimmer.iota.cafe"

drands:
hosts:
drand-01.pre-devnet.shimmer.iota.cafe:
vars:
drngHostTemplate: "drng-0{drandNumber}.pre-devnet.shimmer.iota.cafe"
15 changes: 12 additions & 3 deletions deploy/ansible/initial-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@
- role: goshimmer-node
nodeType: analysis-server

- hosts: goshimmers
- hosts: goshimmers:&internal_nodes
vars:
nodeType: goshimmer
roles:
- goshimmer-node

- hosts: goshimmers:&public_nodes
vars:
nodeType: public-node
roles:
- goshimmer-node


- hosts: drands
vars:
Expand All @@ -28,7 +34,6 @@
roles:
- role: drand
drandNumber: 1
isLeaderDrand: true
- role: drand
drandNumber: 2
- role: drand
Expand All @@ -41,9 +46,13 @@
- name: Generate key materials in leader Drand
command: docker exec -d drand1 drand share --leader --nodes {{ numberOfDrands }} --threshold {{ drandsThreshold }} --secret "{{ drandsSecret }}" --period 10s --catchup-period 0
- name: Generate key materials in follower Drands
command: docker exec -d drand{{ item.drandNumber }} drand share --connect "drand-01.pre-devnet.shimmer.iota.cafe:1234" --tls-disable --nodes {{ numberOfDrands }} --threshold {{ drandsThreshold }} --secret "{{ drandsSecret }}" --catchup-period 0
command: docker exec -d drand{{ item.drandNumber }} drand share --connect "{{ inventory_hostname }}:1234" --tls-disable --nodes {{ numberOfDrands }} --threshold {{ drandsThreshold }} --secret "{{ drandsSecret }}" --catchup-period 0
with_items:
- { drandNumber: 2 }
- { drandNumber: 3 }
- { drandNumber: 4 }
- { drandNumber: 5 }

- hosts: asset_registries
roles:
- asset-registry
31 changes: 31 additions & 0 deletions deploy/ansible/roles/asset-registry/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
- name: Create directory
file:
path: /opt/asset-registry
state: directory
mode: '0755'


- name: Template docker-compose.yml
template:
src: docker-compose.yml.j2
dest: /opt/asset-registry/docker-compose.yml
mode: '0644'

- name: Stop existing services gracefully
community.general.docker_compose:
project_src: /opt/asset-registry
timeout: 180
state: present
stopped: yes

- name: Tear down existing services
community.general.docker_compose:
project_src: /opt/asset-registry
state: absent

- name: Run services
community.general.docker_compose:
project_src: /opt/asset-registry
timeout: 180
state: present
pull: yes
Loading

0 comments on commit 32b92c4

Please sign in to comment.