11name : Profiling Report
2- on :
2+ on : # yamllint disable-line rule:truthy
33 pull_request :
44
55jobs :
@@ -26,25 +26,10 @@ jobs:
2626 profiling :
2727 needs : check-changes
2828 if : needs.check-changes.outputs.changes == 'true'
29- runs-on : ubuntu-latest
29+ runs-on : self-hosted
3030 steps :
31- - name : Install Docker
32- shell : bash
33- run : |
34- sudo apt-get update
35- sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
36- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
37- echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list
38- sudo apt-get update
39- sudo apt-get install -y docker-ce docker-ce-cli containerd.io
40- sudo usermod -aG docker $USER
41-
42- - name : Verify Docker installation
43- shell : bash
44- run : |
45- docker ps
46- docker --version
47-
31+ # NOTE: In case of self-hosted runners, tools like docker, make, kubectl etc. are installed at the time of setting up the runner.
32+ # Hence, we don't need to install them as part of the job.
4833 - name : Checkout source
4934 uses : actions/checkout@v5
5035 with :
5944 - name : Install pprof
6045 run : go install github.com/google/pprof@latest
6146
62- - name : Enable fake cpu meter
63- shell : bash
64- run : |
65- sed -i '/fake-cpu-meter:/{n;s/enabled: false/enabled: true/}' \
66- compose/dev/kepler-dev/etc/kepler/config.yaml \
67- compose/dev/kepler-latest/etc/kepler/config.yaml
68-
6947 - name : Run Docker Compose services
7048 shell : bash
7149 working-directory : compose/dev
@@ -122,6 +100,22 @@ jobs:
122100 path : ./tmp/*
123101 retention-days : 5 # Keep artifact for 5 days
124102
103+ # NOTE: Ensure that all deployments, built images and cluster are properly cleaned up
104+ # to prevent residual resources
105+ - name : Shutdown Docker Compose services
106+ if : always()
107+ shell : bash
108+ working-directory : compose/dev
109+ run : |
110+ # Stop kepler-dev and kepler-latest services
111+ docker compose down kepler-dev kepler-latest --volumes
112+
113+ - name : Cleanup Docker images
114+ if : always()
115+ shell : bash
116+ run : |
117+ docker image prune -af
118+
125119 generate-comment-message :
126120 needs : profiling
127121 if : needs.profiling.result == 'success'
0 commit comments