composite #114
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GitHub runner seems not to support IPv6. | |
# See https://github.com/actions/runner-images/issues/668 | |
name: Night | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '20 4 * * 2' | |
push: | |
branches: | |
- fix-night-workflow | |
concurrency: night | |
jobs: | |
night: | |
name: Night | |
runs-on: ubuntu-22.04 | |
steps: | |
################################################### | |
# | |
# Prepare | |
# | |
################################################### | |
- name: (PREPARE) Prepare environment | |
uses: ./.github/actions/prepare-integration-test | |
with: | |
GCP_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }} | |
OS_SSH_KEY_FILE: ${{ secrets.OS_SSH_KEY_FILE }} | |
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }} | |
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }} | |
################################################### | |
# | |
# Installation | |
# | |
################################################### | |
- name: (Installation) Verify checksum | |
run: | | |
wget https://github.com/opentosca/opentosca-vintner/releases/download/latest/vintner-linux-x64.sha256 | |
cp /usr/bin/vintner vintner-linux-x64 | |
sha256sum --check vintner-linux-x64.sha256 | |
rm vintner-linux-x64 | |
rm vintner-linux-x64.sha256 | |
- name: (Installation) Verify signature | |
run: | | |
curl https://vintner.opentosca.org/vintner-release.gpg | gpg --import | |
wget https://github.com/opentosca/opentosca-vintner/releases/download/latest/vintner-linux-x64.asc | |
cp /usr/bin/vintner vintner-linux-x64 | |
gpg --verify vintner-linux-x64.asc | |
rm vintner-linux-x64.asc | |
- name: Abort | |
run: exit 1 | |
if: always() | |
################################################### | |
# | |
# Unfurl Motivation Production | |
# | |
################################################### | |
- name: (UNFURL-MOTIVATION-PROD) Prepare environment | |
run: | | |
vintner setup clean --force | |
vintner setup init | |
vintner orchestrators init unfurl | |
vintner orchestrators enable --orchestrator unfurl | |
vintner orchestrators attest --orchestrator unfurl | |
- name: (UNFURL-MOTIVATION-PROD) Resolve variability | |
run: | | |
vintner templates import --template motivation --path examples/unfurl-motivation | |
vintner instances init --instance motivation --template motivation | |
vintner instances resolve --instance motivation --presets prod | |
- name: (UNFURL-MOTIVATION-PROD) Deploy application | |
run: | | |
DEPLOYMENT_INPUTS=/tmp/unfurl-motivation-prod-deployment-inputs.yaml | |
cat << EOF > ${DEPLOYMENT_INPUTS} | |
gcp_service_account_file: /tmp/gcp-credentials.json | |
os_application_credential_secret: dummy | |
EOF | |
vintner instances deploy --instance motivation --inputs ${DEPLOYMENT_INPUTS} | |
- name: (UNFURL-MOTIVATION-PROD) Test application | |
run: curl --fail-with-body https://application-dot-stoetzms-387808.ey.r.appspot.com | |
- name: (UNFURL-MOTIVATION-PROD) Undeploy application | |
run: vintner instances undeploy --instance motivation | |
if: always() | |
################################################### | |
# | |
# Vintner | |
# | |
################################################### | |
- name: (VINTNER) Ensure that version is overridden | |
run: | | |
vintner --version | |
if [ "$(vintner --version)" == "__VERSION__" ]; then | |
exit 1 | |
fi | |
- name: (VINTNER) Ensure that license is overridden | |
run: | | |
vintner info license | |
if [ "$(vintner info license)" == "$(cat src/assets/LICENSE)" ]; then | |
exit 1 | |
fi | |
- name: (VINTNER) Ensure that dependencies are overridden | |
run: | | |
vintner info dependencies | |
if [ "$(vintner info dependencies)" == "$(cat src/assets/dependencies.csv)" ]; then | |
exit 1 | |
fi | |
- name: (VINTNER) Test filesystem initialization | |
run: vintner setup init | |
- name: (VINTNER) Test resolver | |
run: vintner setup benchmark --seeds 10 250 | |
################################################### | |
# | |
# Docker | |
# | |
################################################### | |
- name: (DOCKER) Start Docker container | |
run: | | |
docker run --detach --name vintner ghcr.io/opentosca/opentosca-vintner:latest | |
sleep 2 | |
docker logs vintner | |
- name: (DOCKER) Ensure Vintner can be executed | |
run: docker exec vintner vintner --version | |
- name: (DOCKER) Ensure Vintner can be executed | |
run: | | |
DOCKER_VERSION=$(docker exec vintner vintner --version) | |
echo "Docker version: $DOCKER_VERSION}" | |
BINARY_VERSION=$(vintner --version) | |
echo "Binary version: ${BINARY_VERSION}" | |
if [ ${DOCKER_VERSION} != ${BINARY_VERSION} ]; then | |
echo "Versions do not match" | |
exit 1 | |
fi | |
- name: (DOCKER) Stop Docker container | |
run: docker kill vintner | |
################################################### | |
# | |
# xOpera Motivation Development | |
# | |
################################################### | |
- name: (XOPERA-MOTIVATION-DEV) Prepare environment | |
run: | | |
vintner setup clean --force | |
vintner setup init | |
vintner orchestrators init xopera | |
vintner orchestrators enable --orchestrator xopera | |
vintner orchestrators attest --orchestrator xopera | |
- name: (XOPERA-MOTIVATION-DEV) Resolve variability | |
run: | | |
vintner templates import --template motivation --path examples/xopera-motivation | |
vintner instances init --instance motivation --template motivation | |
vintner instances resolve --instance motivation --presets dev | |
vintner instances validate --instance motivation | |
- name: (XOPERA-MOTIVATION-DEV) Deploy application | |
run: | | |
DEPLOYMENT_INPUTS=/tmp/xopera-motivation-dev-deployment-inputs.yaml | |
cat << EOF > ${DEPLOYMENT_INPUTS} | |
os_application_credential_id: ${OS_APPLICATION_CREDENTIAL_ID} | |
os_application_credential_secret: ${OS_APPLICATION_CREDENTIAL_SECRET} | |
private_vm_ssh_key_file: /tmp/os-ssh-key-file | |
EOF | |
vintner instances deploy --instance motivation --inputs ${DEPLOYMENT_INPUTS} | |
env: | |
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }} | |
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }} | |
- name: (XOPERA-MOTIVATION-DEV) Test application | |
run: | | |
VIRTUAL_MACHINE_NAME=abcdefgh-private-vm | |
cd ~/opera | |
. .venv/bin/activate | |
. /tmp/os-credentials.sh | |
VIRTUAL_MACHINE_IP=$(openstack server show ${VIRTUAL_MACHINE_NAME} -f json | jq -r '.addresses."public-belwue"[0]') | |
echo "virtual machine name: ${VIRTUAL_MACHINE_NAME}" | |
echo "virtual machine ip: ${VIRTUAL_MACHINE_IP}" | |
curl --fail-with-body http://${VIRTUAL_MACHINE_IP} | |
- name: (XOPERA-MOTIVATION-DEV) Undeploy application | |
run: vintner instances undeploy --instance motivation | |
if: always() | |
################################################### | |
# | |
# xOpera Motivation Production | |
# | |
################################################### | |
- name: (XOPERA-MOTIVATION-PROD) Prepare environment | |
run: | | |
vintner setup clean --force | |
vintner setup init | |
vintner orchestrators init xopera | |
vintner orchestrators enable --orchestrator xopera | |
vintner orchestrators attest --orchestrator xopera | |
- name: (XOPERA-MOTIVATION-PROD) Resolve variability | |
run: | | |
vintner templates import --template motivation --path examples/xopera-motivation | |
vintner instances init --instance motivation --template motivation | |
vintner instances resolve --instance motivation --presets prod | |
vintner instances validate --instance motivation | |
- name: (XOPERA-MOTIVATION-PROD) Deploy application | |
run: | | |
DEPLOYMENT_INPUTS=/tmp/xopera-motivation-prod-deployment-inputs.yaml | |
cat << EOF > ${DEPLOYMENT_INPUTS} | |
gcp_service_account_file: /tmp/gcp-credentials.json | |
EOF | |
vintner instances deploy --instance motivation --inputs ${DEPLOYMENT_INPUTS} | |
- name: (XOPERA-MOTIVATION-PROD) Test application | |
run: curl --fail-with-body https://application-dot-stoetzms-387808.ey.r.appspot.com | |
- name: (XOPERA-MOTIVATION-PROD) Undeploy application | |
run: vintner instances undeploy --instance motivation | |
if: always() | |
################################################### | |
# | |
# xOpera Pruning Elastic | |
# | |
################################################### | |
- name: (XOPERA-PRUNING-ELASTIC) Prepare environment | |
run: | | |
vintner setup clean --force | |
vintner setup init | |
vintner orchestrators init xopera | |
vintner orchestrators enable --orchestrator xopera | |
vintner orchestrators attest --orchestrator xopera | |
- name: (XOPERA-PRUNING-ELASTIC) Resolve variability | |
run: | | |
vintner templates import --template pruning --path examples/xopera-pruning | |
vintner instances init --instance pruning --template pruning | |
vintner instances resolve --instance pruning --presets elastic | |
vintner instances validate --instance pruning | |
- name: (XOPERA-PRUNING-ELASTIC) Deploy application | |
run: | | |
DEPLOYMENT_INPUTS=/tmp/xopera-pruning-elastic-deployment-inputs.yaml | |
cat << EOF > ${DEPLOYMENT_INPUTS} | |
gcp_service_account_file: /tmp/gcp-credentials.json | |
EOF | |
vintner instances deploy --instance pruning --inputs ${DEPLOYMENT_INPUTS} | |
- name: (XOPERA-PRUNING-ELASTIC) Test application | |
run: curl --fail-with-body https://shop-dot-stoetzms-387808.ey.r.appspot.com | |
- name: (XOPERA-PRUNING-ELASTIC) Undeploy application | |
run: vintner instances undeploy --instance pruning | |
if: always() | |
################################################### | |
# | |
# Unfurl Motivation Development | |
# | |
################################################### | |
- name: (UNFURL-MOTIVATION-DEV) Prepare environment | |
run: | | |
vintner setup clean --force | |
vintner setup init | |
vintner orchestrators init unfurl | |
vintner orchestrators enable --orchestrator unfurl | |
vintner orchestrators attest --orchestrator unfurl | |
- name: (UNFURL-MOTIVATION-DEV) Resolve variability | |
run: | | |
vintner templates import --template motivation --path examples/unfurl-motivation | |
vintner instances init --instance motivation --template motivation | |
vintner instances resolve --instance motivation --presets dev | |
- name: (UNFURL-MOTIVATION-DEV) Deploy application | |
run: | | |
DEPLOYMENT_INPUTS=/tmp/unfurl-motivation-dev-deployment-inputs.yaml | |
cat << EOF > ${DEPLOYMENT_INPUTS} | |
os_application_credential_id: ${OS_APPLICATION_CREDENTIAL_ID} | |
os_application_credential_secret: ${OS_APPLICATION_CREDENTIAL_SECRET} | |
vm_ssh_key_file: /tmp/os-ssh-key-file | |
EOF | |
vintner instances deploy --instance motivation --inputs ${DEPLOYMENT_INPUTS} | |
env: | |
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }} | |
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }} | |
- name: (UNFURL-MOTIVATION-DEV) Test the application | |
run: | | |
VIRTUAL_MACHINE_NAME=abcdefgh-private-vm | |
cd ~/unfurl | |
. .venv/bin/activate | |
. /tmp/os-credentials.sh | |
VIRTUAL_MACHINE_IP=$(openstack server show ${VIRTUAL_MACHINE_NAME} -f json | jq -r '.addresses."public-belwue"[0]') | |
echo "virtual machine name: ${VIRTUAL_MACHINE_NAME}" | |
echo "virtual machine ip: ${VIRTUAL_MACHINE_IP}" | |
curl --fail-with-body http://${VIRTUAL_MACHINE_IP} | |
- name: (UNFURL-MOTIVATION-DEV) Undeploy the application | |
run: vintner instances undeploy --instance motivation | |
if: always() | |
################################################### | |
# | |
# Unfurl Artifacts Enterprise | |
# | |
################################################### | |
- name: (UNFURL-ARTIFACTS-ENTERPRISE) Prepare environment | |
run: | | |
vintner setup clean --force | |
vintner setup init | |
vintner orchestrators init unfurl | |
vintner orchestrators enable --orchestrator unfurl | |
vintner orchestrators attest --orchestrator unfurl | |
- name: (UNFURL-ARTIFACTS-ENTERPRISE) Resolve variability | |
run: | | |
vintner templates import --template artifacts --path examples/unfurl-artifacts | |
vintner instances init --instance artifacts --template artifacts | |
vintner instances resolve --instance artifacts --inputs examples/unfurl-artifacts/tests/enterprise/inputs.yaml | |
- name: (UNFURL-ARTIFACTS-ENTERPRISE) Deploy application | |
run: | | |
DEPLOYMENT_INPUTS=/tmp/unfurl-artifacts-pruning-elastic-deployment-inputs.yaml | |
cat << EOF > ${DEPLOYMENT_INPUTS} | |
gcp_credentials: /tmp/gcp-credentials.json | |
EOF | |
vintner instances deploy --instance artifacts --inputs ${DEPLOYMENT_INPUTS} | |
- name: (UNFURL-ARTIFACTS-ENTERPRISE) Test application | |
run: curl --fail-with-body https://shop-dot-stoetzms-387808.ey.r.appspot.com | |
- name: (UNFURL-ARTIFACTS-ENTERPRISE) Undeploy application | |
run: vintner instances undeploy --instance artifacts | |
if: always() | |
################################################### | |
# | |
# Notification | |
# | |
################################################### | |
- name: (NOTIFICATION) Send success notification | |
run: | | |
curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data "{\"content\": \"Night workflow [${GITHUB_RUN_ID}](https://github.com/OpenTOSCA/opentosca-vintner/actions/runs/${GITHUB_RUN_ID}) succeeded.\"}" ${DISCORD_WEBHOOK_NIGHT_WORKFLOW} | |
env: | |
DISCORD_WEBHOOK_NIGHT_WORKFLOW: ${{ secrets.DISCORD_WEBHOOK_NIGHT_WORKFLOW }} | |
if: success() | |
- name: (NOTIFICATION) Send failure notification | |
run: | | |
curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data "{\"content\": \"Night workflow [${GITHUB_RUN_ID}](https://github.com/OpenTOSCA/opentosca-vintner/actions/runs/${GITHUB_RUN_ID}) failed.\"}" ${DISCORD_WEBHOOK_NIGHT_WORKFLOW} | |
env: | |
DISCORD_WEBHOOK_NIGHT_WORKFLOW: ${{ secrets.DISCORD_WEBHOOK_NIGHT_WORKFLOW }} | |
if: failure() | |
- name: (DISCORD) Send cancel notification | |
run: | | |
curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data "{\"content\": \"Night workflow [${GITHUB_RUN_ID}](https://github.com/OpenTOSCA/opentosca-vintner/actions/runs/${GITHUB_RUN_ID}) cancelled.\"}" ${DISCORD_WEBHOOK_NIGHT_WORKFLOW} | |
env: | |
DISCORD_WEBHOOK_NIGHT_WORKFLOW: ${{ secrets.DISCORD_WEBHOOK_NIGHT_WORKFLOW }} | |
if: cancelled() |