Skip to content
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

ci: add sanity test for running multiple VM instances in release test #278

Merged
merged 6 commits into from
Mar 11, 2023
Merged
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
61 changes: 60 additions & 1 deletion .github/workflows/release-homebrew.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ jobs:
- uses: actions/checkout@v3
with:
ref: ${{ env.FINCH_TAG }}
fetch-depth: 0
persist-credentials: false
submodules: true
- name: Clean up previous files
run: |
sudo rm -rf /opt/finch
Expand All @@ -85,8 +88,36 @@ jobs:
brew bump-cask-pr --write-only -f --version=$FINCH_VERSION finch
- name: Silently install
run: |
export HOMEBREW_NO_INSTALL_FROM_API=1
cd $(brew --repo homebrew/cask)
brew install --cask ./Casks/finch.rb
- name: Build project
run: |
brew install go lz4 automake autoconf libtool
export PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH"
make
- name: Multiple instances of Finch test
run: |
# start two Finch VM instances
./_output/bin/finch vm init
finch vm init
# start a container in each VM instance
./_output/bin/finch pull alpine
finch pull alpine
./_output/bin/finch run --name test-ctr1 alpine
finch run --name test-ctr2 alpine
# clean up the VMs
./_output/bin/finch vm stop && ./_output/bin/finch vm remove
finch vm stop && finch vm remove
- name: Clean up multiple instance test
run: |
sudo rm -rf ./_output
export HOMEBREW_NO_INSTALL_FROM_API=1
cd $(brew --repo homebrew/cask)
# Need to reinstall because there were errors on arm64 11.7 and arm64 12.6 hosts after running multiple instances tests,
# that caused the VM initialization failure in the e2e test.
# Example workflow run https://github.com/runfinch/finch/actions/runs/4367457552/jobs/7638794529
brew reinstall --cask ./Casks/finch.rb
ningziwen marked this conversation as resolved.
Show resolved Hide resolved
- name: Run e2e tests
run: INSTALLED=true make test-e2e
- name: Silently uninstall
Expand Down Expand Up @@ -124,6 +155,9 @@ jobs:
- uses: actions/checkout@v3
with:
ref: ${{ env.FINCH_TAG }}
fetch-depth: 0
persist-credentials: false
submodules: true
- name: Clean up previous files
run: |
sudo rm -rf /opt/finch
Expand All @@ -148,8 +182,33 @@ jobs:
brew bump-cask-pr --write-only -f --version=$FINCH_VERSION finch
- name: Silently install
run: |
export HOMEBREW_NO_INSTALL_FROM_API=1
cd $(brew --repo homebrew/cask)
brew install --cask ./Casks/finch.rb
- name: Build project
run: |
brew install go lz4 automake autoconf libtool
export PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH"
make
- name: Multiple instances of Finch test
run: |
# start two Finch VM instances
./_output/bin/finch vm init
finch vm init
# start a container in each VM instance
./_output/bin/finch pull alpine
finch pull alpine
./_output/bin/finch run --name test-ctr1 alpine
finch run --name test-ctr2 alpine
# clean up the VMs
./_output/bin/finch vm stop && ./_output/bin/finch vm remove
finch vm stop && finch vm remove
- name: Clean up multiple instance test
run: |
sudo rm -rf ./_output
export HOMEBREW_NO_INSTALL_FROM_API=1
cd $(brew --repo homebrew/cask)
brew reinstall --cask ./Casks/finch.rb
- name: Run e2e tests
run: INSTALLED=true make test-e2e
- name: Silently uninstall
Expand All @@ -161,7 +220,7 @@ jobs:
echo ERROR: Finch is not uninstalled
exit 1
fi

