Skip to content

Commit 5a98797

Browse files
authored
Merge pull request #2208 from iotaledger/develop
2 parents 80d5713 + 029c622 commit 5a98797

33 files changed

+12410
-2798
lines changed

.github/workflows/test-docs-build.yml

+9-31
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,21 @@
1-
name: Test Docs Wiki Build
1+
name: Test Docs Build
22

33
on:
44
pull_request:
55
branches:
66
- develop
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
712
jobs:
813
checks:
914
runs-on: ubuntu-latest
1015
steps:
11-
- uses: actions/checkout@v2
12-
- uses: actions/setup-node@v1
13-
with:
14-
node-version: '16.x'
15-
- name: Install dependencies
16-
run: |
17-
cd documentation
18-
npm ci
19-
- name: Setup Wiki and Test Build
16+
- uses: actions/checkout@v3
17+
- name: Test Build
2018
run: |
21-
# Move into the documentation folder
2219
cd documentation
23-
# Export this projects configuration as a variable
24-
export config=$(cat EXTERNAL_DOCS_CONFIG)
25-
# Set up the wiki using iota wiki cli. This will clone the wiki repository as well the current repository
26-
npm run setup
27-
# Sync the PRs static content with the freshly created wiki instance
28-
rsync -av --progress ./static/img/ ./local-wiki/iota-wiki/static/img/
29-
cd ../
30-
# Sync the PR content with the freshly created wiki instance
31-
rsync -av --progress ./ ./documentation/local-wiki/iota-wiki/external/goshimmer --exclude .git --exclude node_modules --exclude local-wiki
32-
# Change directory into the wiki
33-
cd documentation/local-wiki/iota-wiki
34-
# Install docusaurus and it's dependencies
35-
yarn
36-
# Replace the configuration placeholder with the configuration variable text
37-
export replace_string='/\* AUTO GENERATED EXTERNAL DOCS CONFIG \*/'
38-
perl -0pe 's#$ENV{replace_string}#$ENV{config}#' docusaurus.config.js > docusaurus.config.js.cpy
39-
# Replace the existing configuration file with the edited one
40-
rm -f docusaurus.config.js && mv docusaurus.config.js.cpy docusaurus.config.js
41-
sed -i "s+baseUrl: '/',+baseUrl: '/goshimmer/',+g" docusaurus.config.js
42-
# Run the build process to test for any errors
20+
yarn install --immutable
4321
yarn build

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# v0.8.14 - 2022-05-16
2+
3+
> Minor revision introducing small docker changes.
4+
5+
The snapshot has been taken at 2022-05-07 16:30 UTC.
6+
- Fix several Docker discrepancies (#2201, #2206)
7+
18
# v0.8.13 - 2022-05-06
29

310
> This release introduces serix, a reflection-based serialization library that enables us to automatically serialize all models.

Dockerfile

+19-15
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ RUN if [ "$DOWNLOAD_SNAPSHOT" -gt 0 ] && [ "$CUSTOM_SNAPSHOT_URL" = "" ] ; then
9090
touch /tmp/snapshot.bin ; \
9191
fi
9292

93+
RUN mkdir -p /tmp/db/mainnetdb /tmp/db/peerdb
94+
# 65532:65532 is the UID:GUID of nonroot user of distroless image
95+
RUN chown 65532:65532 /tmp/db/mainnetdb /tmp/db/peerdb
96+
9397
############################
9498
# Image
9599
############################
@@ -100,7 +104,7 @@ FROM gcr.io/distroless/cc-debian11:nonroot as prepare-runtime
100104
# Gossip
101105
EXPOSE 14666/tcp
102106
# AutoPeering
103-
#EXPOSE 14626/udp
107+
EXPOSE 14626/udp
104108
# Pprof Profiling
105109
EXPOSE 6061/tcp
106110
# Prometheus exporter
@@ -112,32 +116,32 @@ EXPOSE 8081/tcp
112116
# DAGs Visualizer
113117
EXPOSE 8061/tcp
114118

115-
# Copy configuration
116-
COPY --from=build /tmp/snapshot.bin /snapshot.bin
117-
COPY config.default.json /config.json
119+
# Default directory and drop privileges
120+
WORKDIR /app
121+
USER nonroot
118122

119123
# Copy the Pre-built binary file from the previous stage
120-
COPY --chown=nonroot:nonroot --from=build /go/bin/goshimmer /run/goshimmer
124+
COPY --chown=nonroot:nonroot --from=build /go/bin/goshimmer /app/goshimmer
121125

122-
# Fix permission issue when mounting volumes.
123-
COPY --chown=nonroot:nonroot --from=build /tmp/ /tmp/mainnetdb/
124-
COPY --chown=nonroot:nonroot --from=build /tmp/ /tmp/peerdb/
126+
# Copy configuration and snapshot from the previous stage
127+
COPY config.default.json /app/config.json
128+
COPY --from=build /tmp/snapshot.bin /app/snapshot.bin
125129

126-
WORKDIR /tmp
127-
USER nonroot
130+
# Fix permission issue when mounting volumes
131+
COPY --chown=nonroot:nonroot --from=build /tmp/db/ /app/
128132

129-
# We execute this stage only if debugging is disabled, i.e REMOTE_DEBUGGIN==0.
133+
# We execute this stage only if debugging is disabled, i.e REMOTE_DEBUGGIN==0
130134
FROM prepare-runtime as debugger-enabled-0
131135

132-
ENTRYPOINT ["/run/goshimmer", "--config=/config.json"]
136+
ENTRYPOINT ["/app/goshimmer", "--config=/app/config.json"]
133137

134-
# We execute this stage only if debugging is enabled, i.e REMOTE_DEBUGGIN==1.
138+
# We execute this stage only if debugging is enabled, i.e REMOTE_DEBUGGIN==1
135139
FROM prepare-runtime as debugger-enabled-1
136140
EXPOSE 40000
137141

138142
# Copy the Delve binary
139-
COPY --chown=nonroot:nonroot --from=build /go/bin/dlv /run/dlv
140-
ENTRYPOINT ["/run/dlv","--listen=:40000", "--headless" ,"--api-version=2", "--accept-multiclient", "exec", "--continue", "/run/goshimmer", "--", "--config=/config.json"]
143+
COPY --chown=nonroot:nonroot --from=build /go/bin/dlv /app/dlv
144+
ENTRYPOINT ["/app/dlv", "--listen=:40000", "--headless", "--api-version=2", "--accept-multiclient", "exec", "--continue", "/app/goshimmer", "--", "--config=/app/config.json"]
141145

142146
# Execute corresponding build stage depending on the REMOTE_DEBUGGING build arg.
143147
FROM debugger-enabled-${REMOTE_DEBUGGING} as runtime

deploy/ansible/roles/goshimmer-node/templates/docker-compose-goshimmer.yml.j2

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ services:
5757
--node.enablePlugins=dashboard,remotelog,networkdelay,prometheus{% if faucet|default(false) %},faucet{% endif %},activity,snapshot,WebAPIToolsDRNGEndpoint,WebAPIToolsMessageEndpoint,"WebAPI tools Endpoint"{% if spammer|default(false) %},spammer{% endif %}
5858
--prometheus.bindAddress=0.0.0.0:9311
5959
--activity.broadcastInterval=1s
60-
--messageLayer.snapshot.file=/snapshot.bin
6160
{% if faucet|default(false) %}
6261
--faucet.seed={{ faucetSeed }}
6362
--faucet.tokensPerRequest=1000000

deploy/ansible/roles/metrics/tasks/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
- name: Stop existing services gracefully
6969
community.general.docker_compose:
7070
project_src: /opt/metrics
71-
timeout: 180
71+
timeout: 10
7272
state: present
7373
stopped: yes
7474

docker-compose.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ services:
1515
# make sure to give read/write access to the folder ./mainnetdb (e.g., chmod -R 777 ./mainnetdb)
1616
# optionally, you can mount a config.json into the container
1717
volumes:
18-
- "goshimmer-db-volume:/tmp/mainnetdb:rw"
19-
- "goshimmer-peerdb-volume:/tmp/peerdb:rw"
18+
- "goshimmer-db-volume:/app/mainnetdb:rw"
19+
- "goshimmer-peerdb-volume:/app/peerdb:rw"
2020
- "/etc/localtime:/etc/localtime:ro"
2121
ports:
2222
# AutoPeering
@@ -43,8 +43,8 @@ services:
4343
--autoPeering.entryNodes=2PV5487xMw5rasGBXXWeqSi4hLz7r19YBt8Y1TGAsQbj@analysisentry-01.devnet.shimmer.iota.cafe:15626,5EDH4uY78EA6wrBkHHAVBWBMDt7EcksRq6pjzipoW15B@entry-0.devnet.tanglebay.com:14646,CAB87iQZR6BjBrCgEBupQJ4gpEBgvGKKv3uuGVRBKb4n@entry-1.devnet.tanglebay.com:14646
4444
--node.disablePlugins=portcheck
4545
--node.enablePlugins=remotelog,networkdelay,spammer,prometheus
46-
--database.directory=/tmp/mainnetdb
47-
--node.peerDBDirectory=/tmp/peerdb
46+
--database.directory=/app/mainnetdb
47+
--node.peerDBDirectory=/app/peerdb
4848
--logger.level=info
4949
--logger.disableEvents=false
5050
--logger.remotelog.serverAddress=metrics-01.devnet.shimmer.iota.cafe:5213
@@ -95,4 +95,4 @@ volumes:
9595
goshimmer-db-volume:
9696
goshimmer-peerdb-volume:
9797
grafana-data-volume:
98-
prometheus-data-volume:
98+
prometheus-data-volume:

documentation/.gitignore

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Dependencies
2-
/node_modules
2+
node_modules
3+
4+
# Yarn
5+
.pnp.*
6+
.yarn/*
7+
!.yarn/patches
8+
!.yarn/plugins
9+
!.yarn/releases
10+
!.yarn/sdks
11+
!.yarn/versions
312

413
# Production
514
/build
@@ -18,5 +27,3 @@
1827
npm-debug.log*
1928
yarn-debug.log*
2029
yarn-error.log*
21-
22-
/local-wiki

documentation/.yarn/releases/yarn-3.2.0.cjs

+785
Large diffs are not rendered by default.

documentation/.yarnrc.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
nodeLinker: node-modules
2+
3+
yarnPath: .yarn/releases/yarn-3.2.0.cjs

documentation/EXTERNAL_DOCS_CONFIG

-9
This file was deleted.

documentation/README.md

+8-83
Original file line numberDiff line numberDiff line change
@@ -9,103 +9,28 @@ The documentation is built using [Docusaurus 2](https://docusaurus.io/). The dep
99

1010
## Installation
1111

12-
```shell
13-
npm i
14-
npm run setup
12+
```console
13+
yarn
1514
```
1615

17-
This command checks out a local copy of the wiki and creates links to the content.
16+
This command installs all needed dependencies.
1817

1918
## Local Development
2019

21-
```shell
22-
npm start
20+
```console
21+
yarn start
2322
```
2423

25-
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
26-
27-
## Tear Down
28-
29-
```shell
30-
npm run clean
31-
```
32-
33-
This command deletes the local wiki and local links.
34-
24+
This command starts a local, wiki themed, development server and opens up a browser window. Most changes are reflected live without having to restart the server.
3525

3626
## Including .md file
3727

38-
```shell
28+
```console
3929
{@import <file path>}
4030
```
4131

4232
Example:
4333

44-
```shell
34+
```console
4535
{@import ../../../../bindings/wasm/docs/api-reference.md}
4636
```
47-
48-
# Adding content
49-
50-
## Docs
51-
52-
All the project documentation should be placed in the `docs` folder. If you wish to create a new document, you should create a new `.md` file in the corresponding folder. For example, if you wanted to add a new tutorial, you should create a new `.md` file in `docs/tutorials`:
53-
54-
```
55-
documentation # Root directory of your site
56-
└── blog
57-
└── docs
58-
├── welcome.md
59-
└── tutorials
60-
└── your_new_tutorials_name.md
61-
62-
```
63-
64-
You can find more information on docs in the [official docusaurus documentation](https://docusaurus.io/docs/docs-introduction).
65-
66-
## Blog
67-
68-
You should store all your blog posts in the `blog` directory. When creating a new blog post, please make sure to respect the file name structure which includes the posts date in YYYY_MM_DD format. For example, if you wanted to add a post dated July 28th, 2021, your new `.md` file should be prefixed with `2021_07_28`.
69-
70-
You can find more information on blog posts in the [official docusaurus documentation](https://docusaurus.io/docs/blog).
71-
72-
## Sidebar
73-
74-
As the project has multiple documentation pages and sections, these need to be organized. This is handled by the `sidebars.js` file. The `sidebars.js` file contain an ordered JSON formatted object which will be used to generate the project sidebar.
75-
76-
### Documents
77-
78-
You can add a new doc by adding a new object with type `doc` to the sidebar object:
79-
80-
```json
81-
{
82-
type: 'doc',
83-
label: 'FAQ',
84-
id: 'tutorials/your_new_tutorials_name',
85-
}
86-
```
87-
where
88-
89-
* `type` should always be 'doc'.
90-
* `label` should be your desired sidebar item's label.
91-
* `id` is the item's identifier. The ID field should contain the parent folder/s, if any.
92-
93-
### Categories
94-
95-
You can add a new category by adding a new object with type `category` to the sidebar object:
96-
97-
```json
98-
{
99-
type: 'category',
100-
label: 'Tutorials',
101-
items: []
102-
}
103-
```
104-
105-
where
106-
107-
* `type` should always be 'category'.
108-
* `label` should be your desired sidebar category's label.
109-
* `items` is an array of [documents](#documents).
110-
111-
You can find more information on the sidebar and its components in the [official docusaurus documentation](https://docusaurus.io/docs/sidebar).

documentation/config.json

-6
This file was deleted.

documentation/docs/tooling/docker_private_network.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ A node that is used to expose ports via the host and to have a single attachment
164164

165165
##### Volumes
166166

167-
Docker Compose creates a `shimmerdb` volume to maintain a tangle even after tearing down the containers. Run `docker-compose down -v` to clear the volume.
167+
Docker Compose creates a `mainnetdb` volume to maintain a tangle even after tearing down the containers. Run `docker-compose down -v` to clear the volume.
168168

169169
##### Ports
170170

documentation/docs/tutorials/setup.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ docker-compose version 1.26.0, build d4451659
160160
First, lets create a user defined bridged network. Unlike the already existing `bridge` network, the user defined one will have container name DNS resolution for containers within that network. This is useful if later we want to setup additional containers which need to speak with the GoShimmer container.
161161

162162
```shell
163-
docker network create --driver=bridge shimmer
163+
docker network create --driver=bridge goshimmer
164164
c726034d295c3df66803b92c71ca517a0cf0e3c65c1c6d84ee5fa34ae76cbcd4
165165
```
166166

@@ -174,8 +174,8 @@ Lets create a folder holding our database:
174174

175175
```shell
176176
cd /opt/goshimmer
177-
mkdir db
178-
chmod 0777 db
177+
sudo mkdir mainnetdb && sudo chown 65532:65532 mainnetdb
178+
sudo mkdir peerdb && sudo chown 65532:65532 peerdb
179179
```
180180

181181
Finally, lets create our `docker-compose.yml`:
@@ -191,7 +191,7 @@ version: '3.3'
191191
networks:
192192
outside:
193193
external:
194-
name: shimmer
194+
name: goshimmer
195195

196196
services:
197197
goshimmer:
@@ -200,8 +200,8 @@ services:
200200
hostname: goshimmer
201201
stop_grace_period: 2m
202202
volumes:
203-
- "./db:/tmp/mainnetdb:rw"
204-
- "./peerdb:/tmp/peerdb:rw"
203+
- "./db:/app/mainnetdb:rw"
204+
- "./peerdb:/app/peerdb:rw"
205205
- "/etc/localtime:/etc/localtime:ro"
206206
ports:
207207
# Autopeering
@@ -228,8 +228,8 @@ services:
228228
--autoPeering.entryNodes=2PV5487xMw5rasGBXXWeqSi4hLz7r19YBt8Y1TGAsQbj@analysisentry-01.devnet.shimmer.iota.cafe:15626,5EDH4uY78EA6wrBkHHAVBWBMDt7EcksRq6pjzipoW15B@entry-0.devnet.tanglebay.com:14646,CAB87iQZR6BjBrCgEBupQJ4gpEBgvGKKv3uuGVRBKb4n@entry-1.devnet.tanglebay.com:14646
229229
--node.disablePlugins=portcheck
230230
--node.enablePlugins=remotelog,networkdelay,spammer,prometheus
231-
--database.directory=/tmp/mainnetdb
232-
--node.peerDBDirectory=/tmp/peerdb
231+
--database.directory=/app/mainnetdb
232+
--node.peerDBDirectory=/app/peerdb
233233
--logger.level=info
234234
--logger.disableEvents=false
235235
--logger.remotelog.serverAddress=metrics-01.devnet.shimmer.iota.cafe:5213

0 commit comments

Comments
 (0)