deploy-cluster #56
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
name: deploy-cluster | |
on: | |
workflow_dispatch: | |
inputs: | |
CLUSTER: | |
description: 'Cluster Name' | |
required: true | |
default: ci-ai | |
NODES: | |
description: 'Nodes' | |
required: true | |
default: 3 | |
PULLSECRET: | |
description: 'Pull Secret' | |
required: false | |
default: /root/openshift_pull.json | |
PARAMFILE: | |
description: 'paramfile' | |
required: false | |
default: .github/aicli_parameters.yml | |
PLANFILE: | |
description: 'planfile' | |
required: false | |
default: .github/kcli_plan.yml | |
EXTRAPARAMS: | |
description: 'Extra params' | |
default: '' | |
env: | |
HOME: /root | |
PYTHONUNBUFFERED: true | |
CLUSTER: ${{github.event.inputs.CLUSTER}} | |
NODES: ${{github.event.inputs.NODES}} | |
PULLSECRET: ${{github.event.inputs.PULLSECRET}} | |
PARAMFILE: ${{github.event.inputs.PARAMFILE}} | |
PLANFILE: ${{github.event.inputs.PLANFILE}} | |
EXTRAPARAMS: ${{github.event.inputs.EXTRAPARAMS}} | |
AI_OFFLINETOKEN: ${{ secrets.AI_OFFLINETOKEN }} | |
# CLUSTER: ai-ci | |
# PULLSECRET: /root/openshift_pull.json | |
# PARAMFILE: .github/aicli_parameters.yml | |
jobs: | |
requirements: | |
runs-on: libvirt | |
steps: | |
- uses: actions/checkout@v2 | |
- run: git pull origin ${GITHUB_REF##*/} | |
- name: Install kcli | |
run: | | |
curl https://raw.githubusercontent.com/karmab/kcli/master/install.sh | bash | |
kcli create sushy-service | |
- name: Install aicli | |
run: | | |
pip3 install -U assisted-service-client | |
python3 setup.py install | |
- name: Clean up | |
continue-on-error: true | |
run: | | |
kcli -C local delete plan --yes $CLUSTER || true | |
aicli delete cluster $CLUSTER || true | |
kcli delete iso --yes full.iso || true | |
deploy-kcli-plan: | |
needs: requirements | |
runs-on: libvirt | |
steps: | |
- name: Deploy kcli plan | |
run: kcli -C local create plan -f $PLANFILE -P NODES=$NODES $CLUSTER | |
deploy-ai-cluster: | |
needs: deploy-kcli-plan | |
runs-on: libvirt | |
timeout-minutes: 70 | |
steps: | |
- name: Deploy ai cluster | |
run: | | |
if [ "$NODES" == "1" ] ; then SNO=true ; else SNO=false ; fi | |
aicli create deployment --pf $PARAMFILE -P pull_secret=$PULLSECRET $EXTRAPARAMS -P sno=$SNO $CLUSTER --force |