galaxyproject/admin-training (opens in new tab)
4 workflows
Ansible Bootstrapping
.github/workflows/bootstrap.yml (opens in new tab)Triggers
workflow_dispatch
Jobs
| Job | Runs on | Steps | Actions used |
|---|---|---|---|
| setup | ubuntu-20.04 | 6 | actions/checkout@v2 actions/setup-python@v2 shimataro/ssh-key-action@v2 |
Raw YAML
name: Ansible Bootstrapping
on:
workflow_dispatch:
jobs:
setup:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install Ansible + deps
run: |
pip install -r bootstrap-instances/requirements.txt
- name: Setup SSH Keys
run: |
cd bootstrap-instances;
echo "${{ secrets.GAT_INTERNAL }}" > id_rsa
echo "${{ secrets.GAT_EU }}" > admintraining-eu.key
echo "${{ secrets.GAT_BE }}" > admintraining-be.key
echo "${{ secrets.GAT_OZ }}" > admintraining-oz3.key
echo "${{ secrets.GAT_US }}" > admintraining-us.key
echo "${{ secrets.THE_ONE_KEY }}" > gat-one-key-to-rule-them-all
echo "${{ secrets.THE_ONE_KEY_PUB }}" > gat-one-key-to-rule-them-all.pub
chmod go-rwx *.key gat-one-key-to-rule-them-all* id_rsa*
for x in *.key; do
ssh-keygen -y -f "$x" > "${x}.pub";
cat "${x}.pub"
done
ssh-keygen -y -f id_rsa > id_rsa.pub;
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.THE_ONE_KEY }}
known_hosts: "github.com,192.30.253.112 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ=="
config: |
Host gat-*training.galaxyproject.eu
User ubuntu
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
if_key_exists: replace # replace / ignore / fail; optional (defaults to fail)
- name: Run the playbook
run: |
cd bootstrap-instances
make all
env:
ANSIBLE_STDOUT_CALLBACK: yaml
Last fetched:
Triggers
workflow_dispatch
Jobs
| Job | Runs on | Steps | Actions used |
|---|---|---|---|
| setup | ubuntu-latest | 6 | actions/checkout@v2 actions/setup-python@v2 shimataro/ssh-key-action@v2 |
Raw YAML
name: GAT Status
on:
workflow_dispatch:
inputs:
name:
type: choice
description: Target machines
options:
- workshop_eu
- workshop_oz
- workshop_us
required: true
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install Ansible + deps
run: |
pip install -r bootstrap-instances/requirements.txt
- name: Setup SSH Keys
run: |
cd bootstrap-instances;
echo "${{ secrets.THE_ONE_KEY }}" > gat-one-key-to-rule-them-all
echo "${{ secrets.THE_ONE_KEY_PUB }}" > gat-one-key-to-rule-them-all.pub
chmod go-rwx gat-one-key-to-rule-them-all*
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.THE_ONE_KEY }}
known_hosts: "github.com,192.30.253.112 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ=="
config: |
Host gat-*.galaxy.training
User ubuntu
HostName %h
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
if_key_exists: replace # replace / ignore / fail; optional (defaults to fail)
- run: |
cd bootstrap-instances
ansible -a 'gat status' "${{ github.event.inputs.name }}" -f 20 -vv -e ansible_ssh_private_key_file=gat-one-key-to-rule-them-all > $GITHUB_STEP_SUMMARY
env:
ANSIBLE_STDOUT_CALLBACK: yaml
Last fetched:
Triggers
schedule workflow_dispatch
Jobs
| Job | Runs on | Steps | Actions used |
|---|---|---|---|
| setup | ubuntu-20.04 | 9 | actions/checkout@v2 hashicorp/setup-terraform@v1 |
Raw YAML
name: Terraform
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 0 1 * *'
workflow_dispatch:
jobs:
setup:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 0.15.4
- name: Terraform Format
id: fmt
run: cd terraform && terraform fmt
- name: Terraform Init
id: init
run: cd terraform && terraform init
- name: Terraform Validate
id: validate
run: cd terraform && terraform validate
- name: Terraform Plan
id: plan
run: cd terraform && terraform plan
continue-on-error: true
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_US_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_US_SECRET }}
AWS_DEFAULT_REGION: us-east-1
TF_VAR_EU_OS_USERNAME: ${{ secrets.OS_EU_USERNAME }}
TF_VAR_EU_OS_PASSWORD: ${{ secrets.OS_EU_PASSWORD }}
#TF_VAR_VSC_OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_VSC_APPLICATION_CREDENTIAL_ID }}
#TF_VAR_VSC_OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_VSC_APPLICATION_CREDENTIAL_SECRET }}
- name: Terraform Plan Status
if: steps.plan.outcome == 'failure'
run: exit 1
- name: Terraform Apply
run: cd terraform && terraform apply -auto-approve
continue-on-error: true
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_US_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_US_SECRET }}
AWS_DEFAULT_REGION: us-east-1
TF_VAR_EU_OS_USERNAME: ${{ secrets.OS_EU_USERNAME }}
TF_VAR_EU_OS_PASSWORD: ${{ secrets.OS_EU_PASSWORD }}
#TF_VAR_VSC_OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_VSC_APPLICATION_CREDENTIAL_ID }}
#TF_VAR_VSC_OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_VSC_APPLICATION_CREDENTIAL_SECRET }}
- name: Commit changed files back
run: |
git add terraform
count=$(git diff --name-only --cached | wc -l)
if (( count > 0 )); then
git config --global user.email "bot@github.com"
git config --global user.name "Github Actions"
git commit -a -m "[slack-bot] $(date '+%H:%M')"
git push
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Last fetched:
Release Testing
.github/workflows/test.yml (opens in new tab)Triggers
workflow_dispatch
Jobs
| Job | Runs on | Steps | Actions used |
|---|---|---|---|
| setup | ubuntu-20.04 | 16 | actions/checkout@v2 actions/setup-python@v2 actions/cache@v2 hashicorp/setup-terraform@v1 shimataro/ssh-key-action@v2 actions/upload-artifact@v2 |
Raw YAML
name: Release Testing
on:
workflow_dispatch:
jobs:
setup:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: actions/setup-python@v2
with:
python-version: '3.8'
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Ansible + deps
run: |
pip install -r bootstrap-instances/requirements.txt
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 0.15.4
- name: Terraform Format
id: fmt
run: cd terraform-release && terraform fmt -check
- name: Terraform Init
id: init
run: cd terraform-release && terraform init
- name: Terraform Validate
id: validate
run: cd terraform-release && terraform validate
- name: Terraform Plan
id: plan
run: cd terraform-release && terraform plan
continue-on-error: true
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_EU_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_EU_SECRET }}
AWS_DEFAULT_REGION: us-east-1
- name: Terraform Plan Status
if: steps.plan.outcome == 'failure'
run: exit 1
- name: Terraform Apply
run: cd terraform-release && terraform apply -auto-approve
continue-on-error: true
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_EU_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_EU_SECRET }}
AWS_DEFAULT_REGION: us-east-1
- name: Setup SSH Keys
run: |
cd bootstrap-instances;
echo "${{ secrets.GAT_JETSTREAM }}" > id_rsa.key
echo "${{ secrets.THE_ONE_KEY }}" > gat-one-key-to-rule-them-all
echo "${{ secrets.THE_ONE_KEY_PUB }}" > gat-one-key-to-rule-them-all.pub
chmod go-rwx gat-one-key-to-rule-them-all* id_rsa*
for x in *.key; do
ssh-keygen -y -f "$x" > "${x}.pub";
done
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.THE_ONE_KEY }}
known_hosts: "github.com,192.30.253.112 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ=="
config: |
Host gat-*training.galaxyproject.eu
User ubuntu
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
if_key_exists: replace # replace / ignore / fail; optional (defaults to fail)
- name: Run the playbook
run: |
cd bootstrap-instances
cat > hosts <<-EOF
[workshop_instances]
gat-0.jetstream.training.galaxyproject.eu
gat-1.jetstream.training.galaxyproject.eu
gat-2.jetstream.training.galaxyproject.eu
[workshop_instances:vars]
ansible_user = ubuntu
ansible_ssh_private_key_file = id_rsa.key
ansible_host_key_checking = false
ansible_become = true
set_password = true
EOF
# Build the infra
make all
# Run the testing playbooks
ansible-playbook -i hosts test.yml -e r=12
env:
ANSIBLE_STDOUT_CALLBACK: yaml
continue-on-error: true # We should always continue to the end where we tear down infra.
- uses: actions/upload-artifact@v2
with:
name: test-reports
path: |
/tmp/galaxy*.log
/tmp/galaxy*.html
continue-on-error: true # We should always continue to the end where we tear down infra.
- name: Tear down infrastructure
run: cd terraform-release && terraform destroy -auto-approve
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_EU_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_EU_SECRET }}
AWS_DEFAULT_REGION: us-east-1
Last fetched: