-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* main: Vhost ratio for XGBoost provider (#994) Codespaces merge into main (#993) Container energy idle (#992) Monotonic and low value check (#973) Phase Stats are now also saved if runs fails (#972) RAPL energy filtering moved to provider (#979) fixes the GCC warnings (#985) Bump psycopg-pool from 3.2.3 to 3.2.4 (#982) Bump aiohttp from 3.11.2 to 3.11.4 (#984) Fixed SCI link Hinting UTC Removed duplicate tests and fixed tests Bump aiohttp from 3.11.0 to 3.11.2 (#981) Added unit test for rescale energy value Bump aiohttp from 3.10.10 to 3.11.0 (#980) (fix): Repo submission to software/add was failing on non-main branch
- Loading branch information
Showing
89 changed files
with
779 additions
and
562 deletions.
There are no files selected for viewing
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,36 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
# we have to rename this makefile as it doesn't compile in Codespaces | ||
if [ -f /workspaces/green-metrics-tool/metric_providers/lm_sensors/Makefile ]; then | ||
mv /workspaces/green-metrics-tool/metric_providers/lm_sensors/Makefile /workspaces/green-metrics-tool/metric_providers/lm_sensors/Makefile.bak | ||
git update-index --assume-unchanged /workspaces/green-metrics-tool/metric_providers/lm_sensors/Makefile | ||
fi | ||
|
||
/workspaces/green-metrics-tool/install_linux.sh -p testpw -a "https://${CODESPACE_NAME}-9142.app.github.dev" -m "https://${CODESPACE_NAME}-9143.app.github.dev" -t -i -s -l | ||
source venv/bin/activate | ||
|
||
# Also add XGBoost, as we need it | ||
python3 -m pip install -r /workspaces/green-metrics-tool/metric_providers/psu/energy/ac/xgboost/machine/model/requirements.txt | ||
|
||
# make edits to ports so we can use 9143 to access front end | ||
sed -i 's/listen \[::\]:9142;/listen [::]:9143;/; s/listen 9142;/listen 9143;/' /workspaces/green-metrics-tool/docker/nginx/frontend.conf | ||
sed -i 's/- 9142:9142/- 9142:9142\n - 9143:9143/' /workspaces/green-metrics-tool/docker/compose.yml | ||
sed -i 's|- ./nginx/block.conf|#- ./nginx/block.conf|' /workspaces/green-metrics-tool/docker/compose.yml | ||
|
||
# activate XGBoost provider with sane values for GitHub Codespaces | ||
sed -i 's/common:/common:\n psu.energy.ac.xgboost.machine.provider.PsuEnergyAcXgboostMachineProvider:\n resolution: 99\n CPUChips: 1\n HW_CPUFreq: 2800\n CPUCores: 32\n CPUThreads: 64\n TDP: 270\n HW_MemAmountGB: 256\n VHost_Ratio: 0.03125\n/' /workspaces/green-metrics-tool/config.yml | ||
|
||
|
||
git clone https://github.com/green-coding-solutions/example-applications.git --depth=1 --single-branch /workspaces/green-metrics-tool/example-applications || true | ||
|
||
source venv/bin/activate | ||
|
||
docker compose -f /workspaces/green-metrics-tool/docker/compose.yml down | ||
|
||
docker compose -f /workspaces/green-metrics-tool/docker/compose.yml up -d | ||
|
||
|
||
gh codespace ports visibility 9142:public -c $CODESPACE_NAME | ||
|
||
gh codespace ports visibility 9143:public -c $CODESPACE_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,31 @@ | ||
{ | ||
"postStartCommand": "/workspaces/green-metrics-tool/.devcontainer/on-start.sh", | ||
"forwardPorts": [9142, 9143], | ||
"portsAttributes": { | ||
"9143": { | ||
"label": "metrics page" | ||
}, | ||
"9142": { | ||
"label": "api" | ||
} | ||
}, | ||
"customizations": { | ||
"codespaces": { | ||
"openFiles": [ | ||
".devcontainer/splash.md" | ||
] | ||
}, | ||
"vscode": { | ||
"settings": { | ||
"workbench.editorAssociations": { | ||
"*.md": "vscode.markdown.preview.editor" // Open markdown files in preview mode by default | ||
} | ||
}, | ||
"extensions": | ||
[ | ||
"ms-python.python", | ||
"ms-azuretools.vscode-docker" | ||
] | ||
} | ||
} | ||
} |
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,17 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
etc_hosts_line_1="127.0.0.1 green-coding-postgres-container" | ||
|
||
echo "Writing to /etc/hosts file..." | ||
|
||
# Entry 1 is needed for the local resolution of the containers through the jobs.py and runner.py | ||
if ! sudo grep -Fxq "$etc_hosts_line_1" /etc/hosts; then | ||
echo "$etc_hosts_line_1" | sudo tee -a /etc/hosts | ||
else | ||
echo "Entry was already present..." | ||
fi | ||
|
||
# Ensure that after a restart of the Codespace the ports are set to public again | ||
gh codespace ports visibility 9142:public -c $CODESPACE_NAME | ||
gh codespace ports visibility 9143:public -c $CODESPACE_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,35 @@ | ||
# Green Metrics Tool Codespaces Quickstart | ||
|
||
Thank you for trying out the Green Metrics Tool :-) | ||
|
||
Please run the following command in the terminal to set up everything! 🚀 | ||
|
||
```sh | ||
bash .devcontainer/codespace-setup.sh | ||
``` | ||
|
||
It will take about 3 minutes. | ||
|
||
Afterwards, load the python environment: | ||
|
||
```sh | ||
source venv/bin/activate | ||
``` | ||
|
||
Do your first measurement run like this: | ||
|
||
```sh | ||
python3 runner.py --name "Simple Test" --uri "/workspaces/green-metrics-tool/example-applications/" --filename "stress/usage_scenario.yml" --skip-system-checks --dev-no-optimizations --dev-cache-build | ||
``` | ||
|
||
Then, if you want to see a more representative repository, try running our Bakery Demo repository we did together with the Wagtail Community: | ||
|
||
```sh | ||
python3 runner.py --uri https://github.com/green-coding-solutions/bakerydemo --branch gmt --skip-system-checks --dev-no-optimization --dev-cache-build --skip-unsafe --name "Bakery Demo Test" | ||
``` | ||
|
||
To see the Metrics front end, go to your ports tab and follow the forwarding address for port 9143. | ||
|
||
Make sure the `api` port (9142) is public. If it's private, the metrics frontend will not be able to access the API due to CORS issues. | ||
|
||
If you are experiencing problems, see the file [.devcontainer/troubleshooting.md](./troubleshooting.md) for some common troubleshooting tips. |
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,27 @@ | ||
# Troubleshooting | ||
|
||
## Frontend can't be open | ||
|
||
Make sure the ports 9142 (`api`) und 9143 (`metrics page`) are public. If they are private, the metrics frontend will not be able to access the API due to CORS issues. After a restart of the codespace the ports are set to private, so you have to change the visibility manually. | ||
|
||
You can use the following commands in the terminal to make the ports public: | ||
|
||
```sh | ||
gh codespace ports visibility 9142:public -c $CODESPACE_NAME | ||
gh codespace ports visibility 9143:public -c $CODESPACE_NAME | ||
``` | ||
|
||
## Connection to server failed | ||
|
||
If you entcounter an error like | ||
|
||
```log | ||
error connecting in 'pool-1': connection failed: connection to server at "127.0.0.1", port 9573 failed: Connection refused | ||
Is the server running on that host and accepting TCP/IP connections? | ||
``` | ||
|
||
then ensure that the Docker containers of GMT are running. | ||
|
||
```sh | ||
docker compose -f docker/compose.yml up -d | ||
``` |
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
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
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
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
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
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 was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.