Skip to content

split

split #119

Workflow file for this run

# 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:
###################################################
#
# Installation
#
###################################################
installation:
name: Installation
runs-on: ubuntu-22.04
steps:
###################################################
#
# Prepare
#
###################################################
- name: (PREPARE) Checkout repository
uses: actions/checkout@v3
with:
lfs: true
- name: (PREPARE) Prepare job
uses: ./.github/actions/prepare-integration-job
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 }}
###################################################
#
# Binary
#
###################################################
- name: (BINARY) 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: (BINARY) 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: (BINARY) Ensure that version is overridden
run: |
vintner --version
if [ "$(vintner --version)" == "__VERSION__" ]; then
exit 1
fi
- name: (BINARY) Ensure that license is overridden
run: |
vintner info license
if [ "$(vintner info license)" == "$(cat src/assets/LICENSE)" ]; then
exit 1
fi
- name: (BINARY) Ensure that dependencies are overridden
run: |
vintner info dependencies
if [ "$(vintner info dependencies)" == "$(cat src/assets/dependencies.csv)" ]; then
exit 1
fi
- name: (BINARY) Test filesystem initialization
run: vintner setup init
- name: (BINARY) 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
#
###################################################
xopera-motivation-dev:
name: xOpera Motivation Dev
runs-on: ubuntu-22.04
steps:
- name: (PREPARE) Checkout repository
uses: actions/checkout@v3
with:
lfs: true
- name: (PREPARE) Prepare job
uses: ./.github/actions/prepare-integration-job
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 }}
- name: (CASE-STUDY) 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: (CASE-STUDY) 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: (CASE-STUDY) 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: (CASE-STUDY) 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: (CASE-STUDY) Undeploy application
run: vintner instances undeploy --instance motivation
if: always()
###################################################
#
# xOpera Motivation Production
#
###################################################
xopera-motivation-prod:
name: xOpera Motivation Prod
runs-on: ubuntu-22.04
needs: xopera-motivation-dev
steps:
- name: (PREPARE) Checkout repository
uses: actions/checkout@v3
with:
lfs: true
- name: (PREPARE) Prepare job
uses: ./.github/actions/prepare-integration-job
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 }}
- name: (CASE-STUDY) 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: (CASE-STUDY) 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: (CASE-STUDY) 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: (CASE-STUDY) Test application
run: curl --fail-with-body https://application-dot-stoetzms-387808.ey.r.appspot.com
- name: (CASE-STUDY) Undeploy application
run: vintner instances undeploy --instance motivation
if: always()
###################################################
#
# Unfurl Motivation Development
#
###################################################
unfurl-motivation-dev:
name: Unfurl Motivation Dev
runs-on: ubuntu-22.04
needs: xopera-motivation-prod
steps:
- name: (PREPARE) Checkout repository
uses: actions/checkout@v3
with:
lfs: true
- name: (PREPARE) Prepare job
uses: ./.github/actions/prepare-integration-job
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 }}
- name: (CASE-STUDY) 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: (CASE-STUDY) 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: (CASE-STUDY) 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: (CASE-STUDY) 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: (CASE-STUDY) Undeploy the application
run: vintner instances undeploy --instance motivation
if: always()
###################################################
#
# Unfurl Motivation Production
#
###################################################
# TODO: undeployment does not work in runner but locally
unfurl-motivation-prod:
name: Unfurl Motivation Prod
runs-on: ubuntu-22.04
if: false
steps:
- name: (PREPARE) Checkout repository
uses: actions/checkout@v3
with:
lfs: true
- name: (PREPARE) Prepare job
uses: ./.github/actions/prepare-integration-job
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 }}
- name: (CASE-STUDY) 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: (CASE-STUDY) 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: (CASE-STUDY) 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: (CASE-STUDY) Test application
run: curl --fail-with-body https://application-dot-stoetzms-387808.ey.r.appspot.com
- name: (CASE-STUDY) Undeploy application
run: vintner instances undeploy --instance motivation
if: always()
###################################################
#
# xOpera Pruning Elastic
#
###################################################
xopera-pruning-elastic:
name: xOpera Pruning Elastic
runs-on: ubuntu-22.04
needs: unfurl-motivation-dev
steps:
- name: (PREPARE) Checkout repository
uses: actions/checkout@v3
with:
lfs: true
- name: (PREPARE) Prepare job
uses: ./.github/actions/prepare-integration-job
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 }}
- name: (CASE-STUDY) 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: (CASE-STUDY) 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: (CASE-STUDY) 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: (CASE-STUDY) Test application
run: curl --fail-with-body https://shop-dot-stoetzms-387808.ey.r.appspot.com
- name: (CASE-STUDY) Undeploy application
run: vintner instances undeploy --instance pruning
if: always()
###################################################
#
# Unfurl Artifacts Enterprise
#
###################################################
unfurl-artifacts-enterprise:
name: Unfurl Artifacts Enterprise
runs-on: ubuntu-22.04
needs: xopera-pruning-elastic
steps:
- name: (PREPARE) Checkout repository
uses: actions/checkout@v3
with:
lfs: true
- name: (PREPARE) Prepare job
uses: ./.github/actions/prepare-integration-job
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 }}
- name: (CASE-STUDY) 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: (CASE-STUDY) 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: (CASE-STUDY) 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: (CASE-STUDY) Test application
run: curl --fail-with-body https://shop-dot-stoetzms-387808.ey.r.appspot.com
- name: (CASE-STUDY) Undeploy application
run: vintner instances undeploy --instance artifacts
if: always()