Skip to content

Test how long it takes for a runner to generate a k25 plot in CI #17811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/build-linux-installer-deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,12 @@ jobs:
if: matrix.mode.name == 'GUI'
run: |
[ $(stat -c %a:%G:%U /opt/chia/chrome-sandbox) == "4755:root:root" ]


- name: Test generation of a k25 plot
run: |
chia plots create -k 25 -t ./tmp -d ./plot --override-k
chia plots check -n 1

- name: Remove package
run: |
apt-get remove --yes ${{ matrix.mode.package }}
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/build-linux-installer-rpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,11 @@ jobs:
ls -l /opt
false
fi

- name: Test generation of a k25 plot
run: |
chia plots create -k 25 -t ./tmp -d ./plot --override-k
chia plots check -n 1

- name: Remove package
run: |
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/build-macos-installers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,11 @@ jobs:
run: |
"/Volumes/Chia "*"/Chia.app/Contents/Resources/app.asar.unpacked/daemon/chia" dev installers test --expected-chia-version "${{ needs.version.outputs.chia-installer-version }}"

- name: Test generation of a k25 plot
run: |
/Volumes/Chia "*"/Chia.app/Contents/Resources/app.asar.unpacked/daemon/chia" plots create -k 25 -t ./tmp -d ./plot --override-k
/Volumes/Chia "*"/Chia.app/Contents/Resources/app.asar.unpacked/daemon/chia" chia plots check -n 1

- name: Detach .dmg
if: always()
run: |
Expand Down
257 changes: 171 additions & 86 deletions .github/workflows/build-windows-installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,18 @@ on:
- "**"

concurrency:
group: ${{ github.event_name == 'pull_request' && format('{0}-{1}', github.workflow_ref, github.event.pull_request.number) || github.run_id }}
# SHA is added to the end if on `main` to let all main workflows run
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
cancel-in-progress: true

permissions:
id-token: write
contents: write

jobs:
version:
uses: ./.github/workflows/reflow-version.yml

build:
name: Build EXE
runs-on: [windows-2019]
needs:
- version
timeout-minutes: 65
outputs:
chia-installer-version: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}
Expand All @@ -53,11 +49,6 @@ jobs:
matrix:
python-version: ["3.10"]

env:
CHIA_INSTALLER_VERSION: ${{ needs.version.outputs.chia-installer-version }}
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CHIA_BLOCKCHAIN: ${{ needs.version.outputs.chia-installer-version }}
TAG_TYPE: ${{ needs.version.outputs.tag-type }}

steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand All @@ -70,7 +61,22 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: Chia-Network/actions/git-ssh-to-https@main
- name: Check tag type
shell: bash
run: |
REG_B="^[0-9]+\.[0-9]+\.[0-9]+-b[0-9]+$"
REG_RC="^[0-9]+\.[0-9]+\.[0-9]+-rc[0-9]+$"
if [[ "${{ github.event.release.tag_name }}" =~ $REG_B ]] || [[ "${{ inputs.release_type }}" =~ $REG_B ]]; then
echo "TAG_TYPE=beta"
echo "TAG_TYPE=beta" >> "$GITHUB_ENV"
elif [[ "${{ github.event.release.tag_name }}" =~ $REG_RC ]] || [[ "${{ inputs.release_type }}" =~ $REG_RC ]]; then
echo "TAG_TYPE=rc"
echo "TAG_TYPE=rc" >> "$GITHUB_ENV"
fi

- name: Set git urls to https instead of ssh
run: |
git config --global url."https://github.com/".insteadOf ssh://[email protected]/

- name: Get npm cache directory
id: npm-cache
Expand All @@ -87,8 +93,6 @@ jobs:
${{ runner.os }}-node-

- uses: chia-network/actions/cache-pip@main
with:
mode: poetry

- uses: Chia-Network/actions/setup-python@main
name: Install Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -141,6 +145,19 @@ jobs:
C:\Windows\System32\certutil.exe -csp "DigiCert Signing Manager KSP" -key -user
smksp_cert_sync.exe

