Skip to content

Commit 2d53d32

Browse files
haorldbchihugepantscmmarslenderAmineKhaldi
authored
Disk plotting alpha 1 (#181)
* Added ability to plot using the disk via the `diskplot` command. Co-authored-by: hugepants <[email protected]> Co-authored-by: Chris Marslender <[email protected]> Co-authored-by: Amine Khaldi <[email protected]>
1 parent ad85a8f commit 2d53d32

File tree

214 files changed

+61122
-21798
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

214 files changed

+61122
-21798
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto
2+
3+
*.sh text eol=lf

.github/actions/build-asset-linux.sh renamed to .github/actions/build-asset-unix.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,31 @@
55
# - BB_ARTIFACT_NAME
66
# - BB_VERSION
77
#
8-
set -e
9-
set -o pipefail
8+
set -eo pipefail
109

10+
thread_count=2
11+
12+
if [[ $OSTYPE == 'darwin'* ]]; then
13+
thread_count=$(sysctl -n hw.logicalcpu)
14+
else
15+
thread_count=$(nproc --all)
16+
fi
1117

1218
# TODO: Use specific GCC version
1319
echo "System: $(uname -s)"
1420
gcc --version
1521

1622
mkdir build && cd build
1723
cmake ..
18-
bash -e -o pipefail ../extract-version.sh
19-
cmake --build . --target bladebit --config Release -j $(nproc --all)
24+
bash -eo pipefail ../embed-version.sh
25+
cmake --build . --target bladebit --config Release -j $thread_count
2026
chmod +x ./bladebit
2127

2228
# Ensure bladebit version matches expected version
2329
bb_version="$(./bladebit --version | xargs)"
2430

2531
if [[ "$bb_version" != "$BB_VERSION" ]]; then
26-
>&2 echo "Incorrect bladebit version. Got but '$bb_version' expected '$BB_VERSION'."
32+
>&2 echo "Incorrect bladebit version. Got '$bb_version' but expected '$BB_VERSION'."
2733
exit 1
2834
fi
2935

.github/actions/get-version.sh

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,31 @@
11
#! /usr/bin/env bash
22
# NOTE: This is meant to be run from the repo root dir
33
#
4-
set -e
5-
set -o pipefail
4+
set -eo pipefail
65

76
os=$1
87
arch=$2
98

10-
version=$(cat VERSION)
11-
suffix=
12-
ext="tar.gz"
9+
version_cmp=($(./extract-version.sh))
1310

14-
if [[ "$GITHUB_REF_NAME" != "master" ]]; then
15-
suffix="-$GITHUB_REF_NAME"
16-
fi
11+
ver_maj=${version_cmp[0]}
12+
ver_min=${version_cmp[1]}
13+
ver_rev=${version_cmp[2]}
14+
ver_suffix=${version_cmp[3]}
15+
16+
version="${ver_maj}.${ver_min}.${ver_rev}${ver_suffix}"
17+
18+
# echo "Ref name: '$GITHUB_REF_NAME'"
19+
# if [[ "$GITHUB_REF_NAME" != "master" ]]; then
20+
# suffix="-${GITHUB_REF_NAME}"
21+
# fi
22+
23+
ext="tar.gz"
1724

1825
if [[ "$os" == "windows" ]]; then
1926
ext="zip"
2027
fi
2128

2229
echo "::set-output name=BB_VERSION::$version"
23-
echo "::set-output name=BB_ARTIFACT_NAME::bladebit-v${version}${suffix}-${os}-${arch}.${ext}"
30+
echo "::set-output name=BB_ARTIFACT_NAME::bladebit-v${version}-${os}-${arch}.${ext}"
31+

.github/workflows/attach-release-assets.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ jobs:
1010
runs-on: ubuntu-20.04
1111
steps:
1212
- name: Checkout Repo
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v3
1414
with:
1515
ref: master
1616

1717
# Setup Node
18-
- uses: actions/setup-node@v2
19-
with: { node-version: '14' }
18+
- uses: actions/setup-node@v3
19+
with: { node-version: '16' }
2020
- run: cd .github/actions && npm install @octokit/action
2121

2222
# Upload Artifacts as Release Assets
@@ -35,6 +35,8 @@ jobs:
3535
bladebit-v${BB_VERSION}-ubuntu-arm64.tar.gz
3636
bladebit-v${BB_VERSION}-centos-arm64.tar.gz
3737
bladebit-v${BB_VERSION}-windows-x86-64.zip
38+
bladebit-v${BB_VERSION}-macos-arm64.tar.gz
39+
bladebit-v${BB_VERSION}-macos-x86-64.tar.gz
3840
)
3941
4042
mkdir -p bin

.github/workflows/build-release.yml

Lines changed: 73 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-20.04
1010
steps:
1111
- name: Checkout Repo
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v3
1313

1414
- name: Get Version Number
1515
id: version_number
@@ -22,7 +22,7 @@ jobs:
2222
env:
2323
BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
2424
BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}}
25-
run: .github/actions/build-asset-linux.sh
25+
run: .github/actions/build-asset-unix.sh
2626

2727
- name: Upload Artifact Ubuntu x86-64
2828
uses: actions/upload-artifact@v2
@@ -34,10 +34,10 @@ jobs:
3434
build-centos-x86-64:
3535
runs-on: ubuntu-20.04
3636
container:
37-
image: centos:8
37+
image: quay.io/centos/centos:stream8
3838
steps:
3939
- name: Checkout Repo
40-
uses: actions/checkout@v2
40+
uses: actions/checkout@v3
4141

