Skip to content

Commit

Permalink
Merge pull request #429 from vprashar2929/add-yamllint
Browse files Browse the repository at this point in the history
feat(ci): Add yamllint workflow
  • Loading branch information
sunya-ch authored Sep 3, 2024
2 parents 6955354 + 2d882b8 commit 0957464
Show file tree
Hide file tree
Showing 82 changed files with 2,200 additions and 2,194 deletions.
14 changes: 5 additions & 9 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ body:
</details>
validations:
required: false

- type: textarea
id: kubeVersion
attributes:
Expand Down Expand Up @@ -151,20 +150,17 @@ body:
$ KEPLER_NAMESPACE=kepler
# provide kepler configmap
$ kubectl get configmap kepler-cfm -n ${KEPLER_NAMESPACE}
$ kubectl get configmap kepler-cfm -n ${KEPLER_NAMESPACE}
# paste output here
# provide kepler model server configmap if Kepler Model Server is deployed
$ kubectl get configmap kepler-model-server-cfm -n ${KEPLER_NAMESPACE}
# provide kepler model server configmap if Kepler Model Server is deployed
$ kubectl get configmap kepler-model-server-cfm -n ${KEPLER_NAMESPACE}
# paste output here
# provide kepler deployment description
$ kubectl describe deployment kepler-exporter -n ${KEPLER_NAMESPACE}
$ kubectl describe deployment kepler-exporter -n ${KEPLER_NAMESPACE}
```
For standalone:
# put your Kepler command argument here
</details>
validations:
required: false
required: false
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/document.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ body:
attributes:
label: How do you suggest this is fixed?
validations:
required: false
required: false
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ body:
attributes:
label: Why is this needed?
validations:
required: true
required: true
1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ updates:
directory: /
schedule:
interval: daily

110 changes: 55 additions & 55 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
name: Build-Push Kepler Model Server Image

on:
on: # yamllint disable-line rule:truthy
workflow_call:
secrets:
docker_username:
description: 'Docker username'
description: Docker username
required: false
docker_password:
description: 'Docker password'
description: Docker password
required: false
inputs:
base_change:
description: 'Change flag on base image'
description: Change flag on base image
required: true
type: string
s3_change:
description: 'Change flag on s3 image'
description: Change flag on s3 image
required: true
type: string
image_repo:
description: 'The image repo to use'
description: The image repo to use
required: true
type: string
image_tag:
description: 'The image tag to use'
description: The image tag to use
required: true
type: string
push:
description: 'Push image'
description: Push image
required: false
type: string
default: false
Expand Down Expand Up @@ -68,58 +68,58 @@ jobs:
exists: ${{ steps.check-base-exist.outputs.exists }}

steps:
- name: Check if Docker base image exists
id: check-base-exist
run: |
if docker pull ${{ env.base_image }}; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
- name: Check if Docker base image exists
id: check-base-exist
run: |
if docker pull ${{ env.base_image }}; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
build:
runs-on: ubuntu-latest
needs: [check-secret, check-base-exist]
steps:
- name: checkout
uses: actions/checkout@v4
- name: set up QEMU
uses: docker/setup-qemu-action@v3
- name: set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker
if: ${{ needs.check-secret.outputs.available == 'true' }}
uses: docker/login-action@v3
with:
- name: checkout
uses: actions/checkout@v4
- name: set up QEMU
uses: docker/setup-qemu-action@v3
- name: set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker
if: ${{ needs.check-secret.outputs.available == 'true' }}
uses: docker/login-action@v3
with:
registry: ${{ inputs.image_repo }}
username: ${{ secrets.docker_username }}
password: ${{ secrets.docker_password }}
- name: Build-push s3 image
if: ${{ needs.check-secret.outputs.available == 'true' && env.s3_change == 'true' }}
uses: docker/build-push-action@v6
with:
platforms: linux/amd64
push: ${{ inputs.push }}
tags: ${{ env.s3_image }}
context: model_training/s3
file: model_training/s3/Dockerfile
- name: Build-push base image
if: ${{ (needs.check-secret.outputs.available == 'true') && ((needs.check-base-exist.outputs.exists == 'false') || (env.base_change == 'true')) }}
uses: docker/build-push-action@v6
with:
platforms: linux/amd64
push: true
tags: ${{ env.base_image }}
file: dockerfiles/Dockerfile.base
- name: Replace value in file
if: ${{ (needs.check-secret.outputs.available == 'true') && ((needs.check-base-exist.outputs.exists == 'false') || (env.base_change == 'true')) }}
run: |
sed -i "s|quay.io/sustainable_computing_io/kepler_model_server_base:latest|${{ env.base_image }}|" dockerfiles/Dockerfile
- name: Build-push image
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64
push: ${{ inputs.push }}
tags: ${{ env.image }}
file: dockerfiles/Dockerfile
- name: Build-push s3 image
if: ${{ needs.check-secret.outputs.available == 'true' && env.s3_change == 'true' }}
uses: docker/build-push-action@v6
with:
platforms: linux/amd64
push: ${{ inputs.push }}
tags: ${{ env.s3_image }}
context: model_training/s3
file: model_training/s3/Dockerfile
- name: Build-push base image
if: ${{ (needs.check-secret.outputs.available == 'true') && ((needs.check-base-exist.outputs.exists == 'false') || (env.base_change == 'true')) }}
uses: docker/build-push-action@v6
with:
platforms: linux/amd64
push: true
tags: ${{ env.base_image }}
file: dockerfiles/Dockerfile.base
- name: Replace value in file
if: ${{ (needs.check-secret.outputs.available == 'true') && ((needs.check-base-exist.outputs.exists == 'false') || (env.base_change == 'true')) }}
run: |
sed -i "s|quay.io/sustainable_computing_io/kepler_model_server_base:latest|${{ env.base_image }}|" dockerfiles/Dockerfile
- name: Build-push image
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64
push: ${{ inputs.push }}
tags: ${{ env.image }}
file: dockerfiles/Dockerfile
52 changes: 26 additions & 26 deletions .github/workflows/collect-data-self-hosted.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
name: Self-hosted Collect Data Workflow

on:
on: # yamllint disable-line rule:truthy
workflow_call:
secrets:
self_hosted_github_token:
description: 'The GitHub token to use'
description: The GitHub token to use
required: true
aws_access_key_id:
description: 'The AWS access key id to use'
description: The AWS access key id to use
required: true
aws_secret_access_key:
description: 'The AWS secret access key to use'
description: The AWS secret access key to use
required: true
security_group_id:
description: 'The AWS security group id to use'
description: The AWS security group id to use
required: true
aws_region:
description: 'The AWS region to use'
description: The AWS region to use
required: true
inputs:
github_repo:
description: 'The GitHub repo to use'
description: The GitHub repo to use
required: true
type: string
ami_id:
description: 'The AMI ID to use for the EC2 instance'
description: The AMI ID to use for the EC2 instance
required: true
type: string
instance_type:
description: 'The instance type to use for the EC2 instance'
description: The instance type to use for the EC2 instance
required: true
type: string
model_server_image:
description: 'Kepler Model Server image'
description: Kepler Model Server image
required: true
type: string

env:
KUBECONFIG: /tmp/kubeconfig

jobs:
setup-runner:
name: Setup Self Hosted Runner
Expand All @@ -52,18 +52,18 @@ jobs:
uses: sustainable-computing-io/aws_ec2_self_hosted_runner@v4
id: create-runner
with:
action: "create"
aws_region: ${{ secrets.aws_region }}
github_token: ${{ secrets.self_hosted_github_token }}
aws_access_key_id: ${{ secrets.aws_access_key_id }}
aws_secret_access_key: ${{ secrets.aws_secret_access_key }}
security_group_id: ${{ secrets.security_group_id }}
github_repo: ${{ inputs.github_repo }}
ami_id: ${{ inputs.ami_id }}
instance_type: ${{ inputs.instance_type }}
create_s3_bucket: "false"
spot_instance_only: "true"
root_volume_size: "100"
action: create
aws_region: ${{ secrets.aws_region }}
github_token: ${{ secrets.self_hosted_github_token }}
aws_access_key_id: ${{ secrets.aws_access_key_id }}
aws_secret_access_key: ${{ secrets.aws_secret_access_key }}
security_group_id: ${{ secrets.security_group_id }}
github_repo: ${{ inputs.github_repo }}
ami_id: ${{ inputs.ami_id }}
instance_type: ${{ inputs.instance_type }}
create_s3_bucket: "false"
spot_instance_only: "true"
root_volume_size: "100"

- name: Print Output
id: output
Expand Down Expand Up @@ -165,7 +165,7 @@ jobs:
id: unregister
uses: sustainable-computing-io/aws_ec2_self_hosted_runner@v4
with:
action: "unregister"
action: unregister
runner_name: ${{ needs.setup-runner.outputs.runner_name }}
github_token: ${{ secrets.self_hosted_github_token }}
github_repo: ${{ inputs.github_repo }}
Expand All @@ -174,7 +174,7 @@ jobs:
id: terminate
uses: sustainable-computing-io/aws_ec2_self_hosted_runner@v4
with:
action: "terminate"
action: terminate
aws_access_key_id: ${{ secrets.aws_access_key_id }}
aws_secret_access_key: ${{ secrets.aws_secret_access_key }}
instance_id: ${{ needs.setup-runner.outputs.instance_id }}
instance_id: ${{ needs.setup-runner.outputs.instance_id }}
10 changes: 5 additions & 5 deletions .github/workflows/collect-train.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# manually run on collect needed
on:
on: # yamllint disable-line rule:truthy
workflow_dispatch:

jobs:
Expand All @@ -11,7 +11,7 @@ jobs:
max-parallel: 1
with:
instance_type: ${{ matrix.instance_type }}
ami_id: 'ami-0e4d0bb9670ea8db0'
ami_id: ami-0e4d0bb9670ea8db0
github_repo: ${{ github.repository }}
model_server_image: ${{ vars.IMAGE_REPO }}/kepler_model_server:latest
secrets:
Expand All @@ -20,7 +20,7 @@ jobs:
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
security_group_id: ${{ secrets.AWS_SECURITY_GROUP_ID }}
aws_region: ${{ secrets.AWS_REGION }}

train-model:
needs: [collect-data]
strategy:
Expand All @@ -30,12 +30,12 @@ jobs:
with:
pipeline_name: std_v0.7.11
instance_type: ${{ matrix.instance_type }}
ami_id: 'ami-0e4d0bb9670ea8db0'
ami_id: ami-0e4d0bb9670ea8db0
github_repo: ${{ github.repository }}
model_server_image: ${{ vars.IMAGE_REPO }}/kepler_model_server:latest
trainers: LogisticRegressionTrainer,ExponentialRegressionTrainer,SGDRegressorTrainer,GradientBoostingRegressorTrainer,XgboostFitTrainer
secrets:
self_hosted_github_token: ${{ secrets.GH_SELF_HOSTED_RUNNER_TOKEN }}
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_region: ${{ secrets.AWS_REGION }}
aws_region: ${{ secrets.AWS_REGION }}
2 changes: 1 addition & 1 deletion .github/workflows/commit-msg.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Commit message check

on:
on: # yamllint disable-line rule:truthy
pull_request:

jobs:
Expand Down
Loading

0 comments on commit 0957464

Please sign in to comment.