Skip to content

Commit

Permalink
drt: master merge
Browse files Browse the repository at this point in the history
Signed-off-by: bernardo <bernardoborgessandoval@gmail.com>
  • Loading branch information
bnmfw committed Feb 25, 2025
2 parents 6d618b4 + 271ffb0 commit 67b306e
Show file tree
Hide file tree
Showing 659 changed files with 29,169 additions and 19,936 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ venv/
include/ord/Version.hh

build
build_linux
build_mac
test/results
flow

Expand Down
Binary file added docs/images/grafana.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions etc/DependencyInstaller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ _installCommonDev() {
pcreChecksum="37d2f77cfd411a3ddf1c64e1d72e43f7"
swigVersion=4.1.0
swigChecksum="794433378154eb61270a3ac127d9c5f3"
boostVersionBig=1.80
boostVersionBig=1.86
boostVersionSmall=${boostVersionBig}.0
boostChecksum="077f074743ea7b0cb49c6ed43953ae95"
boostChecksum="ac857d73bb754b718a039830b07b9624"
eigenVersion=3.4
cuddVersion=3.0.0
lemonVersion=1.3.1
Expand Down
65 changes: 65 additions & 0 deletions etc/monitoring/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
## Compose sample
### Prometheus & Grafana

Project structure:
```
.
├── compose.yaml
├── grafana
│   └── datasource.yml
├── prometheus
│   └── prometheus.yml
└── README.md
```

[_compose.yaml_](compose.yaml)
```
services:
prometheus:
image: prom/prometheus
...
ports:
- 9090:9090
grafana:
image: grafana/grafana
...
ports:
- 3000:3000
```
The compose file defines a stack with two services `prometheus` and `grafana`.
When deploying the stack, docker compose maps port the default ports for each service to the equivalent ports on the host in order to inspect easier the web interface of each service.
Make sure the ports 9090 and 3000 on the host are not already in use.

## Deploy with docker compose

```
$ docker compose up -d
Creating network "prometheus-grafana_default" with the default driver
Creating volume "prometheus-grafana_prom_data" with default driver
...
Creating grafana ... done
Creating prometheus ... done
Attaching to prometheus, grafana
```

## Expected result

Listing containers must show two containers running and the port mapping as below:
```
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
dbdec637814f prom/prometheus "/bin/prometheus --c…" 8 minutes ago Up 8 minutes 0.0.0.0:9090->9090/tcp prometheus
79f667cb7dc2 grafana/grafana "/run.sh" 8 minutes ago Up 8 minutes 0.0.0.0:3000->3000/tcp grafana
```

Navigate to `http://localhost:3000` in your web browser and use the login credentials (username=admin, password=grafana) specified in the compose file to access Grafana. It is already configured with prometheus as the default datasource.

![page](/docs/images/grafana.png)

Navigate to `http://localhost:9090` in your web browser to access directly the web interface of prometheus.

Stop and remove the containers. Use `-v` to remove the volumes if looking to erase all data.
```
$ docker compose down -v
```
30 changes: 30 additions & 0 deletions etc/monitoring/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
services:
prometheus:
image: prom/prometheus
container_name: prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
ports:
- 9090:9090
restart: unless-stopped
volumes:
- ./prometheus:/etc/prometheus
- prom_data:/prometheus
extra_hosts:
- "host.docker.internal:host-gateway"

grafana:
image: grafana/grafana
container_name: grafana
ports:
- 3000:3000
restart: unless-stopped
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=grafana
volumes:
- ./grafana/datasource:/etc/grafana/provisioning/datasources
- ./grafana/dashboards:/etc/grafana/provisioning/dashboards
- ./grafana/dashboard_definitions:/var/lib/grafana/dashboards
volumes:
prom_data:
148 changes: 148 additions & 0 deletions etc/monitoring/grafana/dashboard_definitions/openroad.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 1,
"links": [],
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineStyle": {
"fill": "solid"
},
"lineWidth": 2,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 24,
"x": 0,
"y": 0
},
"id": 1,
"interval": "2",
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "11.5.1",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "ord_hpwl",
"fullMetaSearch": false,
"includeNullMetadata": true,
"interval": "",
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
}
],
"title": "Half Perimeter Wire Length Global Placement",
"type": "timeseries"
}
],
"preload": false,
"refresh": "",
"schemaVersion": 40,
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-2d",
"to": "now"
},
"timepicker": {},
"timezone": "browser",
"title": "OpenROAD",
"uid": "bedke9uv3g5q8d",
"version": 6,
"weekStart": ""
}
9 changes: 9 additions & 0 deletions etc/monitoring/grafana/dashboards/default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: 1

providers:
- name: Default # A uniquely identifiable name for the provider
folder: Services # The folder where to place the dashboards
type: file
options:
path:
/var/lib/grafana/dashboards
9 changes: 9 additions & 0 deletions etc/monitoring/grafana/datasource/datasource.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: 1

datasources:
- name: Prometheus
type: prometheus
url: http://prometheus:9090
isDefault: true
access: proxy
editable: true
25 changes: 25 additions & 0 deletions etc/monitoring/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
global:
scrape_interval: 15s
scrape_timeout: 10s
evaluation_interval: 15s

alerting:
alertmanagers:
- static_configs:
- targets: [] # Keep this as is, or add your Alertmanager targets if you have any.
scheme: http # This is already correct
timeout: 10s # This is also fine
api_version: v2 # Changed from v1 to v2
path_prefix: / # ADD THIS - Required for v2

scrape_configs:
- job_name: prometheus
honor_timestamps: true # This section is all good as is.
scrape_interval: 5s
scrape_timeout: 3s
metrics_path: /metrics
scheme: http
static_configs:
- targets:
- localhost:9090
- host.docker.internal:8080
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

{
inputs = {
nixpkgs.url = github:nixos/nixpkgs/nixos-24.05;
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
};

outputs = {self, nixpkgs, ...}: {
Expand Down
2 changes: 0 additions & 2 deletions include/ord/OpenRoad.hh
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,6 @@ class OpenRoad
void writeDb(std::ostream& stream);
void writeDb(const char* filename);

void diffDbs(const char* filename1, const char* filename2, const char* diffs);

void setThreadCount(int threads, bool printInfo = true);
void setThreadCount(const char* threads, bool printInfo = true);
int getThreadCount();
Expand Down
11 changes: 3 additions & 8 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@
##
###############################################################################

# The location used by etc/DependencyInstaller.sh
# lib64 is used for CentOS and openSUSE
# lib is used for Ubuntu and MacOS
list(APPEND CMAKE_INSTALL_RPATH
"/opt/or-tools/lib64"
"/opt/or-tools/lib"
)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/src/cmake")

# The location used by etc/DependencyInstaller.sh
Expand All @@ -49,6 +41,9 @@ list(APPEND CMAKE_PREFIX_PATH
"/opt/or-tools/lib/cmake"
)

# Link to where ortools was found
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

include("openroad")


Expand Down
Loading

0 comments on commit 67b306e

Please sign in to comment.