4242
- name: Get Version Number
4343
id: version_number
@@ -54,7 +54,7 @@ jobs:
5454
BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}}
5555
run: |
5656
source /opt/rh/gcc-toolset-9/enable
57-
.github/actions/build-asset-linux.sh
57+
.github/actions/build-asset-unix.sh
5858
5959
- name: Upload Artifact CentOS x86-64
6060
uses: actions/upload-artifact@v2
@@ -64,15 +64,15 @@ jobs:
6464
if-no-files-found: error
6565

6666
build-ubuntu-arm64:
67-
runs-on: [ARM64]
67+
runs-on: [ARM64, Linux]
6868
container:
69-
image: ubuntu:20.04
69+
image: chianetwork/ubuntu-20.04-builder:latest
7070
defaults:
7171
run:
7272
shell: bash
7373
steps:
7474
- name: Checkout Repo
75-
uses: actions/checkout@v2
75+
uses: actions/checkout@v3
7676

7777
- name: Get Version Number
7878
id: version_number
@@ -82,13 +82,13 @@ jobs:
8282
run: |
8383
export DEBIAN_FRONTEND=noninteractive
8484
apt update
85-
apt install -y build-essential git cmake libgmp-dev libnuma-dev
85+
apt install -y build-essential git libgmp-dev libnuma-dev
8686
8787
- name: Build
8888
env:
8989
BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
9090
BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}}
91-
run: .github/actions/build-asset-linux.sh
91+
run: .github/actions/build-asset-unix.sh
9292

9393
- name: Upload Artifact Ubuntu ARM64
9494
uses: actions/upload-artifact@v2
@@ -98,12 +98,12 @@ jobs:
9898
if-no-files-found: error
9999

100100
build-centos-arm64:
101-
runs-on: [ARM64]
101+
runs-on: [ARM64, Linux]
102102
container:
103-
image: centos:8
103+
image: quay.io/centos/centos:stream8
104104
steps:
105105
- name: Checkout Repo
106-
uses: actions/checkout@v2
106+
uses: actions/checkout@v3
107107

108108
- name: Get Version Number
109109
id: version_number
@@ -120,7 +120,7 @@ jobs:
120120
BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}}
121121
run: |
122122
source /opt/rh/gcc-toolset-9/enable
123-
.github/actions/build-asset-linux.sh
123+
.github/actions/build-asset-unix.sh
124124
125125
- name: Upload Artifact CentOS ARM64
126126
uses: actions/upload-artifact@v2
@@ -133,7 +133,7 @@ jobs:
133133
runs-on: windows-2019
134134
steps:
135135
- name: Checkout Repo
136-
uses: actions/checkout@v2
136+
uses: actions/checkout@v3
137137

138138
- name: Get Version Number
139139
shell: bash
@@ -149,7 +149,7 @@ jobs:
149149
150150
mkdir build && cd build
151151
cmake ..
152-
bash -e -o pipefail ../extract-version.sh
152+
bash -e -o pipefail ../embed-version.sh
153153
cat ../src/Version.h
154154
cmake --build . --target bladebit --config Release
155155
@@ -173,3 +173,60 @@ jobs:
173173
path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
174174
if-no-files-found: error
175175

176+
build-macos-arm64:
177+
runs-on: [macOS, ARM64]
178+
steps:
179+
- name: Cleanup Environment
180+
uses: Chia-Network/actions/clean-workspace@main
181+
182+
- name: Checkout Repo
183+
uses: actions/checkout@v3
184+
185+
- name: Get Version Number
186+
id: version_number
187+
run: bash -e .github/actions/get-version.sh macos arm64
188+
189+
- name: Install Prerequisites
190+
run: brew install cmake
191+
192+
- name: Build
193+
env:
194+
BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
195+
BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}}
196+
run: .github/actions/build-asset-unix.sh
197+
198+
- name: Upload Artifact macOS arm64
199+
uses: actions/upload-artifact@v2
200+
with:
201+
name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
202+
path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
203+
if-no-files-found: error
204+
205+
build-macos-x86-64:
206+
runs-on: macOS-latest
207+
steps:
208+
- name: Cleanup Environment
209+
uses: Chia-Network/actions/clean-workspace@main
210+
211+
- name: Checkout Repo
212+
uses: actions/checkout@v3
213+
214+
- name: Get Version Number
215+
id: version_number
216+
run: .github/actions/get-version.sh macos x86-64
217+
218+
- name: Install Prerequisites
219+
run: brew install cmake
220+
221+
- name: Build
222+
env:
223+
BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
224+
BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}}
225+
run: .github/actions/build-asset-unix.sh
226+
227+
- name: Upload Artifact macOS x86-64
228+
uses: actions/upload-artifact@v2
229+
with:
230+
name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
231+
path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }}
232+
if-no-files-found: error

.gitignore

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
.[bB]in/
2-
.[oP]bj/
3-
[bB]in/
4-
[oP]bj/
5-
[tT]mp/
6-
_[tT]mp/
7-
8-
.vs/
9-
.sandbox/
10-
.dist/
11-
.keys/
12-
dist/
13-
14-
.DS_Store
15-
*.log
16-
park*_hash.txt
17-
18-
lib/*
19-
build/
1+
.[bB]in/
2+
.[oP]bj/
3+
[bB]in/
4+
[oP]bj/
5+
[tT]mp/
6+
_[tT]mp/
7+
8+
.vs/
9+
.sandbox/
10+
.dist/
11+
.keys/
12+
dist/
13+
out/
14+
15+
.DS_Store
16+
*.log
17+
park*_hash.txt
18+
19+
lib/*
20+
build*/
21+
cmake-build*/

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/bladebit.iml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/deployment.xml

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)