Skip to content

Ci runner upsizing #436

Ci runner upsizing

Ci runner upsizing #436

Workflow file for this run

##
## Copyright (c) 2019 Matthias Tafelmeier.
##
## This file is part of godon
##
## godon is free software: you can redistribute it and/or modify
## it under the terms of the GNU Affero General Public License as
## published by the Free Software Foundation, either version 3 of the
## License, or (at your option) any later version.
##
## godon is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU Affero General Public License for more details.
##
## You should have received a copy of the GNU Affero General Public License
## along with this godon. If not, see <http://www.gnu.org/licenses/>.
##
on:
pull_request:
types: [ labeled ]
branches:
- master
env:
INSTANCE_NAME: "ci_runner"
OS_AUTH_URL: https://oprod-controller1.osuosl.org:5000/v3
OS_PROJECT_NAME: "godon"
OS_USER_DOMAIN_NAME: "Default"
OS_PROJECT_DOMAIN_ID: "default"
OS_REGION_NAME: "RegionOne"
OS_IDENTITY_API_VERSION: 3
OS_INTERFACE: public
OS_USERNAME: ${{ secrets.osuosl_openstack_user }}
OS_PASSWORD: ${{ secrets.osuosl_openstack_pw }}
GH_ACTIONS_TOKEN: ${{ secrets.gh_runner_token }}
jobs:
test_stack_rebuild_nixos:
if: ${{ contains(github.event.pull_request.labels.*.name, 'teststack') && contains(github.event.pull_request.labels.*.name, 'rebuild') }}
runs-on: [self-hosted, linux] # only unique osuosl instance
env:
image_pool_dir: "/github-runner/artifacts"
nix_config_path: "testing/infra/machines/nix/configuration.nix"
steps:
- name: build test instance nixos configuration
run: >
source /etc/bashrc;
export NIXPKGS_ALLOW_INSECURE=1;
image="$(nixos-generate -f qcow -c "${nix_config_path}" | tail -n 2 | grep qcow2)";
echo "image=${image}" >> $GITHUB_ENV;
- name: update image in pool
run: >
source /etc/bashrc;
cp "${image}" "${image_pool_dir}";
test_stack_recreate:
if: ${{ contains(github.event.pull_request.labels.*.name, 'teststack') && contains(github.event.pull_request.labels.*.name, 'recreate') }}
runs-on: [self-hosted, linux] # only unique osuosl instance
env:
MASK_FILE: testing/maskfile.md
steps:
- name: cleanup former stack
run: >
source /etc/bashrc;
mask --maskfile "${MASK_FILE}" infra cleanup network;
mask --maskfile "${MASK_FILE}" infra cleanup machines;
- name: reerrect stack
run: >
source /etc/bashrc;
mask --maskfile "${MASK_FILE}" infra create machines;
sleep 50;
mask --maskfile "${MASK_FILE}" config generate prometheus;
mask --maskfile "${MASK_FILE}" config generate breeder "./examples/network_gen.yml";
mask --maskfile "${MASK_FILE}" infra create network;
godon_recreate:
if: ${{ contains(github.event.pull_request.labels.*.name, 'godon') && contains(github.event.pull_request.labels.*.name, 'recreate') }}
runs-on: [self-hosted, linux] # only unique osuosl instance
env:
MASK_FILE: testing/maskfile.md
steps:
- name: cleanup former stack
run: >
source /etc/bashrc;
mask --maskfile "${MASK_FILE}" godon cleanup;
- name: reerrect stack
run: >
source /etc/bashrc;
mask --maskfile "${MASK_FILE}" godon create;