pr-to-homebrew:
needs: [get-latest-tag, macos-arm64-test-installer, macos-amd64-test-installer]
runs-on: macos-latest
Expand Down
85 changes: 83 additions & 2 deletions .github/workflows/release-installer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,18 @@ jobs:
with:
go-version-file: go.mod
cache: true
- uses: actions/checkout@v3
- name: Checkout the tag
uses: actions/checkout@v3
with:
ref: ${{ github.ref_name }}
fetch-depth: 0
persist-credentials: false
submodules: true
- name: Clean up previous files
run: |
sudo rm -rf /opt/finch
sudo rm -rf ~/.finch
sudo rm -rf ./_output
if pgrep '^qemu-system'; then
sudo pkill '^qemu-system'
fi
Expand All @@ -65,6 +72,41 @@ jobs:
aws s3 cp s3://${{ secrets.INSTALLER_PRIVATE_BUCKET_NAME }}/Finch-${GITHUB_REF_NAME}-aarch64.pkg Finch-${GITHUB_REF_NAME}-aarch64.pkg
- name: Silently install
run: sudo installer -pkg Finch-${GITHUB_REF_NAME}-aarch64.pkg -target /
- name: Build project
run: |
brew install go lz4 automake autoconf libtool
export PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH"
make
- name: Multiple instances of Finch test
run: |
# start two Finch VM instances
./_output/bin/finch vm init
finch vm init
# start a container in each VM instance
./_output/bin/finch pull alpine
finch pull alpine
./_output/bin/finch run --name test-ctr1 alpine
finch run --name test-ctr2 alpine
# check whether containers exist
if ! ./_output/bin/finch ps -a | grep 'test-ctr1'; then
echo "ERROR: The container test-ctr1 doesn't exist"
exit 1
fi
if ! finch ps -a | grep 'test-ctr2'; then
echo "ERROR: The container test-ctr2 doesn't exist"
exit 1
fi
# clean up the VMs
./_output/bin/finch vm stop && ./_output/bin/finch vm remove
finch vm stop && finch vm remove
- name: Clean up multiple instance test
run: |
sudo rm -rf ./_output
echo 'y' | sudo bash /Applications/Finch/uninstall.sh
# Need to reinstall because there were errors on arm64 11.7 and arm64 12.6 hosts after running multiple instances tests,
# that caused the VM initialization failure in the e2e test.
# Example workflow run https://github.com/runfinch/finch/actions/runs/4367457552/jobs/7638794529
sudo installer -pkg Finch-${GITHUB_REF_NAME}-aarch64.pkg -target /
- name: Run e2e tests
run: INSTALLED=true make test-e2e
- name: Silently uninstall
Expand All @@ -91,11 +133,18 @@ jobs:
with:
go-version-file: go.mod
cache: true
- uses: actions/checkout@v3
- name: Checkout the tag
uses: actions/checkout@v3
with:
ref: ${{ github.ref_name }}
fetch-depth: 0
persist-credentials: false
submodules: true
- name: Clean up previous files
run: |
sudo rm -rf /opt/finch
sudo rm -rf ~/.finch
sudo rm -rf ./_output
if pgrep '^qemu-system'; then
sudo pkill '^qemu-system'
fi
Expand All @@ -114,6 +163,38 @@ jobs:
- name: Silently install
run: |
sudo installer -pkg Finch-${GITHUB_REF_NAME}-x86_64.pkg -target /
- name: Build project
run: |
brew install go lz4 automake autoconf libtool
export PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH"
make
- name: Multiple instances of Finch test
run: |
# start two Finch VM instances
./_output/bin/finch vm init
finch vm init
# start a container in each VM instance
./_output/bin/finch pull alpine
finch pull alpine
./_output/bin/finch run --name test-ctr1 alpine
finch run --name test-ctr2 alpine
# check whether containers exist
if ! ./_output/bin/finch ps -a | grep 'test-ctr1'; then
echo "ERROR: The container test-ctr1 doesn't exist"
exit 1
fi
if ! finch ps -a | grep 'test-ctr2'; then
echo "ERROR: The container test-ctr2 doesn't exist"
exit 1
fi
# clean up the VMs
./_output/bin/finch vm stop && ./_output/bin/finch vm remove
ningziwen marked this conversation as resolved.
Show resolved Hide resolved
finch vm stop && finch vm remove
- name: Clean up multiple instance test
run: |
sudo rm -rf ./_output
echo 'y' | sudo bash /Applications/Finch/uninstall.sh
sudo installer -pkg Finch-${GITHUB_REF_NAME}-x86_64.pkg -target /
- name: Run e2e tests
run: INSTALLED=true make test-e2e
- name: Silently uninstall
Expand Down