# Create our own venv outside of the git directory JUST for getting the ACTUAL version so that install can't break it
- name: Get version number
id: version_number
shell: bash
run: |
python -m venv ../venv
source ../venv/Scripts/activate
pip3 install setuptools_scm
CHIA_INSTALLER_VERSION=$(python ./build_scripts/installer-version.py)
echo "$CHIA_INSTALLER_VERSION"
echo "CHIA_INSTALLER_VERSION=$CHIA_INSTALLER_VERSION" >> "$GITHUB_OUTPUT"
deactivate

- name: Get latest madmax plotter
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -220,6 +237,7 @@ jobs:

- name: Build Windows installer
env:
CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}
HAS_SIGNING_SECRET: ${{ steps.check_secrets.outputs.HAS_SIGNING_SECRET }}
run: |
$env:path="C:\Program` Files` (x86)\Microsoft` Visual` Studio\2019\Enterprise\SDK\ScopeCppSDK\vc15\VC\bin\;$env:path"
Expand All @@ -231,7 +249,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: chia-installers-windows-exe-intel
path: chia-blockchain-gui\release-builds\windows-installer\
path: ${{ github.workspace }}\chia-blockchain-gui\release-builds\

- name: Remove Windows exe and installer to exclude from cache
run: |
Expand All @@ -241,70 +259,139 @@ jobs:
Remove-Item .\chia-blockchain-gui\release-builds -Recurse -Force

publish:
name: 📦 Publish Installers
uses: ./.github/workflows/reflow-publish-installer.yml
with:
concurrency-name: windows
chia-installer-version: ${{ needs.version.outputs.chia-installer-version }}
chia-dev-version: ${{ needs.version.outputs.chia-dev-version }}
configuration: ${{ toJSON( matrix.configuration ) }}
secrets: inherit
name: Publish EXE
runs-on: ubuntu-latest
needs:
- version
- build
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
configuration:
- python-version: ["3.10"]
os:
- matrix: windows
file-type:
name: EXE
extension: exe
glue-name: windows
artifact-platform-name: windows
file-arch-name:
intel: intel
file-suffix:
arm: ""
intel: ""
names:
gui:
file: ChiaSetup-{0}.exe
dev-file: ChiaSetup-{1}.exe
latest-dev-file: ChiaSetup-latest-dev.exe
mode:
- name: GUI
matrix: gui
glue-name: gui
- name: CLI
matrix: cli
glue-name: cli
arch:
- name: ARM64
matrix: arm
artifact-name: arm
glue-name: arm
- name: Intel
matrix: intel
artifact-name: intel
glue-name: intel
exclude:
- os:
matrix: windows
arch:
matrix: arm
- os:
matrix: windows
mode:
matrix: cli
python-version: ["3.10"]

env:
CHIA_INSTALLER_VERSION: ${{ needs.build.outputs.chia-installer-version }}

steps:
- uses: Chia-Network/actions/clean-workspace@main

- uses: Chia-Network/actions/setup-python@main
with:
python-version: ${{ matrix.python-version }}

- uses: chia-network/actions/create-venv@main
id: create-venv

- uses: chia-network/actions/activate-venv@main
with:
directories: ${{ steps.create-venv.outputs.activate-venv-directories }}

- name: Download constraints file
uses: actions/download-artifact@v4
with:
name: constraints-file-intel
path: venv

- name: Install utilities
run: |
pip install --constraint venv/constraints.txt py3createtorrent

- name: Download packages
uses: actions/download-artifact@v4
with:
name: chia-installers-windows-exe-intel
path: chia-blockchain-gui/release-builds/

- name: Set Env
uses: Chia-Network/actions/setjobenv@main
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Test for secrets access
id: check_secrets
run: |
unset HAS_AWS_SECRET
unset HAS_GLUE_SECRET

if [ -n "$AWS_SECRET" ]; then HAS_AWS_SECRET='true' ; fi
echo HAS_AWS_SECRET=${HAS_AWS_SECRET} >> "$GITHUB_OUTPUT"

