Skip to content

Commit

Permalink
fix: dockerfiles for base node and wallet (#3263)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron Hambly authored Aug 30, 2021
1 parent 011f10e commit 38579a1
Show file tree
Hide file tree
Showing 365 changed files with 21,638 additions and 10,168 deletions.
25 changes: 19 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,24 +106,37 @@ commands:
name: Check eslint
command: cd integration_tests && npm run lint
- run:
name: Pre-build base node
name: Build base node
command: cargo build --release --bin tari_base_node
- run:
name: Pre-build wallet
name: Build wallet
command: cargo build --release --bin tari_console_wallet
- run:
name: Pre-build mmproxy
name: Build wallet FFI
command: cargo build --release --package tari_wallet_ffi
- run:
name: Build mmproxy
command: cargo build --release --bin tari_merge_mining_proxy
- run:
name: Build mining_node
command: cargo build --release --bin tari_mining_node
- run:
name: Run cucumber scenarios
command: cd integration_tests && mkdir -p cucumber_output && node_modules/.bin/cucumber-js --tags "not @long-running and not @broken and not @flaky" --format json:cucumber_output/tests.cucumber
command: cd integration_tests && mkdir -p cucumber_output && node_modules/.bin/cucumber-js --tags "not @long-running and not @broken and not @flaky and not @wallet-ffi" --format json:cucumber_output/tests.cucumber --exit
- run:
name: Generate report
command: cd integration_tests && node ./generate_report.js
when: always
- run:
name: Run flaky/broken cucumber scenarios (Always pass)
command: cd integration_tests && node_modules/.bin/cucumber-js --tags "not @long-running and (@broken or @flaky)" --format json:cucumber_output/broken-tests.cucumber || true
name: Run ffi cucumber scenarios
command: cd integration_tests && mkdir -p cucumber_output && node_modules/.bin/cucumber-js --tags "not @long-running and not @broken and not @flaky and @wallet-ffi" --format json:cucumber_output/tests-ffi.cucumber --exit
- run:
name: Generate report (ffi)
command: cd integration_tests && touch cucumber_output/tests-ffi.cucumber && node ./generate_report.js cucumber_output/tests-ffi.cucumber temp/reports/cucumber_ffi_report.html
when: always
# - run:
# name: Run flaky/broken cucumber scenarios (Always pass)
# command: cd integration_tests && node_modules/.bin/cucumber-js --tags "not @long-running and (@broken or @flaky)" --format json:cucumber_output/broken-tests.cucumber || true
- store_test_results:
path: integration_tests/cucumber_output
- store_artifacts:
Expand Down
4 changes: 2 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ book
report

# On development branch only. This should be removed for point releases
Cargo.lock
# Cargo.lock
*.log

# Ignore DataStore, Database and Log files
Expand All @@ -39,4 +39,4 @@ base_layer/wallet_ffi/build.config
/base_layer/wallet_ffi/logs/
base_layer/wallet_ffi/.cargo/config

keys.json
keys.json
21 changes: 6 additions & 15 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
<!--- Provide a general summary of your changes in the Title above -->
Description
---

## Description
<!--- Describe your changes in detail -->
Motivation and Context
---

## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->
How Has This Been Tested?
---

## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->

## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
* [ ] I'm merging against the `development` branch.
* [ ] I have squashed my commits into a single commit.
79 changes: 46 additions & 33 deletions .github/workflows/base_node_binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ on:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
branches:
- leet-*
- ci-*
schedule:
- cron: '05 00 01 * *'
- cron: '05 00 * * *'
workflow_dispatch:
inputs:
customTag:
Expand All @@ -24,31 +24,15 @@ jobs:
strategy:
fail-fast: false
matrix:
# # Breaks build - cmake issue?
# os: [windows-2016]
# # Breaks build - clang build (croaring-sys)?
# features: ["safe"]
# os: [ubuntu-latest, macos-latest, windows-latest, self-hosted]
# os: [ubuntu-18.04, ubuntu-20.04, macos-10.15, macos-11.0, windows-2016, windows-2019]
os: [ubuntu-18.04, macos-10.15, windows-2019, self-hosted]
os: [ubuntu-20.04, macos-10.15, windows-2019]
# https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html
# features: ["safe", "avx2"]
# target_cpu: ["x86-64", "broadwell", "skylake"]
target_cpu: ["haswell"]
# target_release: ["release", "debug"]
# exclude:
# - target_cpu: "x86-64"
# features: "avx2"
exclude:
- os: "macos-10.15"
target_cpu: "haswell"
- os: "self-hosted"
target_cpu: "haswell"
include:
- os: "macos-10.15"
target_cpu: "x86-64"
- os: "self-hosted"
target_cpu: "x86-64"

runs-on: ${{ matrix.os }}

Expand All @@ -75,14 +59,11 @@ jobs:
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
# toolchain: stable
toolchain: nightly-2021-05-09
components: rustfmt
# target: ${{ matrix.target }}
override: true

- name: Install Linux dependencies - Ubuntu
# if: startsWith(matrix.os,'ubuntu')
if: startsWith(runner.os,'Linux')
run: |
sudo apt-get update
Expand All @@ -104,12 +85,10 @@ jobs:
# sudo apt-get -y upgrade

- name: Install macOS dependencies
# if: startsWith(matrix.os,'macos')
if: startsWith(runner.os,'macOS')
run: brew install cmake zip

- name: Install Windows dependencies
# if: startsWith(matrix.os,'windows')
if: startsWith(runner.os,'Windows')
run: |
vcpkg.exe install sqlite3:x64-windows zlib:x64-windows
Expand Down Expand Up @@ -142,15 +121,6 @@ jobs:
echo "LIBCLANG_PATH=C:\Program Files\LLVM\bin" >> $GITHUB_ENV
echo "C:\Strawberry\perl\bin" >> $GITHUB_PATH
# this is a hack to fix an issue with building libclang in MSVC
# it should be fixed in release 16.9 of MSVC
# issue https://github.com/microsoft/STL/issues/1300
# temp fix https://github.com/mono/CppSharp/pull/1514/files
- name: fix intrin.h file - Windows
if: startsWith(runner.os,'Windows')
shell: powershell
run: .github/hacks/intrin.ps1

- name: Caching
uses: actions/cache@v2
with:
Expand Down Expand Up @@ -198,6 +168,13 @@ jobs:
cp -v "$GITHUB_WORKSPACE/target/release/tari_merge_mining_proxy${TBN_EXT}" .
cp -v "$GITHUB_WORKSPACE/target/release/tari_mining_node${TBN_EXT}" .
- name: Build the windows installer
if: startsWith(runner.os,'Windows')
run: |
cd buildtools
"%programfiles(x86)%\Inno Setup 6\iscc.exe" "windows_inno_installer.iss"
shell: cmd

- name: Archive and Sign Binaries
shell: bash
run: |
Expand Down Expand Up @@ -245,3 +222,39 @@ jobs:
S3OPTIONS: '--recursive --exclude "*" --include "*.zip*"'
# S3OPTIONS: '--recursive --exclude "*" --include "*.zip*"'
# S3OPTIONS: '--acl public-read'

- name: Copy tags to latest s3 - Bash
# if: ${{ env.AWS_SECRET_ACCESS_KEY != '' && matrix.os != 'self-hosted' }}
if: ${{ env.AWS_SECRET_ACCESS_KEY != '' && matrix.os != 'self-hosted' && startsWith(github.ref, 'refs/tags/v') }}
shell: bash
run: |
echo "Starting upload ... ${{ env.SOURCE }}"
if [ "$RUNNER_OS" == "Windows" ]; then
echo "No ls for 'D:' on Windows"
else
ls -al ${{ env.SOURCE }}
fi
aws s3 ${{ env.S3CMD }} --region ${{ secrets.AWS_REGION }} \
"${{ env.SOURCE }}" \
s3://${{ secrets.AWS_S3_BUCKET }}/current/${{ env.DEST_DIR }} \
${{ env.S3OPTIONS }}
aws s3 rm --region ${{ secrets.AWS_REGION }} \
s3://${{ secrets.AWS_S3_BUCKET }}/latest/${{ env.DEST_DIR }}/*
aws s3 ${{ env.S3CMD }} --region ${{ secrets.AWS_REGION }} \
"${{ env.SOURCE }}" \
s3://${{ secrets.AWS_S3_BUCKET }}/latest/${{ env.DEST_DIR }} \
${{ env.S3OPTIONS }}
echo "Done - $?"
exit 0
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SOURCE: '${{ github.workspace }}${{ env.TBN_DIST }}'
DEST_DIR: '${{ env.S3DESTOVERRIDE }}${{ env.S3DESTDIR }}/'
S3CMD: 'cp'
S3OPTIONS: '--recursive --exclude "*" --include "*.zip*"'
# S3OPTIONS: '--recursive --exclude "*" --include "*.zip*"'
# S3OPTIONS: '--acl public-read'
62 changes: 53 additions & 9 deletions .github/workflows/libwallet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,83 @@
name: Build libwallet
on:
push:
# branches:
# - development
# - libwallet
branches:
- "libwallet-*"
# - development
tags:
- "libwallet-*"
jobs:
build-and-upload:
android:
runs-on: ubuntu-latest
steps:
# Checkout the code
- uses: actions/checkout@v2
# Build and package the libraries
- name: Build libwallet
id: build-libwallet
uses: tari-project/[email protected].1
uses: tari-project/[email protected].2
with:
platforms: "x86_64-linux-android;aarch64-linux-android;armv7-linux-androideabi"
level: "24"
# Upload artifacts to Github
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: libwallet
name: libwallet-android
path: ${{ github.workspace }}/libwallet/
# Copy tarballs to S3
- name: Sync to S3
continue-on-error: true # Don't break if s3 upload fails
uses: jakejarvis/[email protected]
with:
args: --acl public-read --follow-symlinks
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1' # optional: defaults to us-east-1
SOURCE_DIR: '$GITHUB_WORKSPACE/libwallet'
DEST_DIR: 'libwallet'
AWS_REGION: "us-east-1" # optional: defaults to us-east-1
SOURCE_DIR: "$GITHUB_WORKSPACE/libwallet"
DEST_DIR: "libwallet"
ios:
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2021-05-09
target: aarch64-apple-ios
components: rustfmt
override: true
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2021-05-09
target: x86_64-apple-ios
components: rustfmt
override: true
- name: Install macOS dependencies
run: brew install cmake zip
- name: Build
run: |
mkdir -p MobileWallet/TariLib/
cd base_layer/wallet_ffi
mv ios.config build.config
./mobile_build.sh
ls -alht $GITHUB_WORKSPACE/MobileWallet/TariLib/
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: libwallet-ios
path: ${{ github.workspace }}/MobileWallet/TariLib/

# "Error: Container action is only supported on Linux"
# - name: Sync to S3
# uses: jakejarvis/[email protected]
# with:
# args: --acl public-read --follow-symlinks
# env:
# AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# AWS_REGION: "us-east-1" # optional: defaults to us-east-1
# SOURCE_DIR: "$GITHUB_WORKSPACE/MobileWallet/TariLib/"
# DEST_DIR: "libwallet-ios"
20 changes: 20 additions & 0 deletions .github/workflows/pr_title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: PR
on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize

jobs:
check-title:
runs-on: ubuntu-latest
steps:
- name: install
run: |
npm install -g @commitlint/cli @commitlint/config-conventional
echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js
- name: lint
run: |
echo ${{github.event.pull_request.title}} | commitlint
Loading

0 comments on commit 38579a1

Please sign in to comment.