-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
548 changed files
with
67,291 additions
and
23 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Delete old workflow runs | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
days: | ||
description: 'Number of days.' | ||
required: true | ||
default: 30 | ||
minimum_runs: | ||
description: 'The minimum runs to keep for each workflow.' | ||
required: true | ||
default: 6 | ||
delete_workflow_pattern: | ||
description: 'The name or filename of the workflow. if not set then it will target all workflows.' | ||
required: false | ||
delete_workflow_by_state_pattern: | ||
description: 'Remove workflow by state: active, deleted, disabled_fork, disabled_inactivity, disabled_manually' | ||
required: true | ||
default: "All" | ||
type: choice | ||
options: | ||
- "All" | ||
- active | ||
- deleted | ||
- disabled_inactivity | ||
- disabled_manually | ||
delete_run_by_conclusion_pattern: | ||
description: 'Remove workflow by conclusion: action_required, cancelled, failure, skipped, success' | ||
required: true | ||
default: "All" | ||
type: choice | ||
options: | ||
- "All" | ||
- action_required | ||
- cancelled | ||
- failure | ||
- skipped | ||
- success | ||
dry_run: | ||
description: 'Only log actions, do not perform any delete operations.' | ||
required: false | ||
|
||
jobs: | ||
del_runs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Delete workflow runs | ||
uses: Mattraks/delete-workflow-runs@v2 | ||
with: | ||
token: ${{ github.token }} | ||
repository: ${{ github.repository }} | ||
retain_days: ${{ github.event.inputs.days }} | ||
keep_minimum_runs: ${{ github.event.inputs.minimum_runs }} | ||
delete_workflow_pattern: ${{ github.event.inputs.delete_workflow_pattern }} | ||
delete_workflow_by_state_pattern: ${{ github.event.inputs.delete_workflow_by_state_pattern }} | ||
delete_run_by_conclusion_pattern: ${{ github.event.inputs.delete_run_by_conclusion_pattern }} | ||
dry_run: ${{ github.event.inputs.dry_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Trigger Github Actions | ||
|
||
on: | ||
pull_request_review: | ||
types: [submitted] | ||
|
||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
BRANCH_NAME: ${{ github.event.pull_request.head.ref }} | ||
|
||
jobs: | ||
call-python-workflow: | ||
if: ${{ github.event.review.state == 'approved' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: tj-actions/changed-files@v35 | ||
id: changed_files | ||
with: | ||
json: "true" | ||
- name: Print changed files | ||
run: | | ||
echo "Changed files: ${{ steps.changed_files.outputs.all_changed_files }}" | ||
- name: Call imaging if new-site config file changed | ||
if: contains(steps.changed_files.outputs.all_changed_files, 'config/new-site.json') | ||
run: | | ||
gh workflow run trigger-python-workflows.yml -f file=config/new-site.json -f workflow=imaging -f branch=${{ env.BRANCH_NAME }} | ||
- name: Call cluster-config if pod-config file changed | ||
if: contains(steps.changed_files.outputs.all_changed_files, 'config/pod-config.yml') | ||
run: | | ||
gh workflow run trigger-python-workflows.yml -f file=config/pod-config.yml -f workflow=pod-config -f branch=${{ env.BRANCH_NAME }} | ||
- name: Call vm-workloads if create_vm_workloads file changed | ||
if: contains(steps.changed_files.outputs.all_changed_files, 'config/create-vm-workloads.json') | ||
run: | | ||
gh workflow run trigger-python-workflows.yml -f file=config/create_vm_workloads.json -f workflow=create-vm-workloads -f branch=${{ env.BRANCH_NAME }} | ||
- name: Call edge-ai-workloads if edge_ai file changed | ||
if: contains(steps.changed_files.outputs.all_changed_files, 'config/edge-ai.json') | ||
run: | | ||
gh workflow run trigger-python-workflows.yml -f file=config/edge-ai.json -f workflow=calm-edgeai-vm-workload -f branch=${{ env.BRANCH_NAME }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: Trigger Python Workflows | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
file: | ||
description: 'Input file' | ||
required: true | ||
branch: | ||
description: 'Branch name where the config file resides' | ||
required: true | ||
workflow: | ||
description: 'Workflow to run' | ||
required: true | ||
default: "pod-config" | ||
type: choice | ||
options: | ||
- "pod-config" | ||
- "imaging" | ||
- "create-vm-workloads" | ||
- "calm-edgeai-vm-workload" | ||
|
||
jobs: | ||
create-python-environment: | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.inputs.branch }} | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
# gives you either a new virtualenv, or restores an old one based on | ||
# the requirements*.txt -file. | ||
- uses: syphar/restore-virtualenv@v1 | ||
id: cache-virtualenv | ||
- uses: syphar/restore-pip-download-cache@v1 | ||
if: steps.cache-virtualenv.outputs.cache-hit != 'true' | ||
# the package installation will only be executed when the | ||
# requirements*.txt - file has changed. | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
cd framework | ||
pip install -r requirements/dev.txt | ||
if: steps.cache-virtualenv.outputs.cache-hit != 'true' | ||
run-python-workflow: | ||
needs: create-python-environment | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.inputs.branch }} | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
- name: Restore cache | ||
uses: syphar/restore-virtualenv@v1 | ||
id: cache-virtualenv | ||
- name: Run python script | ||
shell: bash | ||
run: | | ||
cd framework | ||
python main.py --workflow ${{ github.event.inputs.workflow }} --file ${{ github.event.inputs.file }} | ||
- name: Git add config and logs | ||
run: | | ||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
git add sites/* | ||
git commit -a -m "Workflow trigger logs" | ||
- name: Push the config and logs to the trigger branch | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ github.event.inputs.branch }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Mac OS | ||
.DS_Store | ||
.idea | ||
|
||
# Development | ||
publish_to_marketplace.log | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*,cover | ||
.hypothesis/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff | ||
local_settings.py | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# IPython Notebook | ||
.ipynb_checkpoints | ||
|
||
# pyenv | ||
.python-version | ||
pyvenv.cfg | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
|
||
|
||
# virtualenv | ||
.venv/ | ||
venv/ | ||
ENV/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# others | ||
framework/script_log.log |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
dev: | ||
# Setup our python based virtualenv | ||
# This step assumes python3 is installed on your dev machine as python | ||
[ -f venv/bin/python ] || (python -m venv venv && \ | ||
venv/bin/pip install --upgrade pip setuptools) | ||
cd framework && \ | ||
../venv/bin/pip install --no-cache -r requirements/dev.txt | ||
|
||
test: dev | ||
# In progress | ||
pytest |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
password |
Oops, something went wrong.