if [ -n "$GLUE_API_URL" ]; then HAS_GLUE_SECRET='true' ; fi
echo HAS_GLUE_SECRET=${HAS_GLUE_SECRET} >> "$GITHUB_OUTPUT"
env:
SIGNING_SECRET: "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}"
AWS_SECRET: "${{ secrets.CHIA_AWS_ACCOUNT_ID }}"
GLUE_API_URL: "${{ secrets.GLUE_API_URL }}"

- name: Configure AWS credentials
if: steps.check_secrets.outputs.HAS_AWS_SECRET
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ secrets.CHIA_AWS_ACCOUNT_ID }}:role/installer-upload
aws-region: us-west-2

- name: Upload to s3
if: steps.check_secrets.outputs.HAS_AWS_SECRET
run: |
GIT_SHORT_HASH=$(echo "${GITHUB_SHA}" | cut -c1-8)
CHIA_DEV_BUILD=${CHIA_INSTALLER_VERSION}-$GIT_SHORT_HASH
echo CHIA_DEV_BUILD=${CHIA_DEV_BUILD} >> "$GITHUB_OUTPUT"
echo ${CHIA_DEV_BUILD}
pwd
aws s3 cp chia-blockchain-gui/release-builds/windows-installer/ChiaSetup-${CHIA_INSTALLER_VERSION}.exe s3://download.chia.net/dev/ChiaSetup-${CHIA_DEV_BUILD}.exe

- name: Create Checksums
run: |
ls "$GITHUB_WORKSPACE"/chia-blockchain-gui/release-builds/windows-installer/
sha256sum "$GITHUB_WORKSPACE"/chia-blockchain-gui/release-builds/windows-installer/ChiaSetup-${{ env.CHIA_INSTALLER_VERSION }}.exe > "$GITHUB_WORKSPACE"/chia-blockchain-gui/release-builds/windows-installer/ChiaSetup-${{ env.CHIA_INSTALLER_VERSION }}.exe.sha256
ls "$GITHUB_WORKSPACE"/chia-blockchain-gui/release-builds/windows-installer/

- name: Create torrent
if: env.FULL_RELEASE == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce "${GITHUB_WORKSPACE}"/chia-blockchain-gui/release-builds/windows-installer/ChiaSetup-${{ env.CHIA_INSTALLER_VERSION }}.exe -o "${GITHUB_WORKSPACE}"/chia-blockchain-gui/release-builds/windows-installer/ChiaSetup-${{ env.CHIA_INSTALLER_VERSION }}.exe.torrent --webseed https://download.chia.net/install/ChiaSetup-${{ env.CHIA_INSTALLER_VERSION }}.exe
ls
gh release upload --repo ${{ github.repository }} $RELEASE_TAG "${GITHUB_WORKSPACE}"/chia-blockchain-gui/release-builds/windows-installer/ChiaSetup-${{ env.CHIA_INSTALLER_VERSION }}.exe.torrent

- name: Upload Dev Installer
if: steps.check_secrets.outputs.HAS_AWS_SECRET && github.ref == 'refs/heads/main'
run: |
aws s3 cp "${GITHUB_WORKSPACE}"/chia-blockchain-gui/release-builds/windows-installer/ChiaSetup-${{ env.CHIA_INSTALLER_VERSION }}.exe s3://download.chia.net/latest-dev/ChiaSetup-latest-dev.exe
aws s3 cp "${GITHUB_WORKSPACE}"/chia-blockchain-gui/release-builds/windows-installer/ChiaSetup-${{ env.CHIA_INSTALLER_VERSION }}.exe.sha256 s3://download.chia.net/latest-dev/ChiaSetup-latest-dev.exe.sha256

- name: Upload Release Files
if: steps.check_secrets.outputs.HAS_AWS_SECRET && env.FULL_RELEASE == 'true'
run: |
aws s3 cp "${GITHUB_WORKSPACE}"/chia-blockchain-gui/release-builds/windows-installer/ChiaSetup-${{ env.CHIA_INSTALLER_VERSION }}.exe s3://download.chia.net/install/
aws s3 cp "${GITHUB_WORKSPACE}"/chia-blockchain-gui/release-builds/windows-installer/ChiaSetup-${{ env.CHIA_INSTALLER_VERSION }}.exe.sha256 s3://download.chia.net/install/
aws s3 cp "${GITHUB_WORKSPACE}"/chia-blockchain-gui/release-builds/windows-installer/ChiaSetup-${{ env.CHIA_INSTALLER_VERSION }}.exe.torrent s3://download.chia.net/torrents/

