Skip to content

Commit

Permalink
Merge branch 'main' into add-vm-metrics-train
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiyiLiu1234 authored Oct 22, 2024
2 parents fb45b43 + 7b4721e commit c5f8ec5
Show file tree
Hide file tree
Showing 29 changed files with 1,087 additions and 2,198 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/collect-data-self-hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
uses: actions/checkout@v4

- name: use Kepler action to deploy cluster
uses: sustainable-computing-io/[email protected].7
uses: sustainable-computing-io/[email protected].9
with:
ebpfprovider: libbpf
cluster_provider: kind
Expand Down
23 changes: 14 additions & 9 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,13 @@ env:

jobs:
run-integration:
if: ${{ (inputs.base_change != 'true') || ( (inputs.base_change == 'true') && (inputs.docker_secret == 'true') ) }}
runs-on: ubuntu-20.04
steps:
- name: use Kepler action to deploy cluster
uses: sustainable-computing-io/[email protected].7
uses: sustainable-computing-io/[email protected].9
with:
runningBranch: kind
cluster_provider: kind
local_dev_cluster_version: v0.0.5
- name: load kepler image
run: |
docker pull ${{ env.KEPLER_IMAGE }}
Expand Down Expand Up @@ -74,24 +72,31 @@ jobs:
- name: test deploying with only estimator
run: |
make deploy
make e2e-test
./tests/e2e_test.sh --estimator ${{ inputs.additional_opts }}
make cleanup
env:
OPTS: ESTIMATOR${{ inputs.additional_opts }}
OPTS: ESTIMATOR
KEPLER_IMAGE_VERSION: ${{ inputs.kepler_tag }}
- name: test deploying with only server
run: |
make deploy
make e2e-test
./tests/e2e_test.sh --server ${{ inputs.additional_opts }}
make cleanup
env:
OPTS: SERVER${{ inputs.additional_opts }}
OPTS: SERVER
KEPLER_IMAGE_VERSION: ${{ inputs.kepler_tag }}
- name: test deploying with estimator and model server
run: |
make deploy
make e2e-test
./tests/e2e_test.sh --estimator --server ${{ inputs.additional_opts }}
make cleanup
env:
OPTS: ESTIMATOR SERVER${{ inputs.additional_opts }}
OPTS: ESTIMATOR SERVER
KEPLER_IMAGE_VERSION: ${{ inputs.kepler_tag }}

- name: upload artifacts on failure
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: integration-test-artifacts
path: tmp/e2e
6 changes: 3 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ jobs:
image_repo: ${{ vars.IMAGE_REPO || 'docker.io/library' }}
image_tag: ${{ needs.check-branch.outputs.tag }}
kepler_tag: release-0.7.11
additional_opts: " TEST"
additional_opts: --test

integration-test-with-exporter:
needs: [check-secret, check-branch, check-change, base-image]
Expand All @@ -232,7 +232,7 @@ jobs:
image_repo: ${{ vars.IMAGE_REPO || 'docker.io/library' }}
image_tag: ${{ needs.check-branch.outputs.tag }}
kepler_tag: release-0.7.11
additional_opts: " DB"
additional_opts: --db

integration-test-with-latest:
needs: [check-secret, check-branch, check-change, base-image]
Expand All @@ -244,7 +244,7 @@ jobs:
image_repo: ${{ vars.IMAGE_REPO || 'docker.io/library' }}
image_tag: ${{ needs.check-branch.outputs.tag }}
kepler_tag: latest
additional_opts: " DB"
additional_opts: --db

verify_model_training_script:
runs-on: ubuntu-latest
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/tekton-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ env:
BASE_IMAGE: ${{ inputs.image_repo }}/kepler_model_server_base:${{ inputs.image_tag }}
IMAGE: ${{ inputs.image_repo }}/kepler_model_server:${{ inputs.image_tag }}
KIND_CLUSTER_NAME: kind
KUBECONFIG: /tmp/kubeconfig