- name: Upload release artifacts
if: env.RELEASE == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload --repo ${{ github.repository }} $RELEASE_TAG "${GITHUB_WORKSPACE}"/chia-blockchain-gui/release-builds/windows-installer/ChiaSetup-${{ env.CHIA_INSTALLER_VERSION }}.exe

- uses: Chia-Network/actions/github/jwt@main
if: steps.check_secrets.outputs.HAS_GLUE_SECRET

- name: Mark pre-release installer complete
if: steps.check_secrets.outputs.HAS_GLUE_SECRET && env.PRE_RELEASE == 'true'
run: |
curl -s -XPOST -H "Authorization: Bearer ${{ env.JWT_TOKEN }}" --data '{"chia_ref": "${{ env.RELEASE_TAG }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/${{ env.RFC_REPO }}-prerelease/${{ env.RELEASE_TAG }}/success/build-windows

- name: Mark release installer complete
if: steps.check_secrets.outputs.HAS_GLUE_SECRET && env.FULL_RELEASE == 'true'
run: |
curl -s -XPOST -H "Authorization: Bearer ${{ env.JWT_TOKEN }}" --data '{"chia_ref": "${{ env.RELEASE_TAG }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/${{ env.RFC_REPO }}/${{ env.RELEASE_TAG }}/success/build-windows

test:
name: Test ${{ matrix.os.name }}
runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }}
needs:
- version
- build
strategy:
fail-fast: false
Expand All @@ -322,9 +409,6 @@ jobs:
- name: Intel
matrix: intel

env:
INSTALL_PATH: installed/

steps:
- uses: Chia-Network/actions/clean-workspace@main

Expand All @@ -335,26 +419,27 @@ jobs:
path: packages

- name: Install package
env:
INSTALL_PATH: ${{ github.workspace }}\installed
run: |
dir ./packages/
$env:INSTALLER_PATH = (Get-ChildItem packages/ChiaSetup-*.exe)
# note that the installer requires the target path use backslashes
$env:RESOLVED_INSTALL_PATH = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($env:INSTALL_PATH)
Start-Process -Wait -FilePath $env:INSTALLER_PATH -ArgumentList "/S", ("/D=" + $env:RESOLVED_INSTALL_PATH)
echo ======================================
dir ./
echo ======================================
dir ./installed/
$env:INSTALLER_PATH = (Get-ChildItem packages/windows-installer/ChiaSetup-*.exe)
Start-Process -Wait -FilePath $env:INSTALLER_PATH -ArgumentList "/S", ("/D=" + $env:INSTALL_PATH)

- name: List installed files
run: |
Get-ChildItem -Recurse $env:INSTALL_PATH | Select FullName

- name: List all files
if:
run: |
Get-ChildItem -Recurse $env:INSTALL_PATH | Select FullName

- name: Run chia dev installers test
env:
INSTALL_PATH: ${{ github.workspace }}\installed
run: |
& ($env:INSTALL_PATH + "\resources\app.asar.unpacked\daemon\chia.exe") dev installers test --expected-chia-version "${{ needs.build.outputs.chia-installer-version }}"

# Testing to see how long the plot takes
- name: Test generation of a k25 plot
env:
INSTALL_PATH: ${{ github.workspace }}\installed
run: |
& ($env:INSTALL_PATH + "/resources/app.asar.unpacked/daemon/chia.exe") dev installers test --expected-chia-version "${{ needs.version.outputs.chia-installer-version }}"
& ($env:INSTALL_PATH + "\resources\app.asar.unpacked\daemon\chia.exe") plots create -k 25 -t ./tmp -d ./plot --override-k
& ($env:INSTALL_PATH + "\resources\app.asar.unpacked\daemon\chia.exe") chia plots check -n 1
Loading