jobs:
tekton-test:
if: ${{ (inputs.base_change != 'true') || ( (inputs.base_change == 'true') && (inputs.docker_secret == 'true') ) }}
runs-on: ubuntu-latest
steps:
- name: checkout
Expand All @@ -59,7 +57,7 @@ jobs:
run: |
docker build -t $IMAGE -f dockerfiles/Dockerfile .
- name: use Kepler action to deploy cluster
uses: sustainable-computing-io/[email protected].7
uses: sustainable-computing-io/[email protected].9
with:
ebpfprovider: libbpf
cluster_provider: kind
Expand All @@ -73,6 +71,7 @@ jobs:
- name: Install Kepler
working-directory: model_training
run: |
export KUBECONFIG_ROOT_DIR=/tmp/kubeconfig
./script.sh deploy_kepler
./script.sh deploy_prom_dependency
podname=$(kubectl get pods -oname -nkepler)
Expand All @@ -84,17 +83,20 @@ jobs:
- name: Prepare PVC
working-directory: model_training/tekton
run: |
export KUBECONFIG_ROOT_DIR=/tmp/kubeconfig
kubectl apply -f pvc/hostpath.yaml
- name: Deploy Tasks and Pipelines
working-directory: model_training/tekton
run: |
export KUBECONFIG_ROOT_DIR=/tmp/kubeconfig
kubectl apply -f tasks
kubectl apply -f tasks/s3
kubectl apply -f pipelines
- name: Run Tekton Collect
run: |
export KUBECONFIG_ROOT_DIR=/tmp/kubeconfig
cat <<EOF | kubectl apply -f -
apiVersion: tekton.dev/v1
kind: PipelineRun
Expand Down Expand Up @@ -131,6 +133,7 @@ jobs:
- name: Run Tekton Retrain
run: |
export KUBECONFIG_ROOT_DIR=/tmp/kubeconfig
cat <<EOF | kubectl apply -f -
apiVersion: tekton.dev/v1
kind: PipelineRun
Expand Down Expand Up @@ -166,6 +169,7 @@ jobs:
- name: Run Tekton Complete Retrain
run: |
export KUBECONFIG_ROOT_DIR=/tmp/kubeconfig
cat <<EOF | kubectl apply -f -
apiVersion: tekton.dev/v1
kind: PipelineRun
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/train-model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
sudo pip3 install awscli
- name: use Kepler action to deploy cluster
uses: sustainable-computing-io/[email protected].7
uses: sustainable-computing-io/[email protected].9
with:
ebpfprovider: libbpf
cluster_provider: kind
Expand Down
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,6 @@ manifest:
@./manifests/set.sh "${OPTS}"
@$(MAKE) _print

e2e-test:
chmod +x ./tests/e2e_test.sh
./tests/e2e_test.sh test "${OPTS}"

patch-power-request-client:
kubectl patch ds kepler-exporter -n kepler --patch-file ./manifests/test/power-request-client.yaml

Expand Down
86 changes: 86 additions & 0 deletions hack/utils.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#
# Copyright 2024.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

is_fn() {
[[ $(type -t "$1") == "function" ]]
return $?
}

header() {
local title=" πŸ”†πŸ”†πŸ”† $* πŸ”†πŸ”†πŸ”† "

local len=40
if [[ ${#title} -gt $len ]]; then
len=${#title}
fi

echo -e "\n\n \033[1m${title}\033[0m"
echo -n "━━━━━"
printf '━%.0s' $(seq "$len")
echo "━━━━━━━"

}

info() {
echo -e " πŸ”” $*" >&2
}

err() {
echo -e " 😱 $*" >&2
}

warn() {
echo -e "  $*" >&2
}

ok() {
echo -e " βœ… $*" >&2
}

skip() {
echo -e " πŸ™ˆ SKIP: $*" >&2
}

fail() {
echo -e " ❌ FAIL: $*" >&2
}

info_run() {
echo -e " ξž• $*\n" >&2
}

run() {
echo -e " ❯ $*\n" >&2
"$@"
}

die() {
echo -e "\n βœ‹ $* "
echo -e "──────────────────── ⛔️⛔️⛔️ ────────────────────────\n"
exit 1
}

line() {
local len="$1"
local style="${2:-thin}"
shift

local ch='─'
[[ "$style" == 'heavy' ]] && ch="━"

printf "$ch%.0s" $(seq "$len") >&2
echo
}
Loading

0 comments on commit c5f8ec5

Please sign in to comment.